Subversion Repositories Games.Prince of Persia

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
/*
2
  Simple DirectMedia Layer
3
  Copyright (C) 1997-2017 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
enum
52
{
53
    SDL_PIXELTYPE_UNKNOWN,
54
    SDL_PIXELTYPE_INDEX1,
55
    SDL_PIXELTYPE_INDEX4,
56
    SDL_PIXELTYPE_INDEX8,
57
    SDL_PIXELTYPE_PACKED8,
58
    SDL_PIXELTYPE_PACKED16,
59
    SDL_PIXELTYPE_PACKED32,
60
    SDL_PIXELTYPE_ARRAYU8,
61
    SDL_PIXELTYPE_ARRAYU16,
62
    SDL_PIXELTYPE_ARRAYU32,
63
    SDL_PIXELTYPE_ARRAYF16,
64
    SDL_PIXELTYPE_ARRAYF32
65
};
66
 
67
/** Bitmap pixel order, high bit -> low bit. */
68
enum
69
{
70
    SDL_BITMAPORDER_NONE,
71
    SDL_BITMAPORDER_4321,
72
    SDL_BITMAPORDER_1234
73
};
74
 
75
/** Packed component order, high bit -> low bit. */
76
enum
77
{
78
    SDL_PACKEDORDER_NONE,
79
    SDL_PACKEDORDER_XRGB,
80
    SDL_PACKEDORDER_RGBX,
81
    SDL_PACKEDORDER_ARGB,
82
    SDL_PACKEDORDER_RGBA,
83
    SDL_PACKEDORDER_XBGR,
84
    SDL_PACKEDORDER_BGRX,
85
    SDL_PACKEDORDER_ABGR,
86
    SDL_PACKEDORDER_BGRA
87
};
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
enum
93
{
94
    SDL_ARRAYORDER_NONE,
95
    SDL_ARRAYORDER_RGB,
96
    SDL_ARRAYORDER_RGBA,
97
    SDL_ARRAYORDER_ARGB,
98
    SDL_ARRAYORDER_BGR,
99
    SDL_ARRAYORDER_BGRA,
100
    SDL_ARRAYORDER_ABGR
101
};
102
 
103
/** Packed component layout. */
104
enum
105
{
106
    SDL_PACKEDLAYOUT_NONE,
107
    SDL_PACKEDLAYOUT_332,
108
    SDL_PACKEDLAYOUT_4444,
109
    SDL_PACKEDLAYOUT_1555,
110
    SDL_PACKEDLAYOUT_5551,
111
    SDL_PACKEDLAYOUT_565,
112
    SDL_PACKEDLAYOUT_8888,
113
    SDL_PACKEDLAYOUT_2101010,
114
    SDL_PACKEDLAYOUT_1010102
115
};
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
enum
172
{
173
    SDL_PIXELFORMAT_UNKNOWN,
174
    SDL_PIXELFORMAT_INDEX1LSB =
175
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
176
                               1, 0),
177
    SDL_PIXELFORMAT_INDEX1MSB =
178
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
179
                               1, 0),
180
    SDL_PIXELFORMAT_INDEX4LSB =
181
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
182
                               4, 0),
183
    SDL_PIXELFORMAT_INDEX4MSB =
184
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
185
                               4, 0),
186
    SDL_PIXELFORMAT_INDEX8 =
187
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
188
    SDL_PIXELFORMAT_RGB332 =
189
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
190
                               SDL_PACKEDLAYOUT_332, 8, 1),
191
    SDL_PIXELFORMAT_RGB444 =
192
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
193
                               SDL_PACKEDLAYOUT_4444, 12, 2),
194
    SDL_PIXELFORMAT_RGB555 =
195
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
196
                               SDL_PACKEDLAYOUT_1555, 15, 2),
197
    SDL_PIXELFORMAT_BGR555 =
198
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
199
                               SDL_PACKEDLAYOUT_1555, 15, 2),
200
    SDL_PIXELFORMAT_ARGB4444 =
201
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
202
                               SDL_PACKEDLAYOUT_4444, 16, 2),
203
    SDL_PIXELFORMAT_RGBA4444 =
204
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
205
                               SDL_PACKEDLAYOUT_4444, 16, 2),
206
    SDL_PIXELFORMAT_ABGR4444 =
207
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
208
                               SDL_PACKEDLAYOUT_4444, 16, 2),
