Re: [gtk-list] Re: Adding support for 4 bit color
- From: "Shawn T. Amundson" <amundson gimp org>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Adding support for 4 bit color
- Date: Thu, 9 Jul 1998 18:28:12 -0700 (PWT)
On 1 Jul 1998, Owen Taylor wrote:
>
> Walt Pohl <pohl@math.washington.edu> writes:
>
> > The code for visuals is in gdkvisuals.c. There's an array of possible
> > depths, called possible_depths, and you would need to add 4 to that (and
> > add one to npossible_depths). Also, you would probably need to edit
> > gdk_init_visuals -- it ranks the best visuals for a depth, and for 8 bit
> > color, it chooses GDK_PSEUDO_COLOR, otherwise it chooses GDK_TRUE_COLOR.
> > Presumably for 4 bit color, GDK_PSEUDO_COLOR is also the best choice. Let
> > me know if you have any problems.
>
> Actually, for 4 bit color, you probably want StaticColor, (or maybe
> TrueColor - 3x2x2 color cube?). If programs just allocated the first
> 16 colors they wanted into the 16-space color map (14 actually, white
> + black are always preallocated), you'd probably end up with 16 grays
> or 16 blues, or something - it is better to let the server pick
> a small fixed palette (which is what StaticColor is).
>
The list of possible types isn't related to the depths directly,
and as far as I can tell this is just gotton from the Xserver, which
makes the patch to gdk extremely trivial.
I am curious about the array available_depths[4] in gdkvisuals.c.
It seems to me this should be much larger. Am I missing something?
I would assume this should be the same as the possible_depths.
I've committed a patch in the 1.1 branch (3 entire lines) which makes
4 bit screens work with gdk. As with 1 bit, GtkPreview and GIMP both
have problems of there own, but most other widgets work fine.
--
Shawn T. Amundson
amundson@gimp.org http://www.gimp.org/~amundson
"The assumption that the universe looks the same in every
direction is clearly not true in reality." - Stephen Hawking
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]