File indexing completed on 2024-05-12 15:56:13
0001 /* 0002 * SPDX-FileCopyrightText: 2015 Boudewijn Rempt <boud@valdyas.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef KIS_COLOR_MANAGER_H 0007 #define KIS_COLOR_MANAGER_H 0008 0009 #include <QObject> 0010 #include <QString> 0011 #include <QStringList> 0012 #include <QByteArray> 0013 0014 #include "kritacolor_export.h" 0015 /** 0016 * @brief The KisColorManager class can be used as a cross-platform way to get the 0017 * display profile associated with a device. 0018 * 0019 * TODO: support other devices than monitors 0020 */ 0021 class KRITACOLOR_EXPORT KisColorManager : public QObject 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 explicit KisColorManager(); 0027 ~KisColorManager() override; 0028 0029 enum DeviceType { 0030 screen, 0031 printer, 0032 camera, 0033 scanner 0034 }; 0035 0036 /// Return the user-visible name for the given device 0037 QString deviceName(const QString &id); 0038 0039 /// Return a list of device id's for the specified type 0040 QStringList devices(DeviceType type = screen) const; 0041 0042 /// Return the icc profile for the given device and index (if a device has more than one profile) 0043 QByteArray displayProfile(const QString &device, int profile = 0) const; 0044 0045 static KisColorManager *instance(); 0046 0047 Q_SIGNALS: 0048 0049 void changed(const QString device); 0050 0051 public Q_SLOTS: 0052 0053 private: 0054 0055 KisColorManager(const KisColorManager&); 0056 KisColorManager operator=(const KisColorManager&); 0057 0058 class Private; 0059 const Private *const d; 0060 }; 0061 0062 #endif // KIS_COLOR_MANAGER_H