[AD] A silly question

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Firstly, I apologize for this silly question ;-)

Secondly... the question: is it normal that create_rgb_table() can build a
RGB_MAP that is not the right inverse of the specified palette, i.e:
   palette(rgb_map(RGB)) == RGB  (modulo the one bit shift between 6-bit RGB
and 5-bit RGB_MAP).

In pratice: I've got a RGB palette (coming from that of the Windows desktop)
with three indexes (10, 26, 255) pointing to white, i.e RGB(0x3f, 0x3f,
0x3f). When passed this palette, create_rgb_table() builds a RGB_MAP with
the following property: white, i.e RGB(0x1f, 0x1f, 0x1f) is mapped to index
246.

Now index 246 is RGB(0x3f, 0x3f, 0x3c), that is roughly but not white
(moreover, 0x3c >>1 is not equal to 0x1f). It's not very nice to have such a
color for the window background when all other windows have a true white.

P.S: I'm asking this question respectfully because the create_rgb_table()
function was written by Jan Hubicka (from the Czech Republic), that is
likely the same guy now working on GCC for SuSE (at suse.cz).

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/