MCPcopy Create free account
hub / github.com/android/ndk-samples / palette_from_fixed

Function palette_from_fixed

bitmap-plasma/app/src/main/cpp/plasma.cpp:154–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154static __inline__ uint16_t palette_from_fixed(Fixed x) {
155 if (x < 0) x = -x;
156 if (x >= FIXED_ONE) x = FIXED_ONE - 1;
157 int idx = FIXED_FRAC(x) >> (FIXED_BITS - PALETTE_BITS);
158 return palette[idx & (PALETTE_SIZE - 1)];
159}
160
161/* Angles expressed as fixed point radians */
162

Callers 1

fill_plasmaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected