#include <KisSwatch.h>
Definition at line 17 of file KisSwatch.h.
◆ KisSwatch() [1/2]
◆ KisSwatch() [2/2]
| KisSwatch::KisSwatch |
( |
const KoColor & | color, |
|
|
const QString & | name = QString() ) |
◆ color()
◆ fromByteArray() [1/2]
| KisSwatch KisSwatch::fromByteArray |
( |
QByteArray & | data | ) |
|
|
static |
Definition at line 88 of file KisSwatch.cpp.
89{
90 QString s;
93}
static KisSwatch fromByteArray(QByteArray &data, QString &groupName, int &originalRow, int &originalColumn)
References fromByteArray().
◆ fromByteArray() [2/2]
| KisSwatch KisSwatch::fromByteArray |
( |
QByteArray & | data, |
|
|
QString & | groupName, |
|
|
int & | originalRow, |
|
|
int & | originalColumn ) |
|
static |
Definition at line 57 of file KisSwatch.cpp.
58{
59 QDataStream stream(&data, QIODevice::ReadOnly);
63 QString colorXml;
64
65 while (!stream.atEnd()) {
67 >> originalRow >> originalColumn
68 >> oldGroupName
69 >> colorXml;
70
74
75 QDomDocument doc;
76 doc.setContent(colorXml);
77 QDomElement e = doc.documentElement();
78 QDomElement c = e.firstChildElement();
79 if (!c.isNull()) {
82 }
83 }
84
85 return s;
86}
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
void setSpotColor(bool spotColor)
void setColor(const KoColor &color)
void setId(const QString &id)
void setName(const QString &name)
static KoColor fromXML(const QDomElement &elt, const QString &channelDepthId)
References KoColor::fromXML(), KoID::id(), id(), Integer8BitsColorDepthID, name(), setColor(), setId(), setName(), setSpotColor(), and spotColor().
◆ id()
| QString KisSwatch::id |
( |
| ) |
const |
|
inline |
◆ isValid()
| bool KisSwatch::isValid |
( |
| ) |
const |
|
inline |
◆ name()
| QString KisSwatch::name |
( |
| ) |
const |
|
inline |
◆ operator==()
| bool KisSwatch::operator== |
( |
const KisSwatch & | rhs | ) |
const |
|
inline |
◆ setColor()
◆ setId()
| void KisSwatch::setId |
( |
const QString & | id | ) |
|
◆ setName()
| void KisSwatch::setName |
( |
const QString & | name | ) |
|
◆ setSpotColor()
| void KisSwatch::setSpotColor |
( |
bool | spotColor | ) |
|
◆ spotColor()
| bool KisSwatch::spotColor |
( |
| ) |
const |
|
inline |
◆ writeToStream()
| void KisSwatch::writeToStream |
( |
QDataStream & | stream, |
|
|
const QString & | groupName, |
|
|
int | originalRow, |
|
|
int | originalColumn ) |
Definition at line 44 of file KisSwatch.cpp.
45{
46 QDomDocument doc;
47 QDomElement root = doc.createElement("Color");
48 root.setAttribute(
"bitdepth",
color().colorSpace()->colorDepthId().
id());
49 doc.appendChild(root);
51
53 << originalRow << originalColumn
54 << groupName << doc.toString();
55}
void toXML(QDomDocument &doc, QDomElement &colorElt) const
References color(), id(), name(), spotColor(), and KoColor::toXML().
◆ m_color
◆ m_id
◆ m_name
| QString KisSwatch::m_name |
|
private |
◆ m_spotColor
| bool KisSwatch::m_spotColor {false} |
|
private |
◆ m_valid
| bool KisSwatch::m_valid {false} |
|
private |
The documentation for this class was generated from the following files: