backport r24377 and r24378

mandelbrot color fixes for greyscale targets


git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_5@24379 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-01-30 08:39:02 +00:00
parent 984c17bee9
commit 5cda26f9fb

View file

@ -31,14 +31,16 @@ static unsigned char imgbuffer[LCD_HEIGHT];
static fb_data imgbuffer[LCD_HEIGHT]; static fb_data imgbuffer[LCD_HEIGHT];
#endif #endif
#define NUM_COLORS ((unsigned)(1 << LCD_DEPTH)) #ifdef USEGSLIB
#define LCOLOR(iter) ((iter ^ 7) << 5)
#else
/* /*
* Spread iter's colors over color range. * Spread iter's colors over color range.
* 345 (=15*26-45) is max_iter maximal value * 345 (=15*26-45) is max_iter maximal value
* This implementation ignores pixel format, thus it is not uniformly spread * This implementation ignores pixel format, thus it is not uniformly spread
*/ */
#define LCOLOR(iter) ((iter * NUM_COLORS) / 345) #define LCOLOR(iter) ((iter << LCD_DEPTH) / 345)
#endif
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
#define COLOR(iter) (fb_data)LCOLOR(iter) #define COLOR(iter) (fb_data)LCOLOR(iter)