One last refactor for pigment : KoColorProfile and LCMSism

Cyrille Berger cberger at
Mon Apr 30 18:55:00 CEST 2007


There is one last refactor I want to do for pigment (well two but they are 
related to one other).

* hide LCMSism :
 in KoColorSpace :
    virtual quint32 colorSpaceType() = 0;
    virtual icColorSpaceSignature colorSpaceSignature() = 0;
 in KoColorProfile :
    icColorSpaceSignature colorSpaceSignature() const;
    icProfileClassSignature deviceClass() const;
    cmsHPROFILE profile();

For KoColorSpace, they are usually only use internally to KoLcmsColorSpace and 
they have no meaning for non lcms colorspaces. And for KoColorSpace, see my 
plan bellow.

* KoColorProfile is used to hold some specific configuration for a lcms 
colorspace. I want to expand that to fill the need of color configuration for 
some colorspaces:
 - YCbCr : to/from RGB convertion coefficient
 - index images : storing the palette
 - HDR images : store the exposure instead of the current hack of passing it 
in all functions, and it will be usefull for color convertion, because in a 
correct HDR workflow, you set the exposure of the image and then draw on it 
the color appears correct for the current exposure. Currently in 1.6 when 
drawing on an HDR image we allways draw values between 0.0-1.0.

Expanding would be made by inheriting, and the lcms specific functions would 
be hidden.

An alternative is to add a KisColorSpaceConfiguration, but somehow I think it 
would only add burden to the API.

Cyrille Berger

More information about the kimageshop mailing list