Lines Matching refs:palette
21 // Generates an LATC palette. LATC constructs
22 // a palette of eight colors from LUM0 and LUM1 using the algorithm:
43 static void generate_latc_palette(uint8_t palette[], uint8_t lum0, uint8_t lum1) {
44 palette[0] = lum0;
45 palette[1] = lum1;
48 palette[i+1] = ((7-i)*lum0 + i*lum1) / 7;
52 palette[i+1] = ((5-i)*lum0 + i*lum1) / 5;
54 palette[6] = 0;
55 palette[7] = 255;
140 uint8_t palette[kLATCPaletteSize];
141 generate_latc_palette(palette, maxVal, minVal);
146 // Find the best palette index
147 uint8_t bestError = abs_diff(pixels[i], palette[0]);
150 uint8_t error = abs_diff(pixels[i], palette[j]);
169 // account the extremal values. The generated palette will contain extremal values
186 uint8_t palette[kLATCPaletteSize];
187 generate_latc_palette(palette, minVal, maxVal);
192 // Find the best palette index
203 uint8_t bestError = abs_diff(pixels[i], palette[0]);
205 uint8_t error = abs_diff(pixels[i], palette[j]);
226 // values LUM0 and LUM1, and an index into the generated palette. Details of how
227 // the palette is generated can be found in the comments of generatePalette above.
229 // We choose which palette type to use based on whether or not 'pixels' contains
231 // palette that has the extremal values built in. Otherwise, we use the full bounding
281 // If all the pixels are nonmaximal then compute the palette using
322 // Since the palette is
410 uint8_t palette[kLATCPaletteSize];
411 generate_latc_palette(palette, lum0, lum1);
416 dst[i] = palette[block & 0x7];