Krita Source Code Documentation
Loading...
Searching...
No Matches
ManagedColor.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef MANAGEDCOLOR_H
8#define MANAGEDCOLOR_H
9
10#include <QObject>
11#include <QVector>
12#include <QScopedPointer>
13
14#include "kritalibkis_export.h"
15#include "libkis.h"
16
17class KoColor;
18
45class KRITALIBKIS_EXPORT ManagedColor : public QObject
46{
47 Q_OBJECT
48public:
53 explicit ManagedColor(QObject *parent = 0);
58 ManagedColor(const QString &colorModel, const QString &colorDepth, const QString &colorProfile, QObject *parent = 0);
59 ManagedColor(KoColor color, QObject *parent = 0);
60 ~ManagedColor() override;
61
62 bool operator==(const ManagedColor &other) const;
63
71 QColor colorForCanvas(Canvas *canvas) const;
72
79 static ManagedColor *fromQColor(const QColor &qcolor, Canvas *canvas = 0);
80
91 QString colorDepth() const;
92
106 QString colorModel() const;
107
111 QString colorProfile() const;
112
121 bool setColorProfile(const QString &colorProfile);
122
148 bool setColorSpace(const QString &colorModel, const QString &colorDepth, const QString &colorProfile);
149
154 QVector<float> components() const;
155
160 QVector<float> componentsOrdered() const;
161
168 void setComponents(const QVector<float> &values);
169
174 QString toXML() const;
175
185 void fromXML(const QString &xml);
186
191 QString toQString();
192
193
194private:
195
196 friend class View;
197 friend class PaletteView;
198 friend class Swatch;
199 friend class ColorizeMask;
200
201 KoColor color() const;
202
203 struct Private;
204 const QScopedPointer<Private> d;
205
206};
207
208#endif // MANAGEDCOLOR_H
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
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. A managed color is a color...
const QScopedPointer< Private > d
The PaletteView class is a wrapper around a MVC method for handling palettes. This class shows a nice...
Definition PaletteView.h:31
The Swatch class is a thin wrapper around the KisSwatch class.
Definition Swatch.h:22
Definition View.h:25