FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
PixelData.hpp
1 /*
2  * Copyright 2011, 2012 Lukas Jirkovsky
3  *
4  * This file is part of FotoSHOCKcore.
5  *
6  * FotoSHOCKcore is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, version 3 of the License.
9  *
10  * FotoSHOCKcore is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with FotoSHOCKcore. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef PIXELDATA_H
20 #define PIXELDATA_H
21 
22 #include "ValueType.hpp"
23 #include "serialization/XmlNode.hpp"
24 
25 #include <boost/shared_ptr.hpp>
26 
27 namespace FotoSHOCKcore {
28 
30 
35 class PixelData {
36  public:
38 
45  PixelData();
47 
56  PixelData(ValueType format, ColorSpace colorSpace, cmsHPROFILE profile = 0);
60  PixelData(ValueType format, unsigned int usedBits, int numOfBands, ColorSpace colorSpace, cmsHPROFILE profile = 0);
61 
63 
68  void colorSpace(ColorSpace cspace);
70 
78  const ColorSpace& colorSpace() const;
79 
81 
86  void format(ValueType format);
88 
91  ValueType format() const;
92 
94 
103  void usedBits(unsigned int usedBits);
105 
111  unsigned int usedBits() const;
112 
114 
121  void numOfBands(int numOfBands);
123 
131  int numOfBands() const;
132 
134 
139  // NOTE: how my own color space conversions should be handled?
140  cmsUInt32Number cmsFormatter() const;
141 
143 
151  void cmsProfile(cmsHPROFILE profile);
153 
156  cmsHPROFILE cmsProfile() const;
157 
158  xmlNodePtr serialize() const;
159  static PixelData deserialize(const xmlNodePtr value);
160  private:
161  ValueType m_format;
162  unsigned int m_usedBits;
163  int m_numOfBands;
164  ColorSpace m_colorSpace;
165 
167  boost::shared_ptr<void> m_cmsProfile;
168 };
169 
170 }
171 
172 #endif