NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
REL="HOME"
TITLE="SDL Library Documentation"
REL="UP"
TITLE="Video"
REL="PREVIOUS"
TITLE="SDL_SetGammaRamp"
HREF="sdlsetgammaramp.html"><
LINK
REL="NEXT"
TITLE="SDL_MapRGBA"
HREF="sdlmaprgba.html"><
/HEAD
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
CLASS="NAVHEADER"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation<
/TH
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
HREF="sdlsetgammaramp.html"
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
HREF="sdlmaprgba.html"
ALIGN="LEFT"
NAME="SDLMAPRGB"
CLASS="REFNAMEDIV"
NAME="AEN1237"
>SDL_MapRGB -- Map a RGB
color value to a pixel format.<
/DIV
CLASS="REFSYNOPSISDIV"
NAME="AEN1240"
CLASS="FUNCSYNOPSIS"
NAME="AEN1241"
CLASS="FUNCSYNOPSISINFO"
CLASS="FUNCDEF"
CLASS="FSFUNC"
>
(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b
);<
/CODE
CLASS="REFSECT1"
NAME="AEN1247"
>Maps the RGB color value to the specified pixel format and returns the
pixel
value as a
32-bit int.<
/P
>If the format has a palette (8-bit) the index of the closest matching
color in the palette will be returned.<
/P
>If the specified pixel format has an alpha component it will be returned
as all
1 bits
(fully opaque
).<
/P
CLASS="REFSECT1"
NAME="AEN1252"
>A pixel value best approximating the given RGB color value for a given
pixel format. 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
CLASS="TYPE"
CLASS="TYPE"
> for an 8-bpp
CLASS="REFSECT1"
NAME="AEN1257"
HREF="sdlgetrgb.html"
CLASS="FUNCTION"
>,
HREF="sdlgetrgba.html"
CLASS="FUNCTION"
>,
HREF="sdlmaprgba.html"
CLASS="FUNCTION"
>,
HREF="sdlpixelformat.html"
CLASS="STRUCTNAME"
CLASS="NAVFOOTER"
ALIGN="LEFT"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
HREF="sdlsetgammaramp.html"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="index.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
HREF="sdlmaprgba.html"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="video.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>