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

print-dither-matrices.c File Reference

#include <gutenprint/gutenprint.h>
#include "gutenprint-internal.h"
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "dither-impl.h"

Go to the source code of this file.

Defines

#define MATRIX_POINT(m, x, y, x_size, y_size)   ((m)[(((x) + (x_size)) % (x_size)) + ((x_size) * (((y) + (y_size)) % (y_size)))])

Functions

static unsigned gcd (unsigned a, unsigned b)
static int calc_ordered_point (unsigned x, unsigned y, int steps, int multiplier, int size, const unsigned *map)
static int is_po2 (size_t i)
void stp_dither_matrix_iterated_init (stp_dither_matrix_impl_t *mat, size_t size, size_t expt, const unsigned *array)
void stp_dither_matrix_shear (stp_dither_matrix_impl_t *mat, int x_shear, int y_shear)
int stp_dither_matrix_validate_array (const stp_array_t *array)
void stp_dither_matrix_init_from_dither_array (stp_dither_matrix_impl_t *mat, const stp_array_t *array, int transpose)
void stp_dither_matrix_init (stp_dither_matrix_impl_t *mat, int x_size, int y_size, const unsigned int *array, int transpose, int prescaled)
void stp_dither_matrix_init_short (stp_dither_matrix_impl_t *mat, int x_size, int y_size, const unsigned short *array, int transpose, int prescaled)
void stp_dither_matrix_destroy (stp_dither_matrix_impl_t *mat)
void stp_dither_matrix_clone (const stp_dither_matrix_impl_t *src, stp_dither_matrix_impl_t *dest, int x_offset, int y_offset)
void stp_dither_matrix_copy (const stp_dither_matrix_impl_t *src, stp_dither_matrix_impl_t *dest)
void stp_dither_matrix_scale_exponentially (stp_dither_matrix_impl_t *mat, double exponent)
void stp_dither_matrix_set_row (stp_dither_matrix_impl_t *mat, int y)
static void preinit_matrix (stp_vars_t *v)
static void postinit_matrix (stp_vars_t *v, int x_shear, int y_shear)
void stp_dither_set_iterated_matrix (stp_vars_t *v, size_t edge, size_t iterations, const unsigned *data, int prescaled, int x_shear, int y_shear)
void stp_dither_set_matrix (stp_vars_t *v, const stp_dither_matrix_generic_t *matrix, int transposed, int x_shear, int y_shear)
void stp_dither_set_matrix_from_dither_array (stp_vars_t *v, const stp_array_t *array, int transpose)
void stp_dither_set_transition (stp_vars_t *v, double exponent)
static stp_xml_dither_cache_tstp_xml_dither_cache_get (int x, int y)
static void stp_xml_dither_cache_set (int x, int y, const char *filename)
static int stp_xml_process_dither_matrix (stp_mxml_node_t *dm, const char *file)
static stp_array_tstpi_dither_array_create_from_xmltree (stp_mxml_node_t *dm)
static stp_array_txml_doc_get_dither_array (stp_mxml_node_t *doc)
static stp_array_tstpi_dither_array_create_from_file (const char *file)
static stp_array_tstp_xml_get_dither_array (int x, int y)
void stpi_init_dither (void)
stp_array_tstp_find_standard_dither_array (int x_aspect, int y_aspect)

Variables

static stp_list_tdither_matrix_cache = NULL


Define Documentation

#define MATRIX_POINT m,
x,
y,
x_size,
y_size   )     ((m)[(((x) + (x_size)) % (x_size)) + ((x_size) * (((y) + (y_size)) % (y_size)))])
 

Definition at line 128 of file print-dither-matrices.c.

Referenced by stp_dither_matrix_shear().


Function Documentation

static int calc_ordered_point unsigned  x,
unsigned  y,
int  steps,
int  multiplier,
int  size,
const unsigned *  map
[inline, static]
 

Definition at line 65 of file print-dither-matrices.c.

Referenced by stp_dither_matrix_iterated_init().

static unsigned gcd unsigned  a,
unsigned  b
[static]
 

Definition at line 45 of file print-dither-matrices.c.

static int is_po2 size_t  i  )  [static]
 

Definition at line 88 of file print-dither-matrices.c.

Referenced by stp_dither_matrix_init(), stp_dither_matrix_init_from_dither_array(), stp_dither_matrix_init_short(), and stp_dither_matrix_iterated_init().

static void postinit_matrix stp_vars_t v,
int  x_shear,
int  y_shear
[static]
 

Definition at line 356 of file print-dither-matrices.c.

