include/SDL_pixels.h
changeset 2275 12ea0fdc0df2
parent 2257 340942cfda48
child 2673 24a6b3588eac
     1.1 --- a/include/SDL_pixels.h	Mon Sep 10 12:11:40 2007 +0000
     1.2 +++ b/include/SDL_pixels.h	Mon Sep 10 12:20:02 2007 +0000
     1.3 @@ -37,6 +37,10 @@
     1.4  /* *INDENT-ON* */
     1.5  #endif
     1.6  
     1.7 +/* Transparency definitions: These define alpha as the opacity of a surface */
     1.8 +#define SDL_ALPHA_OPAQUE 255
     1.9 +#define SDL_ALPHA_TRANSPARENT 0
    1.10 +
    1.11  enum
    1.12  {                               /* Pixel type */
    1.13      SDL_PIXELTYPE_UNKNOWN,
    1.14 @@ -330,6 +334,54 @@
    1.15   */
    1.16  extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
    1.17  
    1.18 +/**
    1.19 + * \fn Uint32 SDL_MapRGB(const SDL_PixelFormat *format,
    1.20 + *                       Uint8 r, Uint8 g, Uint8 b)
    1.21 + *
    1.22 + * \brief Maps an RGB triple to an opaque pixel value for a given pixel format
    1.23 + *
    1.24 + * \sa SDL_MapRGBA
    1.25 + */
    1.26 +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
    1.27 +                                          Uint8 r, Uint8 g, Uint8 b);
    1.28 +
    1.29 +/**
    1.30 + * \fn Uint32 SDL_MapRGBA(const SDL_PixelFormat *fmt,
    1.31 + *                        Uint8 r, Uint8 g, Uint8 b, Uint8 a)
    1.32 + *
    1.33 + * \brief Maps an RGBA quadruple to a pixel value for a given pixel format
    1.34 + *
    1.35 + * \sa SDL_MapRGB
    1.36 + */
    1.37 +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
    1.38 +                                           Uint8 r, Uint8 g, Uint8 b,
    1.39 +                                           Uint8 a);
    1.40 +
    1.41 +/**
    1.42 + * \fn void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format,
    1.43 + *                     Uint8 * r, Uint8 * g, Uint8 * b)
    1.44 + *
    1.45 + * \brief Maps a pixel value into the RGB components for a given pixel format
    1.46 + *
    1.47 + * \sa SDL_GetRGBA
    1.48 + */
    1.49 +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
    1.50 +                                        const SDL_PixelFormat * format,
    1.51 +                                        Uint8 * r, Uint8 * g, Uint8 * b);
    1.52 +
    1.53 +/**
    1.54 + * \fn void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format,
    1.55 + *                      Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a)
    1.56 + *
    1.57 + * \brief Maps a pixel value into the RGBA components for a given pixel format
    1.58 + *
    1.59 + * \sa SDL_GetRGB
    1.60 + */
    1.61 +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
    1.62 +                                         const SDL_PixelFormat * format,
    1.63 +                                         Uint8 * r, Uint8 * g, Uint8 * b,
    1.64 +                                         Uint8 * a);
    1.65 +
    1.66  /* Ends C function definitions when using C++ */
    1.67  #ifdef __cplusplus
    1.68  /* *INDENT-OFF* */