Home | History | Annotate | Download | only in video

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;
405 if ( fmt->palette == NULL ) {
415 *r = fmt->palette->colors[pixel].r;
416 *g = fmt->palette->colors[pixel].g;
417 *b = fmt->palette->colors[pixel].b;
434 /* Map from Palette to Palette */
442 /* If an identical palette, no need to map */
462 /* Map from Palette to BitField */
469 SDL_Palette *pal = src->palette;
487 /* Map from BitField to Dithered-Palette to Palette */
490 /* Generate a 256 color dither palette */
493 SDL_Palette *pal = dst->palette;
562 /* Palette --> Palette */
563 /* If both SDL_HWSURFACE, assume have same palette */
568 map->table = Map1to1(srcfmt->palette,
569 dstfmt->palette, &map->identity);
581 /* Palette --> BitField */
592 /* BitField --> Palette */