Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

dither-main.c File Reference

#include <gutenprint/gutenprint.h>
#include "gutenprint-internal.h"
#include <gutenprint/gutenprint-intl-internal.h>
#include <math.h>
#include <string.h>
#include "dither-impl.h"
#include "generic-options.h"

Go to the source code of this file.

Defines

#define RETURN_DITHERFUNC(func, v)

Functions

stp_parameter_list_t stp_dither_list_parameters (const stp_vars_t *v)
void stp_dither_describe_parameter (const stp_vars_t *v, const char *name, stp_parameter_t *description)
static stpi_ditherfunc_tstpi_set_dither_function (stp_vars_t *v)
void stp_dither_set_adaptive_limit (stp_vars_t *v, double limit)
void stp_dither_set_ink_spread (stp_vars_t *v, int spread)
void stp_dither_set_randomizer (stp_vars_t *v, int i, double val)
static void stpi_dither_free (void *vd)
void stp_dither_init (stp_vars_t *v, stp_image_t *image, int out_width, int xdpi, int ydpi)
void stpi_dither_reverse_row_ends (stpi_dither_t *d)
int stp_dither_get_first_position (stp_vars_t *v, int color, int subchannel)
int stp_dither_get_last_position (stp_vars_t *v, int color, int subchannel)
int * stpi_dither_get_errline (stpi_dither_t *d, int row, int color)
void stp_dither_internal (stp_vars_t *v, int row, const unsigned short *input, int duplicate_line, int zero_mask, const unsigned char *mask)
void stp_dither (stp_vars_t *v, int row, int duplicate_line, int zero_mask, const unsigned char *mask)

Variables

static const stpi_dither_algorithm_t dither_algos []
static const int num_dither_algos = sizeof(dither_algos)/sizeof(stpi_dither_algorithm_t)
static const unsigned sq2 []
static const stp_parameter_t dither_parameters []
static const int dither_parameter_count


Define Documentation

#define RETURN_DITHERFUNC func,
 ) 
 

Value:

do                                                                      \
{                                                                       \
  stp_dprintf(STP_DBG_COLORFUNC, v, "ditherfunc %s\n", #func);  \
  return (func);                                                        \
} while (0)

Definition at line 162 of file dither-main.c.

Referenced by stpi_set_dither_function().


Function Documentation

void stp_dither stp_vars_t v,
int  row,
int  duplicate_line,
int  zero_mask,
const unsigned char *  mask
 

Definition at line 500 of file dither-main.c.

References stp_channel_get_output(), and stp_dither_internal().

Referenced by canon_do_print(), escp2_print_data(), lexmark_do_print(), and pcl_do_print().

void stp_dither_describe_parameter const stp_vars_t v,
const char *  name,
stp_parameter_t description
 

Definition at line 117 of file dither-main.c.

References stp_parameter_t::bounds, stp_parameter_t::dbl, stp_parameter_t::deflt, dither_algos, dither_parameters, stp_double_bound_t::lower, stp_param_string_t::name, stpi_dither_algorithm_t::name, num_dither_algos, stp_parameter_t::p_type, stp_check_string_parameter(), stp_fill_parameter_settings(), stp_get_string_parameter(), STP_PARAMETER_ACTIVE, STP_PARAMETER_LEVEL_BASIC, STP_PARAMETER_TYPE_INVALID, stp_string_list_add_string(), stp_string_list_create(), stp_string_list_param(), stpi_get_quality_by_name(), stp_parameter_t::str, stpi_dither_algorithm_t::text, and stp_double_bound_t::upper.

Referenced by stp_describe_parameter().

int stp_dither_get_first_position stp_vars_t v,
int  color,
int  subchannel
 

Definition at line 437 of file dither-main.c.

References CHANNEL, stp_get_component_data(), and stpi_dither_translate_channel().

int stp_dither_get_last_position stp_vars_t v,
int  color,
int  subchannel
 

Definition at line 447 of file dither-main.c.

References CHANNEL, stp_get_component_data(), and stpi_dither_translate_channel().

Referenced by pcl_printfunc().

void stp_dither_init stp_vars_t v,
stp_image_t image,
int  out_width,
int  xdpi,
int  ydpi
 

Definition at line 346 of file dither-main.c.

References dither::adaptive_limit, dither::channel_count, dither::d_cutoff, D_EVENTONE, D_FAST, D_PREDITHERED, D_VERY_FAST, DITHER_FAST_STEPS, dither::ditherfunc, dither::dst_width, ERROR_ROWS, dither::error_rows, dither::finalized, dither::offset0_table, dither::offset1_table, sq2, dither::src_width, stp_abort(), stp_allocate_component_data(), stp_array_destroy(), stp_check_array_parameter(), stp_check_int_parameter(), stp_dither_matrix_validate_array(), stp_dither_set_ink_spread(), stp_dither_set_iterated_matrix(), stp_dither_set_matrix_from_dither_array(), stp_dither_set_transition(), stp_eprintf(), stp_find_standard_dither_array(), stp_get_array_parameter(), stp_get_int_parameter(), stp_image_width(), STP_PARAMETER_ACTIVE, stp_zalloc(), stpi_dither_free(), dither::stpi_dither_type, stpi_set_dither_function(), dither::transition, dither::x_aspect, and dither::y_aspect.

Referenced by canon_do_print(), escp2_print_page(), lexmark_do_print(), and pcl_do_print().

void stp_dither_internal stp_vars_t v,
int  row,
const unsigned short *  input,
int  duplicate_line,
int  zero_mask,
const unsigned char *  mask
 

Definition at line 474 of file dither-main.c.

References CHANNEL, CHANNEL_COUNT, dither::dither_matrix, dither::ditherfunc, dither::dst_width, dither_channel::ptr, dither::ptr_offset, dither_channel::row_ends, stp_dither_matrix_set_row(), stp_get_component_data(), stpi_dither_finalize(), and dither::transition_matrix.

Referenced by stp_dither().

stp_parameter_list_t stp_dither_list_parameters const stp_vars_t v  ) 
 

Definition at line 107 of file dither-main.c.

References dither_parameter_count, dither_parameters, stp_parameter_list_add_param(), and stp_parameter_list_create().

Referenced by stp_get_parameter_list().

void stp_dither_set_adaptive_limit stp_vars_t v,
double  limit
 

Definition at line 284 of file dither-main.c.

References dither::adaptive_limit, and stp_get_component_data().

void stp_dither_set_ink_spread stp_vars_t v,
int  spread
 

Definition at line 291 of file dither-main.c.

References dither::offset0_table, dither::offset1_table, dither::spread, dither::spread_mask, stp_get_component_data(), stp_malloc(), and STP_SAFE_FREE.

Referenced by stp_dither_init().

void stp_dither_set_randomizer stp_vars_t v,
int  i,
double  val
 

Definition at line 318 of file dither-main.c.

References CHANNEL, CHANNEL_COUNT, and stp_get_component_data().

static void stpi_dither_free void *  vd  )  [static]
 

Definition at line 327 of file dither-main.c.

References dither::aux_freefunc, dither::channel, CHANNEL, CHANNEL_COUNT, dither::channel_index, dither::dither_matrix, dither::offset0_table, dither::offset1_table, stp_dither_matrix_destroy(), stp_free(), STP_SAFE_FREE, stpi_dither_channel_destroy(), dither::subchannel_count, and dither::transition_matrix.

Referenced by stp_dither_init().

int* stpi_dither_get_errline stpi_dither_t d,
int  row,
int  color
 

Definition at line 457 of file dither-main.c.

References CHANNEL, CHANNEL_COUNT, dither_channel::error_rows, dither_channel::errs, MAX_SPREAD, and stp_zalloc().

Referenced by shared_ed_initializer().

void stpi_dither_reverse_row_ends stpi_dither_t d  ) 
 

Definition at line 424 of file dither-main.c.

References CHANNEL, and CHANNEL_COUNT.

Referenced by stpi_dither_ed(), stpi_dither_et(), and stpi_dither_ut().

static stpi_ditherfunc_t* stpi_set_dither_function stp_vars_t v  )  [static]
 

Definition at line 170 of file dither-main.c.

References _, D_ADAPTIVE_HYBRID, D_EVENTONE, D_FAST, D_HYBRID_EVENTONE, D_HYBRID_UNITONE, D_ORDERED, D_PREDITHERED, D_UNITONE, D_VERY_FAST, dither_algos, stpi_dither_algorithm_t::id, num_dither_algos, stpi_quality_t::quality_level, RETURN_DITHERFUNC, stp_check_string_parameter(), stp_get_component_data(), stp_get_string_parameter(), STP_PARAMETER_ACTIVE, stpi_dither_ed, stpi_dither_et, stpi_dither_ordered, stpi_dither_predithered, dither::stpi_dither_type, stpi_dither_ut, stpi_dither_very_fast, stpi_get_quality_by_name(), dither::x_aspect, and dither::y_aspect.

Referenced by stp_dither_init().


Variable Documentation

const stpi_dither_algorithm_t dither_algos[] [static]
 

Initial value:

{
  
  
  { "None",           N_ ("Default"),                -1 },
  { "EvenTone",       N_ ("EvenTone"),               D_EVENTONE },
  { "HybridEvenTone", N_ ("Hybrid EvenTone"),        D_HYBRID_EVENTONE },
  




  { "Adaptive",       N_ ("Adaptive Hybrid"),        D_ADAPTIVE_HYBRID },
  { "Ordered",        N_ ("Ordered"),                D_ORDERED },
  { "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 }
}

Definition at line 42 of file dither-main.c.

Referenced by stp_dither_describe_parameter(), and stpi_set_dither_function().

const int dither_parameter_count [static]
 

Initial value:

sizeof(dither_parameters) / sizeof(const stp_parameter_t)

Definition at line 103 of file dither-main.c.

Referenced by stp_dither_list_parameters().

const stp_parameter_t dither_parameters[] [static]
 

Initial value:

{
  {
    "Density", N_("Density"), N_("Output Level Adjustment"),
    N_("Adjust the density (amount of ink) of the print. "
       "Reduce the density if the ink bleeds through the "
       "paper or smears; increase the density if black "
       "regions are not solid."),
    STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_OUTPUT,
    STP_PARAMETER_LEVEL_ADVANCED, 0, 1, -1, 1, 0
  },
  {
    "DitherAlgorithm", N_("Dither Algorithm"), N_("Screening Adjustment"),
    N_("Choose the dither algorithm to be used.\n"
       "Adaptive Hybrid usually produces the best all-around quality.\n"
       "EvenTone is a new, experimental algorithm that often produces excellent results.\n"
       "Ordered is faster and produces almost as good quality on photographs.\n"
       "Fast and Very Fast are considerably faster, and work well for text and line art.\n"
       "Hybrid Floyd-Steinberg generally produces inferior output."),
    STP_PARAMETER_TYPE_STRING_LIST, STP_PARAMETER_CLASS_OUTPUT,
    STP_PARAMETER_LEVEL_ADVANCED, 1, 1, -1, 1, 0
  },
}

Definition at line 79 of file dither-main.c.

Referenced by stp_dither_describe_parameter(), and stp_dither_list_parameters().

const int num_dither_algos = sizeof(dither_algos)/sizeof(stpi_dither_algorithm_t) [static]
 

Definition at line 65 of file dither-main.c.

Referenced by stp_dither_describe_parameter(), and stpi_set_dither_function().

const unsigned sq2[] [static]
 

Initial value:

{
  0, 2,
  3, 1
}

Definition at line 73 of file dither-main.c.

Referenced by stp_dither_init().


Generated on Thu Feb 10 19:29:31 2005 for libgutenprint API Reference by  doxygen 1.4.1