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

dither-eventone.c File Reference

#include <gutenprint/gutenprint.h>
#include "gutenprint-internal.h"
#include <gutenprint/gutenprint-intl-internal.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include "dither-impl.h"
#include "dither-inlined-functions.h"

Go to the source code of this file.

Defines

#define EVEN_C1   256
#define EVEN_C2   (EVEN_C1 * sqrt(3.0) / 2.0)
#define UNITONE_C1   16384
#define UNITONE_C2   (UNITONE_C1 * sqrt(3.0) / 2.0)

Typedefs

typedef shade_segment shade_distance_t

Functions

static void free_eventone_data (stpi_dither_t *d)
static void et_setup (stpi_dither_t *d)
static int et_initializer (stpi_dither_t *d, int duplicate_line, int zero_mask)
static void advance_eventone_pre (shade_distance_t *sp, eventone_t *et, int x)
static void eventone_update (stpi_dither_channel_t *dc, eventone_t *et, int x, int direction)
static void diffuse_error (stpi_dither_channel_t *dc, eventone_t *et, int x, int direction)
static int eventone_adjust (stpi_dither_channel_t *dc, eventone_t *et, int dither_point, unsigned int desired)
static int unitone_adjust (stpi_dither_channel_t *dc, eventone_t *et, int dither_point, unsigned int desired)
static void find_segment (stpi_dither_channel_t *dc, unsigned inkval, stpi_ink_defn_t *lower, stpi_ink_defn_t *upper)
static int find_segment_and_ditherpoint (stpi_dither_channel_t *dc, unsigned inkval, stpi_ink_defn_t *lower, stpi_ink_defn_t *upper)
static void print_ink (stpi_dither_t *d, unsigned char *tptr, const stpi_ink_defn_t *ink, unsigned char bit, int length)
void stpi_dither_et (stp_vars_t *v, int row, const unsigned short *raw, int duplicate_line, int zero_mask, const unsigned char *mask)
void stpi_dither_ut (stp_vars_t *v, int row, const unsigned short *raw, int duplicate_line, int zero_mask, const unsigned char *mask)


Define Documentation

#define EVEN_C1   256
 

Definition at line 70 of file dither-eventone.c.

Referenced by eventone_adjust().

#define EVEN_C2   (EVEN_C1 * sqrt(3.0) / 2.0)
 

Definition at line 71 of file dither-eventone.c.

Referenced by et_setup().

#define UNITONE_C1   16384
 

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

Referenced by unitone_adjust().

#define UNITONE_C2   (UNITONE_C1 * sqrt(3.0) / 2.0)
 

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

Referenced by et_setup().


Typedef Documentation

typedef struct shade_segment shade_distance_t
 


Function Documentation

static void advance_eventone_pre shade_distance_t sp,
eventone_t et,
int  x
[inline, static]
 

Definition at line 215 of file dither-eventone.c.

Referenced by stpi_dither_et(), and stpi_dither_ut().

static void diffuse_error stpi_dither_channel_t dc,
eventone_t et,
int  x,
int  direction
[inline, static]
 

Definition at line 249 of file dither-eventone.c.

References MAX_SPREAD.

Referenced by stpi_dither_et(), and stpi_dither_ut().

static int et_initializer stpi_dither_t d,
int  duplicate_line,
int  zero_mask
[static]
 

Definition at line 178 of file dither-eventone.c.

References CHANNEL, CHANNEL_COUNT, eventone_t::dummy_channel, dither_channel::errs, et_setup(), and dither_channel::v.

Referenced by stpi_dither_et(), and stpi_dither_ut().

static void et_setup stpi_dither_t d  )  [static]
 

Definition at line 101 of file dither-eventone.c.

References eventone_t::aspect, dither_channel::aux_data, CHANNEL, CHANNEL_COUNT, eventone_t::d2x, eventone_t::d2y, eventone_t::d_sq, D_UNITONE, eventone_t::diff_factor, shade_segment::dis, dither_channel::dithermat, eventone_t::dummy_channel, distance_t::dx, distance_t::dy, dither_channel::error_rows, dither_channel::errs, shade_segment::et_dis, EVEN_C2, free_eventone_data(), MAX_SPREAD, eventone_t::physical_aspect, dither_channel::pick, distance_t::r_sq, shade_segment::share_this_channel, stp_dither_matrix_clone(), stp_malloc(), stp_zalloc(), eventone_t::unitone_aspect, and UNITONE_C2.

Referenced by et_initializer().

