Blender  V2.59
DNA_color_types.h
Go to the documentation of this file.
00001 /*
00002  * $Id: DNA_color_types.h 34941 2011-02-17 20:48:12Z jesterking $ 
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2006 Blender Foundation.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL/BL DUAL LICENSE BLOCK *****
00028  */
00029 #ifndef DNA_COLOR_TYPES_H
00030 #define DNA_COLOR_TYPES_H
00031 
00036 #include "DNA_vec_types.h"
00037 
00038 /* general defines for kernel functions */
00039 #define CM_RESOL 32
00040 #define CM_TABLE 256
00041 #define CM_TABLEDIV             (1.0f/256.0f)
00042 
00043 #define CM_TOT  4
00044 
00045 typedef struct CurveMapPoint {
00046         float x, y;
00047         short flag, shorty;             /* shorty for result lookup */
00048 } CurveMapPoint;
00049 
00050 /* curvepoint->flag */
00051 #define CUMA_SELECT             1
00052 #define CUMA_VECTOR             2
00053 
00054 typedef struct CurveMap {
00055         short totpoint, flag;
00056         
00057         float range;                                    /* quick multiply value for reading table */
00058         float mintable, maxtable;               /* the x-axis range for the table */
00059         float ext_in[2], ext_out[2];    /* for extrapolated curves, the direction vector */
00060         CurveMapPoint *curve;                   /* actual curve */
00061         CurveMapPoint *table;                   /* display and evaluate table */
00062         CurveMapPoint *premultable;             /* for RGB curves, premulled table */
00063 } CurveMap;
00064 
00065 /* cuma->flag */
00066 #define CUMA_EXTEND_EXTRAPOLATE 1
00067 
00068 typedef struct CurveMapping {
00069         int flag, cur;                                  /* cur; for buttons, to show active curve */
00070         int preset;
00071         int changed_timestamp;
00072         
00073         rctf curr, clipr;                               /* current rect, clip rect (is default rect too) */
00074         
00075         CurveMap cm[4];                                 /* max 4 builtin curves per mapping struct now */
00076         float black[3], white[3];               /* black/white point (black[0] abused for current frame) */
00077         float bwmul[3];                                 /* black/white point multiply value, for speed */
00078         
00079         float sample[3];                                /* sample values, if flag set it draws line and intersection */
00080 } CurveMapping;
00081 
00082 /* cumapping->flag */
00083 #define CUMA_DO_CLIP                    1
00084 #define CUMA_PREMULLED                  2
00085 #define CUMA_DRAW_CFRA                  4
00086 #define CUMA_DRAW_SAMPLE                8
00087 
00088 /* cumapping->preset */
00089 typedef enum CurveMappingPreset {
00090         CURVE_PRESET_LINE,
00091         CURVE_PRESET_SHARP,
00092         CURVE_PRESET_SMOOTH,
00093         CURVE_PRESET_MAX,
00094         CURVE_PRESET_MID9,
00095         CURVE_PRESET_ROUND,
00096         CURVE_PRESET_ROOT,
00097 } CurveMappingPreset;
00098 
00099 /* histogram->mode */
00100 #define HISTO_MODE_LUMA 0
00101 #define HISTO_MODE_RGB  1
00102 #define HISTO_MODE_R    2
00103 #define HISTO_MODE_G    3
00104 #define HISTO_MODE_B    4
00105 
00106 typedef struct Histogram {
00107         int channels;
00108         int x_resolution;
00109         float data_r[256];
00110         float data_g[256];
00111         float data_b[256];
00112         float data_luma[256];
00113         float xmax, ymax;
00114         int mode;
00115         int height;
00116 } Histogram;
00117 
00118 struct ImBuf;
00119 
00120 typedef struct Scopes {
00121         int ok;
00122         int sample_full;
00123         int sample_lines;
00124         float accuracy;
00125         int wavefrm_mode;
00126         float wavefrm_alpha;
00127         float wavefrm_yfac;
00128         int wavefrm_height;
00129         float vecscope_alpha;
00130         int vecscope_height;
00131         float minmax[3][2];
00132         struct Histogram hist;
00133         float *waveform_1;
00134         float *waveform_2;
00135         float *waveform_3;
00136         float *vecscope;
00137         int waveform_tot;
00138         int pad;
00139 } Scopes;
00140 
00141 /* scopes->wavefrm_mode */
00142 #define SCOPES_WAVEFRM_LUMA             0
00143 #define SCOPES_WAVEFRM_RGB              1
00144 #define SCOPES_WAVEFRM_YCC_601  2
00145 #define SCOPES_WAVEFRM_YCC_709  3
00146 #define SCOPES_WAVEFRM_YCC_JPEG 4
00147 
00148 
00149 #endif
00150