Scribus
Open source desktop publishing at your fingertips
sccolorspacedata_cmyk.h
1 #ifndef SCCOLORSPACEDATA_CMYK_H
2 #define SCCOLORSPACEDATA_CMYK_H
3 
4 #include <cassert>
5 #include <climits>
6 #include <limits>
7 #include "sccolorprofile.h"
8 #include "sccolorspacedata.h"
9 
10 template<typename T, eColorFormat COLORFORMAT>
12 {
13 protected:
14  int m_cIndex;
15  int m_mIndex;
16  int m_yIndex;
17  int m_kIndex;
18 
19 public:
21 
22  virtual uint alphaIndex(void) const { return 0; }
23  virtual void flattenAlpha(void* dataIn, uint numElems) const {};
24 };
25 
26 template<typename T, eColorFormat COLORFORMAT>
28 {
29  m_colorFormat = COLORFORMAT;
30  m_profile = profile;
31  if (m_colorFormat == Format_CMYK_8 || m_colorFormat == Format_CMYK_16)
32  {
33  m_cIndex = 0;
34  m_mIndex = 1;
35  m_yIndex = 2;
36  m_kIndex = 3;
37  }
38  else if (m_colorFormat == Format_YMCK_8 || m_colorFormat == Format_YMCK_16)
39  {
40  m_cIndex = 2;
41  m_mIndex = 1;
42  m_yIndex = 0;
43  m_kIndex = 3;
44  }
45  else
46  {
47  assert(false);
48  }
49  if (m_profile)
50  {
51  assert(m_profile.colorSpace() == ColorSpace_Cmyk || m_profile.colorSpace() == ColorSpace_Cmy);
52  }
53 };
54 
59 
60 #endif
Definition: sccolorprofile.h:16
Definition: sccolorspacedata.h:17
Definition: sccolorspacedata_cmyk.h:11