libopenraw  0.3.7
mosaicinfo.cpp
1 /* -*- mode:c++; indent-tabs-mode:nil; c-basic-offset:4; tab-width:4; -*- */
2 /*
3  * libopenraw - mosaicinfo.cpp
4  *
5  * Copyright (C) 2016-2019 Hubert Figuière
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 #include <libopenraw/mosaicinfo.h>
23 
24 #include "capi.h"
25 #include "mosaicinfo.hpp"
26 
27 extern "C" {
28 
29 API_EXPORT or_cfa_pattern
31 {
32  return reinterpret_cast<const OpenRaw::MosaicInfo*>(pattern)->patternType();
33 }
34 
35 API_EXPORT const uint8_t *
36 or_mosaicinfo_get_pattern(ORMosaicInfoRef pattern, uint16_t *count)
37 {
38  // TODO check parameters.
39  auto pat = reinterpret_cast<const OpenRaw::MosaicInfo*>(pattern);
40  return pat->patternPattern(*count);
41 }
42 
43 }
44 
Info on the mosaic for the Colour Filter Array.
Definition: mosaicinfo.hpp:33
const uint8_t * patternPattern(uint16_t &count) const
Return the pattern's pattern.
Definition: mosaicinfo.cpp:178
API_EXPORT or_cfa_pattern or_mosaicinfo_get_type(ORMosaicInfoRef pattern)
Get the type of the mosaic.
Definition: mosaicinfo.cpp:30
const struct _MosaicInfo * ORMosaicInfoRef
A MosaicInfo object.
Definition: mosaicinfo.h:40
API_EXPORT const uint8_t * or_mosaicinfo_get_pattern(ORMosaicInfoRef pattern, uint16_t *count)
Get the pattern.
Definition: mosaicinfo.cpp:36
or_cfa_pattern
CFA pattern types.
Definition: consts.h:94