[cairo] Spot colors (and CMYK)

Kai-Uwe Behrmann ku.b at gmx.de
Wed Jan 13 12:07:39 PST 2010

Am 13.01.10, 11:36 -0800 schrieb Bill Spitzak:
> I think instead the apis can take an enumeration describing the "type"
> of color followed by a pointer to the data. I would purposely not allow
> any ability to get colors *from* Cairo so that the backend is free to
> immediatly translate to device space (ie to 32 bit color) and not keep
> the original color around.

You seems to confuse coding with colour space definition. A colour space 
can be described in ICC terms through a colour matrix and gamma curves or 
values or through more complicated processing elements including matrixes, 
several stages of one dimensional LUTs and multi dimensional tables. The 
later is typical indexed my a MD5 hash sum and is explained in the ICC 
spec itself.

While the currently few bit encodings used in Cairo are easliy enumerated, 
ICC profiles will not play nicely this way.

> Something like this:
>   cairo_set_source_color(cairo_t*, cairo_color_type_enum, float data[]);

However, I like the idea to pass a array instead of single values. This 
reduces number of APIs to fewer functions for 
rgb/rgba/cmyk/cmyka/gray/graya ...

> I can't see any good way around having to cast the final pointer if the
> data is not an array of floats.

kind regards
Kai-Uwe Behrmann
developing for colour management 
www.behrmann.name + www.oyranos.org

More information about the cairo mailing list