You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- It's possible we could use unsafePerformIO here, but I'm not
410
-
-- sure. De need to guarantee that pointers aren't reused?
411
-
--| Map an RGB triple to an opaque pixel value for a given pixel format.
412
-
--
413
-
-- This function maps the RGB color value to the specified pixel format and returns the pixel value best approximating the given RGB color value for the given pixel format.
414
-
--
415
-
-- If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.
416
-
--
417
-
-- If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque).
418
-
--
419
-
-- If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a 'Word16', and similarly a 'Word8' for an 8-bpp format).
420
-
--
421
-
-- See @<https://wiki.libsdl.org/SDL_MapRGB SDL_MapRGB>@ for C documentation.
422
-
mapRGB::MonadIOm
423
-
=>SurfacePixelFormat--^ The format of the pixel
424
-
->V3Word8--^ The color to map
425
-
->mWord32
426
-
mapRGB (SurfacePixelFormat fmt) (V3 r g b) =Raw.mapRGB fmt r g b
427
-
428
-
{-# DEPRECATED mapRGB "mapRGB is no longer needed, as it called implictly. If you still need this, use SDL.Raw.mapRGB" #-}
429
-
430
408
-- It's possible we could use unsafePerformIO here, but I'm not
431
409
-- sure. surface->{w,h} are immutable, but do we need to guarantee that pointers
0 commit comments