Scribus
Open source desktop publishing at your fingertips
sccolorspacedata_rgb.h
1 #ifndef SCCOLORSPACEDATA_RGB_H
2 #define SCCOLORSPACEDATA_RGB_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_rIndex;
15  int m_gIndex;
16  int m_bIndex;
17 
18 public:
20 
21  virtual uint alphaIndex(void) const { return 0; }
22  virtual void flattenAlpha(void* dataIn, uint numElems) const {};
23 };
24 
25 template<typename T, eColorFormat COLORFORMAT>
27 {
28  m_colorFormat = COLORFORMAT;
29  m_profile = profile;
30  if (m_colorFormat == Format_RGB_8 || m_colorFormat == Format_RGB_16)
31  {
32  m_rIndex = 0;
33  m_gIndex = 1;
34  m_bIndex = 2;
35  }
36  else
37  {
38  assert(false);
39  }
40  if (m_profile)
41  {
42  assert(m_profile.colorSpace() == ColorSpace_Rgb);
43  }
44 };
45 
48 
49 #endif
Definition: sccolorprofile.h:16
Definition: sccolorspacedata.h:17
Definition: sccolorspacedata_rgb.h:11