References CHANNEL, CHANNEL_COUNT, dither::dither_matrix, stp_dither_matrix_clone(), stp_dither_matrix_shear(), stp_dither_set_transition(), stp_get_component_data(), dither::transition, dither_matrix_impl::x_size, and dither_matrix_impl::y_size.

Referenced by stp_dither_set_iterated_matrix(), stp_dither_set_matrix(), and stp_dither_set_matrix_from_dither_array().

static void preinit_matrix stp_vars_t v  )  [static]
 

Definition at line 346 of file print-dither-matrices.c.

References CHANNEL, CHANNEL_COUNT, dither::dither_matrix, stp_dither_matrix_destroy(), and stp_get_component_data().

Referenced by stp_dither_set_iterated_matrix(), stp_dither_set_matrix(), and stp_dither_set_matrix_from_dither_array().

void stp_dither_matrix_clone const stp_dither_matrix_impl_t src,
stp_dither_matrix_impl_t dest,
int  x_offset,
int  y_offset
 

Definition at line 281 of file print-dither-matrices.c.

Referenced by et_setup(), initialize_channel(), postinit_matrix(), stp_dither_set_transition(), and stpi_dither_finalize().

void stp_dither_matrix_copy const stp_dither_matrix_impl_t src,
stp_dither_matrix_impl_t dest
 

Definition at line 302 of file print-dither-matrices.c.

References stp_malloc().

Referenced by stp_dither_set_transition().

void stp_dither_matrix_destroy stp_dither_matrix_impl_t mat  ) 
 

Definition at line 267 of file print-dither-matrices.c.

References stp_free().

Referenced by preinit_matrix(), stp_dither_set_transition(), stpi_dither_channel_destroy(), and stpi_dither_free().

void stp_dither_matrix_init stp_dither_matrix_impl_t mat,
int  x_size,
int  y_size,
const unsigned int *  array,
int  transpose,
int  prescaled
 

Definition at line 200 of file print-dither-matrices.c.

References is_po2(), and stp_malloc().

Referenced by stp_dither_set_matrix().

void stp_dither_matrix_init_from_dither_array stp_dither_matrix_impl_t mat,
const stp_array_t array,
int  transpose
 

Definition at line 162 of file print-dither-matrices.c.

References is_po2(), stp_array_get_sequence(), stp_array_get_size(), stp_malloc(), and stp_sequence_get_ushort_data().

Referenced by stp_dither_set_matrix_from_dither_array().

void stp_dither_matrix_init_short stp_dither_matrix_impl_t mat,
int  x_size,
int  y_size,
const unsigned short *  array,
int  transpose,
int  prescaled
 

Definition at line 233 of file print-dither-matrices.c.

References is_po2(), and stp_malloc().

Referenced by stp_dither_set_matrix().

void stp_dither_matrix_iterated_init stp_dither_matrix_impl_t mat,
size_t  size,
size_t  expt,
const unsigned *  array
 

Definition at line 96 of file print-dither-matrices.c.

References calc_ordered_point(), is_po2(), and stp_malloc().

Referenced by stp_dither_set_iterated_matrix().

void stp_dither_matrix_scale_exponentially stp_dither_matrix_impl_t mat,
double  exponent
 

Definition at line 325 of file print-dither-matrices.c.

Referenced by stp_dither_set_transition().

void stp_dither_matrix_set_row stp_dither_matrix_impl_t mat,
int  y
 

Definition at line 338 of file print-dither-matrices.c.

Referenced by stp_dither_internal().

void stp_dither_matrix_shear stp_dither_matrix_impl_t mat,
int  x_shear,
int  y_shear
 

Definition at line 132 of file print-dither-matrices.c.

References MATRIX_POINT, stp_free(), and stp_malloc().

Referenced by postinit_matrix().

int stp_dither_matrix_validate_array const stp_array_t array  ) 
 

Definition at line 150 of file print-dither-matrices.c.

References stp_array_get_sequence(), and stp_sequence_get_bounds().

Referenced by stp_dither_init().

void stp_dither_set_iterated_matrix stp_vars_t v,
size_t  edge,
size_t  iterations,
const unsigned *  data,
int  prescaled,
int  x_shear,
int  y_shear
 

Definition at line 379 of file print-dither-matrices.c.

References dither::dither_matrix, postinit_matrix(), preinit_matrix(), stp_dither_matrix_iterated_init(), and stp_get_component_data().

Referenced by stp_dither_init().

void stp_dither_set_matrix stp_vars_t v,
const stp_dither_matrix_generic_t matrix,
int  transposed,
int  x_shear,
int  y_shear
 

Definition at line 390 of file print-dither-matrices.c.

