libgimpprint API Reference: dither-eventone.c File Reference

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

# src/main/dither-eventone.c File Reference

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

## Data Structures
struct | distance_t
struct | eventone_t
struct | shade_segment
## 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
void | free_eventone_data (stpi_dither_t *d)
void | et_setup (stpi_dither_t *d)
int | et_initializer (stpi_dither_t *d, int duplicate_line, int zero_mask)
void | advance_eventone_pre (shade_distance_t *sp, eventone_t *et, int x)
void | eventone_update (stpi_dither_channel_t *dc, eventone_t *et, int x, int direction)
void | diffuse_error (stpi_dither_channel_t *dc, eventone_t *et, int x, int direction)
int | eventone_adjust (stpi_dither_channel_t *dc, eventone_t *et, int dither_point, unsigned int desired)
int | unitone_adjust (stpi_dither_channel_t *dc, eventone_t *et, int dither_point, unsigned int desired)
void | find_segment (stpi_dither_channel_t *dc, unsigned inkval, stpi_ink_defn_t *lower, stpi_ink_defn_t *upper)
int | find_segment_and_ditherpoint (stpi_dither_channel_t *dc, unsigned inkval, stpi_ink_defn_t *lower, stpi_ink_defn_t *upper)
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

| Referenced by advance_eventone_pre(), et_setup(), eventone_adjust(), eventone_update(), free_eventone_data(), stpi_dither_et(), stpi_dither_ut(), and unitone_adjust().

## Function Documentation

void advance_eventone_pre | ( | shade_distance_t * | sp,
|  | eventone_t * | et,
|  | int | x
| ) | `[inline, static]`

| Definition at line 215 of file dither-eventone.c. References eventone_t::d2x, shade_segment::dis, distance_t::dx, shade_segment::et_dis, distance_t::r_sq, and shade_distance_t. Referenced by stpi_dither_et(), and stpi_dither_ut().

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 dither_channel::errs, MAX_SPREAD, stpi_dither_channel_t, and dither_channel::v. Referenced by stpi_dither_et(), and stpi_dither_ut().

int et_initializer | ( | stpi_dither_t * | d,
|  | int | duplicate_line,
|  | int | zero_mask
| ) | `[static]`

| Definition at line 178 of file dither-eventone.c. References dither::aux_data, CHANNEL, CHANNEL_COUNT, dither::dst_width, eventone_t::dummy_channel, dither_channel::errs, et_setup(), dither::last_line_was_empty, stpi_dither_t, and dither_channel::v. Referenced by stpi_dither_et(), and stpi_dither_ut().

void et_setup | ( | stpi_dither_t * | d | ) | `[static]`

| Definition at line 101 of file dither-eventone.c. References eventone_t::aspect, dither::aux_data, dither_channel::aux_data, dither::aux_freefunc, CHANNEL, CHANNEL_COUNT, eventone_t::d2x, eventone_t::d2y, eventone_t::d_sq, D_UNITONE, eventone_t::diff_factor, shade_segment::dis, dither::dither_matrix, dither_channel::dithermat, dither::dst_width, 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_distance_t, shade_segment::share_this_channel, stp_dither_matrix_clone(), stp_malloc(), stp_zalloc(), stpi_dither_channel_t, stpi_dither_t, dither::stpi_dither_type, dither::transition_matrix, eventone_t::unitone_aspect, UNITONE_C2, dither::x_aspect, and dither::y_aspect. Referenced by et_initializer().

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 eventone_t::aspect, dither_channel::aux_data, shade_segment::dis, EVEN_C1, distance_t::r_sq, shade_distance_t, and stpi_dither_channel_t. Referenced by stpi_dither_et(), and stpi_dither_ut().

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 dither_channel::aux_data, eventone_t::d2y, shade_segment::dis, distance_t::dx, distance_t::dy, shade_segment::et_dis, distance_t::r_sq, shade_distance_t, and stpi_dither_channel_t. Referenced by stpi_dither_et(), and stpi_dither_ut().

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, dither_channel::ink_list, dither_channel::nlevels, ink_defn::range, stpi_dither_channel_t, stpi_ink_defn_t, and ink_defn::value. Referenced by find_segment_and_ditherpoint().

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(), ink_defn::range, stpi_dither_channel_t, and stpi_ink_defn_t. Referenced by stpi_dither_et(), and stpi_dither_ut().

void free_eventone_data | ( | stpi_dither_t * | d | ) | `[static]`

| Definition at line 76 of file dither-eventone.c. References dither_channel::aux_data, dither::aux_data, CHANNEL, CHANNEL_COUNT, eventone_t::dummy_channel, shade_segment::et_dis, shade_distance_t, STP_SAFE_FREE, stpi_dither_channel_destroy(), stpi_dither_channel_t, and stpi_dither_t. Referenced by et_setup().

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. References ink_defn::bits, dither::ptr_offset, stpi_dither_t, and stpi_ink_defn_t. 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(), shade_distance_t, dither::src_width, stp_get_component_data(), stp_vars_t, stpi_dither_channel_t, stpi_dither_reverse_row_ends(), stpi_dither_t, dither::stpi_dither_type, stpi_ink_defn_t, and dither_channel::v. Referenced by stpi_dither_ut().

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_distance_t, shade_segment::share_this_channel, dither::src_width, stp_get_component_data(), stp_vars_t, stpi_dither_channel_t, stpi_dither_et(), stpi_dither_reverse_row_ends(), stpi_dither_t, dither::stpi_dither_type, stpi_ink_defn_t, unitone_adjust(), shade_segment::upper, and dither_channel::v.

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 dither_channel::aux_data, shade_segment::dis, distance_t::r_sq, shade_distance_t, stpi_dither_channel_t, eventone_t::unitone_aspect, and UNITONE_C1. Referenced by stpi_dither_ut().