HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
HYPHY Package >> HyPhy bugs >> Linux color depth problem
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1190093788

Message started by Patola on Sep 17th, 2007 at 10:36pm

Title: Linux color depth problem
Post by Patola on Sep 17th, 2007 at 10:36pm
Hello, I would like to raise a question about the widget problem that occurs with Hyphy on color depths smaller than 24 bits. I myself use 16 bits of color depth and it would be too much a hassle to switch that to 24 bits because the display gets a lot slower and the memory consumption is much bigger. But hyphy insists on creating windows with 24 bits depth... Ok, I have traced the problem to GUI/HYPlatformGraphicPane.cpp - these two lines:

73         thePane = gdk_pixmap_new (NULL, w, h, 24/*d<24?d:24*/);
134         thePane = gdk_pixmap_new (NULL, w, h, 24/*d<24?d:24*/);

I don't understand some of the syntax here: the test "24/*d<24" is ok, but what about "24*/"? What does it mean?

Nevertheless, I noticed that the effect here is that the color depth is always 24. Because of this, the letters and graphics become invisible on color depths smaller than 24... The solution I've come was just to change the two lines to:
thePane = gdk_pixmap_new (NULL, w, h, 16);

It works in 16 and 24 bits color depths. But I wonder, why reserve a space of 16 million colors for just a few colored fonts or different line colors? Is it really necessary? I think that even a colorspace of 256 colors (8 bits) would be more than enough for that. I did not trace the value of "d" to see if it was different depending on the display - I was satisfied as long as my problem was resolved.

Title: Re: Linux color depth problem
Post by Sergei on Sep 18th, 2007 at 1:24am
Dear Patola,

As you discovered by looking at the source code, I never took the time to polish the GTK+ version of the code; some of that has to do with the fact that 99+% of HyPhy users are Mac and Windows based.

I recall that 16 bits did not properly work on X11 under Mac OS X, so that is why I changed it to 24.

At any rate, the proper way to solve this would be to query the depth of the primary display and set the pixmap depth to Min(screen_depth,24). I'll add that in the next build. Thanks for pointing out the problem!

Also, system font rendering these days is rather sophisticated (aliasing, blending, trapping), so one could probably see a difference (especially on colored backgrounds) in font 'smoothness', but you are quite right in saying that 24 bits is probably an overkill.

Cheers,
Sergei

Title: Re: Linux color depth problem
Post by Patola on Sep 18th, 2007 at 3:13am
Hi Sergei! Thanks for the response.

Anyway, dumb me... Looking again at the lines, I finally noticed that /* */ was a comment, but as it was not highlighted as such in vim, I though it was some kind of division with pointers and such.

Anyway, since I'll be using hyphy heavily from now on, count me as a tester... I hope I can help you improve Linux usage.  ;D

HyPhy message board » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.