Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Color mask issues with PalleteData


I believe this is how Windows expects masks when the BITMAPINFOHEADER field  biCompression is
BI_RGB.

Silenio



lipe! <lipeandrade@xxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

10/10/2006 09:11 AM

Please respond to
"Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>

To
swt-devlist <platform-swt-dev@xxxxxxxxxxx>
cc
Subject
[platform-swt-dev] Color mask issues with PalleteData





Hi all,

I have noticied "strange" behavior with SWT PalleteData and different color Depths.

With a 16 bit-color display, PalleteData uses a mask with 5 bit per color and the representation orientation is RGB, from most significant bit to less significant bit. Also, the not used bits are all at the left.

 
-------------------------------------------------
Image depth: 16
Direct pallete: true
-
    Black: 00000000000000000000000000000000
      Red: 00000000000000000
111110000000000
    Green: 0000000000000000000000
1111100000
     Blue: 000000000000000000000000000
11111
    White: 00000000000000000111111111111111
-------------------------------------------------




But with a 32 bit-color display, PalleteData uses a mask with 8 bit per color and representation orientation is BGR, from most significant bit to less significant bit. And here, the not user bits are all at the right!

-------------------------------------------------
Image depth: 32
Direct pallete: true
-
    Black: 00000000000000000000000000000000
      Red: 0000000000000000
1111111100000000
    Green: 00000000
111111110000000000000000
     Blue:
11111111000000000000000000000000
    White: 11111111111111111111111100000000
-------------------------------------------------




The question is: there is any good reason to color-bits orientation changing from a color-depth to another?!

 
The code snippet used to generate this report is attached (i using SWT 3.2 / JDK 1.5).



Thanks for any explanation,




--
[ ]s,
Felipe Santos Andrade
<
lipeandrade@xxxxxxxxx> _______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

Attachment: ColorTest.java
Description: Binary data


Back to the top