Scribus
Open source desktop publishing at your fingertips
sclcmscolormgmtengineimpl.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 
8 #ifndef SCLCMSCOLORMGMTENGINEIMPL_H
9 #define SCLCMSCOLORMGMTENGINEIMPL_H
10 
11 #include <stdexcept>
12 
13 #include "lcms.h"
14 #include "sccolormgmtenginedata.h"
15 #include "sccolorprofilecache.h"
16 
18 {
19  friend class ScLcmsColorProfileImpl;
20  friend class ScLcmsColorTransformImpl;
21 
22 public:
24 
25  // Setter, only for color management strategy
26  virtual void setStrategy(const ScColorMgmtStrategy& strategy);
27 
28  // function for getting available profile in a directory
29  virtual QList<ScColorProfileInfo> getAvailableProfileInfo(const QString& directory, bool recursive);
30 
31  // functions for opening icc profiles
32  virtual ScColorProfile openProfileFromFile(ScColorMgmtEngine& engine, const QString& filePath);
33  virtual ScColorProfile openProfileFromMem (ScColorMgmtEngine& engine, const QByteArray& array);
34 
35  // functions for creating profiles
36  virtual ScColorProfile createProfile_sRGB(ScColorMgmtEngine& engine);
37  virtual ScColorProfile createProfile_Lab (ScColorMgmtEngine& engine);
38 
39  // functions for creating transforms
40  virtual ScColorTransform createTransform(ScColorMgmtEngine& colorManagementEngine,
41  const ScColorProfile& inputProfile , eColorFormat inputFormat,
42  const ScColorProfile& outputProfile, eColorFormat outputFormat,
43  eRenderIntent renderIntent, long transformFlags);
44  virtual ScColorTransform createProofingTransform(ScColorMgmtEngine& colorManagementEngine,
45  const ScColorProfile& inputProfile , eColorFormat inputFormat,
46  const ScColorProfile& outputProfile, eColorFormat outputFormat,
47  const ScColorProfile& proofing, eRenderIntent renderIntent,
48  eRenderIntent proofingIntent, long transformFlags);
49 
50 protected:
51 
52  // Color profile cache
53  static QSharedPointer<ScColorProfileCache> m_profileCache;
54 
55  // Color transform cache
56  static QSharedPointer<ScColorTransformPool> m_transformPool;
57 
58  static DWORD translateFlagsToLcmsFlags(long flags);
59  static DWORD translateFormatToLcmsFormat(eColorFormat format);
60  static int translateIntentToLcmsIntent(eRenderIntent intent, eRenderIntent defaut = Intent_Relative_Colorimetric);
61  static eColorSpaceType translateLcmsColorSpaceType(icColorSpaceSignature);
62  static eProfileClass translateLcmsProfileClass(icProfileClassSignature);
63 
64  // Exception class thrown by cmsErrorHandler
65  class lcmsException : public std::runtime_error
66  {
67  public :
68  lcmsException(const char* msg) : std::runtime_error(msg) {}
69  };
70 
76  static int cmsErrorHandler(int ErrorCode, const char *ErrorText);
77 };
78 
79 #endif
static int cmsErrorHandler(int ErrorCode, const char *ErrorText)
Simple error handler for use in conjunction with littlecms.
Definition: sclcmscolormgmtengineimpl.cpp:604
Definition: sclcmscolorprofileimpl.h:17
Definition: sccolorprofile.h:16
Definition: sccolormgmtenginedata.h:22
Definition: sccolortransform.h:16
Definition: sclcmscolormgmtengineimpl.h:17
Definition: sccolormgmtstructs.h:92
Definition: sclcmscolortransformimpl.h:15
Definition: sclcmscolormgmtengineimpl.h:65
Definition: sccolormgmtengine.h:16