Function sdl2_sys::SDL_GetRGBA

source ·
pub unsafe extern "C" fn SDL_GetRGBA(
    pixel: Uint32,
    format: *const SDL_PixelFormat,
    r: *mut Uint8,
    g: *mut Uint8,
    b: *mut Uint8,
    a: *mut Uint8
)
Expand description

Get RGBA values from a pixel in the specified format.

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]).

If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque).

\param pixel a pixel value \param format an SDL_PixelFormat structure describing the format of the pixel \param r a pointer filled in with the red component \param g a pointer filled in with the green component \param b a pointer filled in with the blue component \param a a pointer filled in with the alpha component

\since This function is available since SDL 2.0.0.

\sa SDL_GetRGB \sa SDL_MapRGB \sa SDL_MapRGBA