Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesdna/DNA_color_types.h
| Show All 18 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup DNA | * \ingroup DNA | ||||
| */ | */ | ||||
| #ifndef __DNA_COLOR_TYPES_H__ | #ifndef __DNA_COLOR_TYPES_H__ | ||||
| #define __DNA_COLOR_TYPES_H__ | #define __DNA_COLOR_TYPES_H__ | ||||
| #include "DNA_defs.h" | |||||
| #include "DNA_vec_types.h" | #include "DNA_vec_types.h" | ||||
| /* general defines for kernel functions */ | /* general defines for kernel functions */ | ||||
| #define CM_RESOL 32 | #define CM_RESOL 32 | ||||
| #define CM_TABLE 256 | #define CM_TABLE 256 | ||||
| #define CM_TABLEDIV (1.0f / 256.0f) | #define CM_TABLEDIV (1.0f / 256.0f) | ||||
| #define CM_TOT 4 | #define CM_TOT 4 | ||||
| typedef struct CurveMapPoint { | typedef struct CurveMapPoint { | ||||
| float x, y; | float x, y; | ||||
| /** Shorty for result lookup. */ | /** Shorty for result lookup. */ | ||||
| short flag, shorty; | short flag, shorty; | ||||
| } CurveMapPoint; | } CurveMapPoint; | ||||
| /* curvepoint->flag */ | /* curvepoint->flag */ | ||||
| enum { | enum { | ||||
| CUMA_SELECT = (1 << 0), | CUMA_SELECT = (1 << 0), | ||||
| CUMA_HANDLE_VECTOR = (1 << 1), | CUMA_HANDLE_VECTOR = (1 << 1), | ||||
| CUMA_HANDLE_AUTO_ANIM = (1 << 2), | CUMA_HANDLE_AUTO_ANIM = (1 << 2), | ||||
| }; | }; | ||||
| typedef struct CurveMap { | typedef struct CurveMap { | ||||
| short totpoint, flag; | short totpoint; | ||||
| short flag DNA_DEPRECATED; | |||||
| /** Quick multiply value for reading table. */ | /** Quick multiply value for reading table. */ | ||||
| float range; | float range; | ||||
| /** The x-axis range for the table. */ | /** The x-axis range for the table. */ | ||||
| float mintable, maxtable; | float mintable, maxtable; | ||||
| /** For extrapolated curves, the direction vector. */ | /** For extrapolated curves, the direction vector. */ | ||||
| float ext_in[2], ext_out[2]; | float ext_in[2], ext_out[2]; | ||||
| /** Actual curve. */ | /** Actual curve. */ | ||||
| CurveMapPoint *curve; | CurveMapPoint *curve; | ||||
| /** Display and evaluate table. */ | /** Display and evaluate table. */ | ||||
| CurveMapPoint *table; | CurveMapPoint *table; | ||||
| /** For RGB curves, premulled table. */ | /** For RGB curves, premulled table. */ | ||||
| CurveMapPoint *premultable; | CurveMapPoint *premultable; | ||||
| /** For RGB curves, premulled extrapolation vector. */ | /** For RGB curves, premulled extrapolation vector. */ | ||||
| float premul_ext_in[2]; | float premul_ext_in[2]; | ||||
| float premul_ext_out[2]; | float premul_ext_out[2]; | ||||
| } CurveMap; | } CurveMap; | ||||
| /* cuma->flag */ | |||||
| #define CUMA_EXTEND_EXTRAPOLATE 1 | |||||
| typedef struct CurveMapping { | typedef struct CurveMapping { | ||||
| /** Cur; for buttons, to show active curve. */ | /** Cur; for buttons, to show active curve. */ | ||||
| int flag, cur; | int flag, cur; | ||||
| int preset; | int preset; | ||||
| int changed_timestamp; | int changed_timestamp; | ||||
| /** Current rect, clip rect (is default rect too). */ | /** Current rect, clip rect (is default rect too). */ | ||||
| rctf curr, clipr; | rctf curr, clipr; | ||||
| /** Max 4 builtin curves per mapping struct now. */ | /** Max 4 builtin curves per mapping struct now. */ | ||||
| CurveMap cm[4]; | CurveMap cm[4]; | ||||
| /** Black/white point (black[0] abused for current frame). */ | /** Black/white point (black[0] abused for current frame). */ | ||||
| float black[3], white[3]; | float black[3], white[3]; | ||||
| /** Black/white point multiply value, for speed. */ | /** Black/white point multiply value, for speed. */ | ||||
| float bwmul[3]; | float bwmul[3]; | ||||
| /** Sample values, if flag set it draws line and intersection. */ | /** Sample values, if flag set it draws line and intersection. */ | ||||
| float sample[3]; | float sample[3]; | ||||
| short tone; | short tone; | ||||
| char _pad[6]; | char _pad[6]; | ||||
| } CurveMapping; | } CurveMapping; | ||||
| /* cumapping->flag */ | /* CurveMapping.flag */ | ||||
| #define CUMA_DO_CLIP (1 << 0) | typedef enum eCurveMappingFlags { | ||||
| #define CUMA_PREMULLED (1 << 1) | CUMA_DO_CLIP = (1 << 0), | ||||
| #define CUMA_DRAW_CFRA (1 << 2) | CUMA_PREMULLED = (1 << 1), | ||||
| #define CUMA_DRAW_SAMPLE (1 << 3) | CUMA_DRAW_CFRA = (1 << 2), | ||||
| CUMA_DRAW_SAMPLE = (1 << 3), | |||||
| /* The curve is extended by extrapolation. When not set the curve is extended | |||||
| * Horizontally */ | |||||
| CUMA_EXTEND_EXTRAPOLATE = (1 << 4), | |||||
| } eCurveMappingFlags; | |||||
| /* cumapping->preset */ | /* cumapping->preset */ | ||||
| typedef enum eCurveMappingPreset { | typedef enum eCurveMappingPreset { | ||||
| CURVE_PRESET_LINE = 0, | CURVE_PRESET_LINE = 0, | ||||
| CURVE_PRESET_SHARP = 1, | CURVE_PRESET_SHARP = 1, | ||||
| CURVE_PRESET_SMOOTH = 2, | CURVE_PRESET_SMOOTH = 2, | ||||
| CURVE_PRESET_MAX = 3, | CURVE_PRESET_MAX = 3, | ||||
| CURVE_PRESET_MID9 = 4, | CURVE_PRESET_MID9 = 4, | ||||
| ▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines | |||||