This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Color Problem


Hey,

I just investigated the color problem and found the two reasons why 
colors are distorted.

16bpp:
------

    red and blue values are switched
xpyinfo gives the following lines on linux xfree:
  visual:
    visual id:    0x43
    class:    TrueColor
    depth:    16 planes
    available colormap entries:    64 per subfield
    red, green, blue masks:    0xf800, 0x7e0, 0x1f
    significant bits in color specification:    6 bits
for the windows box this is 
  visual:
    visual id:    0x26
    class:    DirectColor
    depth:    16 planes
    available colormap entries:    64 per subfield
    red, green, blue masks:    0x3f, 0x7c0, 0xf800
    significant bits in color specification:    8 bits

important are the masks
linux:   red, green, blue masks:    0xf800, 0x7e0, 0x1f
windows: red, green, blue masks:    0x3f, 0x7c0, 0xf800 

As you can see this is mixed.

second problem: 
    there is a wrap around in every color at 50% color.
this means if you let for example the green and blue value fixed at 0
and count the redvalue up from 0 to 1 (let 1 be the maximum), the maximum color
intensity is reached at 0.5 and after 0.5 it starts again with all black.

If you have a linux box, you can try this with the Gtk color chooser.

This is indicated by the field "significant bits in color specification"
in the xdpyinfo output. Linux says 6, windows says 8.


24bpp:
------

Here is just the red and blue value switched. The significant bit value
is correctly at 8 bits.

Xdpyinfo say on the windows box: 
  visual:
    visual id:    0x26
    class:    DirectColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits

This evening i will look again into the source to find a place, where its
broken, but maybe some of you, who are familar with the Xserver directory
can give me a hint where to look.

cu
    ago
-- 
Alexander.Gottwald@informatik.tu-chemnitz.de
http://www.gotti.org
+49 3725 3498080


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]