MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / rgbaToARGB4444

Function rgbaToARGB4444

engine/Poseidon/Graphics/Textures/Image.cpp:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47// --- RGBA8888 → format converters ---
48
49static void rgbaToARGB4444(const uint8_t* src, uint8_t* dst, int w, int h)
50{
51 auto* out = reinterpret_cast<uint16_t*>(dst);
52 for (int i = 0; i < w * h; ++i)
53 {
54 uint8_t r = src[i * 4 + 0] >> 4;
55 uint8_t g = src[i * 4 + 1] >> 4;
56 uint8_t b = src[i * 4 + 2] >> 4;
57 uint8_t a = src[i * 4 + 3] >> 4;
58 out[i] = (a << 12) | (r << 8) | (g << 4) | b;
59 }
60}
61
62static void rgbaToARGB1555(const uint8_t* src, uint8_t* dst, int w, int h)
63{

Callers 1

ConvertPixelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected