ReactOS 0.4.17-dev-243-g1369312
gdipluspixelformats.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007 Google (Evan Stade)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef _GDIPLUSPIXELFORMATS_H
20#define _GDIPLUSPIXELFORMATS_H
21
22typedef DWORD ARGB;
24
25#define ALPHA_SHIFT 24
26#define RED_SHIFT 16
27#define GREEN_SHIFT 8
28#define BLUE_SHIFT 0
29#define ALPHA_MASK ((ARGB) 0xff << ALPHA_SHIFT)
30
31#define PixelFormatIndexed 0x00010000
32#define PixelFormatGDI 0x00020000
33#define PixelFormatAlpha 0x00040000
34#define PixelFormatPAlpha 0x00080000
35#define PixelFormatExtended 0x00100000
36#define PixelFormatCanonical 0x00200000
37
38#define PixelFormatUndefined 0
39#define PixelFormatDontCare 0
40
41#define PixelFormat1bppIndexed (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI)
42#define PixelFormat4bppIndexed (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI)
43#define PixelFormat8bppIndexed (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI)
44#define PixelFormat16bppGrayScale (4 | (16 << 8) | PixelFormatExtended)
45#define PixelFormat16bppRGB555 (5 | (16 << 8) | PixelFormatGDI)
46#define PixelFormat16bppRGB565 (6 | (16 << 8) | PixelFormatGDI)
47#define PixelFormat16bppARGB1555 (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI)
48#define PixelFormat24bppRGB (8 | (24 << 8) | PixelFormatGDI)
49#define PixelFormat32bppRGB (9 | (32 << 8) | PixelFormatGDI)
50#define PixelFormat32bppARGB (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical)
51#define PixelFormat32bppPARGB (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI)
52#define PixelFormat48bppRGB (12 | (48 << 8) | PixelFormatExtended)
53#define PixelFormat64bppARGB (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended)
54#define PixelFormat64bppPARGB (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended)
55#define PixelFormat32bppCMYK (15 | (32 << 8))
56#define PixelFormatMax 16
57
59{
60 return (format & PixelFormatIndexed) != 0;
61}
62
64{
65 return (format & PixelFormatAlpha) != 0;
66}
67
69{
70 return (format & PixelFormatCanonical) != 0;
71}
72
74{
75 return (format & PixelFormatExtended) != 0;
76}
77
79{
80 return (format >> 8) & 0xff;
81}
82
84{
88};
89
90#ifdef __cplusplus
91
92struct ColorPalette
93{
94public:
95 UINT Flags;
96 UINT Count;
97 ARGB Entries[1];
98};
99
100#else /* end of c++ typedefs */
101
102typedef struct ColorPalette
103{
108
109#endif /* end of c typedefs */
110
111typedef enum DitherType
112{
125
126typedef enum PaletteType
127{
139
140#endif
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD ARGB
#define PixelFormatExtended
static BOOL IsIndexedPixelFormat(PixelFormat format)
PaletteFlags
@ PaletteFlagsGrayScale
@ PaletteFlagsHalftone
@ PaletteFlagsHasAlpha
static BOOL IsCanonicalPixelFormat(PixelFormat format)
@ PaletteTypeOptimal
@ PaletteTypeCustom
@ PaletteTypeFixedHalftone27
@ PaletteTypeFixedHalftone125
@ PaletteTypeFixedHalftone64
@ PaletteTypeFixedHalftone256
@ PaletteTypeFixedHalftone8
@ PaletteTypeFixedHalftone252
@ PaletteTypeFixedHalftone216
@ PaletteTypeFixedBW
INT PixelFormat
#define PixelFormatIndexed
static BOOL IsAlphaPixelFormat(PixelFormat format)
#define PixelFormatCanonical
static UINT GetPixelFormatSize(PixelFormat format)
@ DitherTypeErrorDiffusion
@ DitherTypeMax
@ DitherTypeOrdered16x16
@ DitherTypeDualSpiral8x8
@ DitherTypeOrdered8x8
@ DitherTypeSolid
@ DitherTypeDualSpiral4x4
@ DitherTypeSpiral4x4
@ DitherTypeNone
@ DitherTypeOrdered4x4
@ DitherTypeSpiral8x8
static BOOL IsExtendedPixelFormat(PixelFormat format)
#define PixelFormatAlpha
unsigned int UINT
Definition: ndis.h:50
Definition: format.c:58
int32_t INT
Definition: typedefs.h:58