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 * SDL's pixel formats have the following naming convention:
28 *
29 * * Names with a list of components and a single bit count, such as
30 * RGB24 and ABGR32, define a platform-independent encoding into
31 * bytes in the order specified. For example, in RGB24 data, each
32 * pixel is encoded in 3 bytes (red, green, blue) in that order,
33 * and in ABGR32 data, each pixel is encoded in 4 bytes
34 * (alpha, blue, green, red) in that order. Use these names if the
35 * property of a format that is important to you is the order of
36 * the bytes in memory or on disk.
37 *
38 * * Names with a bit count per component, such as ARGB8888 and
39 * XRGB1555, are "packed" into an appropriately-sized integer in
40 * the platform's native endianness. For example, ARGB8888 is
41 * a sequence of 32-bit integers; in each integer, the most
42 * significant bits are alpha, and the least significant bits are
43 * blue. On a little-endian CPU such as x86, the least significant
44 * bits of each integer are arranged first in memory, but on a
45 * big-endian CPU such as s390x, the most significant bits are
46 * arranged first. Use these names if the property of a format that
47 * is important to you is the meaning of each bit position within a
48 * native-endianness integer.
49 *
50 * * In indexed formats such as INDEX4LSB, each pixel is represented
51 * by encoding an index into the palette into the indicated number
52 * of bits, with multiple pixels packed into each byte if appropriate.
53 * In LSB formats, the first (leftmost) pixel is stored in the
54 * least-significant bits of the byte; in MSB formats, it's stored
55 * in the most-significant bits. INDEX8 does not need LSB/MSB
56 * variants, because each pixel exactly fills one byte.
57 *
58 * The 32-bit byte-array encodings such as RGBA32 are aliases for the
59 * appropriate 8888 encoding for the current platform. For example,
60 * RGBA32 is an alias for ABGR8888 on little-endian CPUs like x86,
61 * or an alias for RGBA8888 on big-endian CPUs.
62 */
63
64#ifndef SDL_pixels_h_
65#define SDL_pixels_h_
66
67#include <SDL3/SDL_stdinc.h>
68#include <SDL3/SDL_endian.h>
69
70#include <SDL3/SDL_begin_code.h>
71/* Set up for C function definitions, even when using C++ */
72#ifdef __cplusplus
73extern "C" {
74#endif
75
76/**
77 * \name Transparency definitions
78 *
79 * These define alpha as the opacity of a surface.
80 */
81/* @{ */
82#define SDL_ALPHA_OPAQUE 255
83#define SDL_ALPHA_TRANSPARENT 0
84/* @} */
85
86/** Pixel type. */
102
103/** Bitmap pixel order, high bit -> low bit. */
110
111/** Packed component order, high bit -> low bit. */
124
125/** Array component order, low byte -> high byte. */
126typedef enum
127{
130 SDL_ARRAYORDER_UNUSED1, /* Left for compatibility with SDL2 */
131 SDL_ARRAYORDER_UNUSED2, /* Left for compatibility with SDL2 */
134
135/** Packed component layout. */
148
149#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
150
151#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
152 ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
153 ((bits) << 8) | ((bytes) << 0))
154
155#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
156#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
157#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
158#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
159#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
160#define SDL_BYTESPERPIXEL(X) \
161 (SDL_ISPIXELFORMAT_FOURCC(X) ? \
162 ((((X) == SDL_PIXELFORMAT_YUY2) || \
163 ((X) == SDL_PIXELFORMAT_UYVY) || \
164 ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
165
166#define SDL_ISPIXELFORMAT_INDEXED(format) \
167 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
168 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
169 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
170 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
171
172#define SDL_ISPIXELFORMAT_PACKED(format) \
173 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
174 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
175 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
176 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
177
178#define SDL_ISPIXELFORMAT_ARRAY(format) \
179 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
180 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
181 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
182 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
183 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
184 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
185
186#define SDL_ISPIXELFORMAT_ALPHA(format) \
187 ((SDL_ISPIXELFORMAT_PACKED(format) && \
188 ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
189 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
190 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
191 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))))
192
193/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
194#define SDL_ISPIXELFORMAT_FOURCC(format) \
195 ((format) && (SDL_PIXELFLAG(format) != 1))
196
197/* Note: If you modify this list, update SDL_GetPixelFormatName() */
198typedef enum
199{
203 1, 0),
206 1, 0),
209 4, 0),
212 4, 0),
266 24, 3),
269 24, 3),
297
298 /* Aliases for RGBA byte arrays of color data, for the current platform */
299#if SDL_BYTEORDER == SDL_BIG_ENDIAN
308#else
317#endif
318
319 SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
320 SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
321 SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
322 SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
323 SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
324 SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
325 SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
326 SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
327 SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
328 SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
329 SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */
330 SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
331 SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
332 SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
333 SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
334 SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
336
337/**
338 * The bits of this structure can be directly reinterpreted as an integer-packed
339 * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
340 * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
341 */
349#define SDL_Colour SDL_Color
350
358
359/**
360 * \note Everything in the pixel format structure is read-only.
361 */
384
385/**
386 * Get the human readable name of a pixel format.
387 *
388 * \param format the pixel format to query
389 * \returns the human readable name of the specified pixel format or
390 * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
391 *
392 * \since This function is available since SDL 3.0.0.
393 */
394extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
395
396/**
397 * Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
398 *
399 * \param format one of the SDL_PixelFormatEnum values
400 * \param bpp a bits per pixel value; usually 15, 16, or 32
401 * \param Rmask a pointer filled in with the red mask for the format
402 * \param Gmask a pointer filled in with the green mask for the format
403 * \param Bmask a pointer filled in with the blue mask for the format
404 * \param Amask a pointer filled in with the alpha mask for the format
405 * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
406 * possible; call SDL_GetError() for more information.
407 *
408 * \since This function is available since SDL 3.0.0.
409 *
410 * \sa SDL_GetPixelFormatEnumForMasks
411 */
413 int *bpp,
414 Uint32 * Rmask,
415 Uint32 * Gmask,
416 Uint32 * Bmask,
417 Uint32 * Amask);
418
419/**
420 * Convert a bpp value and RGBA masks to an enumerated pixel format.
421 *
422 * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
423 * possible.
424 *
425 * \param bpp a bits per pixel value; usually 15, 16, or 32
426 * \param Rmask the red mask for the format
427 * \param Gmask the green mask for the format
428 * \param Bmask the blue mask for the format
429 * \param Amask the alpha mask for the format
430 * \returns one of the SDL_PixelFormatEnum values
431 *
432 * \since This function is available since SDL 3.0.0.
433 *
434 * \sa SDL_GetMasksForPixelFormatEnum
435 */
436extern DECLSPEC Uint32 SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp,
440 Uint32 Amask);
441
442/**
443 * Create an SDL_PixelFormat structure corresponding to a pixel format.
444 *
445 * Returned structure may come from a shared global cache (i.e. not newly
446 * allocated), and hence should not be modified, especially the palette. Weird
447 * errors such as `Blit combination not supported` may occur.
448 *
449 * \param pixel_format one of the SDL_PixelFormatEnum values
450 * \returns the new SDL_PixelFormat structure or NULL on failure; call
451 * SDL_GetError() for more information.
452 *
453 * \since This function is available since SDL 3.0.0.
454 *
455 * \sa SDL_DestroyPixelFormat
456 */
457extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(Uint32 pixel_format);
458
459/**
460 * Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat().
461 *
462 * \param format the SDL_PixelFormat structure to free
463 *
464 * \since This function is available since SDL 3.0.0.
465 *
466 * \sa SDL_CreatePixelFormat
467 */
468extern DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
469
470/**
471 * Create a palette structure with the specified number of color entries.
472 *
473 * The palette entries are initialized to white.
474 *
475 * \param ncolors represents the number of color entries in the color palette
476 * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
477 * there wasn't enough memory); call SDL_GetError() for more
478 * information.
479 *
480 * \since This function is available since SDL 3.0.0.
481 *
482 * \sa SDL_DestroyPalette
483 */
484extern DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors);
485
486/**
487 * Set the palette for a pixel format structure.
488 *
489 * \param format the SDL_PixelFormat structure that will use the palette
490 * \param palette the SDL_Palette structure that will be used
491 * \returns 0 on success or a negative error code on failure; call
492 * SDL_GetError() for more information.
493 *
494 * \since This function is available since SDL 3.0.0.
495 *
496 * \sa SDL_CreatePalette
497 * \sa SDL_DestroyPalette
498 */
501
502/**
503 * Set a range of colors in a palette.
504 *
505 * \param palette the SDL_Palette structure to modify
506 * \param colors an array of SDL_Color structures to copy into the palette
507 * \param firstcolor the index of the first palette entry to modify
508 * \param ncolors the number of entries to modify
509 * \returns 0 on success or a negative error code on failure; call
510 * SDL_GetError() for more information.
511 *
512 * \since This function is available since SDL 3.0.0.
513 *
514 * \sa SDL_CreatePalette
515 * \sa SDL_CreateSurface
516 */
517extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
518 const SDL_Color * colors,
519 int firstcolor, int ncolors);
520
521/**
522 * Free a palette created with SDL_CreatePalette().
523 *
524 * \param palette the SDL_Palette structure to be freed
525 *
526 * \since This function is available since SDL 3.0.0.
527 *
528 * \sa SDL_CreatePalette
529 */
530extern DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
531
532/**
533 * Map an RGB triple to an opaque pixel value for a given pixel format.
534 *
535 * This function maps the RGB color value to the specified pixel format and
536 * returns the pixel value best approximating the given RGB color value for
537 * the given pixel format.
538 *
539 * If the format has a palette (8-bit) the index of the closest matching color
540 * in the palette will be returned.
541 *
542 * If the specified pixel format has an alpha component it will be returned as
543 * all 1 bits (fully opaque).
544 *
545 * If the pixel format bpp (color depth) is less than 32-bpp then the unused
546 * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
547 * format the return value can be assigned to a Uint16, and similarly a Uint8
548 * for an 8-bpp format).
549 *
550 * \param format an SDL_PixelFormat structure describing the pixel format
551 * \param r the red component of the pixel in the range 0-255
552 * \param g the green component of the pixel in the range 0-255
553 * \param b the blue component of the pixel in the range 0-255
554 * \returns a pixel value
555 *
556 * \since This function is available since SDL 3.0.0.
557 *
558 * \sa SDL_GetRGB
559 * \sa SDL_GetRGBA
560 * \sa SDL_MapRGBA
561 */
562extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
563 Uint8 r, Uint8 g, Uint8 b);
564
565/**
566 * Map an RGBA quadruple to a pixel value for a given pixel format.
567 *
568 * This function maps the RGBA color value to the specified pixel format and
569 * returns the pixel value best approximating the given RGBA color value for
570 * the given pixel format.
571 *
572 * If the specified pixel format has no alpha component the alpha value will
573 * be ignored (as it will be in formats with a palette).
574 *
575 * If the format has a palette (8-bit) the index of the closest matching color
576 * in the palette will be returned.
577 *
578 * If the pixel format bpp (color depth) is less than 32-bpp then the unused
579 * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
580 * format the return value can be assigned to a Uint16, and similarly a Uint8
581 * for an 8-bpp format).
582 *
583 * \param format an SDL_PixelFormat structure describing the format of the
584 * pixel
585 * \param r the red component of the pixel in the range 0-255
586 * \param g the green component of the pixel in the range 0-255
587 * \param b the blue component of the pixel in the range 0-255
588 * \param a the alpha component of the pixel in the range 0-255
589 * \returns a pixel value
590 *
591 * \since This function is available since SDL 3.0.0.
592 *
593 * \sa SDL_GetRGB
594 * \sa SDL_GetRGBA
595 * \sa SDL_MapRGB
596 */
597extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
598 Uint8 r, Uint8 g, Uint8 b,
599 Uint8 a);
600
601/**
602 * Get RGB values from a pixel in the specified format.
603 *
604 * This function uses the entire 8-bit [0..255] range when converting color
605 * components from pixel formats with less than 8-bits per RGB component
606 * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
607 * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
608 *
609 * \param pixel a pixel value
610 * \param format an SDL_PixelFormat structure describing the format of the
611 * pixel
612 * \param r a pointer filled in with the red component
613 * \param g a pointer filled in with the green component
614 * \param b a pointer filled in with the blue component
615 *
616 * \since This function is available since SDL 3.0.0.
617 *
618 * \sa SDL_GetRGBA
619 * \sa SDL_MapRGB
620 * \sa SDL_MapRGBA
621 */
622extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
623 const SDL_PixelFormat * format,
624 Uint8 * r, Uint8 * g, Uint8 * b);
625
626/**
627 * Get RGBA values from a pixel in the specified format.
628 *
629 * This function uses the entire 8-bit [0..255] range when converting color
630 * components from pixel formats with less than 8-bits per RGB component
631 * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
632 * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
633 *
634 * If the surface has no alpha component, the alpha will be returned as 0xff
635 * (100% opaque).
636 *
637 * \param pixel a pixel value
638 * \param format an SDL_PixelFormat structure describing the format of the
639 * pixel
640 * \param r a pointer filled in with the red component
641 * \param g a pointer filled in with the green component
642 * \param b a pointer filled in with the blue component
643 * \param a a pointer filled in with the alpha component
644 *
645 * \since This function is available since SDL 3.0.0.
646 *
647 * \sa SDL_GetRGB
648 * \sa SDL_MapRGB
649 * \sa SDL_MapRGBA
650 */
651extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
652 const SDL_PixelFormat * format,
653 Uint8 * r, Uint8 * g, Uint8 * b,
654 Uint8 * a);
655
656
657/* Ends C function definitions when using C++ */
658#ifdef __cplusplus
659}
660#endif
661#include <SDL3/SDL_close_code.h>
662
663#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:88
@ SDL_PIXELTYPE_UNKNOWN
Definition SDL_pixels.h:89
@ SDL_PIXELTYPE_ARRAYU16
Definition SDL_pixels.h:97
@ SDL_PIXELTYPE_PACKED32
Definition SDL_pixels.h:95
@ SDL_PIXELTYPE_ARRAYU8
Definition SDL_pixels.h:96
@ SDL_PIXELTYPE_INDEX4
Definition SDL_pixels.h:91
@ SDL_PIXELTYPE_PACKED8
Definition SDL_pixels.h:93
@ SDL_PIXELTYPE_ARRAYF16
Definition SDL_pixels.h:99
@ SDL_PIXELTYPE_ARRAYU32
Definition SDL_pixels.h:98
@ SDL_PIXELTYPE_INDEX1
Definition SDL_pixels.h:90
@ SDL_PIXELTYPE_ARRAYF32
Definition SDL_pixels.h:100
@ SDL_PIXELTYPE_INDEX8
Definition SDL_pixels.h:92
@ SDL_PIXELTYPE_PACKED16
Definition SDL_pixels.h:94
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:137
@ SDL_PACKEDLAYOUT_NONE
Definition SDL_pixels.h:138
@ SDL_PACKEDLAYOUT_8888
Definition SDL_pixels.h:144
@ SDL_PACKEDLAYOUT_1010102
Definition SDL_pixels.h:146
@ SDL_PACKEDLAYOUT_565
Definition SDL_pixels.h:143
@ SDL_PACKEDLAYOUT_332
Definition SDL_pixels.h:139
@ SDL_PACKEDLAYOUT_5551
Definition SDL_pixels.h:142
@ SDL_PACKEDLAYOUT_1555
Definition SDL_pixels.h:141
@ SDL_PACKEDLAYOUT_4444
Definition SDL_pixels.h:140
@ SDL_PACKEDLAYOUT_2101010
Definition SDL_pixels.h:145
SDL_Palette * SDL_CreatePalette(int ncolors)
SDL_BitmapOrder
Definition SDL_pixels.h:105
@ SDL_BITMAPORDER_1234
Definition SDL_pixels.h:108
@ SDL_BITMAPORDER_NONE
Definition SDL_pixels.h:106
@ SDL_BITMAPORDER_4321
Definition SDL_pixels.h:107
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:149
SDL_ArrayOrder
Definition SDL_pixels.h:127
@ SDL_ARRAYORDER_RGB
Definition SDL_pixels.h:129
@ SDL_ARRAYORDER_UNUSED1
Definition SDL_pixels.h:130
@ SDL_ARRAYORDER_NONE
Definition SDL_pixels.h:128
@ SDL_ARRAYORDER_BGR
Definition SDL_pixels.h:132
@ SDL_ARRAYORDER_UNUSED2
Definition SDL_pixels.h:131
SDL_PixelFormat * SDL_CreatePixelFormat(Uint32 pixel_format)
SDL_PixelFormatEnum
Definition SDL_pixels.h:199
@ SDL_PIXELFORMAT_BGR565
Definition SDL_pixels.h:261
@ SDL_PIXELFORMAT_EXTERNAL_OES
Definition SDL_pixels.h:333
@ SDL_PIXELFORMAT_YVYU
Definition SDL_pixels.h:327
@ SDL_PIXELFORMAT_RGB332
Definition SDL_pixels.h:215
@ SDL_PIXELFORMAT_INDEX1LSB
Definition SDL_pixels.h:201
@ SDL_PIXELFORMAT_BGR444
Definition SDL_pixels.h:225
@ SDL_PIXELFORMAT_RGBX32
Definition SDL_pixels.h:304
@ SDL_PIXELFORMAT_ABGR4444
Definition SDL_pixels.h:240
@ SDL_PIXELFORMAT_BGRA4444
Definition SDL_pixels.h:243
@ SDL_PIXELFORMAT_BGR24
Definition SDL_pixels.h:267
@ SDL_PIXELFORMAT_INDEX4MSB
Definition SDL_pixels.h:210
@ SDL_PIXELFORMAT_BGRA32
Definition SDL_pixels.h:302
@ SDL_PIXELFORMAT_RGB555
Definition SDL_pixels.h:229
@ SDL_PIXELFORMAT_RGB444
Definition SDL_pixels.h:221
@ SDL_PIXELFORMAT_RGBA8888
Definition SDL_pixels.h:285
@ SDL_PIXELFORMAT_RGBA5551
Definition SDL_pixels.h:249
@ SDL_PIXELFORMAT_ARGB1555
Definition SDL_pixels.h:246
@ SDL_PIXELFORMAT_XBGR4444
Definition SDL_pixels.h:222
@ SDL_PIXELFORMAT_INDEX8
Definition SDL_pixels.h:213
@ SDL_PIXELFORMAT_XRGB8888
Definition SDL_pixels.h:270
@ SDL_PIXELFORMAT_UYVY
Definition SDL_pixels.h:325
@ SDL_PIXELFORMAT_BGRX32
Definition SDL_pixels.h:306
@ SDL_PIXELFORMAT_YV12
Definition SDL_pixels.h:319
@ SDL_PIXELFORMAT_ABGR32
Definition SDL_pixels.h:303
@ SDL_PIXELFORMAT_BGRX8888
Definition SDL_pixels.h:279
@ SDL_PIXELFORMAT_RGB24
Definition SDL_pixels.h:264
@ SDL_PIXELFORMAT_ABGR8888
Definition SDL_pixels.h:288
@ SDL_PIXELFORMAT_YUY2
Definition SDL_pixels.h:323
@ SDL_PIXELFORMAT_XBGR32
Definition SDL_pixels.h:307
@ SDL_PIXELFORMAT_NV12
Definition SDL_pixels.h:329
@ SDL_PIXELFORMAT_BGRA8888
Definition SDL_pixels.h:291
@ SDL_PIXELFORMAT_ARGB32
Definition SDL_pixels.h:301
@ SDL_PIXELFORMAT_ABGR1555
Definition SDL_pixels.h:252
@ SDL_PIXELFORMAT_NV21
Definition SDL_pixels.h:331
@ SDL_PIXELFORMAT_IYUV
Definition SDL_pixels.h:321
@ SDL_PIXELFORMAT_ARGB8888
Definition SDL_pixels.h:282
@ SDL_PIXELFORMAT_XRGB32
Definition SDL_pixels.h:305
@ SDL_PIXELFORMAT_XBGR1555
Definition SDL_pixels.h:230
@ SDL_PIXELFORMAT_XRGB4444
Definition SDL_pixels.h:218
@ SDL_PIXELFORMAT_ARGB4444
Definition SDL_pixels.h:234
@ SDL_PIXELFORMAT_RGBA32
Definition SDL_pixels.h:300
@ SDL_PIXELFORMAT_INDEX1MSB
Definition SDL_pixels.h:204
@ SDL_PIXELFORMAT_INDEX4LSB
Definition SDL_pixels.h:207
@ SDL_PIXELFORMAT_RGBX8888
Definition SDL_pixels.h:273
@ SDL_PIXELFORMAT_BGRA5551
Definition SDL_pixels.h:255
@ SDL_PIXELFORMAT_XRGB1555
Definition SDL_pixels.h:226
@ SDL_PIXELFORMAT_RGB565
Definition SDL_pixels.h:258
@ SDL_PIXELFORMAT_XBGR8888
Definition SDL_pixels.h:276
@ SDL_PIXELFORMAT_ARGB2101010
Definition SDL_pixels.h:294
@ SDL_PIXELFORMAT_BGR555
Definition SDL_pixels.h:233
@ SDL_PIXELFORMAT_UNKNOWN
Definition SDL_pixels.h:200
@ SDL_PIXELFORMAT_RGBA4444
Definition SDL_pixels.h:237
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes)
Definition SDL_pixels.h:151
void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
SDL_PackedOrder
Definition SDL_pixels.h:113
@ SDL_PACKEDORDER_NONE
Definition SDL_pixels.h:114
@ SDL_PACKEDORDER_RGBX
Definition SDL_pixels.h:116
@ SDL_PACKEDORDER_BGRX
Definition SDL_pixels.h:120
@ SDL_PACKEDORDER_XBGR
Definition SDL_pixels.h:119
@ SDL_PACKEDORDER_RGBA
Definition SDL_pixels.h:118
@ SDL_PACKEDORDER_ABGR
Definition SDL_pixels.h:121
@ SDL_PACKEDORDER_BGRA
Definition SDL_pixels.h:122
@ SDL_PACKEDORDER_XRGB
Definition SDL_pixels.h:115
@ SDL_PACKEDORDER_ARGB
Definition SDL_pixels.h:117
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
Uint32 version
Definition SDL_pixels.h:355
SDL_Color * colors
Definition SDL_pixels.h:354
struct SDL_PixelFormat * next
Definition SDL_pixels.h:382
Uint8 padding[2]
Definition SDL_pixels.h:368
SDL_Palette * palette
Definition SDL_pixels.h:365