libopenraw
rawdata.hpp
1 /*
2  * libopenraw - rawdata.h
3  *
4  * Copyright (C) 2007-2008, 2012 Hubert Figuière
5  * Copyright (C) 2008 Novell, Inc.
6  *
7  * This library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef LIBOPENRAWPP_RAWDATA_H_
24 #define LIBOPENRAWPP_RAWDATA_H_
25 
26 #include <vector>
27 
28 #include <libopenraw/metadata.h>
29 #include "bitmapdata.hpp"
30 #include "cfapattern.hpp"
31 
32 namespace OpenRaw {
33 
34 class RawData
35  : public BitmapData
36 {
37 public:
38  static RawData * getAndExtractRawData(const char* filename,
39  uint32_t options,
40  or_error & err);
41 
42  RawData();
43  virtual ~RawData();
44 
45  RawData(const RawData& f) = delete;
46  RawData & operator=(const RawData&) = delete;
47 
53  ::or_error getRenderedImage(BitmapData & bitmapdata, uint32_t options);
54 
55  // deprecate rename black level and white level resp.
56  uint16_t blackLevel() const;
57  uint16_t whiteLevel() const;
58  void setBlackLevel(uint16_t _m);
59  void setWhiteLevel(uint16_t _m);
60 
61 
64  void setPhotometricInterpretation(ExifPhotometricInterpretation pi);
65  ExifPhotometricInterpretation getPhotometricInterpretation() const;
66 
72  const double* getColourMatrix1(uint32_t & size) const;
73  void setColourMatrix1(const double* matrix, uint32_t size);
74 
80  const double* getColourMatrix2(uint32_t & size) const;
81  void setColourMatrix2(const double* matrix, uint32_t size);
82 
84  void swap(RawData & with);
85 
86  virtual void *allocData(const size_t s) override;
87  virtual void setDimensions(uint32_t x, uint32_t y) override;
88 
89  void setCfaPatternType(::or_cfa_pattern t);
93  const CfaPattern* cfaPattern() const;
94  void setCfaPattern(const CfaPattern* pattern);
95 
96  uint32_t compression() const;
97  void setCompression(uint32_t c);
98 
99 
100  void setSlices(const std::vector<uint16_t> & slices);
101 
103 // BitmapData &append(uint8_t c);
105  RawData &append(uint16_t c);
107  void nextRow();
108 private:
109  class Private;
110  RawData::Private *d;
111 };
112 
113 }
114 
115 /*
116  Local Variables:
117  mode:c++
118  c-file-style:"stroustrup"
119  c-file-offsets:((innamespace . 0))
120  indent-tabs-mode:nil
121  fill-column:80
122  End:
123 */
124 #endif
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
Definition: arwfile.cpp:30
::or_error getRenderedImage(BitmapData &bitmapdata, uint32_t options)
Definition: rawdata.cpp:125
OR_DEPRECATED uint32_t x() const
Definition: bitmapdata.cpp:139
const double * getColourMatrix2(uint32_t &size) const
Definition: rawdata.cpp:228
RawData & append(uint16_t c)
Definition: rawdata.cpp:318
size_t size() const
Definition: bitmapdata.cpp:129
void swap(RawData &with)
Definition: rawdata.cpp:245
OR_DEPRECATED uint32_t y() const
Definition: bitmapdata.cpp:149
const CfaPattern * cfaPattern() const
Definition: rawdata.cpp:287
virtual void setDimensions(uint32_t x, uint32_t y) override
Definition: rawdata.cpp:260
const double * getColourMatrix1(uint32_t &size) const
Definition: rawdata.cpp:211