Task #8807 (closed)
Opened 12 years ago
Closed 12 years ago
Bug: Incorrect or inconsistent specification of colour
Reported by: | rleigh | Owned by: | ajpatterson |
---|---|---|---|
Priority: | critical | Milestone: | OMERO-4.4 |
Component: | Specification | Version: | n.a. |
Keywords: | n.a. | Cc: | ajpatterson, jburel, cxallan, mlinkert |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | 2012-06-05 (16) |
Description (last modified by ajpatterson)
In the current specification:
<xsd:documentation>A color used render this channel - encoded as RGBA The default value "-2147483648" is #FFFFFFFF so solid white (it is a signed 32 bit value)</xsd:documentation>
Two problems with this:
1) "-2147483648" is #FFFFFFFF
This is from what I can tell, false. 0xFFFFFFFF is -1 and 0x80000000 is -2147483648.
2) For the default, -2147483648 would be 0x80000000 i.e. mid intensity transparent red, i.e. completely invisible. 0xFFFFFFFF would be opaque white, i.e. completely visible.
(The above assumes A=0 is transparent, A=255 is opaque; is this the interpretation used in our spec?)
Regards,
Roger
Change History (9)
comment:1 Changed 12 years ago by rleigh
comment:2 Changed 12 years ago by jmoore
- Cc ajpatterson jburel cxallan mlinkert-x added
comment:3 Changed 12 years ago by ajpatterson
- Description modified (diff)
comment:4 Changed 12 years ago by ajpatterson
Roger and I looked through some old spreadsheets of rgba values I had used when we are tackling the colour bug the last time and worked out where the -2147483648 came from (2009-09 schema era) . It looks like the default value should have been updated to -1 when this old bug was fixed (between 2010-04 and 2010-06) and the docs/default changed to reflect this.
comment:5 Changed 12 years ago by jmoore
- Owner set to ajpatterson
- Sprint set to 2012-05-22 (15)
- Summary changed from Incorrect or inconsistent specification of colour to Bug: Incorrect or inconsistent specification of colour
comment:6 Changed 12 years ago by rleigh
After discussion with Andrew, it looks like this is a historical mistake from a much earlier version of the schema in 2010 or earlier. In this version, 0xFFFFFFFF did equal -2147483648. But this was fixed in 2010.
What wasn't changed is the default, so the comment is incorrect. 0xFFFFFFFF is -1. But the default is still set to -2147483648. This may have been preserved to avoid changing the default behaviour. However, given that the default behaviour is to set the colour to invisible transparent red, I have to question whether this is useful. Surely setting to -1 to give white would be the correct change to make here?
comment:7 Changed 12 years ago by jburel
- Sprint changed from 2012-05-22 (15) to 2012-06-05 (16)
Moved from sprint 2012-05-22 (15)
comment:8 Changed 12 years ago by ajpatterson
Default value changed to "-1" and docs in xsd files updated.
comment:9 Changed 12 years ago by ajpatterson
- Resolution set to fixed
- Status changed from new to closed
Test code:
class test
{
}
Output:
0xFFFFFFFF=-1
0x80000000=-2147483648