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

Function argb8888ToRGBA

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

Source from the content-addressed store, hash-verified

176}
177
178static void argb8888ToRGBA(const uint8_t* src, uint8_t* dst, int w, int h)
179{
180 const auto* in = reinterpret_cast<const uint32_t*>(src);
181 for (int i = 0; i < w * h; ++i)
182 {
183 uint32_t p = in[i];
184 dst[i * 4 + 0] = (p >> 16) & 0xFF; // R
185 dst[i * 4 + 1] = (p >> 8) & 0xFF; // G
186 dst[i * 4 + 2] = p & 0xFF; // B
187 dst[i * 4 + 3] = (p >> 24) & 0xFF; // A
188 }
189}
190
191// --- DXT decompression (standalone, for ConvertPixels) ---
192

Callers 1

ConvertPixelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected