libopenraw  0.3.7
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 "mosaicinfo.hpp"
32 
33 namespace OpenRaw {
34 
36 class RawData
37  : public BitmapData
38 {
39 public:
40  static RawData * getAndExtractRawData(const char* filename,
41  uint32_t options,
42  or_error & err);
43 
44  RawData();
45  virtual ~RawData();
46 
47  RawData(const RawData& f) = delete;
48  RawData & operator=(const RawData&) = delete;
49 
55  ::or_error getRenderedImage(BitmapData & bitmapdata, uint32_t options);
56 
57  // deprecate rename black level and white level resp.
58  uint16_t blackLevel() const;
59  uint16_t whiteLevel() const;
60  void setBlackLevel(uint16_t _m);
61  void setWhiteLevel(uint16_t _m);
62 
68  uint32_t activeAreaX() const;
69  uint32_t activeAreaY() const;
70  uint32_t activeAreaWidth() const;
71  uint32_t activeAreaHeight() const;
72  void setActiveArea(uint32_t x, uint32_t y, uint32_t w, uint32_t h);
73 
76  void setPhotometricInterpretation(ExifPhotometricInterpretation pi);
77  ExifPhotometricInterpretation getPhotometricInterpretation() const;
78 
84  const double* getColourMatrix1(uint32_t & size) const;
85  void setColourMatrix1(const double* matrix, uint32_t size);
86 
92  const double* getColourMatrix2(uint32_t & size) const;
93  void setColourMatrix2(const double* matrix, uint32_t size);
94 
96  void swap(RawData & with);
97 
98  virtual void *allocData(const size_t s) override;
99  virtual void setDimensions(uint32_t x, uint32_t y) override;
100 
101  void setCfaPatternType(::or_cfa_pattern t);
105  const MosaicInfo* mosaicInfo() const;
106  void setMosaicInfo(const MosaicInfo* mosaic_info);
107 
108  uint32_t compression() const;
109  void setCompression(uint32_t c);
110 
111 
112  void setSlices(const std::vector<uint16_t> & slices);
113 
115 // BitmapData &append(uint8_t c);
117  RawData &append(uint16_t c);
118 private:
119  class Private;
120  RawData::Private *d;
121 };
122 
123 
124 typedef std::unique_ptr<RawData> RawDataPtr;
125 
126 }
127 
128 /*
129  Local Variables:
130  mode:c++
131  c-file-style:"stroustrup"
132  c-file-offsets:((innamespace . 0))
133  indent-tabs-mode:nil
134  fill-column:80
135  End:
136 */
137 #endif
Represent some bitmap data.
Definition: bitmapdata.hpp:30
size_t size() const
Get the size of the data.
Definition: bitmapdata.cpp:120
Info on the mosaic for the Colour Filter Array.
Definition: mosaicinfo.hpp:33
Represent camera raw data.
Definition: rawdata.hpp:38
void swap(RawData &with)
Definition: rawdata.cpp:282
const double * getColourMatrix1(uint32_t &size) const
Definition: rawdata.cpp:248
uint32_t activeAreaX() const
Definition: rawdata.cpp:209
RawData & append(uint16_t c)
Definition: rawdata.cpp:355
const MosaicInfo * mosaicInfo() const
Definition: rawdata.cpp:335
::or_error getRenderedImage(BitmapData &bitmapdata, uint32_t options)
Definition: rawdata.cpp:131
const double * getColourMatrix2(uint32_t &size) const
Definition: rawdata.cpp:265
virtual void setDimensions(uint32_t x, uint32_t y) override
Set the pixel dimensions of the bitmap.
Definition: rawdata.cpp:297
or_cfa_pattern
CFA pattern types.
Definition: consts.h:94
or_error
Error codes returned by libopenraw.
Definition: consts.h:42
Global namespace for libopenraw.
Definition: arwfile.cpp:29