SDL  2.0
SDL_pixels.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 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  * Header for the enumerated pixel format definitions.
26  */
27 
28 #ifndef SDL_pixels_h_
29 #define SDL_pixels_h_
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_endian.h"
33 
34 #include "begin_code.h"
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 extern "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. */
51 typedef enum
52 {
66 
67 /** Bitmap pixel order, high bit -> low bit. */
68 typedef enum
69 {
74 
75 /** Packed component order, high bit -> low bit. */
76 typedef enum
77 {
88 
89 /** Array component order, low byte -> high byte. */
90 /* !!! FIXME: in 2.1, make these not overlap differently with
91  !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */
92 typedef enum
93 {
102 
103 /** Packed component layout. */
104 typedef enum
105 {
116 
117 #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
118 
119 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
120  ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
121  ((bits) << 8) | ((bytes) << 0))
122 
123 #define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
124 #define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
125 #define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
126 #define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
127 #define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
128 #define SDL_BYTESPERPIXEL(X) \
129  (SDL_ISPIXELFORMAT_FOURCC(X) ? \
130  ((((X) == SDL_PIXELFORMAT_YUY2) || \
131  ((X) == SDL_PIXELFORMAT_UYVY) || \
132  ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
133 
134 #define SDL_ISPIXELFORMAT_INDEXED(format) \
135  (!SDL_ISPIXELFORMAT_FOURCC(format) && \
136  ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
137  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
138  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
139 
140 #define SDL_ISPIXELFORMAT_PACKED(format) \
141  (!SDL_ISPIXELFORMAT_FOURCC(format) && \
142  ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
143  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
144  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
145 
146 #define SDL_ISPIXELFORMAT_ARRAY(format) \
147  (!SDL_ISPIXELFORMAT_FOURCC(format) && \
148  ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
149  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
150  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
151  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
152  (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
153 
154 #define SDL_ISPIXELFORMAT_ALPHA(format) \
155  ((SDL_ISPIXELFORMAT_PACKED(format) && \
156  ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
157  (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
158  (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
159  (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \
160  (SDL_ISPIXELFORMAT_ARRAY(format) && \
161  ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \
162  (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \
163  (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
164  (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
165 
166 /* The flag is set to 1 because 0x1? is not in the printable ASCII range */
167 #define SDL_ISPIXELFORMAT_FOURCC(format) \
168  ((format) && (SDL_PIXELFLAG(format) != 1))
169 
170 /* Note: If you modify this list, update SDL_GetPixelFormatName() */
171 typedef enum
172 {
176  1, 0),
179  1, 0),
182  4, 0),
185  4, 0),
235  24, 3),
238  24, 3),
266 
267  /* Aliases for RGBA byte arrays of color data, for the current platform */
268 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
273 #else
278 #endif
279 
280  SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
281  SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
282  SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
283  SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
284  SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
285  SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
286  SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
287  SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
288  SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
289  SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
290  SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */
291  SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
292  SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
293  SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
294  SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
295  SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
297 
298 typedef struct SDL_Color
299 {
304 } SDL_Color;
305 #define SDL_Colour SDL_Color
306 
307 typedef struct SDL_Palette
308 {
309  int ncolors;
312  int refcount;
313 } SDL_Palette;
314 
315 /**
316  * \note Everything in the pixel format structure is read-only.
317  */
318 typedef struct SDL_PixelFormat
319 {
337  int refcount;
340 
341 /**
342  * \brief Get the human readable name of a pixel format
343  */
345 
346 /**
347  * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
348  *
349  * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
350  *
351  * \sa SDL_MasksToPixelFormatEnum()
352  */
354  int *bpp,
355  Uint32 * Rmask,
356  Uint32 * Gmask,
357  Uint32 * Bmask,
358  Uint32 * Amask);
359 
360 /**
361  * \brief Convert a bpp and RGBA masks to an enumerated pixel format.
362  *
363  * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
364  * wasn't possible.
365  *
366  * \sa SDL_PixelFormatEnumToMasks()
367  */
369  Uint32 Rmask,
370  Uint32 Gmask,
371  Uint32 Bmask,
372  Uint32 Amask);
373 
374 /**
375  * \brief Create an SDL_PixelFormat structure from a pixel format enum.
376  */
377 extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
378 
379 /**
380  * \brief Free an SDL_PixelFormat structure.
381  */
383 
384 /**
385  * \brief Create a palette structure with the specified number of color
386  * entries.
387  *
388  * \return A new palette, or NULL if there wasn't enough memory.
389  *
390  * \note The palette entries are initialized to white.
391  *
392  * \sa SDL_FreePalette()
393  */
394 extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
395 
396 /**
397  * \brief Set the palette for a pixel format structure.
398  */
401 
402 /**
403  * \brief Set a range of colors in a palette.
404  *
405  * \param palette The palette to modify.
406  * \param colors An array of colors to copy into the palette.
407  * \param firstcolor The index of the first palette entry to modify.
408  * \param ncolors The number of entries to modify.
409  *
410  * \return 0 on success, or -1 if not all of the colors could be set.
411  */
413  const SDL_Color * colors,
414  int firstcolor, int ncolors);
415 
416 /**
417  * \brief Free a palette created with SDL_AllocPalette().
418  *
419  * \sa SDL_AllocPalette()
420  */
422 
423 /**
424  * \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
425  *
426  * \sa SDL_MapRGBA
427  */
429  Uint8 r, Uint8 g, Uint8 b);
430 
431 /**
432  * \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
433  *
434  * \sa SDL_MapRGB
435  */
437  Uint8 r, Uint8 g, Uint8 b,
438  Uint8 a);
439 
440 /**
441  * \brief Get the RGB components from a pixel of the specified format.
442  *
443  * \sa SDL_GetRGBA
444  */
445 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
446  const SDL_PixelFormat * format,
447  Uint8 * r, Uint8 * g, Uint8 * b);
448 
449 /**
450  * \brief Get the RGBA components from a pixel of the specified format.
451  *
452  * \sa SDL_GetRGB
453  */
454 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
455  const SDL_PixelFormat * format,
456  Uint8 * r, Uint8 * g, Uint8 * b,
457  Uint8 * a);
458 
459 /**
460  * \brief Calculate a 256 entry gamma ramp for a gamma value.
461  */
462 extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
463 
464 
465 /* Ends C function definitions when using C++ */
466 #ifdef __cplusplus
467 }
468 #endif
469 #include "close_code.h"
470 
471 #endif /* SDL_pixels_h_ */
472 
473 /* vi: set ts=4 sw=4 expandtab: */
SDL_PixelFormat::Rshift
Uint8 Rshift
Definition: SDL_pixels.h:333
SDL_PixelFormat::Ashift
Uint8 Ashift
Definition: SDL_pixels.h:336
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
SDL_SetPixelFormatPalette
int SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette)
Set the palette for a pixel format structure.
Definition: SDL_pixels.c:677
SDL_PIXELFORMAT_ABGR32
@ SDL_PIXELFORMAT_ABGR32
Definition: SDL_pixels.h:277
SDL_CalculateGammaRamp
void SDL_CalculateGammaRamp(float gamma, Uint16 *ramp)
Calculate a 256 entry gamma ramp for a gamma value.
Definition: SDL_pixels.c:1095
SDL_ARRAYORDER_BGRA
@ SDL_ARRAYORDER_BGRA
Definition: SDL_pixels.h:99
SDL_PIXELFORMAT_ARGB1555
@ SDL_PIXELFORMAT_ARGB1555
Definition: SDL_pixels.h:215
DECLSPEC
#define DECLSPEC
Definition: SDL_internal.h:48
SDL_PIXELFORMAT_BGRA4444
@ SDL_PIXELFORMAT_BGRA4444
Definition: SDL_pixels.h:212
SDL_MapRGBA
Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Maps an RGBA quadruple to a pixel value for a given pixel format.
Definition: SDL_pixels.c:819
SDL_PACKEDORDER_NONE
@ SDL_PACKEDORDER_NONE
Definition: SDL_pixels.h:78
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:322
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:323
SDL_PACKEDLAYOUT_8888
@ SDL_PACKEDLAYOUT_8888
Definition: SDL_pixels.h:112
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
SDL_Palette::ncolors
int ncolors
Definition: SDL_pixels.h:309
SDL_Color::b
Uint8 b
Definition: SDL_pixels.h:302
SDL_GetRGBA
void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
Get the RGBA components from a pixel of the specified format.
Definition: SDL_pixels.c:856
SDL_PIXELFORMAT_INDEX1LSB
@ SDL_PIXELFORMAT_INDEX1LSB
Definition: SDL_pixels.h:174
SDL_PIXELFORMAT_RGB888
@ SDL_PIXELFORMAT_RGB888
Definition: SDL_pixels.h:239
SDL_ARRAYORDER_ABGR
@ SDL_ARRAYORDER_ABGR
Definition: SDL_pixels.h:100
SDL_PIXELTYPE_ARRAYF32
@ SDL_PIXELTYPE_ARRAYF32
Definition: SDL_pixels.h:64
SDL_PIXELFORMAT_NV21
@ SDL_PIXELFORMAT_NV21
Definition: SDL_pixels.h:292
SDL_PIXELFORMAT_UYVY
@ SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:286
SDL_PIXELFORMAT_RGBX8888
@ SDL_PIXELFORMAT_RGBX8888
Definition: SDL_pixels.h:242
SDL_PixelFormat::format
Uint32 format
Definition: SDL_pixels.h:320
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1112
SDL_PACKEDLAYOUT_NONE
@ SDL_PACKEDLAYOUT_NONE
Definition: SDL_pixels.h:106
SDL_PIXELTYPE_INDEX8
@ SDL_PIXELTYPE_INDEX8
Definition: SDL_pixels.h:56
SDL_MasksToPixelFormatEnum
Uint32 SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Convert a bpp and RGBA masks to an enumerated pixel format.
Definition: SDL_pixels.c:294
SDL_PIXELFORMAT_YUY2
@ SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:284
SDL_BITMAPORDER_1234
@ SDL_BITMAPORDER_1234
Definition: SDL_pixels.h:72
SDL_Color::r
Uint8 r
Definition: SDL_pixels.h:300
SDL_PIXELFORMAT_BGR888
@ SDL_PIXELFORMAT_BGR888
Definition: SDL_pixels.h:245
SDL_PixelFormat::next
struct SDL_PixelFormat * next
Definition: SDL_pixels.h:338
SDLCALL
#define SDLCALL
Definition: SDL_internal.h:49
SDL_GetRGB
void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b)
Get the RGB components from a pixel of the specified format.
Definition: SDL_pixels.c:833
SDL_PIXELTYPE_UNKNOWN
@ SDL_PIXELTYPE_UNKNOWN
Definition: SDL_pixels.h:53
SDL_PIXELTYPE_INDEX4
@ SDL_PIXELTYPE_INDEX4
Definition: SDL_pixels.h:55
SDL_PIXELFORMAT_BGR565
@ SDL_PIXELFORMAT_BGR565
Definition: SDL_pixels.h:230
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
SDL_PIXELFORMAT_EXTERNAL_OES
@ SDL_PIXELFORMAT_EXTERNAL_OES
Definition: SDL_pixels.h:294
SDL_PixelFormat::refcount
int refcount
Definition: SDL_pixels.h:337
SDL_PACKEDLAYOUT_565
@ SDL_PACKEDLAYOUT_565
Definition: SDL_pixels.h:111
SDL_MapRGB
Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
Maps an RGB triple to an opaque pixel value for a given pixel format.
Definition: SDL_pixels.c:806
SDL_PACKEDLAYOUT_4444
@ SDL_PACKEDLAYOUT_4444
Definition: SDL_pixels.h:108
SDL_PACKEDORDER_XRGB
@ SDL_PACKEDORDER_XRGB
Definition: SDL_pixels.h:79
SDL_ARRAYORDER_ARGB
@ SDL_ARRAYORDER_ARGB
Definition: SDL_pixels.h:97
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_PIXELTYPE_ARRAYU32
@ SDL_PIXELTYPE_ARRAYU32
Definition: SDL_pixels.h:62
SDL_DEFINE_PIXELFOURCC
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D)
Definition: SDL_pixels.h:117
SDL_endian.h
SDL_PIXELFORMAT_RGB565
@ SDL_PIXELFORMAT_RGB565
Definition: SDL_pixels.h:227
SDL_PixelFormatEnumToMasks
SDL_bool SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
Convert one of the enumerated pixel formats to a bpp and RGBA masks.
Definition: SDL_pixels.c:135
SDL_PixelFormat::Rmask
Uint32 Rmask
Definition: SDL_pixels.h:325
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112
SDL_PIXELFORMAT_BGRX8888
@ SDL_PIXELFORMAT_BGRX8888
Definition: SDL_pixels.h:248
SDL_PACKEDLAYOUT_1010102
@ SDL_PACKEDLAYOUT_1010102
Definition: SDL_pixels.h:114
SDL_PIXELFORMAT_IYUV
@ SDL_PIXELFORMAT_IYUV
Definition: SDL_pixels.h:282
close_code.h
SDL_BITMAPORDER_NONE
@ SDL_BITMAPORDER_NONE
Definition: SDL_pixels.h:70
SDL_Color::a
Uint8 a
Definition: SDL_pixels.h:303
SDL_PIXELFORMAT_RGB332
@ SDL_PIXELFORMAT_RGB332
Definition: SDL_pixels.h:188
begin_code.h
SDL_PACKEDLAYOUT_5551
@ SDL_PACKEDLAYOUT_5551
Definition: SDL_pixels.h:110
SDL_PackedLayout
SDL_PackedLayout
Definition: SDL_pixels.h:105
SDL_PIXELTYPE_ARRAYU16
@ SDL_PIXELTYPE_ARRAYU16
Definition: SDL_pixels.h:61
SDL_PACKEDORDER_XBGR
@ SDL_PACKEDORDER_XBGR
Definition: SDL_pixels.h:83
SDL_PIXELFORMAT_BGR555
@ SDL_PIXELFORMAT_BGR555
Definition: SDL_pixels.h:200
SDL_GetPixelFormatName
const char * SDL_GetPixelFormatName(Uint32 format)
Get the human readable name of a pixel format.
Definition: SDL_pixels.c:86
SDL_Palette::colors
SDL_Color * colors
Definition: SDL_pixels.h:310
SDL_PACKEDORDER_RGBX
@ SDL_PACKEDORDER_RGBX
Definition: SDL_pixels.h:80
SDL_PIXELTYPE_ARRAYU8
@ SDL_PIXELTYPE_ARRAYU8
Definition: SDL_pixels.h:60
SDL_PIXELFORMAT_YVYU
@ SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:288
SDL_PIXELTYPE_PACKED16
@ SDL_PIXELTYPE_PACKED16
Definition: SDL_pixels.h:58
SDL_PIXELFORMAT_ARGB4444
@ SDL_PIXELFORMAT_ARGB4444
Definition: SDL_pixels.h:203
SDL_PIXELTYPE_PACKED32
@ SDL_PIXELTYPE_PACKED32
Definition: SDL_pixels.h:59
SDL_ArrayOrder
SDL_ArrayOrder
Definition: SDL_pixels.h:93
SDL_PIXELFORMAT_RGBA5551
@ SDL_PIXELFORMAT_RGBA5551
Definition: SDL_pixels.h:218
SDL_Color::g
Uint8 g
Definition: SDL_pixels.h:301
SDL_BitmapOrder
SDL_BitmapOrder
Definition: SDL_pixels.h:69
SDL_PIXELFORMAT_RGB444
@ SDL_PIXELFORMAT_RGB444
Definition: SDL_pixels.h:191
SDL_PIXELFORMAT_BGRA32
@ SDL_PIXELFORMAT_BGRA32
Definition: SDL_pixels.h:276
SDL_PIXELFORMAT_BGR444
@ SDL_PIXELFORMAT_BGR444
Definition: SDL_pixels.h:194
SDL_PIXELFORMAT_ARGB2101010
@ SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:263
SDL_PIXELFORMAT_ABGR1555
@ SDL_PIXELFORMAT_ABGR1555
Definition: SDL_pixels.h:221
SDL_PixelFormat::palette
SDL_Palette * palette
Definition: SDL_pixels.h:321
SDL_PACKEDORDER_BGRX
@ SDL_PACKEDORDER_BGRX
Definition: SDL_pixels.h:84
SDL_PixelType
SDL_PixelType
Definition: SDL_pixels.h:52
SDL_PixelFormat::Amask
Uint32 Amask
Definition: SDL_pixels.h:328
SDL_ARRAYORDER_RGB
@ SDL_ARRAYORDER_RGB
Definition: SDL_pixels.h:95
SDL_PIXELFORMAT_ABGR4444
@ SDL_PIXELFORMAT_ABGR4444
Definition: SDL_pixels.h:209
SDL_PIXELFORMAT_ARGB8888
@ SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:251
SDL_FreePalette
void SDL_FreePalette(SDL_Palette *palette)
Free a palette created with SDL_AllocPalette().
Definition: SDL_pixels.c:732
SDL_PixelFormat
Definition: SDL_pixels.h:319
SDL_PixelFormat::Gmask
Uint32 Gmask
Definition: SDL_pixels.h:326
SDL_PACKEDLAYOUT_332
@ SDL_PACKEDLAYOUT_332
Definition: SDL_pixels.h:107
SDL_Palette::refcount
int refcount
Definition: SDL_pixels.h:312
SDL_AllocPalette
SDL_Palette * SDL_AllocPalette(int ncolors)
Create a palette structure with the specified number of color entries.
Definition: SDL_pixels.c:646
SDL_PIXELFORMAT_RGBA4444
@ SDL_PIXELFORMAT_RGBA4444
Definition: SDL_pixels.h:206
bpp
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
Definition: pixman-arm-neon-asm.h:146
SDL_PixelFormat::Bloss
Uint8 Bloss
Definition: SDL_pixels.h:331
SDL_ARRAYORDER_BGR
@ SDL_ARRAYORDER_BGR
Definition: SDL_pixels.h:98
SDL_PixelFormat::Bmask
Uint32 Bmask
Definition: SDL_pixels.h:327
SDL_PIXELFORMAT_INDEX1MSB
@ SDL_PIXELFORMAT_INDEX1MSB
Definition: SDL_pixels.h:177
SDL_PACKEDLAYOUT_1555
@ SDL_PACKEDLAYOUT_1555
Definition: SDL_pixels.h:109
SDL_PIXELFORMAT_RGB555
@ SDL_PIXELFORMAT_RGB555
Definition: SDL_pixels.h:197
SDL_Palette
Definition: SDL_pixels.h:308
SDL_PIXELTYPE_ARRAYF16
@ SDL_PIXELTYPE_ARRAYF16
Definition: SDL_pixels.h:63
SDL_DEFINE_PIXELFORMAT
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes)
Definition: SDL_pixels.h:119
SDL_PIXELFORMAT_INDEX4LSB
@ SDL_PIXELFORMAT_INDEX4LSB
Definition: SDL_pixels.h:180
SDL_PIXELFORMAT_RGBA8888
@ SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:254
SDL_PACKEDORDER_BGRA
@ SDL_PACKEDORDER_BGRA
Definition: SDL_pixels.h:86
SDL_PixelFormat::Bshift
Uint8 Bshift
Definition: SDL_pixels.h:335
SDL_PixelFormat::Aloss
Uint8 Aloss
Definition: SDL_pixels.h:332
SDL_stdinc.h
SDL_Palette::version
Uint32 version
Definition: SDL_pixels.h:311
SDL_PIXELFORMAT_RGB24
@ SDL_PIXELFORMAT_RGB24
Definition: SDL_pixels.h:233
SDL_PIXELFORMAT_NV12
@ SDL_PIXELFORMAT_NV12
Definition: SDL_pixels.h:290
SDL_PixelFormat::Rloss
Uint8 Rloss
Definition: SDL_pixels.h:329
SDL_PIXELFORMAT_UNKNOWN
@ SDL_PIXELFORMAT_UNKNOWN
Definition: SDL_pixels.h:173
SDL_PIXELFORMAT_BGRA5551
@ SDL_PIXELFORMAT_BGRA5551
Definition: SDL_pixels.h:224
SDL_PIXELTYPE_PACKED8
@ SDL_PIXELTYPE_PACKED8
Definition: SDL_pixels.h:57
SDL_PIXELTYPE_INDEX1
@ SDL_PIXELTYPE_INDEX1
Definition: SDL_pixels.h:54
SDL_PIXELFORMAT_BGRA8888
@ SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:260
SDL_PIXELFORMAT_RGBA32
@ SDL_PIXELFORMAT_RGBA32
Definition: SDL_pixels.h:274
SDL_Color
Definition: SDL_pixels.h:299
SDL_AllocFormat
SDL_PixelFormat * SDL_AllocFormat(Uint32 pixel_format)
Create an SDL_PixelFormat structure from a pixel format enum.
Definition: SDL_pixels.c:503
SDL_PIXELFORMAT_ARGB32
@ SDL_PIXELFORMAT_ARGB32
Definition: SDL_pixels.h:275
SDL_PixelFormat::Gloss
Uint8 Gloss
Definition: SDL_pixels.h:330
SDL_PIXELFORMAT_BGR24
@ SDL_PIXELFORMAT_BGR24
Definition: SDL_pixels.h:236
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:162
SDL_PackedOrder
SDL_PackedOrder
Definition: SDL_pixels.h:77
SDL_PixelFormat::padding
Uint8 padding[2]
Definition: SDL_pixels.h:324
SDL_PixelFormat::Gshift
Uint8 Gshift
Definition: SDL_pixels.h:334
SDL_PIXELFORMAT_INDEX4MSB
@ SDL_PIXELFORMAT_INDEX4MSB
Definition: SDL_pixels.h:183
SDL_PIXELFORMAT_INDEX8
@ SDL_PIXELFORMAT_INDEX8
Definition: SDL_pixels.h:186
SDL_ARRAYORDER_RGBA
@ SDL_ARRAYORDER_RGBA
Definition: SDL_pixels.h:96
SDL_PACKEDLAYOUT_2101010
@ SDL_PACKEDLAYOUT_2101010
Definition: SDL_pixels.h:113
SDL_BITMAPORDER_4321
@ SDL_BITMAPORDER_4321
Definition: SDL_pixels.h:71
SDL_PIXELFORMAT_YV12
@ SDL_PIXELFORMAT_YV12
Definition: SDL_pixels.h:280
SDL_SetPaletteColors
int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors)
Set a range of colors in a palette.
Definition: SDL_pixels.c:705
SDL_FreeFormat
void SDL_FreeFormat(SDL_PixelFormat *format)
Free an SDL_PixelFormat structure.
Definition: SDL_pixels.c:609
SDL_PIXELFORMAT_ABGR8888
@ SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:257
SDL_PACKEDORDER_RGBA
@ SDL_PACKEDORDER_RGBA
Definition: SDL_pixels.h:82
SDL_PixelFormatEnum
SDL_PixelFormatEnum
Definition: SDL_pixels.h:172
SDL_PACKEDORDER_ABGR
@ SDL_PACKEDORDER_ABGR
Definition: SDL_pixels.h:85
colors
static int colors[7]
Definition: testgesture.c:41
SDL_PACKEDORDER_ARGB
@ SDL_PACKEDORDER_ARGB
Definition: SDL_pixels.h:81
SDL_ARRAYORDER_NONE
@ SDL_ARRAYORDER_NONE
Definition: SDL_pixels.h:94