MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / reverseLutFromBitmap

Function reverseLutFromBitmap

third-party/tinyexr/tinyexr.h:3060–3073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3058} // i.e. number of ones in bitmap minus 1
3059
3060static unsigned short reverseLutFromBitmap(
3061 const unsigned char bitmap[BITMAP_SIZE], unsigned short lut[USHORT_RANGE]) {
3062 int k = 0;
3063
3064 for (int i = 0; i < USHORT_RANGE; ++i) {
3065 if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7)))) lut[k++] = i;
3066 }
3067
3068 int n = k - 1;
3069
3070 while (k < USHORT_RANGE) lut[k++] = 0;
3071
3072 return n; // maximum k where lut[k] is non-zero,
3073} // i.e. number of ones in bitmap minus 1
3074
3075static void applyLut(const unsigned short lut[USHORT_RANGE],
3076 unsigned short data[/*nData*/], int nData) {

Callers 1

DecompressPizFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected