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

print-weave.c File Reference

#include <string.h>
#include <gutenprint/gutenprint.h>
#include "gutenprint-internal.h"
#include <gutenprint/gutenprint-intl-internal.h>

Go to the source code of this file.

Defines

#define ASSERTIONS
#define assert(x, v)

Typedefs

typedef stpi_softweave stpi_softweave_t
typedef raw raw_t
typedef cooked cooked_t

Functions

static int gcd (int x, int y)
static void initialize_raw_weave (raw_t *w, int separation, int jets, int oversample, stp_weave_strategy_t strat, stp_vars_t *v)
static void calculate_raw_pass_parameters (raw_t *w, int pass, int *startrow, int *subpass)
static void calculate_raw_row_parameters (raw_t *w, int row, int subpass, int *pass, int *jet, int *startrow)
static void sort_by_start_row (int *map, int *startrows, int count)
static void calculate_stagger (raw_t *w, int *map, int *startrows_stagger, int count)
static void invert_map (int *map, int *stagger, int count, int oldfirstpass, int newfirstpass)
static void make_passmap (raw_t *w, int **map, int **starts, int first_pass_number, int first_pass_to_map, int first_pass_after_map, int first_pass_to_stagger, int first_pass_after_stagger, int first_row_of_maximal_pass, int separations_to_distribute)
static void calculate_pass_map (stp_vars_t *v, cooked_t *w, int pageheight, int firstrow, int lastrow)
static void * initialize_weave_params (int separation, int jets, int oversample, int firstrow, int lastrow, int pageheight, stp_weave_strategy_t strategy, stp_vars_t *v)
static void stpi_destroy_weave_params (void *vw)
static void stpi_calculate_row_parameters (void *vw, int row, int subpass, int *pass, int *jetnum, int *startingrow, int *ophantomrows, int *ojetsused)
static stp_lineoff_tallocate_lineoff (int count, int ncolors)
static stp_lineactive_tallocate_lineactive (int count, int ncolors)
static stp_linecount_tallocate_linecount (int count, int ncolors)
static stp_linebounds_tallocate_linebounds (int count, int ncolors)
static stp_linebufs_tallocate_linebuf (int count, int ncolors)
static void stpi_destroy_weave (void *vsw)
void stp_initialize_weave (stp_vars_t *v, int jets, int sep, int osample, int v_subpasses, int v_subsample, int ncolors, int bitwidth, int linewidth, int line_count, int first_line, int page_height, const int *head_offset, stp_weave_strategy_t weave_strategy, stp_flushfunc flushfunc, stp_fillfunc fillfunc, stp_packfunc pack, stp_compute_linewidth_func compute_linewidth)
static void weave_parameters_by_row (const stp_vars_t *v, const stpi_softweave_t *sw, int row, int vertical_subpass, stp_weave_t *w)
void stp_weave_parameters_by_row (const stp_vars_t *v, int row, int vertical_subpass, stp_weave_t *w)
static stp_lineoff_tstpi_get_lineoffsets (const stp_vars_t *v, const stpi_softweave_t *sw, int row, int subpass, int offset)
static stp_lineactive_tstpi_get_lineactive (const stp_vars_t *v, const stpi_softweave_t *sw, int row, int subpass, int offset)
static stp_linecount_tstpi_get_linecount (const stp_vars_t *v, const stpi_softweave_t *sw, int row, int subpass, int offset)
static stp_linebufs_tstpi_get_linebases (const stp_vars_t *v, const stpi_softweave_t *sw, int row, int subpass, int offset)
static stp_linebounds_tstpi_get_linebounds (const stp_vars_t *v, const stpi_softweave_t *sw, int row, int subpass, int offset)
static stp_pass_tstpi_get_pass_by_row (stp_vars_t *v, const stpi_softweave_t *sw, int row, int subpass, int offset)
stp_lineoff_tstp_get_lineoffsets_by_pass (const stp_vars_t *v, int pass)
stp_lineactive_tstp_get_lineactive_by_pass (const stp_vars_t *v, int pass)
stp_linecount_tstp_get_linecount_by_pass (const stp_vars_t *v, int pass)
const stp_linebufs_tstp_get_linebases_by_pass (const stp_vars_t *v, int pass)
stp_pass_tstp_get_pass_by_pass (const stp_vars_t *v, int pass)
static void check_linebases (stp_vars_t *v, const stpi_softweave_t *sw, int row, int cpass, int head_offset, int color)
void stp_fill_tiff (stp_vars_t *v, int row, int subpass, int width, int missingstartrows, int color)
void stp_fill_uncompressed (stp_vars_t *v, int row, int subpass, int width, int missingstartrows, int color)
int stp_compute_tiff_linewidth (stp_vars_t *v, int n)
int stp_compute_uncompressed_linewidth (stp_vars_t *v, int n)
static void initialize_row (stp_vars_t *v, stpi_softweave_t *sw, int row, int width, unsigned char *const cols[])
static void add_to_row (stp_vars_t *v, stpi_softweave_t *sw, int row, unsigned char *buf, size_t nbytes, int color, int setactive, int h_pass)
static void stpi_flush_passes (stp_vars_t *v, int flushall)
void stp_flush_all (stp_vars_t *v)
static void finalize_row (stp_vars_t *v, int row)
void stp_write_weave (stp_vars_t *v, unsigned char *const cols[])


Define Documentation

#define assert x,
 ) 
 

Value:

do                                                                      \
{                                                                       \
  if (!(x))                                                             \
    {                                                                   \
      stp_eprintf(v, "Assertion %s failed! file %s, line %d.\n",        \
                  #x, __FILE__, __LINE__);                              \
      stp_abort();                                                      \
    }                                                                   \
} while (0)

Definition at line 44 of file print-weave.c.

Referenced by initialize_channel(), make_passmap(), stp_dither_add_channel(), stp_dither_set_inks_full(), stp_xml_dither_cache_set(), and stpi_calculate_row_parameters().

#define ASSERTIONS
 

Definition at line 40 of file print-weave.c.


Typedef Documentation

typedef struct cooked cooked_t
 

typedef struct raw raw_t
 

typedef struct stpi_softweave stpi_softweave_t
 


Function Documentation

static void add_to_row stp_vars_t v,
stpi_softweave_t sw,
int  row,
unsigned char *  buf,
size_t  nbytes,
int  color,
int  setactive,
int  h_pass
[static]
 

Definition at line 1463 of file print-weave.c.

References stp_abort(), stp_eprintf(), stpi_get_lineactive(), stpi_get_linebases(), stpi_get_linecount(), stpi_get_lineoffsets(), stp_lineactive_t::v, stp_linecount_t::v, and stp_lineoff_t::v.

Referenced by stp_write_weave().

static stp_lineactive_t* allocate_lineactive int  count,
int  ncolors
[static]
 

Definition at line 904 of file print-weave.c.

References stp_lineactive_t::ncolors, stp_malloc(), stp_zalloc(), and stp_lineactive_t::v.

Referenced by stp_initialize_weave().

static stp_linebounds_t* allocate_linebounds int  count,
int  ncolors
[static]
 

Definition at line 930 of file print-weave.c.

References stp_linebounds_t::end_pos, stp_linebounds_t::ncolors, stp_linebounds_t::start_pos, stp_malloc(), and stp_zalloc().

Referenced by stp_initialize_weave().

static stp_linebufs_t* allocate_linebuf int  count,
int  ncolors
[static]
 

Definition at line 944 of file print-weave.c.

References stp_linebufs_t::ncolors, stp_malloc(), stp_zalloc(), and stp_linebufs_t::v.

Referenced by stp_initialize_weave().

static stp_linecount_t* allocate_linecount int  count,
int  ncolors
[static]
 

Definition at line 917 of file print-weave.c.

References stp_linecount_t::ncolors, stp_malloc(), stp_zalloc(), and stp_linecount_t::v.

Referenced by stp_initialize_weave().

static stp_lineoff_t* allocate_lineoff int  count,
int  ncolors
[static]
 

Definition at line 891 of file print-weave.c.

References stp_lineoff_t::ncolors, stp_malloc(), stp_zalloc(), and stp_lineoff_t::v.

Referenced by stp_initialize_weave().

static void calculate_pass_map stp_vars_t v,
cooked_t w,
int  pageheight,
int  firstrow,
int  lastrow
[static]
 

Definition at line 492 of file print-weave.c.

References calculate_raw_pass_parameters(), make_passmap(), STP_DBG_WEAVE_PARAMS, and stp_dprintf().

Referenced by initialize_weave_params().

static void calculate_raw_pass_parameters raw_t w,
int  pass,
int *  startrow,
int *  subpass
[static]
 

Definition at line 175 of file print-weave.c.

References STP_WEAVE_ASCENDING, STP_WEAVE_ASCENDING_2X, STP_WEAVE_ASCENDING_3X, STP_WEAVE_DESCENDING, STP_WEAVE_STAGGERED, and STP_WEAVE_ZIGZAG.

Referenced by calculate_pass_map(), calculate_stagger(), and make_passmap().

static void calculate_raw_row_parameters raw_t w,
int  row,
int  subpass,
int *  pass,
int *  jet,
int *  startrow
[static]
 

Definition at line 244 of file print-weave.c.

References STP_WEAVE_ASCENDING, STP_WEAVE_ASCENDING_2X, STP_WEAVE_ASCENDING_3X, STP_WEAVE_DESCENDING, STP_WEAVE_STAGGERED, and STP_WEAVE_ZIGZAG.

Referenced by stpi_calculate_row_parameters().

static void calculate_stagger raw_t w,
int *  map,
int *  startrows_stagger,
int  count
[static]
 

Definition at line 399 of file print-weave.c.

References calculate_raw_pass_parameters().

Referenced by make_passmap().

static void check_linebases stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  cpass,
int  head_offset,
int  color
[static]
 

Definition at line 1296 of file print-weave.c.

References stp_zalloc(), stpi_get_linebases(), and stp_linebufs_t::v.

Referenced by initialize_row().

static void finalize_row stp_vars_t v,
int  row
[static]
 

Definition at line 1516 of file print-weave.c.

References stpi_softweave::head_offset, stpi_softweave::lineno, stpi_softweave::ncolors, stp_weave_t::pass, stp_weave_t::physpassend, STP_DBG_ROWS, stp_dprintf(), stp_get_component_data(), stpi_flush_passes(), stpi_get_linecount(), stp_linecount_t::v, and weave_parameters_by_row().

Referenced by stp_write_weave().

static int gcd int  x,
int  y
[static]
 

Definition at line 59 of file print-weave.c.

static void initialize_raw_weave raw_t w,
int  separation,
int  jets,
int  oversample,
stp_weave_strategy_t  strat,
stp_vars_t v
[static]
 

Definition at line 155 of file print-weave.c.

References gcd().

Referenced by initialize_weave_params().

static void initialize_row stp_vars_t v,
stpi_softweave_t sw,
int  row,
int  width,
unsigned char *const   cols[]
[static]
 

Definition at line 1400 of file print-weave.c.

References check_linebases(), stp_linebounds_t::end_pos, stp_weave_t::jet, stp_weave_t::logicalpassstart, stp_pass_t::logicalpassstart, stp_weave_t::missingstartrows, stp_pass_t::missingstartrows, stp_weave_t::pass, stp_pass_t::pass, stp_weave_t::physpassend, stp_pass_t::physpassend, stp_weave_t::physpassstart, stp_pass_t::physpassstart, stp_linebounds_t::start_pos, stp_eprintf(), stpi_get_lineactive(), stpi_get_linebounds(), stpi_get_linecount(), stpi_get_lineoffsets(), stpi_get_pass_by_row(), stp_pass_t::subpass, stp_linecount_t::v, stp_lineactive_t::v, stp_lineoff_t::v, and weave_parameters_by_row().

Referenced by stp_write_weave().

static void* initialize_weave_params int  separation,
int  jets,
int  oversample,
int  firstrow,
int  lastrow,
int  pageheight,
stp_weave_strategy_t  strategy,
stp_vars_t v
[static]
 

Definition at line 589 of file print-weave.c.

References calculate_pass_map(), initialize_raw_weave(), cooked::rw, and stp_malloc().

Referenced by stp_initialize_weave().

static void invert_map int *  map,
int *  stagger,
int  count,
int  oldfirstpass,
int  newfirstpass
[static]
 

Definition at line 413 of file print-weave.c.

References stp_free(), and stp_malloc().

Referenced by make_passmap().

static void make_passmap raw_t w,
int **  map,
int **  starts,
int  first_pass_number,
int  first_pass_to_map,
int  first_pass_after_map,
int  first_pass_to_stagger,
int  first_pass_after_stagger,
int  first_row_of_maximal_pass,
int  separations_to_distribute
[static]
 

Definition at line 433 of file print-weave.c.

References assert, calculate_raw_pass_parameters(), calculate_stagger(), invert_map(), sort_by_start_row(), and stp_malloc().

Referenced by calculate_pass_map().

static void sort_by_start_row int *  map,
int *  startrows,
int  count
[static]
 

Definition at line 372 of file print-weave.c.

Referenced by make_passmap().

int stp_compute_tiff_linewidth stp_vars_t v,
int  n
 

Definition at line 1384 of file print-weave.c.

References stp_compute_tiff_linewidth.

int stp_compute_uncompressed_linewidth stp_vars_t v,
int  n
 

Definition at line 1394 of file print-weave.c.

References stp_compute_uncompressed_linewidth.

void stp_fill_tiff stp_vars_t v,
int  row,
int  subpass,
int  width,
int  missingstartrows,
int  color
 

Definition at line 1317 of file print-weave.c.

References stpi_softweave::bitwidth, stpi_softweave::head_offset, stp_fill_tiff, stp_get_component_data(), stpi_get_linebases(), stpi_get_linecount(), stpi_get_lineoffsets(), stp_linecount_t::v, stp_lineoff_t::v, and stp_linebufs_t::v.

void stp_fill_uncompressed stp_vars_t v,
int  row,
int  subpass,
int  width,
int  missingstartrows,
int  color
 

Definition at line 1365 of file print-weave.c.

References stpi_softweave::bitwidth, stpi_softweave::head_offset, stp_fill_uncompressed, stp_get_component_data(), stpi_get_linebases(), stpi_get_linecount(), stpi_get_lineoffsets(), stp_linecount_t::v, and stp_lineoff_t::v.

void stp_flush_all stp_vars_t v  ) 
 

