|
Size: 1419
Comment: update content - pointers, structs
|
Size: 1571
Comment: update content - add include
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 20: | Line 20: |
| ||'''format'''||an enumerated pixel format; see [[SDL_PixelFormatEnum]] for details|| | ||'''format'''||,,an enumerated pixel format; see,, one of the [[SDL_PixelFormatEnum]] values; see [[#Remarks|Remarks]] for details|| |
| Line 36: | Line 36: |
| ''You can add useful comments here'' | '''format''' can be one of these values: <<Include(SDL_PixelFormatEnum, , , from="=== Pixel Format Values ===", to="== Code Examples ==")>> |
SDL_PixelFormatEnumToMasks
Use this function to convert one of the enumerated pixel formats to a bpp value and RGBA masks.
Contents
Syntax
SDL_bool SDL_PixelFormatEnumToMasks(Uint32 format,
int* bpp,
Uint32* Rmask,
Uint32* Gmask,
Uint32* Bmask,
Uint32* Amask)
Function Parameters
format |
an enumerated pixel format; see one of the SDL_PixelFormatEnum values; see Remarks for details |
bpp |
a bits per pixel value; usually 15, 16, or 32 |
Rmask |
a pointer filled in with the red mask for the pixel |
Gmask |
a pointer filled in with the green mask for the pixel |
Bmask |
a pointer filled in with the blue mask for the pixel |
Amask |
a pointer filled in with the alpha mask for the pixel |
Return Value
Returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't possible; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
format can be one of these values:
SDL_PIXELFORMAT_UNKNOWN |
|
SDL_PIXELFORMAT_INDEX1LSB |
|
SDL_PIXELFORMAT_INDEX1MSB |
|
SDL_PIXELFORMAT_INDEX4LSB |
|
SDL_PIXELFORMAT_INDEX4MSB |
|
SDL_PIXELFORMAT_INDEX8 |
|
SDL_PIXELFORMAT_RGB332 |
|
SDL_PIXELFORMAT_RGB444 |
|
SDL_PIXELFORMAT_RGB555 |
|
SDL_PIXELFORMAT_BGR555 |
|
SDL_PIXELFORMAT_ARGB4444 |
|
SDL_PIXELFORMAT_RGBA4444 |
|
SDL_PIXELFORMAT_ABGR4444 |
|
SDL_PIXELFORMAT_BGRA4444 |
|
SDL_PIXELFORMAT_ARGB1555 |
|
SDL_PIXELFORMAT_RGBA5551 |
|
SDL_PIXELFORMAT_ABGR1555 |
|
SDL_PIXELFORMAT_BGRA5551 |
|
SDL_PIXELFORMAT_RGB565 |
|
SDL_PIXELFORMAT_BGR565 |
|
SDL_PIXELFORMAT_RGB24 |
|
SDL_PIXELFORMAT_BGR24 |
|
SDL_PIXELFORMAT_RGB888 |
|
SDL_PIXELFORMAT_RGBX8888 |
|
SDL_PIXELFORMAT_BGR888 |
|
SDL_PIXELFORMAT_BGRX8888 |
|
SDL_PIXELFORMAT_ARGB8888 |
|
SDL_PIXELFORMAT_RGBA8888 |
|
SDL_PIXELFORMAT_ABGR8888 |
|
SDL_PIXELFORMAT_BGRA8888 |
|
SDL_PIXELFORMAT_ARGB2101010 |
|
SDL_PIXELFORMAT_RGBA32 |
alias for RGBA byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_ARGB32 |
alias for ARGB byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_BGRA32 |
alias for BGRA byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_ABGR32 |
alias for ABGR byte array of color data, for the current platform (>= SDL 2.0.5) |
SDL_PIXELFORMAT_YV12 |
planar mode: Y + V + U (3 planes) |
SDL_PIXELFORMAT_IYUV |
planar mode: Y + U + V (3 planes) |
SDL_PIXELFORMAT_YUY2 |
packed mode: Y0+U0+Y1+V0 (1 plane) |
SDL_PIXELFORMAT_UYVY |
packed mode: U0+Y0+V0+Y1 (1 plane) |
SDL_PIXELFORMAT_YVYU |
packed mode: Y0+V0+Y1+U0 (1 plane) |
SDL_PIXELFORMAT_NV12 |
planar mode: Y + U/V interleaved (2 planes) (>= SDL 2.0.4) |
SDL_PIXELFORMAT_NV21 |
planar mode: Y + V/U interleaved (2 planes) (>= SDL 2.0.4) |
