diff include/SDL_pixels.h @ 2275:12ea0fdc0df2

Split out the SDL_rect and SDL_surface functions into their own headers. Removed unused count from the dirty rect list.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 10 Sep 2007 12:20:02 +0000
parents 340942cfda48
children 24a6b3588eac
line wrap: on
line diff
--- a/include/SDL_pixels.h	Mon Sep 10 12:11:40 2007 +0000
+++ b/include/SDL_pixels.h	Mon Sep 10 12:20:02 2007 +0000
@@ -37,6 +37,10 @@
 /* *INDENT-ON* */
 #endif
 
+/* Transparency definitions: These define alpha as the opacity of a surface */
+#define SDL_ALPHA_OPAQUE 255
+#define SDL_ALPHA_TRANSPARENT 0
+
 enum
 {                               /* Pixel type */
     SDL_PIXELTYPE_UNKNOWN,
@@ -330,6 +334,54 @@
  */
 extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
 
+/**
+ * \fn Uint32 SDL_MapRGB(const SDL_PixelFormat *format,
+ *                       Uint8 r, Uint8 g, Uint8 b)
+ *
+ * \brief Maps an RGB triple to an opaque pixel value for a given pixel format
+ *
+ * \sa SDL_MapRGBA
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
+                                          Uint8 r, Uint8 g, Uint8 b);
+
+/**
+ * \fn Uint32 SDL_MapRGBA(const SDL_PixelFormat *fmt,
+ *                        Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+ *
+ * \brief Maps an RGBA quadruple to a pixel value for a given pixel format
+ *
+ * \sa SDL_MapRGB
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
+                                           Uint8 r, Uint8 g, Uint8 b,
+                                           Uint8 a);
+
+/**
+ * \fn void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format,
+ *                     Uint8 * r, Uint8 * g, Uint8 * b)
+ *
+ * \brief Maps a pixel value into the RGB components for a given pixel format
+ *
+ * \sa SDL_GetRGBA
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
+                                        const SDL_PixelFormat * format,
+                                        Uint8 * r, Uint8 * g, Uint8 * b);
+
+/**
+ * \fn void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format,
+ *                      Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a)
+ *
+ * \brief Maps a pixel value into the RGBA components for a given pixel format
+ *
+ * \sa SDL_GetRGB
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
+                                         const SDL_PixelFormat * format,
+                                         Uint8 * r, Uint8 * g, Uint8 * b,
+                                         Uint8 * a);
+
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 /* *INDENT-OFF* */