123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- #ifndef _GDIPLUSPIXELFORMATS_H
- #define _GDIPLUSPIXELFORMATS_H
- typedef DWORD ARGB;
- typedef DWORDLONG ARGB64;
- #define ALPHA_SHIFT 24
- #define RED_SHIFT 16
- #define GREEN_SHIFT 8
- #define BLUE_SHIFT 0
- #define ALPHA_MASK ((ARGB) 0xff << ALPHA_SHIFT)
- #ifndef DCR_USE_NEW_105760
- enum PixelFormat
- {
- PixelFormatIndexed = 0x00010000,
- PixelFormatGDI = 0x00020000,
- PixelFormatAlpha = 0x00040000,
- PixelFormatPAlpha = 0x00080000,
- PixelFormatExtended = 0x00100000,
- PixelFormatCanonical = 0x00200000,
- PixelFormatUndefined = 0,
- PixelFormatDontCare = 0,
- PixelFormat1bppIndexed = 1 | ( 1 << 8) | PixelFormatIndexed
- | PixelFormatGDI,
- PixelFormat4bppIndexed = 2 | ( 4 << 8) | PixelFormatIndexed
- | PixelFormatGDI,
- PixelFormat8bppIndexed = 3 | ( 8 << 8) | PixelFormatIndexed
- | PixelFormatGDI,
- PixelFormat16bppGrayScale = 4 | (16 << 8) | PixelFormatExtended,
- PixelFormat16bppRGB555 = 5 | (16 << 8) | PixelFormatGDI,
- PixelFormat16bppRGB565 = 6 | (16 << 8) | PixelFormatGDI,
- PixelFormat16bppARGB1555 = 7 | (16 << 8) | PixelFormatAlpha
- | PixelFormatGDI,
- PixelFormat24bppRGB = 8 | (24 << 8) | PixelFormatGDI,
- PixelFormat32bppRGB = 9 | (32 << 8) | PixelFormatGDI,
- PixelFormat32bppARGB = 10 | (32 << 8) | PixelFormatAlpha
- | PixelFormatGDI
- | PixelFormatCanonical,
- PixelFormat32bppPARGB = 11 | (32 << 8) | PixelFormatAlpha
- | PixelFormatPAlpha
- | PixelFormatGDI,
- PixelFormat48bppRGB = 12 | (48 << 8) | PixelFormatExtended,
- PixelFormat64bppARGB = 13 | (64 << 8) | PixelFormatAlpha
- | PixelFormatCanonical
- | PixelFormatExtended,
- PixelFormat64bppPARGB = 14 | (64 << 8) | PixelFormatAlpha
- | PixelFormatPAlpha
- | PixelFormatExtended,
- PixelFormat24bppBGR = 15 | (24 << 8) | PixelFormatGDI,
- PixelFormatMax = 16
- };
- #else
- typedef INT PixelFormat;
- #define PixelFormatIndexed 0x00010000
- #define PixelFormatGDI 0x00020000
- #define PixelFormatAlpha 0x00040000
- #define PixelFormatPAlpha 0x00080000
- #define PixelFormatExtended 0x00100000
- #define PixelFormatCanonical 0x00200000
- #define PixelFormatUndefined 0
- #define PixelFormatDontCare 0
- #define PixelFormat1bppIndexed (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI)
- #define PixelFormat4bppIndexed (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI)
- #define PixelFormat8bppIndexed (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI)
- #define PixelFormat16bppGrayScale (4 | (16 << 8) | PixelFormatExtended)
- #define PixelFormat16bppRGB555 (5 | (16 << 8) | PixelFormatGDI)
- #define PixelFormat16bppRGB565 (6 | (16 << 8) | PixelFormatGDI)
- #define PixelFormat16bppARGB1555 (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI)
- #define PixelFormat24bppRGB (8 | (24 << 8) | PixelFormatGDI)
- #define PixelFormat32bppRGB (9 | (32 << 8) | PixelFormatGDI)
- #define PixelFormat32bppARGB (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical)
- #define PixelFormat32bppPARGB (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI)
- #define PixelFormat48bppRGB (12 | (48 << 8) | PixelFormatExtended)
- #define PixelFormat64bppARGB (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended)
- #define PixelFormat64bppPARGB (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended)
- #define PixelFormatMax 15
- #endif
- inline UINT
- GetPixelFormatSize(
- PixelFormat pixfmt
- )
- {
- return (pixfmt >> 8) & 0xff;
- }
- inline BOOL
- IsIndexedPixelFormat(
- PixelFormat pixfmt
- )
- {
- return (pixfmt & PixelFormatIndexed) != 0;
- }
- inline BOOL
- IsAlphaPixelFormat(
- PixelFormat pixfmt
- )
- {
- return (pixfmt & PixelFormatAlpha) != 0;
- }
- inline BOOL
- IsExtendedPixelFormat(
- PixelFormat pixfmt
- )
- {
- return (pixfmt & PixelFormatExtended) != 0;
- }
- inline BOOL
- IsCanonicalPixelFormat(
- PixelFormat pixfmt
- )
- {
- return (pixfmt & PixelFormatCanonical) != 0;
- }
-
- enum PaletteFlags
- {
- PaletteFlagsHasAlpha = 0x0001,
- PaletteFlagsGrayScale = 0x0002,
- PaletteFlagsHalftone = 0x0004
- };
- struct ColorPalette
- {
- public:
- UINT Flags;
- UINT Count;
- ARGB Entries[1];
- };
- #endif
|