From Inkscape Wiki
Revision as of 18:53, 23 February 2008 by Mental (talk | contribs) (Try to match cairo API a little better)
Jump to navigation Jump to search


In order for inkscape to produce CMYK PDFs and PSs with cairo, Cairo needs to support ICC. This is an intent to propose a Cairo API that would be suitable with inkscape needs.


A set of profiles will apply to the whole Cairo surface. Cairo needs to be able to compute a transform from this set. We can get inspiration from the lcms api [1], in particular the cmsCreateMultiprofileTransform (more generic than cmsCreateTransform that handles only a pair of color profiles).

So a proposal would be:

typedef enum cairo_color_intent {
} cairo_color_intent_t;
typedef struct cairo_color_profile cairo_color_profile_t;

void cairo_pattern_add_profile_pair (cairo_pattern_t *pat, 
                                     cairo_color_profile_t *in, 
                                     cairo_color_profile_t *out);

void cairo_pattern_remove_profiles (cairo_pattern_t *pat);

void cairo_pattern_set_color_intent(cairo_pattern_t *pat,
                                    cairo_color_intent_t intent);


All the functions handling colors, like cairo_set_source_rgba and cairo_set_source_rgb, must be complemented (or replaced) with

void cairo_set_source_profiled_color  (cairo_t *cr, void* color);

format of the color is the one defined by DWORD input_format.