Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_color_manager.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include <QGlobalStatic>
8
9#include "kis_color_manager.h"
10#include "colord/KisColord.h"
11
12#include <kis_debug.h>
13
15
17public:
18 Private(QObject *parent)
19 : colord(new KisColord(parent))
20 {}
21
23};
24
26 : QObject()
27 , d(new Private(this))
28{
29 //dbgKrita << "ColorManager started";
30 connect(d->colord, SIGNAL(changed(QString)), this, SIGNAL(changed(QString)));
31}
32
34{
35 delete d;
36}
37
38QString KisColorManager::deviceName(const QString &id)
39{
40 return d->colord->deviceName(id);
41}
42
44{
45
46 switch (type) {
47 case screen:
48 return d->colord->devices("display");
49 case printer:
50 return d->colord->devices("printer");
51 case camera:
52 return d->colord->devices("camera");
53 case scanner:
54 return d->colord->devices("scanner");
55 };
56
57 return QStringList();
58}
59
60QByteArray KisColorManager::displayProfile(const QString &device, int profile) const
61{
62 return d->colord->deviceProfile(device, profile);
63}
64
66{
67 return s_instance;
68}
QList< QString > QStringList
Q_GLOBAL_STATIC(KisStoragePluginRegistry, s_instance)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
The KisColorManager class can be used as a cross-platform way to get the display profile associated w...
QByteArray displayProfile(const QString &device, int profile=0) const
Return the icc profile for the given device and index (if a device has more than one profile)
QString deviceName(const QString &id)
Return the user-visible name for the given device.
void changed(const QString device)
~KisColorManager() override
QStringList devices(DeviceType type=screen) const
Return a list of device id's for the specified type.
const Private *const d
static KisColorManager * instance()
QStringList devices(const QString &type) const
Definition KisColord.cpp:85
QByteArray deviceProfile(const QString &id, int profile)
const QString deviceName(const QString &id) const
Definition KisColord.cpp:96