Beispiel #1
0
uint16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color)
{
	uint8 r, g, b;
	uint16 color16;

	GetBGR32(r, g, b, color);

	if (hdc->rgb555)
	{
		if (hdc->invert)
		{
			color16 = BGR15(r, g, b);
		}
		else
		{
			color16 = RGB15(r, g, b);
		}
	}
	else
	{
		if (hdc->invert)
		{
			color16 = BGR16(r, g, b);
		}
		else
		{
			color16 = RGB16(r, g, b);
		}
	}

	return color16;
}
Beispiel #2
0
void test_color_GetBGR32(void)
{
	int r, g, b;
	UINT32 bgr32 = 0x00CCBBAA;
	GetBGR32(r, g, b, bgr32);

	CU_ASSERT(r == 0xAA);
	CU_ASSERT(g == 0xBB);
	CU_ASSERT(b == 0xCC);
}
Beispiel #3
0
UINT32 gdi_get_color_32bpp(HGDI_DC hdc, GDI_COLOR color)
{
	UINT32 color32;
	BYTE a, r, g, b;

	a = 0xFF;
	GetBGR32(r, g, b, color);

	if (hdc->invert)
	{
		color32 = ABGR32(a, r, g, b);
	}
	else
	{
		color32 = ARGB32(a, r, g, b);
	}

	return color32;
}