References dither::dither_matrix, postinit_matrix(), preinit_matrix(), stp_dither_matrix_init(), stp_dither_matrix_init_short(), and stp_get_component_data().

void stp_dither_set_matrix_from_dither_array stp_vars_t v,
const stp_array_t array,
int  transpose
 

Definition at line 409 of file print-dither-matrices.c.

References dither::dither_matrix, postinit_matrix(), preinit_matrix(), stp_dither_matrix_init_from_dither_array(), and stp_get_component_data().

Referenced by stp_dither_init().

void stp_dither_set_transition stp_vars_t v,
double  exponent
 

Definition at line 420 of file print-dither-matrices.c.

References CHANNEL, CHANNEL_COUNT, dither::dither_matrix, stp_dither_matrix_clone(), stp_dither_matrix_copy(), stp_dither_matrix_destroy(), stp_dither_matrix_scale_exponentially(), stp_get_component_data(), dither::transition, dither::transition_matrix, dither_matrix_impl::x_size, and dither_matrix_impl::y_size.

Referenced by postinit_matrix(), and stp_dither_init().

stp_array_t* stp_find_standard_dither_array int  x_aspect,
int  y_aspect
 

Definition at line 683 of file print-dither-matrices.c.

References gcd(), and stp_xml_get_dither_array().

Referenced by stp_dither_init().

static stp_xml_dither_cache_t* stp_xml_dither_cache_get int  x,
int  y
[static]
 

Definition at line 457 of file print-dither-matrices.c.

References dither_matrix_cache, STP_DBG_XML, stp_deprintf(), stp_list_get_start(), stp_list_item_get_data(), and stp_list_item_next().

Referenced by stp_xml_dither_cache_set(), and stp_xml_get_dither_array().

static void stp_xml_dither_cache_set int  x,
int  y,
const char *  filename
[static]
 

Definition at line 489 of file print-dither-matrices.c.

References assert, stp_xml_dither_cache_t::dither_array, dither_matrix_cache, stp_xml_dither_cache_t::filename, STP_DBG_XML, stp_deprintf(), stp_list_create(), stp_list_item_create(), stp_malloc(), stp_strdup(), stp_xml_dither_cache_get(), stp_xml_exit(), stp_xml_init(), stp_xml_dither_cache_t::x, and stp_xml_dither_cache_t::y.

Referenced by stp_xml_process_dither_matrix().

static stp_array_t* stp_xml_get_dither_array int  x,
int  y
[static]
 

Definition at line 648 of file print-dither-matrices.c.

References stp_xml_dither_cache_t::dither_array, stp_xml_dither_cache_t::filename, stp_array_create_copy(), stp_xml_dither_cache_get(), stp_xml_parse_file_named(), and stpi_dither_array_create_from_file().

Referenced by stp_find_standard_dither_array().

static int stp_xml_process_dither_matrix stp_mxml_node_t dm,
const char *  file
[static]
 

Definition at line 523 of file print-dither-matrices.c.

References STP_DBG_XML, stp_deprintf(), stp_mxmlElementGetAttr(), stp_xml_dither_cache_set(), and stp_xmlstrtol().

Referenced by stpi_init_dither().

static stp_array_t* stpi_dither_array_create_from_file const char *  file  )  [static]
 

Definition at line 615 of file print-dither-matrices.c.

References STP_DBG_XML, stp_deprintf(), stp_erprintf(), STP_MXML_NO_CALLBACK, stp_mxmlDelete(), stp_mxmlLoadFile(), stp_xml_exit(), stp_xml_init(), and xml_doc_get_dither_array().

Referenced by stp_xml_get_dither_array().

static stp_array_t* stpi_dither_array_create_from_xmltree stp_mxml_node_t dm  )  [static]
 

Definition at line 545 of file print-dither-matrices.c.

References stp_array_create_from_xmltree(), stp_erprintf(), STP_MXML_DESCEND, stp_mxmlElementGetAttr(), stp_mxmlFindElement(), and stp_xmlstrtoul().

Referenced by xml_doc_get_dither_array().

static stp_array_t* xml_doc_get_dither_array stp_mxml_node_t doc  )  [static]
 

Definition at line 585 of file print-dither-matrices.c.

References stp_mxml_node_s::child, stp_xml_get_node(), and stpi_dither_array_create_from_xmltree().

Referenced by stpi_dither_array_create_from_file().


Variable Documentation

stp_list_t* dither_matrix_cache = NULL [static]
 

Definition at line 446 of file print-dither-matrices.c.

Referenced by stp_xml_dither_cache_get(), and stp_xml_dither_cache_set().


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