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

Function ai88ToRGBA

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

Source from the content-addressed store, hash-verified

162}
163
164static void ai88ToRGBA(const uint8_t* src, uint8_t* dst, int w, int h)
165{
166 const auto* in = reinterpret_cast<const uint16_t*>(src);
167 for (int i = 0; i < w * h; ++i)
168 {
169 uint8_t intensity = in[i] & 0xFF;
170 uint8_t alpha = (in[i] >> 8) & 0xFF;
171 dst[i * 4 + 0] = intensity;
172 dst[i * 4 + 1] = intensity;
173 dst[i * 4 + 2] = intensity;
174 dst[i * 4 + 3] = alpha;
175 }
176}
177
178static void argb8888ToRGBA(const uint8_t* src, uint8_t* dst, int w, int h)
179{

Callers 1

ConvertPixelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected