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

Function rgbaToARGB8888

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

Source from the content-addressed store, hash-verified

98}
99
100static void rgbaToARGB8888(const uint8_t* src, uint8_t* dst, int w, int h)
101{
102 auto* out = reinterpret_cast<uint32_t*>(dst);
103 for (int i = 0; i < w * h; ++i)
104 {
105 uint32_t r = src[i * 4 + 0];
106 uint32_t g = src[i * 4 + 1];
107 uint32_t b = src[i * 4 + 2];
108 uint32_t a = src[i * 4 + 3];
109 out[i] = (a << 24) | (r << 16) | (g << 8) | b;
110 }
111}
112
113// --- Format → RGBA8888 converters ---
114

Callers 1

ConvertPixelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected