Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorSet_p.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-or-later
3 */
4
5#ifndef KOCOLORSET_P_H
6#define KOCOLORSET_P_H
7
8#include <QXmlStreamReader>
9#include <QDomElement>
10#include <kundo2stack.h>
11
12#include <KisSwatch.h>
13#include <KisSwatchGroup.h>
14
15#include "KoColorSet.h"
16
17struct RiffHeader {
18 quint32 riff;
19 quint32 size;
20 quint32 signature;
21 quint32 data;
22 quint32 datasize;
23 quint16 version;
24 quint16 colorcount;
25};
26
28{
29
30public:
31 Private(KoColorSet *a_colorSet);
32
33public:
35 Q_ASSERT(swatchGroups.size() > 0 && swatchGroups.first()->name() == GLOBAL_GROUP_NAME);
36 return swatchGroups.first();
37 }
38public:
39 bool init();
40
41 bool saveGpl(QIODevice *dev) const;
42 bool loadGpl();
43
44 bool loadAct();
45 bool loadRiff();
46 bool loadPsp();
47 bool loadAco();
48 bool loadXml();
49 bool loadSbz();
50 bool loadAse();
51 bool loadAcb();
52 bool loadCss();
53
54 bool saveKpl(QIODevice *dev) const;
55 bool loadKpl();
56
57public:
58
61 QByteArray data;
62 QString comment;
65 bool isLocked {false};
67
68private:
69
70 friend struct AddSwatchCommand;
71 friend struct RemoveSwatchCommand;
73 friend struct AddGroupCommand;
74 friend struct RemoveGroupCommand;
75 friend struct ClearCommand;
76 friend struct SetColumnCountCommand;
77 friend struct SetCommentCommand;
78 friend struct SetPaletteTypeCommand;
79 friend struct MoveGroupCommand;
80
81 KoColorSet::PaletteType detectFormat(const QString &fileName, const QByteArray &ba);
82 void scribusParseColor(KoColorSet *set, QXmlStreamReader *xml);
83 bool loadScribusXmlPalette(KoColorSet *set, QXmlStreamReader *xml);
84 quint8 readByte(QIODevice *io);
85 quint16 readShort(QIODevice *io);
86 qint32 readInt(QIODevice *io);
87 float readFloat(QIODevice *io);
88 QString readUnicodeString(QIODevice *io, bool sizeIsInt = false);
89
90 const KoColorProfile *loadColorProfile(QScopedPointer<KoStore> &store,
91 const QString &path,
92 const QString &modelId,
93 const QString &colorDepthId);
94
95 void saveKplGroup(QDomDocument &doc, QDomElement &groupEle,
96 const KisSwatchGroupSP group, QSet<const KoColorSpace *> &colorSetSet) const;
97 bool loadKplProfiles(QScopedPointer<KoStore> &store);
98 bool loadKplColorset(QScopedPointer<KoStore> &store);
99 bool loadSbzSwatchbook(QScopedPointer<KoStore> &store);
100 void loadKplGroup(const QDomDocument &doc, const QDomElement &parentElement, KisSwatchGroupSP group, QString version);
101};
102
103#endif // KOCOLORSET_P_H
bool saveKpl(QIODevice *dev) const
KUndo2Stack undoStack
KoColorSet::PaletteType detectFormat(const QString &fileName, const QByteArray &ba)
bool loadSbzSwatchbook(QScopedPointer< KoStore > &store)
quint8 readByte(QIODevice *io)
const KoColorProfile * loadColorProfile(QScopedPointer< KoStore > &store, const QString &path, const QString &modelId, const QString &colorDepthId)
bool loadKplColorset(QScopedPointer< KoStore > &store)
KoColorSet::PaletteType paletteType
KoColorSet * colorSet
void scribusParseColor(KoColorSet *set, QXmlStreamReader *xml)
bool loadKplProfiles(QScopedPointer< KoStore > &store)
float readFloat(QIODevice *io)
void saveKplGroup(QDomDocument &doc, QDomElement &groupEle, const KisSwatchGroupSP group, QSet< const KoColorSpace * > &colorSetSet) const
bool saveGpl(QIODevice *dev) const
KisSwatchGroupSP global()
bool loadScribusXmlPalette(KoColorSet *set, QXmlStreamReader *xml)
quint16 readShort(QIODevice *io)
QList< KisSwatchGroupSP > swatchGroups
QString readUnicodeString(QIODevice *io, bool sizeIsInt=false)
void loadKplGroup(const QDomDocument &doc, const QDomElement &parentElement, KisSwatchGroupSP group, QString version)
qint32 readInt(QIODevice *io)
static const QString GLOBAL_GROUP_NAME
Definition KoColorSet.h:33
quint32 data
quint16 colorcount
quint32 riff
quint16 version
quint32 datasize
quint32 signature
quint32 size