libopenraw
cfapattern.cpp
1/*
2 * libopenraw - cfapattern.cpp
3 *
4 * Copyright (C) 2016 Hubert Figuiere
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 <libopenraw/cfapattern.h>
22
23#include "cfapattern.hpp"
24
25extern "C" {
26
27or_cfa_pattern
28or_cfapattern_get_type(ORCfaPatternRef pattern)
29{
30 return reinterpret_cast<const OpenRaw::CfaPattern*>(pattern)->patternType();
31}
32
33const uint8_t *
34or_cfapattern_get_pattern(ORCfaPatternRef pattern, uint16_t *count)
35{
36 // TODO check parameters.
37 auto pat = reinterpret_cast<const OpenRaw::CfaPattern*>(pattern);
38 return pat->patternPattern(*count);
39}
40
41}
42