Definition at line 1510 of file print-weave.c.

References stpi_flush_passes().

Referenced by escp2_print_page(), and lexmark_do_print().

stp_lineactive_t* stp_get_lineactive_by_pass const stp_vars_t v,
int  pass
 

Definition at line 1264 of file print-weave.c.

References stpi_softweave::lineactive, stp_get_component_data(), and stpi_softweave::vmod.

Referenced by flush_pass(), and stpi_escp2_flush_pass().

const stp_linebufs_t* stp_get_linebases_by_pass const stp_vars_t v,
int  pass
 

Definition at line 1280 of file print-weave.c.

References stpi_softweave::linebases, stp_get_component_data(), and stpi_softweave::vmod.

Referenced by flush_pass(), and stpi_escp2_flush_pass().

stp_linecount_t* stp_get_linecount_by_pass const stp_vars_t v,
int  pass
 

Definition at line 1272 of file print-weave.c.

References stpi_softweave::linecounts, stp_get_component_data(), and stpi_softweave::vmod.

Referenced by flush_pass(), and stpi_escp2_flush_pass().

stp_lineoff_t* stp_get_lineoffsets_by_pass const stp_vars_t v,
int  pass
 

Definition at line 1256 of file print-weave.c.

References stpi_softweave::lineoffsets, stp_get_component_data(), and stpi_softweave::vmod.

