SDL_GetRGB

 

Description

 

Gets RGB values from a pixel in the specified pixel format.

 

C Syntax

 

void SDL_GetRGB(

Uint32 pixel,

SDL_PixelFormat *fmt,

Uint8 *r,

Uint8 *g,

Uint8 *b

);

 

PowerBASIC Syntax

 

FUNCTION SDL_GetRGB CDECL ( _

BYVAL format AS SDL_PixelFormat PTR, _

BYREF r AS BYTE, _

BYREF g AS BYRE, _

BYREF b AS BYTE _

) AS DWORD

 

Parameters

 

format

 

Pointer to the SDL_PixelFormat structure.

 

r

 

Pointer to a BYTE variable that will receive the red color value.

 

g

 

Pointer to a BYTE variable that will receive the green color value.

 

b

 

Pointer to a BYTE variable that will receive the blue color value.

 

Return Value

 

No return value.

 

Remarks

 

If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.

 

If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque).

 

Valid XHTML 1.0 Transitional