Pixel translations

Ho-Kuo Chan hchan "at" Matrox.COM
Tue, 11 Apr 2000 17:47:31 +0000


Hi,
	I was looking at the code for the pixel format translations and there
is something I can't quite figure out (I'm hoping Wez or Jonathan can
help me with this). Let's say the server is at 24 bpp in BGR888 and the
client wants 8 bpp in BGR233. If we use three separate tables in the
server, then the server will translate 8 bit blue to 2 bit blue, 8 bit
green to 3 bit green and 8 bit red to 3 bit red. I would think that this
would work out to an even distribution, eg: for blue, 8 bit input values
from 0 to 63 would translate to 0 in 2 bits, 64 to 127 -> 1, 128 to 191
->2 and 192 to 255 -> 3. However, after analysing the code, I see that
in fact, the distribution is actually: 0 to 42 -> 0, 43 to 127 -> 1, 128
to 212 -> 2 and 213 to 255 -> 3. The results are similar to other
translations (eg: 8 bit primary colour input to 3 bit primary output, 8
bit to 5 bit, etc). I would think that an equally distributed
translation would result in a more true image. Can anyone explain?
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at" uk.research.att.com
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------