|
Krita Source Code Documentation
|
The ManagedColor class is a class to handle colors that are color managed. A managed color is a color of which we know the model(RGB, LAB, CMYK, etc), the bitdepth and the specific properties of its colorspace, such as the whitepoint, chromaticities, trc, etc, as represented by the color profile. More...
#include <ManagedColor.h>
Inheritance diagram for ManagedColor:Public Member Functions | |
| QString | colorDepth () const |
| QColor | colorForCanvas (Canvas *canvas) const |
| colorForCanvas | |
| QString | colorModel () const |
| colorModel retrieve the current color model of this document: | |
| QString | colorProfile () const |
| QVector< float > | components () const |
| components | |
| QVector< float > | componentsOrdered () const |
| componentsOrdered() | |
| void | fromXML (const QString &xml) |
| ManagedColor (const QString &colorModel, const QString &colorDepth, const QString &colorProfile, QObject *parent=0) | |
| ManagedColor create a managed color with the given color space properties. | |
| ManagedColor (KoColor color, QObject *parent=0) | |
| ManagedColor (QObject *parent=0) | |
| ManagedColor Create a ManagedColor that is black and transparent. | |
| bool | operator== (const ManagedColor &other) const |
| bool | setColorProfile (const QString &colorProfile) |
| setColorProfile set the color profile of the image to the given profile. The profile has to be registered with krita and be compatible with the current color model and depth; the image data is not converted. | |
| bool | setColorSpace (const QString &colorModel, const QString &colorDepth, const QString &colorProfile) |
| setColorSpace convert the nodes and the image to the given colorspace. The conversion is done with Perceptual as intent, High Quality and No LCMS Optimizations as flags and no blackpoint compensation. | |
| void | setComponents (const QVector< float > &values) |
| setComponents Set the channel/components with normalized values. For integer colorspace, this obviously means the limit is between 0.0-1.0, but for floating point colorspaces, 2.4 or 103.5 are still meaningful (if bright) values. | |
| QString | toQString () |
| toQString create a user-visible string of the channel names and the channel values | |
| QString | toXML () const |
| ~ManagedColor () override | |
Static Public Member Functions | |
| static ManagedColor * | fromQColor (const QColor &qcolor, Canvas *canvas=0) |
| fromQColor is the (approximate) reverse of colorForCanvas() | |
Private Member Functions | |
| KoColor | color () const |
Private Attributes | |
| const QScopedPointer< Private > | d |
Friends | |
| class | ColorizeMask |
| class | PaletteView |
| class | Swatch |
| class | View |
| Assistance tools: guides, reference, etc. | |
The ManagedColor class is a class to handle colors that are color managed. A managed color is a color of which we know the model(RGB, LAB, CMYK, etc), the bitdepth and the specific properties of its colorspace, such as the whitepoint, chromaticities, trc, etc, as represented by the color profile.
Krita has two color management systems. LCMS and OCIO. LCMS is the one handling the ICC profile stuff, and the major one handling that ManagedColor deals with. OCIO support is only in the display of the colors. ManagedColor has some support for it in colorForCanvas()
All colors in Krita are color managed. QColors are understood as RGB-type colors in the sRGB space.
We recommend you make a color like this:
Definition at line 45 of file ManagedColor.h.
|
explicit |
ManagedColor Create a ManagedColor that is black and transparent.
Definition at line 26 of file ManagedColor.cpp.
| ManagedColor::ManagedColor | ( | const QString & | colorModel, |
| const QString & | colorDepth, | ||
| const QString & | colorProfile, | ||
| QObject * | parent = 0 ) |
ManagedColor create a managed color with the given color space properties.
Definition at line 33 of file ManagedColor.cpp.
References colorDepth(), colorModel(), colorProfile(), KoColorSpaceRegistry::colorSpace(), d, and KoColorSpaceRegistry::instance().
| ManagedColor::ManagedColor | ( | KoColor | color, |
| QObject * | parent = 0 ) |
Definition at line 44 of file ManagedColor.cpp.
|
override |
Definition at line 51 of file ManagedColor.cpp.
|
private |
| QString ManagedColor::colorDepth | ( | ) | const |
colorDepth A string describing the color depth of the image:
Definition at line 92 of file ManagedColor.cpp.
References d.
| QColor ManagedColor::colorForCanvas | ( | Canvas * | canvas | ) | const |
colorForCanvas
| canvas | the canvas whose color management you'd like to use. In Krita, different views have separate canvasses, and these can have different OCIO configurations active. |
Definition at line 60 of file ManagedColor.cpp.
References d, Canvas::displayColorConverter(), KisDisplayColorConverter::displayRendererInterface(), KoDumbColorDisplayRenderer::instance(), and KoColorDisplayRendererInterface::toQColor().
| QString ManagedColor::colorModel | ( | ) | const |
colorModel retrieve the current color model of this document:
Definition at line 97 of file ManagedColor.cpp.
References d.
| QString ManagedColor::colorProfile | ( | ) | const |
Definition at line 102 of file ManagedColor.cpp.
References d.
| QVector< float > ManagedColor::components | ( | ) | const |
components
Definition at line 123 of file ManagedColor.cpp.
References d.
| QVector< float > ManagedColor::componentsOrdered | ( | ) | const |
Definition at line 130 of file ManagedColor.cpp.
References components(), d, and KoChannelInfo::displayPositionToChannelIndex().
|
static |
fromQColor is the (approximate) reverse of colorForCanvas()
| qcolor | the QColor to convert to a KoColor. |
| canvas | the canvas whose color management you'd like to use. |
Definition at line 76 of file ManagedColor.cpp.
References KoColorDisplayRendererInterface::approximateFromRenderedQColor(), Canvas::displayColorConverter(), KisDisplayColorConverter::displayRendererInterface(), KoDumbColorDisplayRenderer::instance(), and ManagedColor().
| void ManagedColor::fromXML | ( | const QString & | xml | ) |
Unserialize a color following Create's swatch color specification available at https://web.archive.org/web/20110826002520/http://create.freedesktop.org/wiki/Swatches_-_color_file_format/Draft
| xml | an XML color |
Definition at line 157 of file ManagedColor.cpp.
References d, KoColor::fromXML(), KoID::id(), and Integer8BitsColorDepthID.
| bool ManagedColor::operator== | ( | const ManagedColor & | other | ) | const |
Definition at line 55 of file ManagedColor.cpp.
References d.
| bool ManagedColor::setColorProfile | ( | const QString & | colorProfile | ) |
setColorProfile set the color profile of the image to the given profile. The profile has to be registered with krita and be compatible with the current color model and depth; the image data is not converted.
| colorProfile |
Definition at line 107 of file ManagedColor.cpp.
References colorProfile(), d, KoColorSpaceRegistry::instance(), and KoColorSpaceRegistry::profileByName().
| bool ManagedColor::setColorSpace | ( | const QString & | colorModel, |
| const QString & | colorDepth, | ||
| const QString & | colorProfile ) |
setColorSpace convert the nodes and the image to the given colorspace. The conversion is done with Perceptual as intent, High Quality and No LCMS Optimizations as flags and no blackpoint compensation.
| colorModel | A string describing the color model of the image:
|
| colorDepth | A string describing the color depth of the image:
|
| colorProfile | a valid color profile for this color model and color depth combination. |
Definition at line 115 of file ManagedColor.cpp.
References colorDepth(), colorModel(), colorProfile(), KoColorSpaceRegistry::colorSpace(), d, and KoColorSpaceRegistry::instance().
setComponents Set the channel/components with normalized values. For integer colorspace, this obviously means the limit is between 0.0-1.0, but for floating point colorspaces, 2.4 or 103.5 are still meaningful (if bright) values.
| values | the QVector containing the new channel/component values. These should be normalized. |
Definition at line 142 of file ManagedColor.cpp.
References d.
| QString ManagedColor::toQString | ( | ) |
toQString create a user-visible string of the channel names and the channel values
Definition at line 171 of file ManagedColor.cpp.
References d, and KoColor::toQString().
| QString ManagedColor::toXML | ( | ) | const |
Serialize this color following Create's swatch color specification available at https://web.archive.org/web/20110826002520/http://create.freedesktop.org/wiki/Swatches_-_color_file_format/Draft
Definition at line 147 of file ManagedColor.cpp.
References colorDepth(), and d.
|
friend |
Definition at line 199 of file ManagedColor.h.
|
friend |
Definition at line 197 of file ManagedColor.h.
|
friend |
Definition at line 198 of file ManagedColor.h.
|
friend |
Assistance tools: guides, reference, etc.
Definition at line 196 of file ManagedColor.h.
|
private |
Definition at line 204 of file ManagedColor.h.