ReactOS 0.4.16-dev-2208-g6350669
palette.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PALETTE
 

Macros

#define PALETTE_UnlockPalette(pPalette)   GDIOBJ_vUnlockObject((POBJ)pPalette)
 
#define PALETTE_ShareLockPalette(hpal)    ((PPALETTE)GDIOBJ_ShareLockObj((HGDIOBJ)hpal, GDI_OBJECT_TYPE_PALETTE))
 
#define PALETTE_ShareUnlockPalette(ppal)    GDIOBJ_vDereferenceObject(&ppal->BaseObject)
 

Typedefs

typedef struct _PALETTE PALETTE
 
typedef struct _PALETTEPPALETTE
 

Enumerations

enum  _PALFLAGS {
  PAL_INDEXED = 0x00000001 , PAL_BITFIELDS = 0x00000002 , PAL_RGB = 0x00000004 , PAL_BGR = 0x00000008 ,
  PAL_CMYK = 0x00000010 , PAL_DC = 0x00000100 , PAL_FIXED = 0x00000200 , PAL_FREE = 0x00000400 ,
  PAL_MANAGED = 0x00000800 , PAL_NOSTATIC = 0x00001000 , PAL_MONOCHROME = 0x00002000 , PAL_BRUSHHACK = 0x00004000 ,
  PAL_DIBSECTION = 0x00008000 , PAL_NOSTATIC256 = 0x00010000 , PAL_HT = 0x00100000 , PAL_RGB16_555 = 0x00200000 ,
  PAL_RGB16_565 = 0x00400000 , PAL_GAMMACORRECTION = 0x00800000
}
 

Functions

NTSTATUS NTAPI InitPaletteImpl (VOID)
 
PPALETTE NTAPI PALETTE_AllocPalette (_In_ ULONG iMode, _In_ ULONG cColors, _In_opt_ const PALETTEENTRY *pEntries, _In_ FLONG flRed, _In_ FLONG flGreen, _In_ FLONG flBlue)
 
PPALETTE NTAPI PALETTE_AllocPalWithHandle (_In_ ULONG iMode, _In_ ULONG cColors, _In_opt_ const PALETTEENTRY *pEntries, _In_ FLONG flRed, _In_ FLONG flGreen, _In_ FLONG flBlue)
 
VOID FASTCALL PALETTE_ValidateFlags (PALETTEENTRY *lpPalE, INT size)
 
INT FASTCALL PALETTE_GetObject (PPALETTE pGdiObject, INT cbCount, LPLOGBRUSH lpBuffer)
 
ULONG NTAPI PALETTE_ulGetNearestPaletteIndex (PPALETTE ppal, ULONG iColor)
 
ULONG NTAPI PALETTE_ulGetNearestIndex (PPALETTE ppal, ULONG iColor)
 
ULONG NTAPI PALETTE_ulGetNearestBitFieldsIndex (PPALETTE ppal, ULONG ulColor)
 
VOID NTAPI PALETTE_vGetBitMasks (PPALETTE ppal, PULONG pulColors)
 
VOID NTAPI PALETTE_vCleanup (PVOID ObjectBody)
 
FORCEINLINE ULONG CalculateShift (ULONG ulMask1, ULONG ulMask2)
 
FORCEINLINE ULONG PALETTE_ulGetRGBColorFromIndex (PPALETTE ppal, ULONG ulIndex)
 
FORCEINLINE VOID PALETTE_vSetRGBColorForIndex (PPALETTE ppal, ULONG ulIndex, COLORREF crColor)
 
HPALETTE NTAPI GreCreatePaletteInternal (IN LPLOGPALETTE pLogPal, IN UINT cEntries)
 

Variables

PALETTE gpalRGB
 
PALETTE gpalBGR
 
PALETTE gpalRGB555
 
PALETTE gpalRGB565
 
PALETTEgppalMono
 
PALETTEgppalDefault
 
PPALETTE appalSurfaceDefault []
 

Macro Definition Documentation

◆ PALETTE_ShareLockPalette

