19ULONG bpp[] = {1, 4, 8, 15, 16, 24, 24, 32, 32};
62 ulColorDepth = bmi.bmiHeader.biBitCount;
76 if (bmi.aulMasks[0] == 0x7c00)
84 bmi.aulMasks[0] == 0xff)
98 ULONG ulRed, ulGreen, ulBlue;
107 return crColor ? 0xffffff : 0;
112 ulRed = (ulRed & 0xF8) >> 3;
113 ulGreen = (ulGreen & 0xF8) >> 3;
114 ulBlue = (ulBlue & 0xF8) >> 3;
115 return ulRed << 10 | ulGreen << 5 | ulBlue;
118 ulRed = (ulRed & 0xF8) >> 3;
119 ulGreen = (ulGreen & 0xFC) >> 2;
120 ulBlue = (ulBlue & 0xF8) >> 3;
121 return ulRed << 11 | ulGreen << 5 | ulBlue;
129 return RGB(ulBlue, ulGreen, ulRed);
138 ULONG ulRed, ulGreen, ulBlue;
143 return ulColor ? 0xffffff : 0;
148 ulRed = (ulColor & 0x7C00) >> 7;
150 ulGreen = (ulColor & 0x3E0) >> 2;
151 ulGreen |= ulGreen >> 5;
152 ulBlue = (ulColor & 0x1F) << 3;
153 ulBlue |= ulBlue >> 5;
154 return RGB(ulRed, ulGreen, ulBlue);
157 ulRed = (ulColor & 0xF800) >> 8;
159 ulGreen = (ulColor & 0x7E0) >> 3;
160 ulGreen |= ulGreen >> 6;
161 ulBlue = (ulColor & 0x1F) << 3;
162 ulBlue |= ulBlue >> 5;
163 return RGB(ulRed, ulGreen, ulBlue);
174 return RGB(ulBlue, ulGreen, ulRed);
201 return (*(
DWORD*)((
PCHAR)pvBits +
x * 3)) & 0xffffff;
278 ok(
BitBlt(
hdcDst, 0, 0, 2, 2,
hdcSrc, 0, 0,
SRCCOPY),
"(%ld): BitBlt failed", iBmpFormat);
316 ok(
BitBlt(
hdcDst, 0, 0, 2, 2,
hdcSrc, 0, 0,
SRCCOPY),
"(%ld): BitBlt failed", iBmpFormat);
346 ok(
BitBlt(
hdcDst, 0, 0, 2, 2,
hdcSrc, 0, 0,
SRCCOPY),
"(%ld): BitBlt failed", iBmpFormat);
411 bmi.bmiHeader.biWidth = 8;
412 bmi.bmiHeader.biHeight = 8;
413 bmi.bmiHeader.biPlanes = 1;
414 bmi.bmiHeader.biBitCount = 1;
415 bmi.bmiHeader.biCompression =
BI_RGB;
416 bmi.bmiHeader.biSizeImage = 0;
417 bmi.bmiHeader.biXPelsPerMeter = 1;
418 bmi.bmiHeader.biYPelsPerMeter = 1;
419 bmi.bmiHeader.biClrUsed = 2;
420 bmi.bmiHeader.biClrImportant = 2;
421 bmi.bmiColors[0] = 0xeeeeee;
422 bmi.bmiColors[1] = 0x111111;
423 memset(bmi.aj, 0xaaaa,
sizeof(bmi.aj));
425 ok(hbr != 0,
"CreateDIBPatternBrushPt failed\n");
475 bmi.bmiHeader.biWidth = 2;
476 bmi.bmiHeader.biHeight = -2;
477 bmi.bmiHeader.biPlanes = 1;
478 bmi.bmiHeader.biBitCount = 16;
479 bmi.bmiHeader.biCompression =
BI_RGB;
480 bmi.bmiHeader.biSizeImage = 0;
481 bmi.bmiHeader.biXPelsPerMeter = 1;
482 bmi.bmiHeader.biYPelsPerMeter = 1;
483 bmi.bmiHeader.biClrUsed = 0;
484 bmi.bmiHeader.biClrImportant = 0;
486 ok(
hbmp != 0,
"CreateDIBSection failed\n");
487 memset(pvBits, 0x55555555, 8 * 8 * 2);
498 c = *(
volatile WORD*)pvBits;
513 ok(
hbmp != 0,
"CreateDIBSection failed\n");
526 ok(
hbmp != 0,
"CreateDIBSection failed\n");
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
GLint GLint GLint GLint GLint x
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
BITMAPINFOHEADER bmiHeader
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
_In_ SIZEL _In_ ULONG iFormat
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
COLORREF WINAPI GetTextColor(_In_ HDC)
HBRUSH WINAPI CreateHatchBrush(_In_ int, _In_ COLORREF)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
COLORREF WINAPI GetBkColor(_In_ HDC)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
struct tagBITMAPINFO * PBITMAPINFO
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
HDC WINAPI GetDC(_In_opt_ HWND)
static HBITMAP hbmp32bpp_a
static HBITMAP hbmp8bpp_b
static HBITMAP hbmp32bpp_b
static HBITMAP hbmp16bpp_a
ULONG GetRealColorDepth()
static HBITMAP hbmp1bpp_a
static ULONG GetClosestColor(ULONG iFormat, COLORREF crColor, COLORREF crBackColor)
static HBITMAP hbmp16bpp_b
static ULONG iXlateFromRGB(ULONG iFormat, COLORREF crColor)
static HBITMAP hbmpCompat
static HBITMAP hbmp24bpp_b
static HBITMAP hbmp1bpp_b
ULONG GetDIBPixel(ULONG iFormat, PVOID pvBits, ULONG x)
void Test_SrcMono1(ULONG iBmpFormat, HBITMAP hbmpDst, PVOID pvBits)
static HBITMAP hbmp24bpp_a
static COLORREF iXlateToRGB(ULONG iFormat, ULONG ulColor)
static HBITMAP hbmp8bpp_a