static int eventone_adjust stpi_dither_channel_t dc,
eventone_t et,
int  dither_point,
unsigned int  desired
[inline, static]
 

Definition at line 273 of file dither-eventone.c.

References shade_segment::dis, EVEN_C1, and distance_t::r_sq.

Referenced by stpi_dither_et(), and stpi_dither_ut().

static void eventone_update stpi_dither_channel_t dc,
eventone_t et,
int  x,
int  direction
[inline, static]
 

Definition at line 228 of file dither-eventone.c.

References shade_segment::dis, distance_t::dx, distance_t::dy, shade_segment::et_dis, and distance_t::r_sq.

Referenced by stpi_dither_et(), and stpi_dither_ut().

static void find_segment stpi_dither_channel_t dc,
unsigned  inkval,
stpi_ink_defn_t lower,
stpi_ink_defn_t upper
[inline, static]
 

Definition at line 313 of file dither-eventone.c.

References ink_defn::bits, ink_defn::range, and ink_defn::value.

Referenced by find_segment_and_ditherpoint().

static int find_segment_and_ditherpoint stpi_dither_channel_t dc,
unsigned  inkval,
stpi_ink_defn_t lower,
stpi_ink_defn_t upper
[inline, static]
 

Definition at line 342 of file dither-eventone.c.

References find_segment().

Referenced by stpi_dither_et(), and stpi_dither_ut().

static void free_eventone_data stpi_dither_t d  )  [static]
 

Definition at line 76 of file dither-eventone.c.

References dither_channel::aux_data, CHANNEL, CHANNEL_COUNT, eventone_t::dummy_channel, shade_segment::et_dis, STP_SAFE_FREE, and stpi_dither_channel_destroy().

Referenced by et_setup().

static void print_ink stpi_dither_t d,
unsigned char *  tptr,
const stpi_ink_defn_t ink,
unsigned char  bit,
int  length
[inline, static]
 

Definition at line 355 of file dither-eventone.c.

Referenced by stpi_dither_et(), and stpi_dither_ut().

void stpi_dither_et stp_vars_t v,
int  row,
const unsigned short *  raw,
int  duplicate_line,
int  zero_mask,
const unsigned char *  mask
 

Definition at line 386 of file dither-eventone.c.

References advance_eventone_pre(), ADVANCE_REVERSE, ADVANCE_UNIDIRECTIONAL, dither_channel::aux_data, dither::aux_data, ink_defn::bits, CHANNEL, CHANNEL_COUNT, D_ORDERED_BASE, eventone_t::d_sq, diffuse_error(), shade_segment::dis, dither::dither_matrix, ditherpoint(), dither::dst_width, dither_channel::errs, et_initializer(), eventone_adjust(), eventone_update(), find_segment_and_ditherpoint(), MAX_SPREAD, print_ink(), dither_channel::ptr, dither::ptr_offset, set_row_ends(), dither::src_width, stp_get_component_data(), stpi_dither_et, stpi_dither_reverse_row_ends(), dither::stpi_dither_type, and dither_channel::v.

void stpi_dither_ut stp_vars_t v,
int  row,
const unsigned short *  raw,
int  duplicate_line,
int  zero_mask,
const unsigned char *  mask
 

Definition at line 499 of file dither-eventone.c.

References advance_eventone_pre(), ADVANCE_REVERSE, ADVANCE_UNIDIRECTIONAL, dither_channel::aux_data, dither::aux_data, dither_channel::b, ink_defn::bits, CHANNEL, CHANNEL_COUNT, D_ORDERED_BASE, eventone_t::d_sq, diffuse_error(), shade_segment::dis, dither::dither_matrix, ditherpoint(), dither::dst_width, eventone_t::dummy_channel, dither_channel::errs, et_initializer(), eventone_adjust(), eventone_update(), find_segment_and_ditherpoint(), shade_segment::lower, MAX_SPREAD, dither_channel::o, print_ink(), dither_channel::ptr, dither::ptr_offset, set_row_ends(), shade_segment::share_this_channel, dither::src_width, stp_get_component_data(), stpi_dither_et, stpi_dither_reverse_row_ends(), dither::stpi_dither_type, stpi_dither_ut, unitone_adjust(), shade_segment::upper, and dither_channel::v.

static int unitone_adjust stpi_dither_channel_t dc,
eventone_t et,
int  dither_point,
unsigned int  desired
[inline, static]
 

Definition at line 294 of file dither-eventone.c.

References shade_segment::dis, distance_t::r_sq, and UNITONE_C1.

Referenced by stpi_dither_ut().


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