MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / hqxInit

Function hqxInit

src/Engine/Scalers/init.cpp:25–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23uint32_t YUV1, YUV2;
24
25HQX_API void HQX_CALLCONV hqxInit(void)
26{
27 /* Initalize RGB to YUV lookup table */
28 uint32_t c, r, g, b, y, u, v;
29 for (c = 0; c < 16777215; c++) {
30 r = (c & 0xFF0000) >> 16;
31 g = (c & 0x00FF00) >> 8;
32 b = c & 0x0000FF;
33 y = (uint32_t)(0.299*r + 0.587*g + 0.114*b);
34 u = (uint32_t)(-0.169*r - 0.331*g + 0.5*b) + 128;
35 v = (uint32_t)(0.5*r - 0.419*g - 0.081*b) + 128;
36 RGBtoYUV[c] = (y << 16) + (u << 8) + v;
37 }
38}

Callers 1

_zoomSurfaceYMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected