Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Linux color depth problem (Read 2300 times)
Patola
YaBB Newbies
*
Offline


Cláudio Sampaio

Posts: 2
Campinas, SP, Brazil
Gender: male
Linux color depth problem
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.
Back to top
 

Student at LGE - Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
1675792 patolaaa  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Linux color depth problem
Reply #1 - 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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
Patola
YaBB Newbies
*
Offline


Cláudio Sampaio

Posts: 2
Campinas, SP, Brazil
Gender: male
Re: Linux color depth problem
Reply #2 - 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.  Grin
Back to top
 

Student at LGE - Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
1675792 patolaaa  
IP Logged