/***************************************************************************** * SetPalette: set the 8bpp palette *****************************************************************************/ static void SetPalette( vout_thread_t *p_vout, uint16_t *red, uint16_t *green, uint16_t *blue ) { int i; /* Fill colors with color information */ for( i = 0; i < 256; i++ ) { aa_setpalette( p_vout->p_sys->palette, 256 -i, red[ i ], green[ i ], blue[ i ] ); } }
static void initialize (void) { int i; context = aa_autoinit (&aa_defparams); if (context == NULL) { printf ("Failed to initialize aalib\n"); exit (1); } aa_autoinitkbd(context, 0); params = aa_getrenderparams (); bitmap = aa_image (context); for (i = 0; i < 256; i++) aa_setpalette (palette, i, pal[i * 3] * 4, pal[i * 3 + 1] * 4, pal[i * 3 + 2] * 4); aa_hidecursor (context); }
static int aarenderer_open(int w, int h, int fs) { int argc = 1; char *argv[] = { "foo", NULL }; int i; if (!aa_parseoptions(NULL, NULL, &argc, argv) || argc != 1) { printf("%s\n", aa_help); return 0; } context = aa_autoinit(&aa_defparams); if (context == NULL) { printf("Can not intialize aalib\n"); return 0; } bitmap = aa_image (context); params = aa_getrenderparams (); for (i = 0; i < 256; i++) aa_setpalette(palette, i, pal[i * 3] * 4, pal[i * 3 + 1] * 4, pal[i * 3 + 2] * 4); aa_hidecursor(context); return 1; }
/** * Prepare a picture for display */ static void Prepare(vout_display_t *vd, picture_t *picture) { vout_display_sys_t *sys = vd->sys; assert(vd->fmt.i_width == aa_imgwidth(sys->aa_context) && vd->fmt.i_height == aa_imgheight(sys->aa_context)); #if 0 if (picture->format.p_palette) { for (int i = 0; i < 256; i++) { aa_setpalette(vd->sys->palette, 256 - i, red[ i ], green[ i ], blue[ i ]); } } #else VLC_UNUSED(picture); #endif aa_fastrender(sys->aa_context, 0, 0, vd->fmt.i_width, vd->fmt.i_height); }