Referenced by flush_pass(), and stpi_escp2_flush_pass().

stp_pass_t* stp_get_pass_by_pass const stp_vars_t v,
int  pass
 

Definition at line 1288 of file print-weave.c.

References stpi_softweave::passes, stp_get_component_data(), and stpi_softweave::vmod.

Referenced by flush_pass(), stpi_escp2_flush_pass(), and stpi_flush_passes().

void stp_initialize_weave stp_vars_t v,
int  jets,
int  sep,
int  osample,
int  v_subpasses,
int  v_subsample,
int  ncolors,
int  bitwidth,
int  linewidth,
int  line_count,
int  first_line,
int  page_height,
const int *  head_offset,
stp_weave_strategy_t  weave_strategy,
stp_flushfunc  flushfunc,
stp_fillfunc  fillfunc,
stp_packfunc  pack,
stp_compute_linewidth_func  compute_linewidth
 

Definition at line 1009 of file print-weave.c.

References allocate_lineactive(), allocate_linebounds(), allocate_linebuf(), allocate_linecount(), allocate_lineoff(), stpi_softweave::bitwidth, stpi_softweave::compute_linewidth, stpi_softweave::current_vertical_subpass, stpi_softweave::fillfunc, stpi_softweave::firstline, stpi_softweave::flushfunc, stpi_softweave::head_offset, stpi_softweave::horizontal_weave, stpi_softweave::horizontal_width, initialize_weave_params(), stpi_softweave::jets, stpi_softweave::last_pass, stpi_softweave::last_pass_offset, stpi_softweave::lineactive, stpi_softweave::linebases, stpi_softweave::linebounds, stpi_softweave::linecounts, stpi_softweave::lineno, stpi_softweave::lineoffsets, stpi_softweave::linewidth, stpi_softweave::ncolors, stpi_softweave::oversample, stpi_softweave::pack, stp_pass_t::pass, stpi_softweave::passes, stpi_softweave::rcache, stpi_softweave::repeat_count, stpi_softweave::separation, stp_allocate_component_data(), stp_eprintf(), stp_free(), stp_zalloc(), stpi_destroy_weave(), stp_linebufs_t::v, stpi_softweave::vcache, stpi_softweave::vertical_height, stpi_softweave::vertical_oversample, stpi_softweave::vertical_subpasses, stpi_softweave::virtual_jets, stpi_softweave::vmod, and stpi_softweave::weaveparm.

Referenced by escp2_print_page(), and lexmark_do_print().

void stp_weave_parameters_by_row const stp_vars_t v,
int  row,
int  vertical_subpass,
stp_weave_t w
 

Definition at line 1192 of file print-weave.c.

References stp_get_component_data(), and weave_parameters_by_row().

void stp_write_weave stp_vars_t v,
unsigned char *const   cols[]
 

Definition at line 1545 of file print-weave.c.

References add_to_row(), stpi_softweave::bitwidth, stpi_softweave::comp_buf, stpi_softweave::compute_linewidth, stpi_softweave::current_vertical_subpass, stp_linebounds_t::end_pos, finalize_row(), stpi_softweave::fold_buf, stpi_softweave::head_offset, stpi_softweave::horizontal_weave, initialize_row(), stpi_softweave::lineno, stpi_softweave::linewidth, stpi_softweave::pack, stpi_softweave::s, stp_linebounds_t::start_pos, stp_fold(), stp_get_component_data(), STP_MAX_WEAVE, stp_split_2(), stp_split_4(), stp_unpack_2(), stp_unpack_4(), stp_unpack_8(), stp_zalloc(), stpi_get_lineactive(), stpi_get_linebases(), stpi_get_linebounds(), stpi_get_linecount(), stpi_get_lineoffsets(), stpi_softweave::vertical_oversample, and stpi_softweave::vertical_subpasses.

Referenced by escp2_print_data(), and lexmark_do_print().

static void stpi_calculate_row_parameters void *  vw,
int  row,
int  subpass,
int *  pass,
int *  jetnum,
int *  startingrow,
int *  ophantomrows,
int *  ojetsused
[static]
 

Definition at line 621 of file print-weave.c.

References assert, calculate_raw_row_parameters(), cooked::first_postmapped_pass, cooked::first_premapped_pass, cooked::first_row_printed, raw::jets, cooked::last_row_printed, cooked::pass_postmap, cooked::pass_premap, cooked::rw, raw::separation, cooked::stagger_postmap, cooked::stagger_premap, and raw::v.

