nanogui: NXLIB Support For Displays With < 8 bpp???
Subject:
Re: [nanogui] NXLIB Support For Displays With < 8 bpp???
From:
"Greg Haerr" ####@####.####
Date:
23 Aug 2005 21:55:03 +0100
Message-Id: <05e601c5a824$d71bf5b0$0300a8c0@RDP>
: I've looked into making the change that you describe below. It looks like
: it shouldn't be too terribly daunting so maybe I'll go ahead and do it.
: However, what I don't know is what sort of mapping is used to go from RGB
: to 4 bpp a la the macros in AllocColor.c. Also, I thought that 4 and 8
: bpp were inherently palette entries, not RGB.
Yes, they are palette entries, so you'll have to get access once
to the system palette and convert passed RGB values to a palette
entry, using the method used in GdFindColor in the server, likely.
: From the macros, it looks
: like we go from full 24 bit color down to 8 bits by just squeezing down
: the resolution of the red, the green and, more so, the blue.
We also implement 8bpp truecolor 3/3/2, so this is sometimes the
case.
:
: Anyway, just for testing purposes, I tried replacing all the
:
: case 8:
:
: statements in all of the code with
:
: case 4:
: case 8:
:
: and changing all the other checks for bpp < 8 to accommodate 4. We have a
: 4 bpp monochrome display so I figured I'd start there. Anyway, it did
: build and the FLTK demos that I ran did come up however they were all
: white/black inverted!!
I don't know whether you're running INVERT4BPP in config file
for nano-X or not, you need to check this, some 4bpp drivers
take all bits inverted. In any case, a reversed palette will also
do the trick.
Regards,
Greg