.TH "SDLmm::PixelFormat" 3 "16 Jul 2001" "SDLmm" \" -*- nroff -*- .ad l .nh .SH NAME SDLmm::PixelFormat \- .SH SYNOPSIS .br .PP \fC#include \fP .PP .SS "Public Methods" .in +1c .ti -1c .RI "\fBPixelFormat\fP (SDL_PixelFormat *pixelformat)" .br .RI "\fIConstructor from an SDL_PixelFormat*.\fP" .ti -1c .RI "virtual \fB~PixelFormat\fP ()" .br .RI "\fIThe destructor.\fP" .ti -1c .RI "Uint8 \fBBitsPerPixel\fP () const" .br .ti -1c .RI "Uint8 \fBBytesPerPixel\fP () const" .br .ti -1c .RI "Uint8 \fBRshift\fP () const" .br .ti -1c .RI "Uint8 \fBGshift\fP () const" .br .ti -1c .RI "Uint8 \fBBshift\fP () const" .br .ti -1c .RI "Uint8 \fBRloss\fP () const" .br .ti -1c .RI "Uint8 \fBGloss\fP () const" .br .ti -1c .RI "Uint8 \fBBloss\fP () const" .br .ti -1c .RI "Uint8 \fBAloss\fP () const" .br .ti -1c .RI "Uint32 \fBRmask\fP () const" .br .ti -1c .RI "Uint32 \fBGmask\fP () const" .br .ti -1c .RI "Uint32 \fBBmask\fP () const" .br .ti -1c .RI "Uint32 \fBAmask\fP () const" .br .ti -1c .RI "\fBColor\fP \fBcolorkey\fP () const" .br .ti -1c .RI "Uint8 \fBalpha\fP () const" .br .ti -1c .RI "SDL_Palette* \fBpalette\fP () const" .br .ti -1c .RI "\fBColor\fP \fBMapRGB\fP (Uint8 r, Uint8 g, Uint8 b) const" .br .RI "\fIMap a RGB color value to a pixel format.\fP" .ti -1c .RI "\fBColor\fP \fBMapRGB\fP (const \fBColorRGB\fP &colorrgb) const" .br .ti -1c .RI "\fBColor\fP \fBMapRGBA\fP (Uint8 r, Uint8 g, Uint8 b, Uint8 a) const" .br .RI "\fIMap a RGBA color value to a pixel format.\fP" .ti -1c .RI "\fBColor\fP \fBMapRGBA\fP (const \fBColorRGBA\fP &colorrgba) const" .br .ti -1c .RI "void \fBGetRGB\fP (\fBColor\fP pixel, Uint8 &r, Uint8 &g, Uint8 &b) const" .br .RI "\fIGet RGB values from a pixel in the pixel format of this \fBPixelFormat\fP.\fP" .ti -1c .RI "const \fBColorRGB\fP \fBGetRGB\fP (\fBColor\fP pixel) const" .br .ti -1c .RI "void \fBGetRGBA\fP (\fBColor\fP pixel, Uint8 &r, Uint8 &g, Uint8 &b, Uint8 &a) const" .br .RI "\fIGet RGBA values from a pixel in the pixel format of this \fBPixelFormat\fP.\fP" .ti -1c .RI "const \fBColorRGBA\fP \fBGetRGBA\fP (\fBColor\fP pixel) const" .br .in -1c .PP .RI "\fBInformational methods\fP" .br .in +1c .in +1c .ti -1c .RI "bool \fBvalid\fP () const" .br .RI "\fIReturns true if this \fBPixelFormat\fP is initialized, false otherwise.\fP" .in -1c .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "SDL_PixelFormat* \fBme\fP" .br .RI "\fIThe actual SDL_PixelFormat for this \fBPixelFormat\fP.\fP" .in -1c .SH "DETAILED DESCRIPTION" .PP \fBAuthor: \fP .in +1c Adam Gates .PP .SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION" .PP .SS "SDLmm::PixelFormat::PixelFormat (SDL_PixelFormat * pixelformat)\fC [inline, explicit]\fP" .PP Constructor from an SDL_PixelFormat*. .PP This creates a new \fBPixelFormat\fP object from an existing SDL_PixelFormat. It's very important not to free the original pixel format since that will cause problems. Use with caution. .SS "SDLmm::PixelFormat::~PixelFormat ()\fC [inline, virtual]\fP" .PP The destructor. .PP .SH "MEMBER FUNCTION DOCUMENTATION" .PP .SS "Uint8 SDLmm::PixelFormat::Aloss () const\fC [inline]\fP" .PP .SS "Uint32 SDLmm::PixelFormat::Amask () const\fC [inline]\fP" .PP .SS "Uint8 SDLmm::PixelFormat::BitsPerPixel () const\fC [inline]\fP" .PP .SS "Uint8 SDLmm::PixelFormat::Bloss () const\fC [inline]\fP" .PP .SS "Uint32 SDLmm::PixelFormat::Bmask () const\fC [inline]\fP" .PP .SS "Uint8 SDLmm::PixelFormat::Bshift () const\fC [inline]\fP" .PP .SS "Uint8 SDLmm::PixelFormat::BytesPerPixel () const\fC [inline]\fP" .PP .SS "const \fBColorRGB\fP SDLmm::PixelFormat::GetRGB (\fBColor\fP pixel) const\fC [inline]\fP" .PP .SS "void SDLmm::PixelFormat::GetRGB (\fBColor\fP pixel, Uint8 & r, Uint8 & g, Uint8 & b) const" .PP Get RGB values from a pixel in the pixel format of this \fBPixelFormat\fP. .PP This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). .PP \fBParameters: \fP .in +1c .TP \fB\fIpixel\fP\fP the pixel value .TP \fB\fIr, g, b\fP\fP references to integers where the RGB result will be stored. .PP \fBSee also: \fP .in +1c \fBGetRGBA\fP, \fBMapRGB\fP, \fBMapRGBA\fP .SS "const \fBColorRGBA\fP SDLmm::PixelFormat::GetRGBA (\fBColor\fP pixel) const\fC [inline]\fP" .PP .SS "void SDLmm::PixelFormat::GetRGBA (\fBColor\fP pixel, Uint8 & r, Uint8 & g, Uint8 & b, Uint8 & a) const" .PP Get RGBA values from a pixel in the pixel format of this \fBPixelFormat\fP. .PP This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). .PP \fBNote: \fP .in +1c If the \fBPixelFormat\fP has no alpha component, the alpha will be returned as 0xff (100% opaque). .PP \fBParameters: \fP .in +1c .TP \fB\fIpixel\fP\fP the pixel value .TP \fB\fIr, g, b, a\fP\fP references to integers where the RGBA result will be stored. .PP \fBSee also: \fP .in +1c \fBGetRGB\fP, \fBMapRGB\fP, \fBMapRGBA\fP .SS "Uint8 SDLmm::PixelFormat::Gloss () const\fC [inline]\fP" .PP .SS "Uint32 SDLmm::PixelFormat::Gmask () const\fC [inline]\fP" .PP .SS "Uint8 SDLmm::PixelFormat::Gshift () const\fC [inline]\fP" .PP .SS "\fBColor\fP SDLmm::PixelFormat::MapRGB (const \fBColorRGB\fP & colorrgb) const\fC [inline]\fP" .PP .SS "\fBColor\fP SDLmm::PixelFormat::MapRGB (Uint8 r, Uint8 g, Uint8 b) const" .PP Map a RGB color value to a pixel format. .PP Maps the RGB color value to this \fBPixelFormat\fP's pixel format and returns the pixel value as a 32-bit int. .PP If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned. .PP If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque). .PP \fBReturns: \fP .in +1c 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 Uint16, and similarly a Uint8 for an 8-bpp format). .PP \fBParameters: \fP .in +1c .TP \fB\fIr, g, b\fP\fP the RGB values. .PP \fBSee also: \fP .in +1c \fBGetRGB\fP, \fBGetRGBA\fP, \fBMapRGBA\fP .SS "\fBColor\fP SDLmm::PixelFormat::MapRGBA (const \fBColorRGBA\fP & colorrgba) const\fC [inline]\fP" .PP .SS "\fBColor\fP SDLmm::PixelFormat::MapRGBA (Uint8 r, Uint8 g, Uint8 b, Uint8 a) const" .PP Map a RGBA color value to a pixel format. .PP Maps the RGBA color value to this \fBPixelFormat\fP's pixel format and returns the pixel value as a 32-bit int. .PP If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned. .PP If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette). .PP \fBReturns: \fP .in +1c A pixel value best approximating the given RGBA 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 Uint16, and similarly a Uint8 for an 8-bpp format). .PP \fBParameters: \fP .in +1c .TP \fB\fIr, g, b, a\fP\fP the RGBA values. .PP \fBSee also: \fP .in +1c \fBGetRGB\fP, \fBGetRGBA\fP, \fBMapRGB\fP .SS "Uint8 SDLmm::PixelFormat::Rloss () const\fC [inline]\fP" .PP .SS "Uint32 SDLmm::PixelFormat::Rmask () const\fC [inline]\fP" .PP .SS "Uint8 SDLmm::PixelFormat::Rshift () const\fC [inline]\fP" .PP .SS "Uint8 SDLmm::PixelFormat::alpha () const\fC [inline]\fP" .PP .SS "\fBColor\fP SDLmm::PixelFormat::colorkey () const\fC [inline]\fP" .PP .SS "SDL_Palette * SDLmm::PixelFormat::palette () const\fC [inline]\fP" .PP .SS "bool SDLmm::PixelFormat::valid () const\fC [inline]\fP" .PP Returns true if this \fBPixelFormat\fP is initialized, false otherwise. .PP \fBWarning: \fP .in +1c Using an uninitialzied \fBPixelFormat\fP can cause many problems. .SH "MEMBER DATA DOCUMENTATION" .PP .SS "SDL_PixelFormat * SDLmm::PixelFormat::me\fC [protected]\fP" .PP The actual SDL_PixelFormat for this \fBPixelFormat\fP. .PP .SH "AUTHOR" .PP Generated automatically by Doxygen for SDLmm from the source code.