summaryrefslogtreecommitdiff
path: root/gpr/source/lib/gpr_sdk/public/gpr_tuning_info.h
blob: 677d68d61871c77044218fcd8e642445ba3cb262 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*! @file gpr_tuning_info.h
 *
 *  @brief Declaration of gpr_tuning_info object and associated functions
 *
 *  GPR API can be invoked by simply including this header file.
 *  This file includes all other header files that are needed.
 *
 *  (C) Copyright 2018 GoPro Inc (http://gopro.com/).
 *
 *  Licensed under either:
 *  - Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0
 *  - MIT license, http://opensource.org/licenses/MIT
 *  at your option.
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

#ifndef GPR_TUNING_INFO_H
#define GPR_TUNING_INFO_H

#include "gpr_platform.h"

#ifdef __cplusplus
    extern "C" {
#endif
        
    typedef enum
    {
        RAW_CHANNEL_RED = 0,
        
        RAW_CHANNEL_GREEN_EVEN = 1,
        
        RAW_CHANNEL_GREEN_ODD = 2,
        
        RAW_CHANNEL_BLUE = 3,
        
    } GPR_RAW_CHANNEL;

    typedef enum
    {
        PIXEL_FORMAT_RGGB_12 = 0,                           // RGGB 12bit pixels packed into 16bits

        PIXEL_FORMAT_RGGB_12P = 1,                          // RGGB 12bit pixels packed into 12bits
        
        PIXEL_FORMAT_RGGB_14 = 2,                           // RGGB 14bit pixels packed into 16bits
        
        PIXEL_FORMAT_GBRG_12 = 3,                           // GBRG 12bit pixels packed into 16bits
        
        PIXEL_FORMAT_GBRG_12P = 4,                          // GBRG 12bit pixels packed into 12bits
        
    } GPR_PIXEL_FORMAT;

    typedef enum
    {
        ORIENTATION_NORMAL      = 0,
        
        ORIENTATION_MIRROR      = 4,
        
        ORIENTATION_DEFAULT     = ORIENTATION_MIRROR,
        
    } GPR_ORIENTATION;

    typedef struct
    {
        int32_t r_black;
        
        int32_t g_r_black;
        
        int32_t g_b_black;
        
        int32_t b_black;
        
    } gpr_static_black_level;

    typedef struct
    {
        uint16_t    iso_value;
        
        uint32_t    shutter_time;
        
    } gpr_auto_exposure_info;

    typedef struct
    {
        int32_t level_red;
        
        int32_t level_green_even;
        
        int32_t level_green_odd;
        
        int32_t level_blue;
        
    } gpr_saturation_level;

    typedef struct
    {
        float_t r_gain;
        
        float_t g_gain;
        
        float_t b_gain;
        
    } gpr_white_balance_gains;

    typedef struct
    {
        char        *buffers[4];
        
        uint32_t    size;
        
    } gpr_gain_map;

    typedef struct
    {
        GPR_ORIENTATION         orientation;
        
        gpr_static_black_level  static_black_level;

        gpr_saturation_level    dgain_saturation_level;
        
        gpr_white_balance_gains wb_gains;
        
        gpr_auto_exposure_info  ae_info;
        
        double                  noise_scale;
        double                  noise_offset;
        
        double                  warp_red_coefficient;
        double                  warp_blue_coefficient;
        
        gpr_gain_map            gain_map;
        
        GPR_PIXEL_FORMAT        pixel_format;

    } gpr_tuning_info;

    int32_t gpr_tuning_info_get_dgain_saturation_level(const gpr_tuning_info* x, GPR_RAW_CHANNEL channel);

    void gpr_tuning_info_set_defaults( gpr_tuning_info* x );

#ifdef __cplusplus
    }
#endif

#endif // GPR_TUNING_INFO_H