libopenraw  0.3.7
mosaicinfo.hpp
1 /*
2  * libopenraw - mosaicinfo.hpp
3  *
4  * Copyright (C) 2012-2020 Hubert Figuière
5  *
6  * This library is free software: you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3 of
9  * the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
21 #pragma once
22 
23 #include <stdint.h>
24 #include <libopenraw/consts.h>
25 
26 namespace OpenRaw {
27 
33 {
34 public:
35  virtual ~MosaicInfo();
36 
38  void setSize(uint16_t x, uint16_t y);
40  void getSize(uint16_t &x, uint16_t &y) const;
41 
43  bool isCFA() const;
44 
46  bool is2by2Rgb() const;
47 
58  const uint8_t* patternPattern(uint16_t& count) const;
59 
63  static const MosaicInfo* twoByTwoPattern(::or_cfa_pattern);
64 
65 protected:
66  MosaicInfo();
72  MosaicInfo(::or_cfa_pattern pattern, uint16_t width, uint16_t height);
73 
79  void setPatternPattern(const uint8_t* pattern, uint16_t count);
80 
81  MosaicInfo(const MosaicInfo &) = delete;
82  MosaicInfo& operator=(const MosaicInfo&) = delete;
83 
85  void setPatternType(::or_cfa_pattern pattern);
86 
87  class Private;
88 
91 };
92 
94 }
95 /*
96  Local Variables:
97  mode:c++
98  c-file-style:"stroustrup"
99  c-file-offsets:((innamespace . 0))
100  tab-width:2
101  c-basic-offset:2
102  indent-tabs-mode:nil
103  fill-column:80
104  End:
105 */
Info on the mosaic for the Colour Filter Array.
Definition: mosaicinfo.hpp:33
void setSize(uint16_t x, uint16_t y)
Set the pattern size.
Definition: mosaicinfo.cpp:142
void setPatternType(::or_cfa_pattern pattern)
Set the pattern type.
Definition: mosaicinfo.cpp:189
::or_cfa_pattern patternType() const
Definition: mosaicinfo.cpp:199
Private * d
Private data.
Definition: mosaicinfo.hpp:87
void getSize(uint16_t &x, uint16_t &y) const
Get the pattern size.
Definition: mosaicinfo.cpp:154
bool isCFA() const
Return of the mosaic is a Color Filter Array.
void setPatternPattern(const uint8_t *pattern, uint16_t count)
Set the pattern pattern.
Definition: mosaicinfo.cpp:167
static const MosaicInfo * twoByTwoPattern(::or_cfa_pattern)
Factory to return a singleton instance of the right pattern.
Definition: mosaicinfo.cpp:84
const uint8_t * patternPattern(uint16_t &count) const
Return the pattern's pattern.
Definition: mosaicinfo.cpp:178
bool is2by2Rgb() const
Return if the pattern is 2x2 RGB.
Definition: mosaicinfo.cpp:160
or_cfa_pattern
CFA pattern types.
Definition: consts.h:94
Global namespace for libopenraw.
Definition: arwfile.cpp:29