Scribus
Open source desktop publishing at your fingertips
sccolorspacedata.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 SCCOLORSPACEDATA_H
9 #define SCCOLORSPACEDATA_H
10 
11 #include <QIODevice>
12 #include "sccolormgmtelem.h"
13 #include "sccolorprofile.h"
14 #include "sccolortransform.h"
15 #include "sccolormgmtstructs.h"
16 
18 {
19 protected:
20  eColorFormat m_colorFormat;
21  ScColorProfile m_profile;
22 
23 public:
24 
25  eColorType type() const { return colorFormatType(m_colorFormat); }
26  eColorFormat colorFormat() const { return m_colorFormat; }
27  const ScColorProfile& profile() const { return m_profile; }
28 
29  uint numChannels(void) const { return colorFormatNumChannels(m_colorFormat); }
30  uint bytesPerChannel(void) const { return colorFormatBytesPerChannel(m_colorFormat); }
31  bool hasAlphaChannel(void) const { return colorFormatHasAlpha(m_colorFormat); }
32 
33  virtual ScColorMgmtEngine& engine() { return m_profile.engine(); }
34  virtual const ScColorMgmtEngine& engine() const { return m_profile.engine(); }
35 
36  // Index of alpha data
37  virtual uint alphaIndex(void) const = 0;
38 
39  // Restore full opacity of alpha channel
40  virtual void flattenAlpha(void* dataIn, uint numElems) const = 0;
41 
42  // Function to create transform to a specific output color space
43  virtual ScColorTransform createTransform(const ScColorSpaceData& outputSpace, eRenderIntent renderIntent,
44  long transformFlags);
45  virtual ScColorTransform createTransform(const ScColorProfile& outputProfile, eColorFormat outputFormat,
46  eRenderIntent renderIntent, long transformFlags);
47 
48  // Function to create proofing transform to a specific output color space and a specific proofing device
49  virtual ScColorTransform createProofingTransform(const ScColorSpaceData& outputSpace, const ScColorProfile& proofing,
50  eRenderIntent renderIntent, eRenderIntent proofingIntent,
51  long transformFlags);
52  virtual ScColorTransform createProofingTransform(const ScColorProfile& outputProfile, eColorFormat outputFormat,
53  const ScColorProfile& proofing, eRenderIntent renderIntent,
54  eRenderIntent proofingIntent, long transformFlags);
55 
56  // Convert color data to a specific color space
57  virtual bool convert(ScColorSpaceData& data, eRenderIntent renderIntent, long transformFlags,
58  void* dataIn, void* dataOut, uint numElems, ScColorTransform* lastTrans = 0);
59  virtual bool convert(ScColorSpaceData& data, eRenderIntent renderIntent, long transformFlags,
60  void* dataIn, QIODevice* device, uint numElems, ScColorTransform* lastTrans = 0);
61 };
62 
63 #endif
Definition: sccolorprofile.h:16
Definition: sccolorspacedata.h:17
Definition: sccolormgmtelem.h:13
Definition: sccolortransform.h:16
Definition: sccolormgmtengine.h:16