Blender  V2.93
DNA_color_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2006 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_defs.h"
27 #include "DNA_vec_types.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /* general defines for kernel functions */
34 #define CM_RESOL 32
35 #define CM_TABLE 256
36 #define CM_TABLEDIV (1.0f / 256.0f)
37 
38 #define CM_TOT 4
39 
40 typedef struct CurveMapPoint {
41  float x, y;
43  short flag, shorty;
45 
46 /* curvepoint->flag */
47 enum {
48  CUMA_SELECT = (1 << 0),
49  CUMA_HANDLE_VECTOR = (1 << 1),
51 };
52 
53 typedef struct CurveMap {
54  short totpoint;
55  short flag DNA_DEPRECATED;
56 
58  float range;
62  float ext_in[2], ext_out[2];
67 
71  float premul_ext_in[2];
72  float premul_ext_out[2];
74 
75 typedef struct CurveMapping {
77  int flag, cur;
78  int preset;
80 
83 
87  float black[3], white[3];
89  float bwmul[3];
90 
92  float sample[3];
93 
94  short tone;
95  char _pad[6];
97 
98 /* CurveMapping.flag */
99 typedef enum eCurveMappingFlags {
100  CUMA_DO_CLIP = (1 << 0),
101  CUMA_PREMULLED = (1 << 1),
102  CUMA_DRAW_CFRA = (1 << 2),
103  CUMA_DRAW_SAMPLE = (1 << 3),
104 
105  /* The curve is extended by extrapolation. When not set the curve is extended
106  * Horizontally */
109 
110 /* cumapping->preset */
111 typedef enum eCurveMappingPreset {
122 
123 /* CurveMapping->tone */
124 typedef enum eCurveMappingTone {
128 
129 /* histogram->mode */
130 enum {
137 };
138 
139 enum {
140  HISTO_FLAG_LINE = (1 << 0),
142 };
143 
144 typedef struct Histogram {
145  int channels;
147  float data_luma[256];
148  float data_r[256];
149  float data_g[256];
150  float data_b[256];
151  float data_a[256];
152  float xmax, ymax;
153  short mode;
154  short flag;
155  int height;
156 
157  /* sample line only */
158  /* image coords src -> dst */
159  float co[2][2];
161 
162 typedef struct Scopes {
163  int ok;
166  float accuracy;
173  float minmax[3][2];
174  struct Histogram hist;
175  float *waveform_1;
176  float *waveform_2;
177  float *waveform_3;
178  float *vecscope;
180  char _pad[4];
182 
183 /* scopes->wavefrm_mode */
184 #define SCOPES_WAVEFRM_LUMA 0
185 #define SCOPES_WAVEFRM_RGB_PARADE 1
186 #define SCOPES_WAVEFRM_YCC_601 2
187 #define SCOPES_WAVEFRM_YCC_709 3
188 #define SCOPES_WAVEFRM_YCC_JPEG 4
189 #define SCOPES_WAVEFRM_RGB 5
190 
191 typedef struct ColorManagedViewSettings {
192  int flag;
193  char _pad[4];
196  char look[64];
198  char view_transform[64];
200  float exposure;
202  float gamma;
205  void *_pad2;
207 
209  char display_device[64];
211 
214  char name[64];
216 
217 /* ColorManagedViewSettings->flag */
218 enum {
220 };
221 
222 #ifdef __cplusplus
223 }
224 #endif
eCurveMappingFlags
@ CUMA_PREMULLED
@ CUMA_EXTEND_EXTRAPOLATE
@ CUMA_DO_CLIP
@ CUMA_DRAW_CFRA
@ CUMA_DRAW_SAMPLE
struct CurveMapping CurveMapping
@ COLORMANAGE_VIEW_USE_CURVES
struct Histogram Histogram
@ HISTO_FLAG_LINE
@ HISTO_FLAG_SAMPLELINE
@ CUMA_HANDLE_AUTO_ANIM
@ CUMA_SELECT
@ CUMA_HANDLE_VECTOR
struct CurveMap CurveMap
@ HISTO_MODE_B
@ HISTO_MODE_G
@ HISTO_MODE_LUMA
@ HISTO_MODE_RGB
@ HISTO_MODE_ALPHA
@ HISTO_MODE_R
struct ColorManagedViewSettings ColorManagedViewSettings
struct CurveMapPoint CurveMapPoint
struct Scopes Scopes
struct ColorManagedColorspaceSettings ColorManagedColorspaceSettings
struct ColorManagedDisplaySettings ColorManagedDisplaySettings
eCurveMappingTone
@ CURVE_TONE_STANDARD
@ CURVE_TONE_FILMLIKE
eCurveMappingPreset
@ CURVE_PRESET_ROOT
@ CURVE_PRESET_GAUSS
@ CURVE_PRESET_SMOOTH
@ CURVE_PRESET_ROUND
@ CURVE_PRESET_LINE
@ CURVE_PRESET_SHARP
@ CURVE_PRESET_MID9
@ CURVE_PRESET_BELL
@ CURVE_PRESET_MAX
struct CurveMapping * curve_mapping
CurveMapPoint * table
float maxtable
short flag DNA_DEPRECATED
short totpoint
CurveMapPoint * curve
CurveMapPoint * premultable
float mintable
float ext_out[2]
float ext_in[2]
float premul_ext_out[2]
float premul_ext_in[2]
float sample[3]
float bwmul[3]
float white[3]
CurveMap cm[4]
float black[3]
float data_a[256]
float data_luma[256]
float data_r[256]
float co[2][2]
float data_b[256]
float data_g[256]
int waveform_tot
int wavefrm_height
int wavefrm_mode
float wavefrm_yfac
float * waveform_3
char _pad[4]
float * waveform_2
int sample_full
int vecscope_height
float wavefrm_alpha
float minmax[3][2]
float vecscope_alpha
float * waveform_1
int sample_lines
float * vecscope
float accuracy
struct Histogram hist