#define PALETTE_ShareLockPalette (   hpal)     ((PPALETTE)GDIOBJ_ShareLockObj((HGDIOBJ)hpal, GDI_OBJECT_TYPE_PALETTE))

Definition at line 57 of file palette.h.

◆ PALETTE_ShareUnlockPalette

#define PALETTE_ShareUnlockPalette (   ppal)     GDIOBJ_vDereferenceObject(&ppal->BaseObject)

Definition at line 59 of file palette.h.

◆ PALETTE_UnlockPalette

#define PALETTE_UnlockPalette (   pPalette)    GDIOBJ_vUnlockObject((POBJ)pPalette)

Definition at line 56 of file palette.h.

Typedef Documentation

◆ PALETTE

◆ PPALETTE

Enumeration Type Documentation

◆ _PALFLAGS

Enumerator
PAL_INDEXED 
PAL_BITFIELDS 
PAL_RGB 
PAL_BGR 
PAL_CMYK 
PAL_DC 
PAL_FIXED 
PAL_FREE 
PAL_MANAGED 
PAL_NOSTATIC 
PAL_MONOCHROME 
PAL_BRUSHHACK 
PAL_DIBSECTION 
PAL_NOSTATIC256 
PAL_HT 
PAL_RGB16_555 
PAL_RGB16_565 
PAL_GAMMACORRECTION 

Definition at line 8 of file palette.h.

9{
10#ifndef _WINDDI_ // Defined in ddk/winddi.h
11 PAL_INDEXED = 0x00000001, // Indexed palette
12 PAL_BITFIELDS = 0x00000002, // Bit fields used for DIB, DIB section
13 PAL_RGB = 0x00000004, // Red, green, blue
14 PAL_BGR = 0x00000008, // Blue, green, red
15 PAL_CMYK = 0x00000010, // Cyan, magenta, yellow, black
16#endif
17 PAL_DC = 0x00000100,
18 PAL_FIXED = 0x00000200, // Can't be changed
19 PAL_FREE = 0x00000400,
20 PAL_MANAGED = 0x00000800,
21 PAL_NOSTATIC = 0x00001000,
22 PAL_MONOCHROME = 0x00002000, // Two colors only
23 PAL_BRUSHHACK = 0x00004000,
24 PAL_DIBSECTION = 0x00008000, // Used for a DIB section
25 PAL_NOSTATIC256 = 0x00010000,
26 PAL_HT = 0x00100000, // Halftone palette
27 PAL_RGB16_555 = 0x00200000, // 16-bit RGB in 555 format
28 PAL_RGB16_565 = 0x00400000, // 16-bit RGB in 565 format
29 PAL_GAMMACORRECTION = 0x00800000, // Correct colors
30};
@ PAL_DC
Definition: palette.h:17
@ PAL_NOSTATIC256
Definition: palette.h:25
@ PAL_MONOCHROME
Definition: palette.h:22
@ PAL_RGB16_565
Definition: palette.h:28
@ PAL_BGR
Definition: palette.h:14
@ PAL_INDEXED
Definition: palette.h:11
@ PAL_HT
Definition: palette.h:26
@ PAL_RGB
Definition: palette.h:13
@ PAL_BRUSHHACK
Definition: palette.h:23
@ PAL_FREE
Definition: palette.h:19
@ PAL_MANAGED
Definition: palette.h:20
@ PAL_NOSTATIC
Definition: palette.h:21
@ PAL_FIXED
Definition: palette.h:18
@ PAL_BITFIELDS
Definition: palette.h:12
@ PAL_RGB16_555
Definition: palette.h:27
@ PAL_CMYK
Definition: palette.h:15
@ PAL_GAMMACORRECTION
Definition: palette.h:29
@ PAL_DIBSECTION
Definition: palette.h:24

Function Documentation

◆ CalculateShift()

FORCEINLINE ULONG CalculateShift ( ULONG  ulMask1,
ULONG  ulMask2 
)

Definition at line 130 of file palette.h.

