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

Function forwardLutFromBitmap

third-party/tinyexr/tinyexr.h:3046–3058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3044}
3045
3046static unsigned short forwardLutFromBitmap(
3047 const unsigned char bitmap[BITMAP_SIZE], unsigned short lut[USHORT_RANGE]) {
3048 int k = 0;
3049
3050 for (int i = 0; i < USHORT_RANGE; ++i) {
3051 if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7))))
3052 lut[i] = k++;
3053 else
3054 lut[i] = 0;
3055 }
3056
3057 return k - 1; // maximum value stored in lut[],
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]) {

Callers 1

CompressPizFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected