diff options
Diffstat (limited to 'src/main/dither-main.c')
-rw-r--r-- | src/main/dither-main.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/dither-main.c b/src/main/dither-main.c index 77211c3..b9ba80a 100644 --- a/src/main/dither-main.c +++ b/src/main/dither-main.c @@ -1,5 +1,5 @@ /* - * "$Id: dither-main.c,v 1.52.8.1 2007/12/15 20:35:44 rlk Exp $" + * "$Id: dither-main.c,v 1.59 2008/02/18 14:20:17 rlk Exp $" * * Dither routine entrypoints * @@ -62,10 +62,13 @@ static const stpi_dither_algorithm_t dither_algos[] = #endif { "Adaptive", N_ ("Adaptive Hybrid"), D_ADAPTIVE_HYBRID }, { "Ordered", N_ ("Ordered"), D_ORDERED }, + { "OrderedNew", N_ ("Ordered New"), D_ORDERED_NEW }, { "Fast", N_ ("Fast"), D_FAST }, { "VeryFast", N_ ("Very Fast"), D_VERY_FAST }, { "Floyd", N_ ("Hybrid Floyd-Steinberg"), D_FLOYD_HYBRID }, - { "Predithered", N_ ("Predithered Input"), D_PREDITHERED } + { "Predithered", N_ ("Predithered Input"), D_PREDITHERED }, + { "Segmented", N_ ("Drop Size Segmented"), D_ORDERED_SEGMENTED }, + { "SegmentedNew", N_ ("Drop Size Segmented New"),D_ORDERED_SEGMENTED_NEW } }; static const int num_dither_algos = sizeof(dither_algos)/sizeof(stpi_dither_algorithm_t); @@ -175,6 +178,9 @@ stpi_set_dither_function(stp_vars_t *v) if (color_correction && strcmp(color_correction, "Predithered") == 0) d->stpi_dither_type = D_PREDITHERED; + else if (color_correction && strcmp(color_correction, "Raw") != 0 && + algorithm && strcmp(algorithm, "Segmented") == 0) + d->stpi_dither_type = D_ORDERED; else if (algorithm && strcmp(algorithm, "None") != 0) { for (i = 0; i < num_dither_algos; i++) @@ -255,6 +261,9 @@ stpi_set_dither_function(stp_vars_t *v) case D_VERY_FAST: RETURN_DITHERFUNC(stpi_dither_very_fast, v); case D_ORDERED: + case D_ORDERED_SEGMENTED: + case D_ORDERED_NEW: + case D_ORDERED_SEGMENTED_NEW: case D_FAST: RETURN_DITHERFUNC(stpi_dither_ordered, v); case D_HYBRID_EVENTONE: @@ -323,7 +332,6 @@ stpi_dither_free(void *vd) STP_SAFE_FREE(d->offset0_table); STP_SAFE_FREE(d->offset1_table); stp_dither_matrix_destroy(&(d->dither_matrix)); - stp_dither_matrix_destroy(&(d->transition_matrix)); stp_free(d->channel); stp_free(d->channel_index); stp_free(d->subchannel_count); @@ -356,7 +364,6 @@ stp_dither_init(stp_vars_t *v, stp_image_t *image, int out_width, d->y_aspect = 1; } d->ditherfunc = stpi_set_dither_function(v); - d->transition = 1.0; d->adaptive_limit = .75 * 65535; /* @@ -399,7 +406,6 @@ stp_dither_init(stp_vars_t *v, stp_image_t *image, int out_width, stp_abort(); } } - stp_dither_set_transition(v, 0.7); d->src_width = in_width; d->dst_width = out_width; @@ -467,7 +473,6 @@ stp_dither_internal(stp_vars_t *v, int row, const unsigned short *input, stpi_dither_t *d = (stpi_dither_t *) stp_get_component_data(v, "Dither"); stpi_dither_finalize(v); stp_dither_matrix_set_row(&(d->dither_matrix), row); - stp_dither_matrix_set_row(&(d->transition_matrix), row); for (i = 0; i < CHANNEL_COUNT(d); i++) { CHANNEL(d, i).ptr = CHANNEL(d, i).ptr; |