131{
132 ULONG ulShift1, ulShift2;
133 BitScanReverse(&ulShift1, ulMask1);
134 BitScanReverse(&ulShift2, ulMask2);
135 ulShift2 -= ulShift1;
136 if ((INT)ulShift2 < 0) ulShift2 += 32;
137 return ulShift2;
138}
#define BitScanReverse
Definition: interlocked.h:6
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59

Referenced by EXLATEOBJ_vInitialize(), and PALETTE_ulGetNearestBitFieldsIndex().

◆ GreCreatePaletteInternal()

HPALETTE NTAPI GreCreatePaletteInternal ( IN LPLOGPALETTE  pLogPal,
IN UINT  cEntries 
)

Systemcall Interface

Definition at line 457 of file palette.c.

460{
461 HPALETTE hpal = NULL;
462 PPALETTE ppal;
463
464 pLogPal->palNumEntries = cEntries;
466 cEntries,
467 pLogPal->palPalEntry,
468 0, 0, 0);
469
470 if (ppal != NULL)
471 {
473
474 hpal = ppal->BaseObject.hHmgr;
476 }
477
478 return hpal;
479}
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
#define NULL
Definition: types.h:112
BASEOBJECT BaseObject
Definition: palette.h:36
ULONG NumColors
Definition: palette.h:41
PALETTEENTRY * IndexedColors
Definition: palette.h:42
VOID FASTCALL PALETTE_ValidateFlags(PALETTEENTRY *lpPalE, INT size)
Definition: palette.c:125
PPALETTE NTAPI PALETTE_AllocPalWithHandle(_In_ ULONG iMode, _In_ ULONG cColors, _In_opt_ const PALETTEENTRY *pEntries, _In_ FLONG flRed, _In_ FLONG flGreen, _In_ FLONG flBlue)
Definition: palette.c:212
#define PALETTE_UnlockPalette(pPalette)
Definition: palette.h:56
#define PAL_INDEXED
Definition: winddi.h:1561
_In_ UINT _In_ UINT cEntries
Definition: wingdi.h:4067

◆ InitPaletteImpl()

NTSTATUS NTAPI InitPaletteImpl ( VOID  )

Definition at line 66 of file palette.c.

67{
68 // Create default palette (20 system colors)
70 20,
72 0, 0, 0);
75
76 /* palette_size = visual->map_entries; */
77
79 gpalRGB.RedMask = RGB(0xFF, 0x00, 0x00);
80 gpalRGB.GreenMask = RGB(0x00, 0xFF, 0x00);
81 gpalRGB.BlueMask = RGB(0x00, 0x00, 0xFF);
84
86 gpalBGR.RedMask = RGB(0x00, 0x00, 0xFF);
87 gpalBGR.GreenMask = RGB(0x00, 0xFF, 0x00);
88 gpalBGR.BlueMask = RGB(0xFF, 0x00, 0x00);
91
93 gpalRGB555.RedMask = 0x7C00;
94 gpalRGB555.GreenMask = 0x3E0;
95 gpalRGB555.BlueMask = 0x1F;
98
100 gpalRGB565.RedMask = 0xF800;
101 gpalRGB565.GreenMask = 0x7E0;
102 gpalRGB565.BlueMask = 0x1F;
105
109
110 /* Initialize default surface palettes */
121
122 return STATUS_SUCCESS;
123}
#define RGB(r, g, b)
Definition: precomp.h:67
#define STATUS_SUCCESS
Definition: shellext.h:65
USHORT BaseFlags
Definition: gdiobj.h:46
ULONG ulShareCount
Definition: gdiobj.h:42
ULONG BlueMask
Definition: palette.h:45
ULONG GreenMask
Definition: palette.h:44
FLONG flFlags
Definition: palette.h:40
ULONG RedMask
Definition: palette.h:43
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:741
const PALETTEENTRY g_sysPalTemplate[NB_RESERVED_COLORS]
Definition: palette.c:23
PPALETTE appalSurfaceDefault[11]
Definition: palette.c:21
PALETTE * gppalMono
Definition: palette.c:20
PPALETTE NTAPI PALETTE_AllocPalette(_In_ ULONG iMode, _In_ ULONG cColors, _In_opt_ const PALETTEENTRY *pEntries, _In_ FLONG flRed, _In_ FLONG flGreen, _In_ FLONG flBlue)
Definition: palette.c:135
PALETTE gpalRGB555
Definition: palette.c:20
PALETTE gpalRGB
Definition: palette.c:20
PALETTE * gppalDefault
Definition: palette.c:20
PALETTE gpalBGR
Definition: palette.c:20
PALETTE gpalRGB565
Definition: palette.c:20
FORCEINLINE VOID PALETTE_vSetRGBColorForIndex(PPALETTE ppal, ULONG ulIndex, COLORREF crColor)
Definition: palette.h:152
#define BMF_16BPP
Definition: winddi.h:358
#define BMF_8BPP
Definition: winddi.h:357
#define PAL_RGB
Definition: winddi.h:1563
#define BMF_1BPP
Definition: winddi.h:355
#define PAL_BITFIELDS
Definition: winddi.h:1562
#define BMF_PNG
Definition: winddi.h:364
#define BMF_24BPP
Definition: winddi.h:359
#define BMF_32BPP
Definition: winddi.h:360
#define PAL_BGR
Definition: winddi.h:1564
#define BMF_8RLE
Definition: winddi.h:362
#define BMF_4RLE
Definition: winddi.h:361
#define BMF_4BPP
Definition: winddi.h:356
#define BMF_JPEG
Definition: winddi.h:363

Referenced by DriverEntry().

◆ PALETTE_AllocPalette()

PPALETTE NTAPI PALETTE_AllocPalette ( _In_ ULONG  iMode,
_In_ ULONG  cColors,
_In_opt_ const PALETTEENTRY pEntries,
_In_ FLONG  flRed,
_In_ FLONG  flGreen,
_In_ FLONG  flBlue 
)

Definition at line 135 of file palette.c.

142{
143 PPALETTE ppal;
144 ULONG fl = 0, cjSize = sizeof(PALETTE);
145
146 /* Check if the palette has entries */
147 if (iMode & PAL_INDEXED)
148 {
149 /* Check color count */
150 if ((cColors == 0) || (cColors > 1024)) return NULL;
151
152 /* Mark 2 color indexed palettes as monochrome */
153 if (cColors == 2) iMode |= PAL_MONOCHROME;
154
155 /* Allocate enough space for the palete entries */
156 cjSize += cColors * sizeof(PALETTEENTRY);
157 }
158 else
159 {
160 /* There are no palette entries */
161 cColors = 0;
162
163 /* We can use the lookaside list */
165 }
166
167 /* Allocate the object (without a handle!) */
169 if (!ppal)
170 {
171 return NULL;
172 }
173
174 /* Set mode, color count and entry pointer */
175 ppal->flFlags = iMode;
176 ppal->NumColors = cColors;
177 ppal->IndexedColors = ppal->apalColors;
178
179 /* Check what kind of palette this is */
180 if (iMode & PAL_INDEXED)
181 {
182 /* Check if we got a color array */
183 if (pEntries)
184 {
185 /* Copy the entries */
186 RtlCopyMemory(ppal->IndexedColors, pEntries, cColors * sizeof(pEntries[0]));
187 }
188 }
189 else if (iMode & PAL_BITFIELDS)
190 {
191 /* Copy the color masks */
192 ppal->RedMask = flRed;
193 ppal->GreenMask = flGreen;
194 ppal->BlueMask = flBlue;
195
196 /* Check what masks we have and set optimization flags */
197 if ((flRed == 0x7c00) && (flGreen == 0x3E0) && (flBlue == 0x1F))
198 ppal->flFlags |= PAL_RGB16_555;
199 else if ((flRed == 0xF800) && (flGreen == 0x7E0) && (flBlue == 0x1F))
200 ppal->flFlags |= PAL_RGB16_565;
201 else if ((flRed == 0xFF0000) && (flGreen == 0xFF00) && (flBlue == 0xFF))
202 ppal->flFlags |= PAL_BGR;
203 else if ((flRed == 0xFF) && (flGreen == 0xFF00) && (flBlue == 0xFF0000))
204 ppal->flFlags |= PAL_RGB;
205 }
206
207 return ppal;
208}
@ BASEFLAG_LOOKASIDE
Definition: gdiobj.h:58
@ GDIObjType_PAL_TYPE
Definition: ntgdityp.h:128
PALETTEENTRY apalColors[0]
Definition: palette.h:50
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
POBJ NTAPI GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl)
Definition: gdiobj.c:569
struct _PALETTE * PPALETTE
struct _PALETTE PALETTE
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG iMode
Definition: winddi.h:3520
_In_ ULONG cjSize
Definition: winddi.h:3634
struct tagPALETTEENTRY PALETTEENTRY

Referenced by CreateDIBPalette(), EngCreatePalette(), FixupDIBBrushPalette(), InitPaletteImpl(), NtGdiDdDDICreateDCFromMemory(), and PALETTE_AllocPalWithHandle().

◆ PALETTE_AllocPalWithHandle()

PPALETTE NTAPI PALETTE_AllocPalWithHandle ( _In_ ULONG  iMode,
_In_ ULONG  cColors,
_In_opt_ const PALETTEENTRY pEntries,
_In_ FLONG  flRed,
_In_ FLONG  flGreen,
_In_ FLONG  flBlue 
)

Definition at line 212 of file palette.c.

219{
220 PPALETTE ppal;
221
222 /* Allocate the palette without a handle */
223 ppal = PALETTE_AllocPalette(iMode, cColors, pEntries, flRed, flGreen, flBlue);
224 if (!ppal) return NULL;
225
226 /* Insert the palette into the handle table */
228 {
229 DPRINT1("Could not insert palette into handle table.\n");
231 return NULL;
232 }
233
234 return ppal;
235}
#define DPRINT1
Definition: precomp.h:8
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
VOID NTAPI GDIOBJ_vFreeObject(POBJ pobj)
Definition: gdiobj.c:603
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
Definition: gdiobj.c:919

Referenced by DIB_MapPaletteColors(), GreCreatePaletteInternal(), InitPaletteImpl(), NtGdiCreateHalftonePalette(), and NtGdiCreatePaletteInternal().

◆ PALETTE_GetObject()

INT FASTCALL PALETTE_GetObject ( PPALETTE  pGdiObject,
INT  cbCount,
LPLOGBRUSH  lpBuffer 
)

Definition at line 250 of file palette.c.

251{
252 if (!lpBuffer)
253 {
254 return sizeof(WORD);
255 }
256
257 if ((UINT)cbCount < sizeof(WORD)) return 0;
258 *((WORD*)lpBuffer) = (WORD)ppal->NumColors;
259 return sizeof(WORD);
260}
unsigned short WORD
Definition: ntddk_ex.h:93
static int cbCount
Definition: fiber.c:54
unsigned int UINT
Definition: ndis.h:50
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68

Referenced by GreGetObject().

◆ PALETTE_ulGetNearestBitFieldsIndex()

ULONG NTAPI PALETTE_ulGetNearestBitFieldsIndex ( PPALETTE  ppal,
ULONG  ulColor 
)

◆ PALETTE_ulGetNearestIndex()

ULONG NTAPI PALETTE_ulGetNearestIndex ( PPALETTE  ppal,
ULONG  iColor 
)

◆ PALETTE_ulGetNearestPaletteIndex()

ULONG NTAPI PALETTE_ulGetNearestPaletteIndex ( PPALETTE  ppal,
ULONG  iColor 
)

◆ PALETTE_ulGetRGBColorFromIndex()

FORCEINLINE ULONG PALETTE_ulGetRGBColorFromIndex ( PPALETTE  ppal,
ULONG  ulIndex 
)

Definition at line 142 of file palette.h.

143{
144 if (ulIndex >= ppal->NumColors) return 0;
145 return RGB(ppal->IndexedColors[ulIndex].peRed,
146 ppal->IndexedColors[ulIndex].peGreen,
147 ppal->IndexedColors[ulIndex].peBlue);
148}

Referenced by CreateDIBPalette(), EBRUSHOBJ_vSetSolidRGBColor(), EXLATEOBJ_vInitialize(), FixupDIBBrushPalette(), and TranslateCOLORREF().

◆ PALETTE_ValidateFlags()

VOID FASTCALL PALETTE_ValidateFlags ( PALETTEENTRY lpPalE,
INT  size 
)

Definition at line 125 of file palette.c.

126{
127 int i = 0;
128 for (; i<size ; i++)
129 lpPalE[i].peFlags = PC_SYS_USED | (lpPalE[i].peFlags & 0x07);
130}
#define PC_SYS_USED
Definition: color.h:3
GLsizeiptr size
Definition: glext.h:5919
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by GreCreatePaletteInternal(), IntAnimatePalette(), and NtGdiCreatePaletteInternal().

◆ PALETTE_vCleanup()

VOID NTAPI PALETTE_vCleanup ( PVOID  ObjectBody)

Definition at line 239 of file palette.c.

240{
241 PPALETTE pPal = (PPALETTE)ObjectBody;
242 if (pPal->IndexedColors && pPal->IndexedColors != pPal->apalColors)
243 {
245 }
246}
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define TAG_PALETTE
Definition: tags.h:26

◆ PALETTE_vGetBitMasks()

VOID NTAPI PALETTE_vGetBitMasks ( PPALETTE  ppal,
PULONG  pulColors 
)

Definition at line 331 of file palette.c.

332{
333 ASSERT(pulColors);
334
335 if (ppal->flFlags & PAL_INDEXED || ppal->flFlags & PAL_RGB)
336 {
337 pulColors[0] = RGB(0xFF, 0x00, 0x00);
338 pulColors[1] = RGB(0x00, 0xFF, 0x00);
339 pulColors[2] = RGB(0x00, 0x00, 0xFF);
340 }
341 else if (ppal->flFlags & PAL_BGR)
342 {
343 pulColors[0] = RGB(0x00, 0x00, 0xFF);
344 pulColors[1] = RGB(0x00, 0xFF, 0x00);
345 pulColors[2] = RGB(0xFF, 0x00, 0x00);
346 }
347 else if (ppal->flFlags & PAL_BITFIELDS)
348 {
349 pulColors[0] = ppal->RedMask;
350 pulColors[1] = ppal->GreenMask;
351 pulColors[2] = ppal->BlueMask;
352 }
353}
#define ASSERT(a)
Definition: mode.c:44

Referenced by EXLATEOBJ_vInitialize().

◆ PALETTE_vSetRGBColorForIndex()

FORCEINLINE VOID PALETTE_vSetRGBColorForIndex ( PPALETTE  ppal,
ULONG  ulIndex,
COLORREF  crColor 
)

Definition at line 152 of file palette.h.

153{
154 if (ulIndex >= ppal->NumColors) return;
155 ppal->IndexedColors[ulIndex].peRed = GetRValue(crColor);
156 ppal->IndexedColors[ulIndex].peGreen = GetGValue(crColor);
157 ppal->IndexedColors[ulIndex].peBlue = GetBValue(crColor);
158}
#define GetBValue(quad)
Definition: precomp.h:71
#define GetGValue(quad)
Definition: precomp.h:70
#define GetRValue(quad)
Definition: precomp.h:69

Referenced by CreateDIBPalette(), FixupDIBBrushPalette(), and InitPaletteImpl().

Variable Documentation

◆ appalSurfaceDefault

PPALETTE appalSurfaceDefault[]
extern

Definition at line 21 of file palette.c.

Referenced by InitPaletteImpl(), and SURFACE_AllocSurface().

◆ gpalBGR

PALETTE gpalBGR

Definition at line 53 of file palette.h.

◆ gpalRGB

◆ gpalRGB555

PALETTE gpalRGB555

Definition at line 53 of file palette.h.

◆ gpalRGB565

PALETTE gpalRGB565

Definition at line 53 of file palette.h.

◆ gppalDefault

PALETTE * gppalDefault

Definition at line 53 of file palette.h.

◆ gppalMono

PALETTE * gppalMono

Definition at line 53 of file palette.h.