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 <memory>
27 #include <vector>
28 
29 #include <libopenraw/metadata.h>
30 #include "bitmapdata.hpp"
31 #include "cfapattern.hpp"
32 
33 namespace OpenRaw {
34 
35 class RawData
36  : public BitmapData
37 {
38 public:
39  static RawData * getAndExtractRawData(const char* filename,
40  uint32_t options,
41  or_error & err);
42 
43  RawData();
44  virtual ~RawData();
45 
46  RawData(const RawData& f) = delete;
47  RawData & operator=(const RawData&) = delete;
48 
54  ::or_error getRenderedImage(BitmapData & bitmapdata, uint32_t options);
55 
56  // deprecate rename black level and white level resp.
57  uint16_t blackLevel() const;
58  uint16_t whiteLevel() const;
59  void setBlackLevel(uint16_t _m);
60  void setWhiteLevel(uint16_t _m);
61 
62 
65  void setPhotometricInterpretation(ExifPhotometricInterpretation pi);
66  ExifPhotometricInterpretation getPhotometricInterpretation() const;
67 
73  const double* getColourMatrix1(uint32_t & size) const;
74  void setColourMatrix1(const double* matrix, uint32_t size);
75 
81  const double* getColourMatrix2(uint32_t & size) const;
82  void setColourMatrix2(const double* matrix, uint32_t size);
83 
85  void swap(RawData & with);
86 
87  virtual void *allocData(const size_t s) override;
88  virtual void setDimensions(uint32_t x, uint32_t y) override;
89 
90  void setCfaPatternType(::or_cfa_pattern t);
94  const CfaPattern* cfaPattern() const;
95  void setCfaPattern(const CfaPattern* pattern);
96 
97  uint32_t compression() const;
98  void setCompression(uint32_t c);
99 
100 
101  void setSlices(const std::vector<uint16_t> & slices);
102 
104 // BitmapData &append(uint8_t c);
106  RawData &append(uint16_t c);
108  void nextRow();
109 private:
110  class Private;
111  RawData::Private *d;
112 };
113 
114 
115 typedef std::unique_ptr<RawData> RawDataPtr;
116 
117 }
118 
119 /*
120  Local Variables:
121  mode:c++
122  c-file-style:"stroustrup"
123  c-file-offsets:((innamespace . 0))
124  indent-tabs-mode:nil
125  fill-column:80
126  End:
127 */
128 #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