I have opened a bug about this issue. See
http://trac.openmicroscopy.org.uk/ome/ticket/8807To follow up from yesterday:
The comment and default in the XML schema stating that "The default value "-2147483648" is #FFFFFFFF so solid white (it is a signed 32 bit value)" is incorrect. This is due to a historical bug in the schema, which is explained further in the above bug report.
The correct value for 0xFFFFFFFF is -1. This should hopefully be changed soon to correct the documentation mistake.
So in order to compose a correct colour value from r g b a values:
- Code: Select all
uint32 composed = (r << 24) | (g << 16) | (b << 8) | (a << 0);
int32 *signed = (int32 *) &composed;
Not sure how you do that in C# I'm afraid; the bottom line is just casting the uint32 to an int32 representation with no changes to the bit pattern. But it looks like this is what you were doing correctly already though, so it's just a matter of shifting and ORing the values together.
Just to clarify my earlier comment, the use of a signed integer is a known deficiency in the model, and this should be corrected in a future version of the schema. While I mentioned this might be a string representation, the actual form of the replacement of the signed integer format has yet to be decided. It might potentially be separate numbers for the RGBA values, for example.
Regards,
Roger