On Feb 25, 2007, at 12:22 PM, bulia byak wrote:


Is it just that, that colours are somewhere handled as 32-bit integers

and as such, the platform byte order (high endian / low endian) makes a

difference? Or is there some still deeper problem here?


As I understand it, the difference is that Inkscape code reads/writes

the 4-byte value by individual components, i.e. as char values to

char* pointers. Cairo always does it as uint32 values to uint32*

pointers. And these two methods give different results on a Mac.



There is another *very* helpful tool for managing conversions and such.

LittleCMS does buffer conversion in its transform code. A list can be seen in the tutorial:

http://www.littlecms.com/tutorial.txt

The include file "lcms.h" has more.

Anyway, an lcms transformation could be used to achieve the buffer conversions. I would also assume that such transformations that are commonplace would be fairly optimized already. Calling cmsCreateTransform() with the stock sRGB profile for both input and output and the proper two buffer types.

Of course... I would *love* to see this go in at the final step before image data hits the screen. That is the best place for a color management transform, and thus the call could serve two functions at once.