libopenraw  0.3.7
xtranspattern.cpp
1 /*
2  * libopenraw - xtranspattern.cpp
3  *
4  * Copyright (C) 2015 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 #include <stdint.h>
22 
23 #include <libopenraw/consts.h>
24 
25 #include "xtranspattern.hpp"
26 
27 namespace OpenRaw {
28 namespace Internals {
29 
31 static const uint8_t RED = OR_PATTERN_COLOUR_RED;
32 static const uint8_t GREEN = OR_PATTERN_COLOUR_GREEN;
33 static const uint8_t BLUE = OR_PATTERN_COLOUR_BLUE;
34 
45 static const uint8_t XTRANS_PATTERN[] = {
46  RED, BLUE, GREEN, BLUE, RED, GREEN,
47  GREEN, GREEN, RED, GREEN, GREEN, BLUE,
48  GREEN, GREEN, BLUE, GREEN, GREEN, RED,
49  BLUE, RED, GREEN, RED, BLUE, GREEN,
50  GREEN, GREEN, BLUE, GREEN, GREEN, RED,
51  GREEN, GREEN, RED, GREEN, GREEN, BLUE
52 };
53 
54 XTransPattern::XTransPattern()
55  : MosaicInfo(OR_CFA_PATTERN_NON_RGB22, 6, 6)
56 {
57  setPatternPattern(XTRANS_PATTERN, 36);
58 }
59 
60 const XTransPattern*
61 XTransPattern::xtransPattern()
62 {
63  static const XTransPattern* s_pat = new XTransPattern();
64 
65  return s_pat;
66 }
67 
68 }
69 }
70 
71 /*
72  Local Variables:
73  mode:c++
74  c-file-style:"stroustrup"
75  c-file-offsets:((innamespace . 0))
76  tab-width:2
77  c-basic-offset:2
78  indent-tabs-mode:nil
79  fill-column:80
80  End:
81 */
The X-Trans CMOS 6x6 pattern starting with the Fuji X-Pro1.
@ OR_CFA_PATTERN_NON_RGB22
Definition: consts.h:96
@ OR_PATTERN_COLOUR_RED
Definition: consts.h:106
@ OR_PATTERN_COLOUR_GREEN
Definition: consts.h:107
Global namespace for libopenraw.
Definition: arwfile.cpp:29