-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathicctransform.h
50 lines (43 loc) · 1.61 KB
/
icctransform.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2022-present Contributors to the jobman project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/mikaelsundell/jobman
#pragma once
#include <lcms2.h>
#include <QObject>
#include <QImage>
#include <QPixmap>
#include <QScopedPointer>
class ICCTransformPrivate;
class ICCTransform : public QObject
{
Q_OBJECT
public:
static ICCTransform* instance();
QString inputProfile() const;
QString outputProfile() const;
QRgb map(QRgb color);
QImage map(const QImage& image);
QRgb map(QRgb color, const QString& profile, const QString& outputProfile);
QImage map(const QImage& image, const QString& profile, const QString& outputProfile);
QRgb map(QRgb color, const QColorSpace& colorSpace, const QString& outputProfile);
QImage map(const QImage& image, const QColorSpace& colorSpace, const QString& outputProfile);
public Q_SLOTS:
void setInputProfile(const QString& inputProfile);
void setOutputProfile(const QString& displayProfile);
Q_SIGNALS:
void inputProfileChanged(const QString& inputProfile);
void outputProfileChanged(const QString& outputProfile);
private:
ICCTransform();
~ICCTransform();
ICCTransform(const ICCTransform&) = delete;
ICCTransform& operator=(const ICCTransform&) = delete;
class Deleter {
public:
static void cleanup(ICCTransform* pointer) {
delete pointer;
}
};
static QScopedPointer<ICCTransform, Deleter> pi;
QScopedPointer<ICCTransformPrivate> p;
};