2 * SPDX-FileCopyrightText: 2017 Boudewijn Rempt <[email protected]>
22 * the specific properties of its colorspace, such as the whitepoint, chromacities, trc, etc, as represented
26 * LCMS is the one handling the ICC profile stuff, and the major one handling that ManagedColor deals with.
27 * OCIO support is only in the display of the colors. ManagedColor has some support for it in colorForCanvas()
29 * All colors in Krita are color managed. QColors are understood as RGB-type colors in the sRGB space.
58 ManagedColor(const QString &colorModel, const QString &colorDepth, const QString &colorProfile, QObject *parent = 0);
60 ~ManagedColor() override;
62 bool operator==(const ManagedColor &other) const;
66 * @param canvas the canvas whose color management you'd like to use. In Krita, different views have
68 * @return the QColor as it would be displaying on the canvas. This result can be used to draw widgets with
91 QString colorDepth() const;
106 QString colorModel() const;
111 QString colorProfile() const;
114 * @brief setColorProfile set the color profile of the image to the given profile. The profile has to
115 * be registered with krita and be compatible with the current color model and depth; the image data
118 * @return false if the colorProfile name does not correspond to to a registered profile or if assigning
121 bool setColorProfile(const QString &colorProfile);
124 * @brief setColorSpace convert the nodes and the image to the given colorspace. The conversion is
125 * done with Perceptual as intent, High Quality and No LCMS Optimizations as flags and no blackpoint
148 bool setColorSpace(const QString &colorModel, const QString &colorDepth, const QString &colorProfile);
152 * @return a QVector containing the channel/components of this color normalized. This includes the alphachannel.
154 QVector<float> components() const;
160 QVector<float> componentsOrdered() const;
164 * Set the channel/components with normalized values. For integer colorspace, this obviously means the limit
165 * is between 0.0-1.0, but for floating point colorspaces, 2.4 or 103.5 are still meaningful (if bright) values.
166 * @param values the QVector containing the new channel/component values. These should be normalized.
172 * at https://web.archive.org/web/20110826002520/http://create.freedesktop.org/wiki/Swatches_-_color_file_format/Draft
174 QString toXML() const;
178 * at https://web.archive.org/web/20110826002520/http://create.freedesktop.org/wiki/Swatches_-_color_file_format/Draft
185 void fromXML(const QString &xml);
191 QString toQString();
196 friend class View;
197 friend class PaletteView;
198 friend class Swatch;
199 friend class ColorizeMask;
204 const QScopedPointer<Private> d;
The ColorizeMask class A colorize mask is a mask type node that can be used to color in line art.
The ManagedColor class is a class to handle colors that are color managed.
The PaletteView class is a wrapper around a MVC method for handling palettes. This class shows a nice...
QVector< V > values(const QMultiHash< K, V > &c)