Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/colormanagement.c
| Show First 20 Lines • Show All 1,023 Lines • ▼ Show 20 Lines | void IMB_colormanagement_init_default_view_settings( | ||||
| view_settings->gamma = 1.0f; | view_settings->gamma = 1.0f; | ||||
| view_settings->exposure = 0.0f; | view_settings->exposure = 0.0f; | ||||
| view_settings->curve_mapping = NULL; | view_settings->curve_mapping = NULL; | ||||
| } | } | ||||
| static void curve_mapping_apply_pixel(CurveMapping *curve_mapping, float *pixel, int channels) | static void curve_mapping_apply_pixel(CurveMapping *curve_mapping, float *pixel, int channels) | ||||
| { | { | ||||
| if (channels == 1) { | if (channels == 1) { | ||||
| pixel[0] = BKE_curvemap_evaluateF(curve_mapping->cm, pixel[0]); | pixel[0] = BKE_curvemap_evaluateF(curve_mapping, curve_mapping->cm, pixel[0]); | ||||
| } | } | ||||
| else if (channels == 2) { | else if (channels == 2) { | ||||
| pixel[0] = BKE_curvemap_evaluateF(curve_mapping->cm, pixel[0]); | pixel[0] = BKE_curvemap_evaluateF(curve_mapping, curve_mapping->cm, pixel[0]); | ||||
| pixel[1] = BKE_curvemap_evaluateF(curve_mapping->cm, pixel[1]); | pixel[1] = BKE_curvemap_evaluateF(curve_mapping, curve_mapping->cm, pixel[1]); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_curvemapping_evaluate_premulRGBF(curve_mapping, pixel, pixel); | BKE_curvemapping_evaluate_premulRGBF(curve_mapping, pixel, pixel); | ||||
| } | } | ||||
| } | } | ||||
| void colorspace_set_default_role(char *colorspace, int size, int role) | void colorspace_set_default_role(char *colorspace, int size, int role) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 2,854 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| int i; | int i; | ||||
| BKE_curvemapping_initialize(curve_mapping); | BKE_curvemapping_initialize(curve_mapping); | ||||
| BKE_curvemapping_premultiply(curve_mapping, false); | BKE_curvemapping_premultiply(curve_mapping, false); | ||||
| BKE_curvemapping_table_RGBA( | BKE_curvemapping_table_RGBA( | ||||
| curve_mapping, &curve_mapping_settings->lut, &curve_mapping_settings->lut_size); | curve_mapping, &curve_mapping_settings->lut, &curve_mapping_settings->lut_size); | ||||
| curve_mapping_settings->use_extend_extrapolate = (curve_mapping->flag & | |||||
| CUMA_EXTEND_EXTRAPOLATE) != 0; | |||||
| for (i = 0; i < 4; i++) { | for (i = 0; i < 4; i++) { | ||||
| CurveMap *cuma = curve_mapping->cm + i; | CurveMap *cuma = curve_mapping->cm + i; | ||||
| curve_mapping_settings->use_extend_extrapolate[i] = (cuma->flag & CUMA_EXTEND_EXTRAPOLATE) != | |||||
| 0; | |||||
| curve_mapping_settings->range[i] = cuma->range; | curve_mapping_settings->range[i] = cuma->range; | ||||
| curve_mapping_settings->mintable[i] = cuma->mintable; | curve_mapping_settings->mintable[i] = cuma->mintable; | ||||
| curve_mapping_settings->ext_in_x[i] = cuma->ext_in[0]; | curve_mapping_settings->ext_in_x[i] = cuma->ext_in[0]; | ||||
| curve_mapping_settings->ext_in_y[i] = cuma->ext_in[1]; | curve_mapping_settings->ext_in_y[i] = cuma->ext_in[1]; | ||||
| curve_mapping_settings->ext_out_x[i] = cuma->ext_out[0]; | curve_mapping_settings->ext_out_x[i] = cuma->ext_out[0]; | ||||
| curve_mapping_settings->ext_out_y[i] = cuma->ext_out[1]; | curve_mapping_settings->ext_out_y[i] = cuma->ext_out[1]; | ||||
| curve_mapping_settings->first_x[i] = cuma->table[0].x; | curve_mapping_settings->first_x[i] = cuma->table[0].x; | ||||
| curve_mapping_settings->first_y[i] = cuma->table[0].y; | curve_mapping_settings->first_y[i] = cuma->table[0].y; | ||||
| ▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines | |||||