1
0
Fork 0
forked from len0rd/rockbox

mandelbrot: use correct colors on greyscale targets (FS#10935)

Tested on Clipv1 (sim/target) and Ipod3g (sim)
Each color would be calculated as 0

Note the iteration over the whole range of colors is quite weird, and I
can not really sense what max_iter represents (except it's a number of
different colors, right?)

It should be backported to branch after tomers check if color range is
correct (FS#10935 mentions much smaller range for color targets as well)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24377 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-01-30 07:16:16 +00:00
parent 436f4d3a20
commit 82fafb2d55

View file

@ -31,14 +31,16 @@ static unsigned char imgbuffer[LCD_HEIGHT];
static fb_data imgbuffer[LCD_HEIGHT];
#endif
#define NUM_COLORS ((unsigned)(1 << LCD_DEPTH))
#ifdef USEGSLIB
#define LCOLOR(iter) (iter << 5)
#else
/*
* Spread iter's colors over color range.
* 345 (=15*26-45) is max_iter maximal value
* 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
#define COLOR(iter) (fb_data)LCOLOR(iter)