209
    SDL_PIXELFORMAT_BGRA4444 =
210
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
211
                               SDL_PACKEDLAYOUT_4444, 16, 2),
212
    SDL_PIXELFORMAT_ARGB1555 =
213
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
214
                               SDL_PACKEDLAYOUT_1555, 16, 2),
215
    SDL_PIXELFORMAT_RGBA5551 =
216
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
217
                               SDL_PACKEDLAYOUT_5551, 16, 2),
218
    SDL_PIXELFORMAT_ABGR1555 =
219
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
220
                               SDL_PACKEDLAYOUT_1555, 16, 2),
221
    SDL_PIXELFORMAT_BGRA5551 =
222
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
223
                               SDL_PACKEDLAYOUT_5551, 16, 2),
224
    SDL_PIXELFORMAT_RGB565 =
225
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
226
                               SDL_PACKEDLAYOUT_565, 16, 2),
227
    SDL_PIXELFORMAT_BGR565 =
228
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
229
                               SDL_PACKEDLAYOUT_565, 16, 2),
230
    SDL_PIXELFORMAT_RGB24 =
231
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
232
                               24, 3),
233
    SDL_PIXELFORMAT_BGR24 =
234
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
235
                               24, 3),
236
    SDL_PIXELFORMAT_RGB888 =
237
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
238
                               SDL_PACKEDLAYOUT_8888, 24, 4),
239
    SDL_PIXELFORMAT_RGBX8888 =
240
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
241
                               SDL_PACKEDLAYOUT_8888, 24, 4),
242
    SDL_PIXELFORMAT_BGR888 =
243
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
244
                               SDL_PACKEDLAYOUT_8888, 24, 4),
245
    SDL_PIXELFORMAT_BGRX8888 =
246
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
247
                               SDL_PACKEDLAYOUT_8888, 24, 4),
248
    SDL_PIXELFORMAT_ARGB8888 =
249
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
250
                               SDL_PACKEDLAYOUT_8888, 32, 4),
251
    SDL_PIXELFORMAT_RGBA8888 =
252
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
253
                               SDL_PACKEDLAYOUT_8888, 32, 4),
254
    SDL_PIXELFORMAT_ABGR8888 =
255
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
256
                               SDL_PACKEDLAYOUT_8888, 32, 4),
257
    SDL_PIXELFORMAT_BGRA8888 =
258
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
259
                               SDL_PACKEDLAYOUT_8888, 32, 4),
260
    SDL_PIXELFORMAT_ARGB2101010 =
261
        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
262
                               SDL_PACKEDLAYOUT_2101010, 32, 4),
263
 
264
    /* Aliases for RGBA byte arrays of color data, for the current platform */
265
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
266
    SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
267
    SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
268
    SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
269
    SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
270
#else
271
    SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
272
    SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
273
    SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
274
    SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
275
#endif
276
 
277
    SDL_PIXELFORMAT_YV12 =      /**< Planar mode: Y + V + U  (3 planes) */
278
        SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
279
    SDL_PIXELFORMAT_IYUV =      /**< Planar mode: Y + U + V  (3 planes) */
280
        SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
281
    SDL_PIXELFORMAT_YUY2 =      /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
282
        SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
283
    SDL_PIXELFORMAT_UYVY =      /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
284
        SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
285
    SDL_PIXELFORMAT_YVYU =      /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
286
        SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
287
    SDL_PIXELFORMAT_NV12 =      /**< Planar mode: Y + U/V interleaved  (2 planes) */
288
        SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
289
    SDL_PIXELFORMAT_NV21 =      /**< Planar mode: Y + V/U interleaved  (2 planes) */
290
        SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1')
291
};
292
 
293
typedef struct SDL_Color
294
{
295
    Uint8 r;
296
    Uint8 g;
297
    Uint8 b;
298
    Uint8 a;
299
} SDL_Color;
300
#define SDL_Colour SDL_Color
301
 
302
typedef struct SDL_Palette
303
{
304
    int ncolors;
305
    SDL_Color *colors;
306
    Uint32 version;
307
    int refcount;
308
} SDL_Palette;
309
 
310
/**
311
 *  \note Everything in the pixel format structure is read-only.
312
 */
