MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / buildColorMap

Function buildColorMap

modules/commodetto/commodettoPocoBlit.c:3156–3175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3154#if kPocoPixelFormat == kCommodettoBitmapCLUT16
3155
3156void buildColorMap(uint32_t *srcCLUT, uint8_t *inverseTable, uint8_t *remap)
3157{
3158 uint8_t i;
3159 for (i = 0; i < 16; i++, srcCLUT++) {
3160 uint32_t entry = c_read32(srcCLUT);
3161 uint16_t srcColor;
3162 uint16_t c;
3163
3164 c = entry & 0xFF;
3165 srcColor = (c >= 248) ? 0x0F : (c + 7) >> 4;
3166
3167 c = (entry >> 8) & 0xFF;
3168 srcColor |= (c >= 248) ? 0xF0 : (c + 7) & 0xF0;
3169
3170 c = (entry >> 16) & 0xFF;
3171 srcColor |= (c >= 248) ? 0xF00 : ((c + 7) & 0xF0) << 4;
3172
3173 remap[i] = c_read8(inverseTable + srcColor);
3174 }
3175}
3176#endif
3177
3178#if MODDEF_POCO_COLORCELL && (16 == kPocoPixelSize)

Callers 3

PocoBitmapDrawFunction · 0.85
PocoBitmapDrawMaskedFunction · 0.85
PocoBitmapPatternFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected