Moved win32k
[reactos.git] / reactos / subsystems / win32 / win32k / include / palette.h
1 #ifndef _WIN32K_PALETTE_H
2 #define _WIN32K_PALETTE_H
3
4 #define NO_MAPPING
5
6 #define PALETTE_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual) */
7 #define PALETTE_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
8
9 #define PALETTE_PRIVATE 0x1000 /* private colormap, identity mapping */
10 #define PALETTE_WHITESET 0x2000
11
12 typedef struct {
13 int shift;
14 int scale;
15 int max;
16 } ColorShifts;
17
18 typedef struct _PALGDI {
19 PALOBJ PalObj;
20 XLATEOBJ *logicalToSystem;
21 HPALETTE Self;
22 ULONG Mode; // PAL_INDEXED, PAL_BITFIELDS, PAL_RGB, PAL_BGR
23 ULONG NumColors;
24 PALETTEENTRY *IndexedColors;
25 ULONG RedMask;
26 ULONG GreenMask;
27 ULONG BlueMask;
28 } PALGDI, *PPALGDI;
29
30 HPALETTE FASTCALL PALETTE_AllocPalette(ULONG Mode,
31 ULONG NumColors,
32 ULONG *Colors,
33 ULONG Red,
34 ULONG Green,
35 ULONG Blue);
36 HPALETTE FASTCALL PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
37 CONST RGBQUAD *Colors);
38 #define PALETTE_FreePalette(hPalette) GDIOBJ_FreeObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)
39 #define PALETTE_LockPalette(hPalette) ((PPALGDI)GDIOBJ_LockObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE))
40 #define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr(pPalette)
41 BOOL INTERNAL_CALL PALETTE_Cleanup(PVOID ObjectBody);
42
43 HPALETTE FASTCALL PALETTE_Init (VOID);
44 VOID FASTCALL PALETTE_ValidateFlags (PALETTEENTRY* lpPalE, INT size);
45 #ifndef NO_MAPPING
46 INT STDCALL PALETTE_SetMapping(PALOBJ* palPtr, UINT uStart, UINT uNum, BOOL mapOnly);
47 #endif
48 INT FASTCALL PALETTE_ToPhysical (PDC dc, COLORREF color);
49
50 PPALETTEENTRY FASTCALL ReturnSystemPalette (VOID);
51
52 #endif /* _WIN32K_PALETTE_H */