MCPcopy Create free account
hub / github.com/RenderKit/embree / bitmapFromData

Function bitmapFromData

tutorials/common/image/tinyexr.h:3098–3118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3096const int BITMAP_SIZE = (USHORT_RANGE >> 3);
3097
3098static void bitmapFromData(const unsigned short data[/*nData*/], int nData,
3099 unsigned char bitmap[BITMAP_SIZE],
3100 unsigned short &minNonZero,
3101 unsigned short &maxNonZero) {
3102 for (int i = 0; i < BITMAP_SIZE; ++i) bitmap[i] = 0;
3103
3104 for (int i = 0; i < nData; ++i) bitmap[data[i] >> 3] |= (1 << (data[i] & 7));
3105
3106 bitmap[0] &= ~1; // zero is not explicitly stored in
3107 // the bitmap; we assume that the
3108 // data always contain zeroes
3109 minNonZero = BITMAP_SIZE - 1;
3110 maxNonZero = 0;
3111
3112 for (int i = 0; i < BITMAP_SIZE; ++i) {
3113 if (bitmap[i]) {
3114 if (minNonZero > i) minNonZero = i;
3115 if (maxNonZero < i) maxNonZero = i;
3116 }
3117 }
3118}
3119
3120static unsigned short forwardLutFromBitmap(
3121 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