digiKam
iccprofile.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-07
7  * Description : a wrapper class for an ICC color profile
8  *
9  * Copyright (C) 2005-2006 by F.J. Cruz <fj dot cruz at supercable dot es>
10  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_ICC_PROFILE_H
27 #define DIGIKAM_ICC_PROFILE_H
28 
29 // Qt includes
30 
31 #include <QByteArray>
32 #include <QMetaType>
33 #include <QSharedData>
34 
35 // Local includes
36 
37 #include "digikam_export.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_EXPORT IccProfile
43 {
44 public:
45 
47  {
59  NamedColor
60  };
61 
62 public:
63 
67  IccProfile();
68 
72  explicit IccProfile(const QByteArray& data);
73 
77  explicit IccProfile(const QString& filePath);
78 
82  static IccProfile sRGB();
83  static IccProfile adobeRGB();
84  static IccProfile wideGamutRGB();
85  static IccProfile proPhotoRGB();
86 
90  static QList<IccProfile> defaultProfiles();
91 
92  IccProfile(const IccProfile& other);
93  ~IccProfile();
94 
95  IccProfile& operator=(const IccProfile& other);
96 
97  bool isNull() const;
98 
104  bool operator==(const IccProfile& other) const;
105 
106  bool operator!=(const IccProfile& other) const
107  {
108  return !operator==(other);
109  }
110 
114  bool isSameProfileAs(IccProfile& other);
115 
122  bool open();
123 
128  void close();
129 
133  bool isOpen() const;
134 
139  QString filePath() const;
140 
144  QString description();
145 
146  ProfileType type();
147 
152  QByteArray data();
153 
157  bool writeToFile(const QString& filePath);
158 
162  void* handle() const;
163 
164  operator void*() const
165  {
166  return handle();
167  }
168 
173  static QStringList defaultSearchPaths();
174 
175  static QList<IccProfile> scanDirectories(const QStringList& dirs);
176 
177  static void considerOriginalAdobeRGB(const QString& filePath);
178 
179 private:
180 
181  IccProfile(const char* const location, const QString& relativePath);
182 
183 private:
184 
185  class Private;
186  QSharedDataPointer<Private> d;
187 };
188 
189 // --------------------------------------------------------------------------------------
190 
191 class DIGIKAM_EXPORT LcmsLock
192 {
193 public:
194 
198  explicit LcmsLock();
199  ~LcmsLock();
200 };
201 
202 } // namespace Digikam
203 
204 Q_DECLARE_METATYPE(Digikam::IccProfile)
205 
206 #endif // DIGIKAM_ICC_PROFILE_H
Definition: iccprofile.h:43
ProfileType
Definition: iccprofile.h:47
@ DeviceLink
Definition: iccprofile.h:58
@ Display
For a display device like a monitor.
Definition: iccprofile.h:55
@ Output
For an output device like a printer.
Definition: iccprofile.h:53
@ Input
For an input device like a scanner or digital camera.
Definition: iccprofile.h:51
@ InvalidType
Returned for a null profile or an unknown (non-standard) profile type.
Definition: iccprofile.h:49
@ ColorSpace
Definition: iccprofile.h:57
@ Abstract
Definition: iccprofile.h:56
static QList< IccProfile > scanDirectories(const QStringList &dirs)
bool operator!=(const IccProfile &other) const
Definition: iccprofile.h:106
Definition: iccprofile.h:192
Definition: piwigotalker.h:48
std::vector< T > location(const std::vector< T > &shape, unsigned long idx)
Definition: shapepredictor.h:109
Definition: datefolderview.cpp:43
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49