zenilib: zenilib/jni/external/sdl/SDL/SDL_pixels.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_pixels.h
Go to the documentation of this file.
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2013 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
28 #ifndef _SDL_pixels_h
29 #define _SDL_pixels_h
30
31 #include "begin_code.h"
32 /* Set up for C function definitions, even when using C++ */
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
42 /* @{ */
43 #define SDL_ALPHA_OPAQUE 255
44 #define SDL_ALPHA_TRANSPARENT 0
45 /* @} */
46
48 enum
49 {
50 SDL_PIXELTYPE_UNKNOWN,
51 SDL_PIXELTYPE_INDEX1,
52 SDL_PIXELTYPE_INDEX4,
53 SDL_PIXELTYPE_INDEX8,
54 SDL_PIXELTYPE_PACKED8,
55 SDL_PIXELTYPE_PACKED16,
56 SDL_PIXELTYPE_PACKED32,
57 SDL_PIXELTYPE_ARRAYU8,
58 SDL_PIXELTYPE_ARRAYU16,
59 SDL_PIXELTYPE_ARRAYU32,
60 SDL_PIXELTYPE_ARRAYF16,
61 SDL_PIXELTYPE_ARRAYF32
62 };
63
65 enum
66 {
67 SDL_BITMAPORDER_NONE,
68 SDL_BITMAPORDER_4321,
69 SDL_BITMAPORDER_1234
70 };
71
73 enum
74 {
75 SDL_PACKEDORDER_NONE,
76 SDL_PACKEDORDER_XRGB,
77 SDL_PACKEDORDER_RGBX,
78 SDL_PACKEDORDER_ARGB,
79 SDL_PACKEDORDER_RGBA,
80 SDL_PACKEDORDER_XBGR,
81 SDL_PACKEDORDER_BGRX,
82 SDL_PACKEDORDER_ABGR,
83 SDL_PACKEDORDER_BGRA
84 };
85
87 enum
88 {
89 SDL_ARRAYORDER_NONE,
90 SDL_ARRAYORDER_RGB,
91 SDL_ARRAYORDER_RGBA,
92 SDL_ARRAYORDER_ARGB,
93 SDL_ARRAYORDER_BGR,
94 SDL_ARRAYORDER_BGRA,
95 SDL_ARRAYORDER_ABGR
96 };
97
99 enum
100 {
101 SDL_PACKEDLAYOUT_NONE,
102 SDL_PACKEDLAYOUT_332,
103 SDL_PACKEDLAYOUT_4444,
104 SDL_PACKEDLAYOUT_1555,
105 SDL_PACKEDLAYOUT_5551,
106 SDL_PACKEDLAYOUT_565,
107 SDL_PACKEDLAYOUT_8888,
108 SDL_PACKEDLAYOUT_2101010,
109 SDL_PACKEDLAYOUT_1010102
110 };
111
112 #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
113
114 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
115 ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
116 ((bits) << 8) | ((bytes) << 0))
117
118 #define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
119 #define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
120 #define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
121 #define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
122 #define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
123 #define SDL_BYTESPERPIXEL(X) \
124 (SDL_ISPIXELFORMAT_FOURCC(X) ? \
125 ((((X) == SDL_PIXELFORMAT_YUY2) || \
126 ((X) == SDL_PIXELFORMAT_UYVY) || \
127 ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
128
129 #define SDL_ISPIXELFORMAT_INDEXED(format) \
130 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
131 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
132 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
133 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
134
135 #define SDL_ISPIXELFORMAT_ALPHA(format) \
136 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
137 ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
138 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
139 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
140 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
141
142 /* The flag is set to 1 because 0x1? is not in the printable ASCII range */
143 #define SDL_ISPIXELFORMAT_FOURCC(format) \
144 ((format) && (SDL_PIXELFLAG(format) != 1))
145
146 /* Note: If you modify this list, update SDL_GetPixelFormatName() */
147 enum
148 {
149 SDL_PIXELFORMAT_UNKNOWN,
150 SDL_PIXELFORMAT_INDEX1LSB =
151 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
152 1, 0),
153 SDL_PIXELFORMAT_INDEX1MSB =
154 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
155 1, 0),
156 SDL_PIXELFORMAT_INDEX4LSB =
157 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
158 4, 0),
159 SDL_PIXELFORMAT_INDEX4MSB =
160 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
161 4, 0),
162 SDL_PIXELFORMAT_INDEX8 =
163 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
164 SDL_PIXELFORMAT_RGB332 =
165 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
166 SDL_PACKEDLAYOUT_332, 8, 1),
167 SDL_PIXELFORMAT_RGB444 =
168 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
169 SDL_PACKEDLAYOUT_4444, 12, 2),
170 SDL_PIXELFORMAT_RGB555 =
171 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
172 SDL_PACKEDLAYOUT_1555, 15, 2),
173 SDL_PIXELFORMAT_BGR555 =
174 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
175 SDL_PACKEDLAYOUT_1555, 15, 2),
176 SDL_PIXELFORMAT_ARGB4444 =
177 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
178 SDL_PACKEDLAYOUT_4444, 16, 2),
179 SDL_PIXELFORMAT_RGBA4444 =
180 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
181 SDL_PACKEDLAYOUT_4444, 16, 2),
182 SDL_PIXELFORMAT_ABGR4444 =
183 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
184 SDL_PACKEDLAYOUT_4444, 16, 2),
185 SDL_PIXELFORMAT_BGRA4444 =
186 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
187 SDL_PACKEDLAYOUT_4444, 16, 2),
188 SDL_PIXELFORMAT_ARGB1555 =
189 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
190 SDL_PACKEDLAYOUT_1555, 16, 2),
191 SDL_PIXELFORMAT_RGBA5551 =
192 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
193 SDL_PACKEDLAYOUT_5551, 16, 2),
194 SDL_PIXELFORMAT_ABGR1555 =
195 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
196 SDL_PACKEDLAYOUT_1555, 16, 2),
197 SDL_PIXELFORMAT_BGRA5551 =
198 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
199 SDL_PACKEDLAYOUT_5551, 16, 2),
200 SDL_PIXELFORMAT_RGB565 =
201 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
202 SDL_PACKEDLAYOUT_565, 16, 2),
203 SDL_PIXELFORMAT_BGR565 =
204 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
205 SDL_PACKEDLAYOUT_565, 16, 2),
206 SDL_PIXELFORMAT_RGB24 =
207 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
208 24, 3),
209 SDL_PIXELFORMAT_BGR24 =
210 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
211 24, 3),
212 SDL_PIXELFORMAT_RGB888 =
213 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
214 SDL_PACKEDLAYOUT_8888, 24, 4),
215 SDL_PIXELFORMAT_RGBX8888 =
216 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
217 SDL_PACKEDLAYOUT_8888, 24, 4),
218 SDL_PIXELFORMAT_BGR888 =
219 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
220 SDL_PACKEDLAYOUT_8888, 24, 4),
221 SDL_PIXELFORMAT_BGRX8888 =
222 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
223 SDL_PACKEDLAYOUT_8888, 24, 4),
224 SDL_PIXELFORMAT_ARGB8888 =
225 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
226 SDL_PACKEDLAYOUT_8888, 32, 4),
227 SDL_PIXELFORMAT_RGBA8888 =
228 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
229 SDL_PACKEDLAYOUT_8888, 32, 4),
230 SDL_PIXELFORMAT_ABGR8888 =
231 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
232 SDL_PACKEDLAYOUT_8888, 32, 4),
233 SDL_PIXELFORMAT_BGRA8888 =
234 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
235 SDL_PACKEDLAYOUT_8888, 32, 4),
236 SDL_PIXELFORMAT_ARGB2101010 =
237 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
238 SDL_PACKEDLAYOUT_2101010, 32, 4),
239
240 SDL_PIXELFORMAT_YV12 =
241 SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
242 SDL_PIXELFORMAT_IYUV =
243 SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
244 SDL_PIXELFORMAT_YUY2 =
245 SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
246 SDL_PIXELFORMAT_UYVY =
247 SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
248 SDL_PIXELFORMAT_YVYU =
249 SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U')
250 };
251
252 typedef struct SDL_Color
253 {
254 Uint8 r;
255 Uint8 g;
256 Uint8 b;
257 Uint8 a;
258 } SDL_Color;
259 #define SDL_Colour SDL_Color
260
261 typedef struct SDL_Palette
262 {
263 int ncolors;
264 SDL_Color *colors;
265 Uint32 version;
266 int refcount;
267 } SDL_Palette;
268
272 typedef struct SDL_PixelFormat
273 {
274 Uint32 format;
275 SDL_Palette *palette;
276 Uint8 BitsPerPixel;
277 Uint8 BytesPerPixel;
278 Uint8 padding[2];
279 Uint32 Rmask;
280 Uint32 Gmask;
281 Uint32 Bmask;
282 Uint32 Amask;
283 Uint8 Rloss;
284 Uint8 Gloss;
285 Uint8 Bloss;
286 Uint8 Aloss;
287 Uint8 Rshift;
288 Uint8 Gshift;
289 Uint8 Bshift;
290 Uint8 Ashift;
291 int refcount;
292 struct SDL_PixelFormat *next;
293 } SDL_PixelFormat;
294
298 extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
299
307 extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
308 int *bpp,
309 Uint32 * Rmask,
310 Uint32 * Gmask,
311 Uint32 * Bmask,
312 Uint32 * Amask);
313
322 extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
323 Uint32 Rmask,
324 Uint32 Gmask,
325 Uint32 Bmask,
326 Uint32 Amask);
327
331 extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
332
336 extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
337
348 extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
349
353 extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
354 SDL_Palette *palette);
355
366 extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
367 const SDL_Color * colors,
368 int firstcolor, int ncolors);
369
375 extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
376
382 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
383 Uint8 r, Uint8 g, Uint8 b);
384
390 extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
391 Uint8 r, Uint8 g, Uint8 b,
392 Uint8 a);
393
399 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
400 const SDL_PixelFormat * format,
401 Uint8 * r, Uint8 * g, Uint8 * b);
402
408 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
409 const SDL_PixelFormat * format,
410 Uint8 * r, Uint8 * g, Uint8 * b,
411 Uint8 * a);
412
416 extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
417
418
419 /* Ends C function definitions when using C++ */
420 #ifdef __cplusplus
421 }
422 #endif
423 #include "close_code.h"
424
425 #endif /* _SDL_pixels_h */
426
427 /* vi: set ts=4 sw=4 expandtab: */
SDL_PixelFormat::Aloss
Uint8 Aloss
Definition: SDL_pixels.h:286
SDL_ARRAYORDER_BGRA
Definition: SDL_pixels.h:94
SDL_PIXELFORMAT_YV12
Definition: SDL_pixels.h:240
SDL_PIXELFORMAT_ABGR4444
Definition: SDL_pixels.h:182
SDL_Palette::version
Uint32 version
Definition: SDL_pixels.h:265
SDL_PIXELFORMAT_INDEX8
Definition: SDL_pixels.h:162
SDL_Color
Definition: SDL_pixels.h:252
SDL_PIXELTYPE_PACKED16
Definition: SDL_pixels.h:55
SDL_PIXELFORMAT_ABGR1555
Definition: SDL_pixels.h:194
SDL_PACKEDLAYOUT_1555
Definition: SDL_pixels.h:104
SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:230
SDL_PIXELFORMAT_BGR24
Definition: SDL_pixels.h:209
SDL_FreeFormat
DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format)
Free an SDL_PixelFormat structure.
Definition: SDL_pixels.c:584
SDL_Color::g
Uint8 g
Definition: SDL_pixels.h:255
SDL_SetPixelFormatPalette
DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette)
Set the palette for a pixel format structure.
Definition: SDL_pixels.c:646
SDL_PACKEDLAYOUT_NONE
Definition: SDL_pixels.h:101
SDL_PixelFormat::Gmask
Uint32 Gmask
Definition: SDL_pixels.h:280
g
GLboolean GLboolean g
Definition: glew.h:8736
SDL_PACKEDORDER_BGRX
Definition: SDL_pixels.h:81
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:277
SDL_PixelFormat::padding
Uint8 padding[2]
Definition: SDL_pixels.h:278
SDL_PIXELFORMAT_RGB24
Definition: SDL_pixels.h:206
SDL_GetPixelFormatName
DECLSPEC const char *SDLCALL SDL_GetPixelFormatName(Uint32 format)
Get the human readable name of a pixel format.
Definition: SDL_pixels.c:86
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:116
SDL_PIXELFORMAT_RGB565
Definition: SDL_pixels.h:200
SDL_PACKEDORDER_XBGR
Definition: SDL_pixels.h:80
SDL_BITMAPORDER_1234
Definition: SDL_pixels.h:69
SDL_PACKEDORDER_NONE
Definition: SDL_pixels.h:75
SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:248
SDL_PIXELFORMAT_RGBA5551
Definition: SDL_pixels.h:191
SDL_PixelFormat::Bmask
Uint32 Bmask
Definition: SDL_pixels.h:281
SDL_FreePalette
DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette *palette)
Free a palette created with SDL_AllocPalette().
Definition: SDL_pixels.c:701
SDL_PIXELFORMAT_BGRX8888
Definition: SDL_pixels.h:221
SDL_PIXELFORMAT_ARGB4444
Definition: SDL_pixels.h:176
SDL_PIXELFORMAT_UNKNOWN
Definition: SDL_pixels.h:149
SDL_PixelFormat::Ashift
Uint8 Ashift
Definition: SDL_pixels.h:290
SDL_PixelFormat::Rloss
Uint8 Rloss
Definition: SDL_pixels.h:283
SDL_MasksToPixelFormatEnum
DECLSPEC Uint32 SDLCALL 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:291
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:8736
DECLSPEC
#define DECLSPEC
Definition: begin_code.h:62
SDL_ARRAYORDER_ARGB
Definition: SDL_pixels.h:92
SDL_Color::b
Uint8 b
Definition: SDL_pixels.h:256
SDL_PIXELFORMAT_INDEX1MSB
Definition: SDL_pixels.h:153
SDL_PACKEDLAYOUT_4444
Definition: SDL_pixels.h:103
SDL_PIXELFORMAT_RGB444
Definition: SDL_pixels.h:167
SDL_Palette
struct SDL_Palette SDL_Palette
SDLCALL
#define SDLCALL
Definition: begin_code.h:72
begin_code.h
SDL_BITMAPORDER_NONE
Definition: SDL_pixels.h:67
SDL_PIXELTYPE_INDEX8
Definition: SDL_pixels.h:53
SDL_PIXELFORMAT_BGR565
Definition: SDL_pixels.h:203
SDL_PIXELTYPE_ARRAYU16
Definition: SDL_pixels.h:58
SDL_ARRAYORDER_RGBA
Definition: SDL_pixels.h:91
SDL_PixelFormat::refcount
int refcount
Definition: SDL_pixels.h:291
SDL_PACKEDORDER_RGBA
Definition: SDL_pixels.h:79
SDL_PIXELTYPE_INDEX1
Definition: SDL_pixels.h:51
SDL_DEFINE_PIXELFOURCC
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D)
Definition: SDL_pixels.h:112
SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:236
SDL_PIXELTYPE_PACKED32
Definition: SDL_pixels.h:56
SDL_BITMAPORDER_4321
Definition: SDL_pixels.h:68
SDL_MapRGBA
DECLSPEC Uint32 SDLCALL 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:812
SDL_ARRAYORDER_ABGR
Definition: SDL_pixels.h:95
SDL_PACKEDLAYOUT_1010102
Definition: SDL_pixels.h:109
SDL_PIXELFORMAT_RGB332
Definition: SDL_pixels.h:164
SDL_PIXELFORMAT_ARGB1555
Definition: SDL_pixels.h:188
SDL_ARRAYORDER_RGB
Definition: SDL_pixels.h:90
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145
SDL_PACKEDLAYOUT_8888
Definition: SDL_pixels.h:107
SDL_PIXELFORMAT_IYUV
Definition: SDL_pixels.h:242
SDL_Color
struct SDL_Color SDL_Color
SDL_PIXELTYPE_ARRAYF16
Definition: SDL_pixels.h:60
SDL_Palette
Definition: SDL_pixels.h:261
SDL_AllocFormat
DECLSPEC SDL_PixelFormat *SDLCALL SDL_AllocFormat(Uint32 pixel_format)
Create an SDL_PixelFormat structure from a pixel format enum.
Definition: SDL_pixels.c:486
SDL_Color::r
Uint8 r
Definition: SDL_pixels.h:254
SDL_PACKEDORDER_XRGB
Definition: SDL_pixels.h:76
SDL_PIXELFORMAT_BGR555
Definition: SDL_pixels.h:173
SDL_PIXELFORMAT_RGBX8888
Definition: SDL_pixels.h:215
close_code.h
SDL_PACKEDLAYOUT_565
Definition: SDL_pixels.h:106
SDL_PixelFormat::Bshift
Uint8 Bshift
Definition: SDL_pixels.h:289
SDL_PixelFormat::Rshift
Uint8 Rshift
Definition: SDL_pixels.h:287
SDL_Color::a
Uint8 a
Definition: SDL_pixels.h:257
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:276
SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:233
SDL_PixelFormat::Bloss
Uint8 Bloss
Definition: SDL_pixels.h:285
SDL_PIXELFORMAT_INDEX4LSB
Definition: SDL_pixels.h:156
SDL_PACKEDLAYOUT_5551
Definition: SDL_pixels.h:105
SDL_Palette::ncolors
int ncolors
Definition: SDL_pixels.h:263
SDL_PACKEDORDER_RGBX
Definition: SDL_pixels.h:77
format
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl2ext.h:845
SDL_PACKEDLAYOUT_332
Definition: SDL_pixels.h:102
SDL_PIXELTYPE_INDEX4
Definition: SDL_pixels.h:52
SDL_PACKEDORDER_ARGB
Definition: SDL_pixels.h:78
SDL_PIXELTYPE_ARRAYU32
Definition: SDL_pixels.h:59
SDL_PIXELFORMAT_INDEX1LSB
Definition: SDL_pixels.h:150
SDL_PACKEDORDER_ABGR
Definition: SDL_pixels.h:82
SDL_PIXELFORMAT_INDEX4MSB
Definition: SDL_pixels.h:159
SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:224
SDL_PIXELFORMAT_RGBA4444
Definition: SDL_pixels.h:179
SDL_Palette::colors
SDL_Color * colors
Definition: SDL_pixels.h:264
SDL_CalculateGammaRamp
DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 *ramp)
Calculate a 256 entry gamma ramp for a gamma value.
Definition: SDL_pixels.c:1086
SDL_PixelFormat::Gshift
Uint8 Gshift
Definition: SDL_pixels.h:288
SDL_GetRGBA
DECLSPEC void SDLCALL 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:849
SDL_PIXELFORMAT_BGRA5551
Definition: SDL_pixels.h:197
SDL_PixelFormat::Rmask
Uint32 Rmask
Definition: SDL_pixels.h:279
SDL_PIXELTYPE_UNKNOWN
Definition: SDL_pixels.h:50
SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:246
SDL_PixelFormat::Gloss
Uint8 Gloss
Definition: SDL_pixels.h:284
SDL_AllocPalette
DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors)
Create a palette structure with the specified number of color entries.
Definition: SDL_pixels.c:615
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
SDL_PIXELFORMAT_RGB555
Definition: SDL_pixels.h:170
SDL_DEFINE_PIXELFORMAT
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes)
Definition: SDL_pixels.h:114
SDL_PACKEDORDER_BGRA
Definition: SDL_pixels.h:83
SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:227
SDL_PIXELTYPE_ARRAYU8
Definition: SDL_pixels.h:57
SDL_PixelFormat
Definition: SDL_pixels.h:272
SDL_PixelFormatEnumToMasks
DECLSPEC SDL_bool SDLCALL 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:132
SDL_MapRGB
DECLSPEC Uint32 SDLCALL 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:799
SDL_ARRAYORDER_NONE
Definition: SDL_pixels.h:89
SDL_GetRGB
DECLSPEC void SDLCALL 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:826
r
GLdouble GLdouble GLdouble r
Definition: glew.h:1392
b
GLdouble GLdouble GLdouble b
Definition: glew.h:8383
SDL_PIXELFORMAT_RGB888
Definition: SDL_pixels.h:212
SDL_PIXELFORMAT_BGR888
Definition: SDL_pixels.h:218
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:137
SDL_PixelFormat::Amask
Uint32 Amask
Definition: SDL_pixels.h:282
SDL_PixelFormat::palette
SDL_Palette * palette
Definition: SDL_pixels.h:275
SDL_PIXELTYPE_PACKED8
Definition: SDL_pixels.h:54
SDL_PixelFormat::format
Uint32 format
Definition: SDL_pixels.h:274
SDL_ARRAYORDER_BGR
Definition: SDL_pixels.h:93
SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:244
SDL_PixelFormat::next
struct SDL_PixelFormat * next
Definition: SDL_pixels.h:292
SDL_PIXELTYPE_ARRAYF32
Definition: SDL_pixels.h:61
colors
GLuint colors[3]
Definition: modern.h:25
SDL_PACKEDLAYOUT_2101010
Definition: SDL_pixels.h:108
SDL_PixelFormat
struct SDL_PixelFormat SDL_PixelFormat
SDL_SetPaletteColors
DECLSPEC int SDLCALL 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:674
SDL_PIXELFORMAT_BGRA4444
Definition: SDL_pixels.h:185
SDL_Palette::refcount
int refcount
Definition: SDL_pixels.h:266