digiKam
Loading...
Searching...
No Matches
iccmanager.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2009-08-12
7 * Description : methods that implement color management tasks
8 *
9 * SPDX-FileCopyrightText: 2005-2006 by F.J. Cruz <fj dot cruz at supercable dot es>
10 * SPDX-FileCopyrightText: 2005-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
11 * SPDX-FileCopyrightText: 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 *
15 * ============================================================ */
16
17#pragma once
18
19// Local includes
20
21#include "digikam_export.h"
22#include "iccprofile.h"
23#include "iccsettings.h"
25
26namespace Digikam
27{
28
29class DImg;
30class DImgLoaderObserver;
31class IccTransform;
32
33class DIGIKAM_EXPORT IccManager
34{
35public:
36
41 explicit IccManager(const DImg& image, const ICCSettingsContainer& settings = IccSettings::instance()->settings());
43
44 void setObserver(DImgLoaderObserver* const observer);
45
46 DImg image() const;
47 ICCSettingsContainer settings() const;
48 DImgLoaderObserver* observer() const;
49
50 bool hasValidWorkspace() const;
51 bool isUncalibratedColor() const;
52 bool isMissingProfile() const;
53 bool isProfileMismatch() const;
54
60 void transformDefault();
61
65 void transform(ICCSettingsContainer::Behavior behavior,
66 const IccProfile& specifiedProfile = IccProfile());
70 void transformToSRGB();
71
75 static bool isSRGB(const DImg& img);
76
80 void transformForOutput(const IccProfile& outputProfile);
81
90 void transformForDisplay();
91 void transformForDisplay(QWidget* const widget);
92 void transformForDisplay(const IccProfile& displayProfile);
93
94 static IccProfile displayProfile(QWidget* const displayingWidget = nullptr);
95 IccTransform displayTransform(QWidget* const displayingWidget = nullptr);
96 IccTransform displayTransform(const IccProfile& displayProfile);
97
101 IccTransform displaySoftProofingTransform(const IccProfile& deviceProfile, QWidget* const displayingWidget = nullptr);
102 IccTransform displaySoftProofingTransform(const IccProfile& deviceProfile, const IccProfile& displayProfile);
103
109 static bool needsPostLoadingManagement(const DImg& img);
110
115 IccProfile imageProfile(ICCSettingsContainer::Behavior behavior,
116 const IccProfile& specifiedProfile = IccProfile());
117
121 static void transformToSRGB(QImage& qimage, const IccProfile& inputProfile);
122
126 static void transformForDisplay(QImage& qimage, const IccProfile& displayProfile1 = displayProfile());
127
128protected:
129
130 void getTransform(IccTransform& trans, ICCSettingsContainer::Behavior behavior, const IccProfile& specifiedProfile);
131 void setIccProfile(const IccProfile& profile);
132 ICCSettingsContainer::Behavior safestBestBehavior() const;
133
134private:
135
136 // Disable
137 IccManager(const IccManager&) = delete;
138 IccManager& operator=(const IccManager&) = delete;
139
140private:
141
142 class Private;
143 Private* const d = nullptr;
144};
145
146} // namespace Digikam
Definition dimgloaderobserver.h:31
Definition dimg.h:52
Definition iccsettingscontainer.h:35
Definition iccmanager.h:34
Definition iccprofile.h:33
Definition icctransform.h:39
Definition datefolderview.cpp:34