Lines Matching refs:palette
56 format->palette = NULL;
126 format->palette = (SDL_Palette *)SDL_malloc(sizeof(SDL_Palette));
127 if ( format->palette == NULL ) {
132 (format->palette)->ncolors = ncolors;
133 (format->palette)->colors = (SDL_Color *)SDL_malloc(
134 (format->palette)->ncolors*sizeof(SDL_Color));
135 if ( (format->palette)->colors == NULL ) {
141 /* create palette according to masks */
190 format->palette->colors[i].r=r;
194 format->palette->colors[i].g=g;
198 format->palette->colors[i].b=b;
203 format->palette->colors[i].unused=a;
205 format->palette->colors[i].unused=0;
209 /* Create a black and white bitmap palette */
210 format->palette->colors[0].r = 0xFF;
211 format->palette->colors[0].g = 0xFF;
212 format->palette->colors[0].b = 0xFF;
213 format->palette->colors[1].r = 0x00;
214 format->palette->colors[1].g = 0x00;
215 format->palette->colors[1].b = 0x00;
217 /* Create an empty palette */
218 SDL_memset((format->palette)->colors, 0,
219 (format->palette)->ncolors*sizeof(SDL_Color));
254 if ( format->palette ) {
255 if ( format->palette->colors ) {
256 SDL_free(format->palette->colors);
258 SDL_free(format->palette);
264 * Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors
311 * Match an RGB value to a particular palette index
344 if ( format->palette == NULL ) {
350 return SDL_FindColor(format->palette, r, g, b);
359 if ( format->palette == NULL ) {
365 return SDL_FindColor(format->palette, r, g, b);
372 if ( fmt->palette == NULL ) {
396 *r = fmt->palette->colors[pixel].r;
397 *g = fmt->palette->colors[pixel].g;
398 *b = fmt->palette->colors[pixel].b;
406 if ( fmt->palette == NULL ) {
416 *r = fmt->palette->colors[pixel].r;
417 *g = fmt->palette->colors[pixel].g;
418 *b = fmt->palette->colors[pixel].b;
435 /* Map from Palette to Palette */
443 /* If an identical palette, no need to map */
463 /* Map from Palette to BitField */
470 SDL_Palette *pal = src->palette;
488 /* Map from BitField to Dithered-Palette to Palette */
491 /* Generate a 256 color dither palette */
494 SDL_Palette *pal = dst->palette;
563 /* Palette --> Palette */
564 /* If both SDL_HWSURFACE, assume have same palette */
569 map->table = Map1to1(srcfmt->palette,
570 dstfmt->palette, &map->identity);
582 /* Palette --> BitField */
593 /* BitField --> Palette */