Referenced by weave_parameters_by_row().

static void stpi_destroy_weave void *  vsw  )  [static]
 

Definition at line 972 of file print-weave.c.

References stpi_softweave::comp_buf, stp_linebounds_t::end_pos, stpi_softweave::fold_buf, stpi_softweave::head_offset, stpi_softweave::lineactive, stpi_softweave::linebases, stpi_softweave::linebounds, stpi_softweave::linecounts, stpi_softweave::lineoffsets, stpi_softweave::passes, stpi_softweave::s, stp_linebounds_t::start_pos, stp_free(), STP_MAX_WEAVE, stpi_destroy_weave_params(), stp_lineoff_t::v, stp_lineactive_t::v, stp_linecount_t::v, stp_linebufs_t::v, and stpi_softweave::weaveparm.

Referenced by stp_initialize_weave().

static void stpi_destroy_weave_params void *  vw  )  [static]
 

Definition at line 609 of file print-weave.c.

References cooked::pass_postmap, cooked::pass_premap, cooked::stagger_postmap, cooked::stagger_premap, and stp_free().

Referenced by stpi_destroy_weave().

static void stpi_flush_passes stp_vars_t v,
int  flushall
[static]
 

Definition at line 1490 of file print-weave.c.

References stpi_softweave::flushfunc, stpi_softweave::last_pass, stpi_softweave::lineno, stp_pass_t::pass, stp_pass_t::physpassend, stp_get_component_data(), stp_get_pass_by_pass(), and stp_pass_t::subpass.

Referenced by finalize_row(), and stp_flush_all().

static stp_lineactive_t* stpi_get_lineactive const stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  subpass,
int  offset
[static]
 

Definition at line 1211 of file print-weave.c.

References stp_weave_t::pass, and weave_parameters_by_row().

Referenced by add_to_row(), initialize_row(), and stp_write_weave().

static stp_linebufs_t* stpi_get_linebases const stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  subpass,
int  offset
[static]
 

Definition at line 1229 of file print-weave.c.

References stp_weave_t::pass, and weave_parameters_by_row().

Referenced by add_to_row(), check_linebases(), stp_fill_tiff(), stp_fill_uncompressed(), and stp_write_weave().

static stp_linebounds_t* stpi_get_linebounds const stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  subpass,
int  offset
[static]
 

Definition at line 1238 of file print-weave.c.

References stp_weave_t::pass, and weave_parameters_by_row().

Referenced by initialize_row(), and stp_write_weave().

static stp_linecount_t* stpi_get_linecount const stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  subpass,
int  offset
[static]
 

Definition at line 1220 of file print-weave.c.

References stp_weave_t::pass, and weave_parameters_by_row().

Referenced by add_to_row(), finalize_row(), initialize_row(), stp_fill_tiff(), stp_fill_uncompressed(), and stp_write_weave().

static stp_lineoff_t* stpi_get_lineoffsets const stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  subpass,
int  offset
[static]
 

Definition at line 1202 of file print-weave.c.

References stp_weave_t::pass, and weave_parameters_by_row().

Referenced by add_to_row(), initialize_row(), stp_fill_tiff(), stp_fill_uncompressed(), and stp_write_weave().

static stp_pass_t* stpi_get_pass_by_row stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  subpass,
int  offset
[static]
 

Definition at line 1247 of file print-weave.c.

References stp_weave_t::pass, and weave_parameters_by_row().

Referenced by initialize_row().

static void weave_parameters_by_row const stp_vars_t v,
const stpi_softweave_t sw,
int  row,
int  vertical_subpass,
stp_weave_t w
[static]
 

Definition at line 1154 of file print-weave.c.

References stpi_softweave::rcache, stpi_softweave::separation, STP_DBG_WEAVE_PARAMS, stp_dprintf(), stpi_calculate_row_parameters(), and stpi_softweave::vcache.

Referenced by finalize_row(), initialize_row(), stp_weave_parameters_by_row(), stpi_get_lineactive(), stpi_get_linebases(), stpi_get_linebounds(), stpi_get_linecount(), stpi_get_lineoffsets(), and stpi_get_pass_by_row().


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