313
typedef struct SDL_PixelFormat
314
{
315
    Uint32 format;
316
    SDL_Palette *palette;
317
    Uint8 BitsPerPixel;
318
    Uint8 BytesPerPixel;
319
    Uint8 padding[2];
320
    Uint32 Rmask;
321
    Uint32 Gmask;
322
    Uint32 Bmask;
323
    Uint32 Amask;
324
    Uint8 Rloss;
325
    Uint8 Gloss;
326
    Uint8 Bloss;
327
    Uint8 Aloss;
328
    Uint8 Rshift;
329
    Uint8 Gshift;
330
    Uint8 Bshift;
331
    Uint8 Ashift;
332
    int refcount;
333
    struct SDL_PixelFormat *next;
334
} SDL_PixelFormat;
335
 
336
/**
337
 * \brief Get the human readable name of a pixel format
338
 */
339
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
340
 
341
/**
342
 *  \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
343
 *
344
 *  \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
345
 *
346
 *  \sa SDL_MasksToPixelFormatEnum()
347
 */
348
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
349
                                                            int *bpp,
350
                                                            Uint32 * Rmask,
351
                                                            Uint32 * Gmask,
352
                                                            Uint32 * Bmask,
353
                                                            Uint32 * Amask);
354
 
355
/**
356
 *  \brief Convert a bpp and RGBA masks to an enumerated pixel format.
357
 *
358
 *  \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
359
 *          wasn't possible.
360
 *
361
 *  \sa SDL_PixelFormatEnumToMasks()
362
 */
363
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
364
                                                          Uint32 Rmask,
365
                                                          Uint32 Gmask,
366
                                                          Uint32 Bmask,
367
                                                          Uint32 Amask);
368
 
369
/**
370
 *  \brief Create an SDL_PixelFormat structure from a pixel format enum.
371
 */
372
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
373
 
374
/**
375
 *  \brief Free an SDL_PixelFormat structure.
376
 */
377
extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
378
 
379
/**
380
 *  \brief Create a palette structure with the specified number of color
381
 *         entries.
382
 *
383
 *  \return A new palette, or NULL if there wasn't enough memory.
384
 *
385
 *  \note The palette entries are initialized to white.
386
 *
387
 *  \sa SDL_FreePalette()
388
 */
389
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
390
 
391
/**
392
 *  \brief Set the palette for a pixel format structure.
393
 */
394
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
395
                                                      SDL_Palette *palette);
396
 
397
/**
398
 *  \brief Set a range of colors in a palette.
399
 *
400
 *  \param palette    The palette to modify.
401
 *  \param colors     An array of colors to copy into the palette.
402
 *  \param firstcolor The index of the first palette entry to modify.
403
 *  \param ncolors    The number of entries to modify.
404
 *
405
 *  \return 0 on success, or -1 if not all of the colors could be set.
406
 */
407
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
408
                                                 const SDL_Color * colors,
409
                                                 int firstcolor, int ncolors);
410
 
411
/**
412
 *  \brief Free a palette created with SDL_AllocPalette().
413
 *
414
 *  \sa SDL_AllocPalette()
415
 */
416
extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
417
 
418
/**
419
 *  \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
420
 *
421
 *  \sa SDL_MapRGBA
422
 */
423
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
424
                                          Uint8 r, Uint8 g, Uint8 b);
425
 
426
/**
427
 *  \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
428
 *
429
 *  \sa SDL_MapRGB
430
 */
431
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
432
                                           Uint8 r, Uint8 g, Uint8 b,
433
                                           Uint8 a);
434
 
435
/**
436
 *  \brief Get the RGB components from a pixel of the specified format.
437
 *
438
 *  \sa SDL_GetRGBA
439
 */
440
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
441
                                        const SDL_PixelFormat * format,
442
                                        Uint8 * r, Uint8 * g, Uint8 * b);
443
 
444
/**
445
 *  \brief Get the RGBA components from a pixel of the specified format.
446
 *
447
 *  \sa SDL_GetRGB
448
 */
449
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
450
                                         const SDL_PixelFormat * format,
451
                                         Uint8 * r, Uint8 * g, Uint8 * b,
452
                                         Uint8 * a);
453
 
454
/**
455
 *  \brief Calculate a 256 entry gamma ramp for a gamma value.
456
 */
457
extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
458
 
459
 
460
/* Ends C function definitions when using C++ */
461
#ifdef __cplusplus
462
}
463
#endif
464
#include "close_code.h"
465
 
466
#endif /* SDL_pixels_h_ */
467
 
468
/* vi: set ts=4 sw=4 expandtab: */