Blender V2.61 - r43446

DNA_color_types.h

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