Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

src/main/dither-main.c File Reference

#include <gimp-print/gimp-print.h>
#include "gimp-print-internal.h"
#include <gimp-print/gimp-print-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)
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)
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

const stpi_dither_algorithm_t dither_algos []
const int num_dither_algos = sizeof(dither_algos)/sizeof(stpi_dither_algorithm_t)
const unsigned sq2 []
const stp_parameter_t dither_parameters []
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 155 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 485 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 110 of file dither-main.c.

References stp_parameter_t::bounds, stp_parameter_t::deflt, stp_parameter_t::is_active, stp_param_string_t::name, stpi_dither_algorithm_t::name, num_dither_algos, stp_parameter_t::p_level, 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(), and stpi_dither_algorithm_t::text.

Referenced by stp_describe_parameter().

int stp_dither_get_first_position stp_vars_t   v,
int    color,
int    subchannel
 

Definition at line 422 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 432 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 331 of file dither-main.c.

References dither::adaptive_limit, dither::channel_count, dither::d_cutoff, D_EVENTONE, D_FAST, 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_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 459 of file dither-main.c.

References CHANNEL, CHANNEL_COUNT, dither::dither_matrix, dither::ditherfunc, dither::dst_width, dither::ptr_offset, 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 100 of file dither-main.c.

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

Referenced by stp_get_parameter_list().

void stp_dither_set_adaptive_limit stp_vars_t   v,
double    limit
 

Definition at line 269 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 276 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 303 of file dither-main.c.

References CHANNEL, CHANNEL_COUNT, and stp_get_component_data().

void stpi_dither_free void *    vd [static]
 

Definition at line 312 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 442 of file dither-main.c.

References CHANNEL, CHANNEL_COUNT, dither::dst_width, dither_channel::error_rows, dither::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 409 of file dither-main.c.

References CHANNEL, and CHANNEL_COUNT.

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

stpi_ditherfunc_t* stpi_set_dither_function stp_vars_t   v [static]
 

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

References _, D_ADAPTIVE_HYBRID, D_EVENTONE, D_FAST, D_HYBRID_EVENTONE, D_HYBRID_UNITONE, D_ORDERED, D_UNITONE, D_VERY_FAST, 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, dither::stpi_dither_type, 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 },
  { "UniTone",        N_ ("UniTone"),                D_UNITONE },
  { "HybridUniTone",  N_ ("Hybrid UniTone"),         D_HYBRID_UNITONE },
  { "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 }
}

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

const int dither_parameter_count [static]
 

Initial value:

sizeof(dither_parameters) / sizeof(const stp_parameter_t)

Definition at line 96 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_ADVANCED2, 1, 1, -1, 1, 0
  },
}

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

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

Definition at line 58 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 66 of file dither-main.c.

Referenced by stp_dither_init().


Generated on Wed May 12 20:21:35 2004 for libgimpprint API Reference by doxygen1.2.17