Re: graphics (color query code for truecolor displays)

From: Jun P. Furuse (
Date: Wed Apr 07 1999 - 14:30:24 MET DST

Message-Id: <>
Subject: Re: graphics (color query code for truecolor displays)
From: "Jun P. Furuse" <>
Date: Wed, 07 Apr 1999 14:30:24 +0200


> I was excited to hear that the 2.02 graphics library
> had better support for 24 bit displays, but I can't
> get it to work properly. Ideally, I'd like something like
> set_color (rgb x y z)
> to just work right, no matter how many times I call it.
> The support in 2.02 looks like it only works for images
> (?), and even that doesn't seem to work properly on my
> machine; ocaml seems to think I have an eight bit
> display. I've looked at the graphics code a bit, but
> I'm no X genius.

I am the one who added "fast colour look up code" in graph library.
Instead of the older version which communicates between X server
for each colour query (and it is very inefficient), I intended to
compute its "colour index" in the client side. But this colour index
computation method is highly architecture dependent of X servers
(bit order, colour model, bit depth, etc), and not well documented.
We checked this modification work correctly for XFree86 servers with
16 bits depth and some DEC Alpha servers, but the code does not
support the all possibilities of architectures, I am afraid.

To do quick repair, use the patch following. This just disables
the new modification. Each color query creates communication between X
server and it REALLY slows the full color graphics programs, but at
least, it works correctly.


Jun P. Furuse
    Institut National de Recherche en Informatique et en Automatique

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:22 MET