diff options
Diffstat (limited to 'src/main/print-color.c')
-rw-r--r-- | src/main/print-color.c | 67 |
1 files changed, 44 insertions, 23 deletions
diff --git a/src/main/print-color.c b/src/main/print-color.c index b381667..b6ebb71 100644 --- a/src/main/print-color.c +++ b/src/main/print-color.c @@ -1,5 +1,5 @@ /* - * "$Id: print-color.c,v 1.129 2005/06/30 01:45:19 rlk Exp $" + * "$Id: print-color.c,v 1.131 2005/07/04 00:23:54 rlk Exp $" * * Gutenprint color management module - traditional Gutenprint algorithm. * @@ -282,7 +282,7 @@ static const float_param_t float_parameters[] = N_("Adjust the red gamma"), STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_OUTPUT, STP_PARAMETER_LEVEL_ADVANCED1, 0, 1, 1, 1, 0 - }, 0.0, 4.0, 1.0, CMASK_R, 1 + }, 0.0, 1.0, 1.0, CMASK_R, 1 }, { { @@ -310,6 +310,30 @@ static const float_param_t float_parameters[] = }, { { + "CyanBalance", N_("Cyan Balance"), N_("GrayBalance"), + N_("Adjust the cyan gray balance"), + STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_OUTPUT, + STP_PARAMETER_LEVEL_ADVANCED1, 0, 1, 1, 1, 0 + }, 0.0, 1.0, 1.0, CMASK_C, 1 + }, + { + { + "MagentaBalance", N_("Magenta Balance"), N_("GrayBalance"), + N_("Adjust the magenta gray balance"), + STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_OUTPUT, + STP_PARAMETER_LEVEL_ADVANCED1, 0, 1, 2, 1, 0 + }, 0.0, 1.0, 1.0, CMASK_M, 1 + }, + { + { + "YellowBalance", N_("Yellow Balance"), N_("GrayBalance"), + N_("Adjust the yellow gray balance"), + STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_OUTPUT, + STP_PARAMETER_LEVEL_ADVANCED1, 0, 1, 3, 1, 0 + }, 0.0, 1.0, 1.0, CMASK_Y, 1 + }, + { + { "Saturation", N_("Saturation"), N_("Basic Image Adjustment"), N_("Adjust the saturation (color balance) of the print\n" "Use zero saturation to produce grayscale output " @@ -701,7 +725,6 @@ copy_lut(void *vlut) stp_curve_cache_copy(&(dest->hue_map), &(src->hue_map)); stp_curve_cache_copy(&(dest->lum_map), &(src->lum_map)); stp_curve_cache_copy(&(dest->sat_map), &(src->sat_map)); - stp_curve_cache_copy(&(dest->gcr_curve), &(src->gcr_curve)); /* Don't copy gray_tmp */ /* Don't copy cmy_tmp */ if (src->in_data) @@ -723,7 +746,6 @@ free_lut(void *vlut) stp_curve_free_curve_cache(&(lut->hue_map)); stp_curve_free_curve_cache(&(lut->lum_map)); stp_curve_free_curve_cache(&(lut->sat_map)); - stp_curve_free_curve_cache(&(lut->gcr_curve)); STP_SAFE_FREE(lut->gray_tmp); STP_SAFE_FREE(lut->cmy_tmp); STP_SAFE_FREE(lut->in_data); @@ -799,29 +821,28 @@ static void initialize_gcr_curve(const stp_vars_t *vars) { lut_t *lut = (lut_t *)(stp_get_component_data(vars, "Color")); - if (!stp_curve_cache_get_curve(&(lut->gcr_curve))) + stp_curve_t *curve = NULL; + if (stp_check_curve_parameter(vars, "GCRCurve", STP_PARAMETER_DEFAULTED)) { - if (stp_check_curve_parameter(vars, "GCRCurve", STP_PARAMETER_DEFAULTED)) + double data; + size_t count; + int i; + curve = stp_curve_create_copy(stp_get_curve_parameter(vars, "GCRCurve")); + stp_curve_resample(curve, lut->steps); + count = stp_curve_count_points(curve); + stp_curve_set_bounds(curve, 0.0, 65535.0); + for (i = 0; i < count; i++) { - double data; - size_t count; - int i; - stp_curve_t *curve = - stp_curve_create_copy(stp_get_curve_parameter(vars, "GCRCurve")); - stp_curve_resample(curve, lut->steps); - count = stp_curve_count_points(curve); - stp_curve_set_bounds(curve, 0.0, 65535.0); - for (i = 0; i < count; i++) - { - stp_curve_get_point(curve, i, &data); - data = 65535.0 * data * (double) i / (count - 1); - stp_curve_set_point(curve, i, data); - } - stp_curve_cache_set_curve(&(lut->gcr_curve), curve); + stp_curve_get_point(curve, i, &data); + data = 65535.0 * data * (double) i / (count - 1); + stp_curve_set_point(curve, i, data); } - else - stp_curve_cache_set_curve(&(lut->gcr_curve), compute_gcr_curve(vars)); } + else + curve = compute_gcr_curve(vars); + stp_channel_set_gcr_curve((stp_vars_t *)vars, curve); + if (curve) + stp_curve_destroy(curve); } /* |