Home | History | Annotate | Download | only in utils

Lines Matching refs:palette

22 // Generates an LATC palette. LATC constructs
23 // a palette of eight colors from LUM0 and LUM1 using the algorithm:
44 static void generate_latc_palette(uint8_t palette[], uint8_t lum0, uint8_t lum1) {
45 palette[0] = lum0;
46 palette[1] = lum1;
49 palette[i+1] = ((7-i)*lum0 + i*lum1) / 7;
53 palette[i+1] = ((5-i)*lum0 + i*lum1) / 5;
55 palette[6] = 0;
56 palette[7] = 255;
141 uint8_t palette[kLATCPaletteSize];
142 generate_latc_palette(palette, maxVal, minVal);
147 // Find the best palette index
148 uint8_t bestError = abs_diff(pixels[i], palette[0]);
151 uint8_t error = abs_diff(pixels[i], palette[j]);
170 // account the extremal values. The generated palette will contain extremal values
187 uint8_t palette[kLATCPaletteSize];
188 generate_latc_palette(palette, minVal, maxVal);
193 // Find the best palette index
204 uint8_t bestError = abs_diff(pixels[i], palette[0]);
206 uint8_t error = abs_diff(pixels[i], palette[j]);
227 // values LUM0 and LUM1, and an index into the generated palette. Details of how
228 // the palette is generated can be found in the comments of generatePalette above.
230 // We choose which palette type to use based on whether or not 'pixels' contains
232 // palette that has the extremal values built in. Otherwise, we use the full bounding
282 // If all the pixels are nonmaximal then compute the palette using
323 // Since the palette is
411 uint8_t palette[kLATCPaletteSize];
412 generate_latc_palette(palette, lum0, lum1);
417 dst[i] = palette[block & 0x7];