[PATCH 2/2] fbsplash: support 8bit mode

Peter Korsgaard jacmet at sunsite.dk
Mon Oct 17 06:40:00 UTC 2011


>>>>> "Denys" == Denys Vlasenko <vda.linux at googlemail.com> writes:

 >> +
 >> +	/* RGB:332 */
 >> +	for (i = 0; i < 256; i++)
 >> +	{
 >> +		red[i]   = ((i & 0xe0) << 8)  + ((i & 0x20) ? 0x1fff : 0);
 >> +		green[i] = ((i & 0x1c) << 11) + ((i & 0x04) ? 0x1fff : 0);
 >> +		blue[i]  = ((i & 0x03) << 14) + ((i & 0x01) ? 0x3fff : 0);
 >> +	}

 Denys> This doesn't map values entirely correctly.
 Denys> How about this?

Intuitively I would say that using anything else than the least
significant bit of the 2/3 MSB to extimate the missing bits doesn't make
sense, but then I found:

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.17.5503&rep=rep1&type=pdf

Which does exactly like you propose - So I'll shut up ;)

Thanks!

-- 
Bye, Peter Korsgaard


More information about the busybox mailing list