SDL 3.0
SDL_pixels.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * \file SDL_pixels.h
24 *
25 * \brief Header for the enumerated pixel format definitions.
26 */
27
28#ifndef SDL_pixels_h_
29#define SDL_pixels_h_
30
31#include <SDL3/SDL_stdinc.h>
32#include <SDL3/SDL_endian.h>
33
34#include <SDL3/SDL_begin_code.h>
35/* Set up for C function definitions, even when using C++ */
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/**
41 * \name Transparency definitions
42 *
43 * These define alpha as the opacity of a surface.
44 */
45/* @{ */
46#define SDL_ALPHA_OPAQUE 255
47#define SDL_ALPHA_TRANSPARENT 0
48/* @} */
49
50/** Pixel type. */
51typedef enum
52{
66
67/** Bitmap pixel order, high bit -> low bit. */
68typedef enum
69{
74
75/** Packed component order, high bit -> low bit. */
76typedef enum
77{
88
89/** Array component order, low byte -> high byte. */
90typedef enum
91{
96
97/** Packed component layout. */
98typedef enum
99{
110
111#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
112
113#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
114 ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
115 ((bits) << 8) | ((bytes) << 0))
116
117#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
118#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
119#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
120#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
121#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
122#define SDL_BYTESPERPIXEL(X) \
123 (SDL_ISPIXELFORMAT_FOURCC(X) ? \
124 ((((X) == SDL_PIXELFORMAT_YUY2) || \
125 ((X) == SDL_PIXELFORMAT_UYVY) || \
126 ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
127
128#define SDL_ISPIXELFORMAT_INDEXED(format) \
129 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
130 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
131 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
132 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
133
134#define SDL_ISPIXELFORMAT_PACKED(format) \
135 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
136 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
137 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
138 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
139
140#define SDL_ISPIXELFORMAT_ARRAY(format) \
141 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
142 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
143 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
144 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
145 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
146 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
147
148#define SDL_ISPIXELFORMAT_ALPHA(format) \
149 ((SDL_ISPIXELFORMAT_PACKED(format) && \
150 ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
151 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
152 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
153 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))))
154
155/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
156#define SDL_ISPIXELFORMAT_FOURCC(format) \
157 ((format) && (SDL_PIXELFLAG(format) != 1))
158
159/* Note: If you modify this list, update SDL_GetPixelFormatName() */
160typedef enum
161{
165 1, 0),
168 1, 0),
171 4, 0),
174 4, 0),
228 24, 3),
231 24, 3),
261
262 /* Aliases for RGBA byte arrays of color data, for the current platform */
263#if SDL_BYTEORDER == SDL_BIG_ENDIAN
268#else
273#endif
274
275 SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
276 SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
277 SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
278 SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
279 SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
280 SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
281 SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
282 SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
283 SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
284 SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
285 SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */
286 SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
287 SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
288 SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
289 SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
290 SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
292
293/**
294 * The bits of this structure can be directly reinterpreted as an integer-packed
295 * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
296 * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
297 */
298typedef struct SDL_Color
299{
304} SDL_Color;
305#define SDL_Colour SDL_Color
306
307typedef struct SDL_Palette
308{
314
315/**
316 * \note Everything in the pixel format structure is read-only.
317 */
318typedef struct SDL_PixelFormat
319{
340
341/**
342 * Get the human readable name of a pixel format.
343 *
344 * \param format the pixel format to query
345 * \returns the human readable name of the specified pixel format or
346 * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
347 *
348 * \since This function is available since SDL 3.0.0.
349 */
350extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
351
352/**
353 * Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
354 *
355 * \param format one of the SDL_PixelFormatEnum values
356 * \param bpp a bits per pixel value; usually 15, 16, or 32
357 * \param Rmask a pointer filled in with the red mask for the format
358 * \param Gmask a pointer filled in with the green mask for the format
359 * \param Bmask a pointer filled in with the blue mask for the format
360 * \param Amask a pointer filled in with the alpha mask for the format
361 * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
362 * possible; call SDL_GetError() for more information.
363 *
364 * \since This function is available since SDL 3.0.0.
365 *
366 * \sa SDL_GetPixelFormatEnumForMasks
367 */
369 int *bpp,
370 Uint32 * Rmask,
371 Uint32 * Gmask,
372 Uint32 * Bmask,
373 Uint32 * Amask);
374
375/**
376 * Convert a bpp value and RGBA masks to an enumerated pixel format.
377 *
378 * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
379 * possible.
380 *
381 * \param bpp a bits per pixel value; usually 15, 16, or 32
382 * \param Rmask the red mask for the format
383 * \param Gmask the green mask for the format
384 * \param Bmask the blue mask for the format
385 * \param Amask the alpha mask for the format
386 * \returns one of the SDL_PixelFormatEnum values
387 *
388 * \since This function is available since SDL 3.0.0.
389 *
390 * \sa SDL_GetMasksForPixelFormatEnum
391 */
392extern DECLSPEC Uint32 SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp,
396 Uint32 Amask);
397
398/**
399 * Create an SDL_PixelFormat structure corresponding to a pixel format.
400 *
401 * Returned structure may come from a shared global cache (i.e. not newly
402 * allocated), and hence should not be modified, especially the palette. Weird
403 * errors such as `Blit combination not supported` may occur.
404 *
405 * \param pixel_format one of the SDL_PixelFormatEnum values
406 * \returns the new SDL_PixelFormat structure or NULL on failure; call
407 * SDL_GetError() for more information.
408 *
409 * \since This function is available since SDL 3.0.0.
410 *
411 * \sa SDL_DestroyPixelFormat
412 */
413extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(Uint32 pixel_format);
414
415/**
416 * Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat().
417 *
418 * \param format the SDL_PixelFormat structure to free
419 *
420 * \since This function is available since SDL 3.0.0.
421 *
422 * \sa SDL_CreatePixelFormat
423 */
424extern DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
425
426/**
427 * Create a palette structure with the specified number of color entries.
428 *
429 * The palette entries are initialized to white.
430 *
431 * \param ncolors represents the number of color entries in the color palette
432 * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
433 * there wasn't enough memory); call SDL_GetError() for more
434 * information.
435 *
436 * \since This function is available since SDL 3.0.0.
437 *
438 * \sa SDL_DestroyPalette
439 */
440extern DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors);
441
442/**
443 * Set the palette for a pixel format structure.
444 *
445 * \param format the SDL_PixelFormat structure that will use the palette
446 * \param palette the SDL_Palette structure that will be used
447 * \returns 0 on success or a negative error code on failure; call
448 * SDL_GetError() for more information.
449 *
450 * \since This function is available since SDL 3.0.0.
451 *
452 * \sa SDL_CreatePalette
453 * \sa SDL_DestroyPalette
454 */
457
458/**
459 * Set a range of colors in a palette.
460 *
461 * \param palette the SDL_Palette structure to modify
462 * \param colors an array of SDL_Color structures to copy into the palette
463 * \param firstcolor the index of the first palette entry to modify
464 * \param ncolors the number of entries to modify
465 * \returns 0 on success or a negative error code on failure; call
466 * SDL_GetError() for more information.
467 *
468 * \since This function is available since SDL 3.0.0.
469 *
470 * \sa SDL_CreatePalette
471 * \sa SDL_CreateSurface
472 */
473extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
474 const SDL_Color * colors,
475 int firstcolor, int ncolors);
476
477/**
478 * Free a palette created with SDL_CreatePalette().
479 *
480 * \param palette the SDL_Palette structure to be freed
481 *
482 * \since This function is available since SDL 3.0.0.
483 *
484 * \sa SDL_CreatePalette
485 */
486extern DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
487
488/**
489 * Map an RGB triple to an opaque pixel value for a given pixel format.
490 *
491 * This function maps the RGB color value to the specified pixel format and
492 * returns the pixel value best approximating the given RGB color value for
493 * the given pixel format.
494 *
495 * If the format has a palette (8-bit) the index of the closest matching color
496 * in the palette will be returned.
497 *
498 * If the specified pixel format has an alpha component it will be returned as
499 * all 1 bits (fully opaque).
500 *
501 * If the pixel format bpp (color depth) is less than 32-bpp then the unused
502 * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
503 * format the return value can be assigned to a Uint16, and similarly a Uint8
504 * for an 8-bpp format).
505 *
506 * \param format an SDL_PixelFormat structure describing the pixel format
507 * \param r the red component of the pixel in the range 0-255
508 * \param g the green component of the pixel in the range 0-255
509 * \param b the blue component of the pixel in the range 0-255
510 * \returns a pixel value
511 *
512 * \since This function is available since SDL 3.0.0.
513 *
514 * \sa SDL_GetRGB
515 * \sa SDL_GetRGBA
516 * \sa SDL_MapRGBA
517 */
518extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
519 Uint8 r, Uint8 g, Uint8 b);
520
521/**
522 * Map an RGBA quadruple to a pixel value for a given pixel format.
523 *
524 * This function maps the RGBA color value to the specified pixel format and
525 * returns the pixel value best approximating the given RGBA color value for
526 * the given pixel format.
527 *
528 * If the specified pixel format has no alpha component the alpha value will
529 * be ignored (as it will be in formats with a palette).
530 *
531 * If the format has a palette (8-bit) the index of the closest matching color
532 * in the palette will be returned.
533 *
534 * If the pixel format bpp (color depth) is less than 32-bpp then the unused
535 * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
536 * format the return value can be assigned to a Uint16, and similarly a Uint8
537 * for an 8-bpp format).
538 *
539 * \param format an SDL_PixelFormat structure describing the format of the
540 * pixel
541 * \param r the red component of the pixel in the range 0-255
542 * \param g the green component of the pixel in the range 0-255
543 * \param b the blue component of the pixel in the range 0-255
544 * \param a the alpha component of the pixel in the range 0-255
545 * \returns a pixel value
546 *
547 * \since This function is available since SDL 3.0.0.
548 *
549 * \sa SDL_GetRGB
550 * \sa SDL_GetRGBA
551 * \sa SDL_MapRGB
552 */
553extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
554 Uint8 r, Uint8 g, Uint8 b,
555 Uint8 a);
556
557/**
558 * Get RGB values from a pixel in the specified format.
559 *
560 * This function uses the entire 8-bit [0..255] range when converting color
561 * components from pixel formats with less than 8-bits per RGB component
562 * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
563 * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
564 *
565 * \param pixel a pixel value
566 * \param format an SDL_PixelFormat structure describing the format of the
567 * pixel
568 * \param r a pointer filled in with the red component
569 * \param g a pointer filled in with the green component
570 * \param b a pointer filled in with the blue component
571 *
572 * \since This function is available since SDL 3.0.0.
573 *
574 * \sa SDL_GetRGBA
575 * \sa SDL_MapRGB
576 * \sa SDL_MapRGBA
577 */
578extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
579 const SDL_PixelFormat * format,
580 Uint8 * r, Uint8 * g, Uint8 * b);
581
582/**
583 * Get RGBA values from a pixel in the specified format.
584 *
585 * This function uses the entire 8-bit [0..255] range when converting color
586 * components from pixel formats with less than 8-bits per RGB component
587 * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
588 * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
589 *
590 * If the surface has no alpha component, the alpha will be returned as 0xff
591 * (100% opaque).
592 *
593 * \param pixel a pixel value
594 * \param format an SDL_PixelFormat structure describing the format of the
595 * pixel
596 * \param r a pointer filled in with the red component
597 * \param g a pointer filled in with the green component
598 * \param b a pointer filled in with the blue component
599 * \param a a pointer filled in with the alpha component
600 *
601 * \since This function is available since SDL 3.0.0.
602 *
603 * \sa SDL_GetRGB
604 * \sa SDL_MapRGB
605 * \sa SDL_MapRGBA
606 */
607extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
608 const SDL_PixelFormat * format,
609 Uint8 * r, Uint8 * g, Uint8 * b,
610 Uint8 * a);
611
612
613/* Ends C function definitions when using C++ */
614#ifdef __cplusplus
615}
616#endif
617#include <SDL3/SDL_close_code.h>
618
619#endif /* SDL_pixels_h_ */
Functions for reading and writing endian-specific values.
int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors)
SDL_bool SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
int SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette)
SDL_PixelType
Definition: SDL_pixels.h:52
@ SDL_PIXELTYPE_UNKNOWN
Definition: SDL_pixels.h:53
@ SDL_PIXELTYPE_ARRAYU16
Definition: SDL_pixels.h:61
@ SDL_PIXELTYPE_PACKED32
Definition: SDL_pixels.h:59
@ SDL_PIXELTYPE_ARRAYU8
Definition: SDL_pixels.h:60
@ SDL_PIXELTYPE_INDEX4
Definition: SDL_pixels.h:55
@ SDL_PIXELTYPE_PACKED8
Definition: SDL_pixels.h:57
@ SDL_PIXELTYPE_ARRAYF16
Definition: SDL_pixels.h:63
@ SDL_PIXELTYPE_ARRAYU32
Definition: SDL_pixels.h:62
@ SDL_PIXELTYPE_INDEX1
Definition: SDL_pixels.h:54
@ SDL_PIXELTYPE_ARRAYF32
Definition: SDL_pixels.h:64
@ SDL_PIXELTYPE_INDEX8
Definition: SDL_pixels.h:56
@ SDL_PIXELTYPE_PACKED16
Definition: SDL_pixels.h:58
const char * SDL_GetPixelFormatName(Uint32 format)
void SDL_DestroyPixelFormat(SDL_PixelFormat *format)
Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
SDL_PackedLayout
Definition: SDL_pixels.h:99
@ SDL_PACKEDLAYOUT_NONE
Definition: SDL_pixels.h:100
@ SDL_PACKEDLAYOUT_8888
Definition: SDL_pixels.h:106
@ SDL_PACKEDLAYOUT_1010102
Definition: SDL_pixels.h:108
@ SDL_PACKEDLAYOUT_565
Definition: SDL_pixels.h:105
@ SDL_PACKEDLAYOUT_332
Definition: SDL_pixels.h:101
@ SDL_PACKEDLAYOUT_5551
Definition: SDL_pixels.h:104
@ SDL_PACKEDLAYOUT_1555
Definition: SDL_pixels.h:103
@ SDL_PACKEDLAYOUT_4444
Definition: SDL_pixels.h:102
@ SDL_PACKEDLAYOUT_2101010
Definition: SDL_pixels.h:107
SDL_Palette * SDL_CreatePalette(int ncolors)
SDL_BitmapOrder
Definition: SDL_pixels.h:69
@ SDL_BITMAPORDER_1234
Definition: SDL_pixels.h:72
@ SDL_BITMAPORDER_NONE
Definition: SDL_pixels.h:70
@ SDL_BITMAPORDER_4321
Definition: SDL_pixels.h:71
Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
void SDL_DestroyPalette(SDL_Palette *palette)
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D)
Definition: SDL_pixels.h:111
SDL_ArrayOrder
Definition: SDL_pixels.h:91
@ SDL_ARRAYORDER_RGB
Definition: SDL_pixels.h:93
@ SDL_ARRAYORDER_NONE
Definition: SDL_pixels.h:92
@ SDL_ARRAYORDER_BGR
Definition: SDL_pixels.h:94
SDL_PixelFormat * SDL_CreatePixelFormat(Uint32 pixel_format)
SDL_PixelFormatEnum
Definition: SDL_pixels.h:161
@ SDL_PIXELFORMAT_BGR565
Definition: SDL_pixels.h:223
@ SDL_PIXELFORMAT_EXTERNAL_OES
Definition: SDL_pixels.h:289
@ SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:283
@ SDL_PIXELFORMAT_RGB332
Definition: SDL_pixels.h:177
@ SDL_PIXELFORMAT_INDEX1LSB
Definition: SDL_pixels.h:163
@ SDL_PIXELFORMAT_BGR444
Definition: SDL_pixels.h:187
@ SDL_PIXELFORMAT_ABGR4444
Definition: SDL_pixels.h:202
@ SDL_PIXELFORMAT_BGRA4444
Definition: SDL_pixels.h:205
@ SDL_PIXELFORMAT_BGR24
Definition: SDL_pixels.h:229
@ SDL_PIXELFORMAT_INDEX4MSB
Definition: SDL_pixels.h:172
@ SDL_PIXELFORMAT_BGRA32
Definition: SDL_pixels.h:266
@ SDL_PIXELFORMAT_RGB555
Definition: SDL_pixels.h:191
@ SDL_PIXELFORMAT_RGB444
Definition: SDL_pixels.h:183
@ SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:249
@ SDL_PIXELFORMAT_RGBA5551
Definition: SDL_pixels.h:211
@ SDL_PIXELFORMAT_ARGB1555
Definition: SDL_pixels.h:208
@ SDL_PIXELFORMAT_XBGR4444
Definition: SDL_pixels.h:184
@ SDL_PIXELFORMAT_INDEX8
Definition: SDL_pixels.h:175
@ SDL_PIXELFORMAT_XRGB8888
Definition: SDL_pixels.h:232
@ SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:281
@ SDL_PIXELFORMAT_BGR888
Definition: SDL_pixels.h:242
@ SDL_PIXELFORMAT_YV12
Definition: SDL_pixels.h:275
@ SDL_PIXELFORMAT_ABGR32
Definition: SDL_pixels.h:267
@ SDL_PIXELFORMAT_BGRX8888
Definition: SDL_pixels.h:243
@ SDL_PIXELFORMAT_RGB24
Definition: SDL_pixels.h:226
@ SDL_PIXELFORMAT_RGB888
Definition: SDL_pixels.h:235
@ SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:252
@ SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:279
@ SDL_PIXELFORMAT_NV12
Definition: SDL_pixels.h:285
@ SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:255
@ SDL_PIXELFORMAT_ARGB32
Definition: SDL_pixels.h:265
@ SDL_PIXELFORMAT_ABGR1555
Definition: SDL_pixels.h:214
@ SDL_PIXELFORMAT_NV21
Definition: SDL_pixels.h:287
@ SDL_PIXELFORMAT_IYUV
Definition: SDL_pixels.h:277
@ SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:246
@ SDL_PIXELFORMAT_XBGR1555
Definition: SDL_pixels.h:192
@ SDL_PIXELFORMAT_XRGB4444
Definition: SDL_pixels.h:180
@ SDL_PIXELFORMAT_ARGB4444
Definition: SDL_pixels.h:196
@ SDL_PIXELFORMAT_RGBA32
Definition: SDL_pixels.h:264
@ SDL_PIXELFORMAT_INDEX1MSB
Definition: SDL_pixels.h:166
@ SDL_PIXELFORMAT_INDEX4LSB
Definition: SDL_pixels.h:169
@ SDL_PIXELFORMAT_RGBX8888
Definition: SDL_pixels.h:236
@ SDL_PIXELFORMAT_BGRA5551
Definition: SDL_pixels.h:217
@ SDL_PIXELFORMAT_XRGB1555
Definition: SDL_pixels.h:188
@ SDL_PIXELFORMAT_RGB565
Definition: SDL_pixels.h:220
@ SDL_PIXELFORMAT_XBGR8888
Definition: SDL_pixels.h:239
@ SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:258
@ SDL_PIXELFORMAT_BGR555
Definition: SDL_pixels.h:195
@ SDL_PIXELFORMAT_UNKNOWN
Definition: SDL_pixels.h:162
@ SDL_PIXELFORMAT_RGBA4444
Definition: SDL_pixels.h:199
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes)
Definition: SDL_pixels.h:113
void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
SDL_PackedOrder
Definition: SDL_pixels.h:77
@ SDL_PACKEDORDER_NONE
Definition: SDL_pixels.h:78
@ SDL_PACKEDORDER_RGBX
Definition: SDL_pixels.h:80
@ SDL_PACKEDORDER_BGRX
Definition: SDL_pixels.h:84
@ SDL_PACKEDORDER_XBGR
Definition: SDL_pixels.h:83
@ SDL_PACKEDORDER_RGBA
Definition: SDL_pixels.h:82
@ SDL_PACKEDORDER_ABGR
Definition: SDL_pixels.h:85
@ SDL_PACKEDORDER_BGRA
Definition: SDL_pixels.h:86
@ SDL_PACKEDORDER_XRGB
Definition: SDL_pixels.h:79
@ SDL_PACKEDORDER_ARGB
Definition: SDL_pixels.h:81
void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b)
Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
This is a general header that includes C language support.
uint8_t Uint8
Definition: SDL_stdinc.h:147
SDL_bool
Definition: SDL_stdinc.h:130
uint32_t Uint32
Definition: SDL_stdinc.h:171
Uint8 r
Definition: SDL_pixels.h:300
Uint8 b
Definition: SDL_pixels.h:302
Uint8 a
Definition: SDL_pixels.h:303
Uint8 g
Definition: SDL_pixels.h:301
Uint32 version
Definition: SDL_pixels.h:311
SDL_Color * colors
Definition: SDL_pixels.h:310
struct SDL_PixelFormat * next
Definition: SDL_pixels.h:338
Uint8 padding[2]
Definition: SDL_pixels.h:324
Uint8 BytesPerPixel
Definition: SDL_pixels.h:323
Uint8 BitsPerPixel
Definition: SDL_pixels.h:322
SDL_Palette * palette
Definition: SDL_pixels.h:321