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

weave.h

Go to the documentation of this file.
00001 /*
00002  * "$Id: weave.h,v 1.1 2004/09/17 18:38:01 rleigh Exp $"
00003  *
00004  *   libgimpprint header.
00005  *
00006  *   Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
00007  *      Robert Krawitz (rlk@alum.mit.edu)
00008  *
00009  *   This program is free software; you can redistribute it and/or modify it
00010  *   under the terms of the GNU General Public License as published by the Free
00011  *   Software Foundation; either version 2 of the License, or (at your option)
00012  *   any later version.
00013  *
00014  *   This program is distributed in the hope that it will be useful, but
00015  *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00016  *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00017  *   for more details.
00018  *
00019  *   You should have received a copy of the GNU General Public License
00020  *   along with this program; if not, write to the Free Software
00021  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00022  *
00023  * Revision History:
00024  *
00025  *   See ChangeLog
00026  */
00027 
00033 /*
00034  * This file must include only standard C header files.  The core code must
00035  * compile on generic platforms that don't support glib, gimp, gtk, etc.
00036  */
00037 
00038 #ifndef GUTENPRINT_WEAVE_H
00039 #define GUTENPRINT_WEAVE_H
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 #ifdef HAVE_CONFIG_H
00046 #include <config.h>
00047 #endif
00048 
00049 #define STP_MAX_WEAVE (8)
00050 
00051 
00052 typedef struct                  /* Weave parameters for a specific row */
00053 {
00054   int row;                      /* Absolute row # */
00055   int pass;                     /* Computed pass # */
00056   int jet;                      /* Which physical nozzle we're using */
00057   int missingstartrows;         /* Phantom rows (nonexistent rows that */
00058                                 /* would be printed by nozzles lower than */
00059                                 /* the first nozzle we're using this pass; */
00060                                 /* with the current algorithm, always zero */
00061   int logicalpassstart;         /* Offset in rows (from start of image) */
00062                                 /* that the printer must be for this row */
00063                                 /* to print correctly with the specified jet */
00064   int physpassstart;            /* Offset in rows to the first row printed */
00065                                 /* in this pass.  Currently always equal to */
00066                                 /* logicalpassstart */
00067   int physpassend;              /* Offset in rows (from start of image) to */
00068                                 /* the last row that will be printed this */
00069                                 /* pass (assuming that we're printing a full */
00070                                 /* pass). */
00071 } stp_weave_t;
00072 
00073 typedef struct                  /* Weave parameters for a specific pass */
00074 {
00075   int pass;                     /* Absolute pass number */
00076   int missingstartrows;         /* All other values the same as weave_t */
00077   int logicalpassstart;
00078   int physpassstart;
00079   int physpassend;
00080   int subpass;
00081 } stp_pass_t;
00082 
00083 typedef struct {                /* Offsets from the start of each line */
00084   int ncolors;
00085   unsigned long *v;             /* (really pass) */
00086 } stp_lineoff_t;
00087 
00088 typedef struct {                /* Is this line (really pass) active? */
00089   int ncolors;
00090   char *v;
00091 } stp_lineactive_t;
00092 
00093 typedef struct {                /* number of rows for a pass */
00094   int ncolors;
00095   int *v;
00096 } stp_linecount_t;
00097 
00098 typedef struct {                /* Base pointers for each pass */
00099   int ncolors;
00100   unsigned char **v;
00101 } stp_linebufs_t;
00102 
00103 typedef struct {                /* Width of data actually printed */
00104   int ncolors;
00105   int *start_pos;
00106   int *end_pos;
00107 } stp_linebounds_t;
00108 
00109 typedef enum {
00110   STP_WEAVE_ZIGZAG,
00111   STP_WEAVE_ASCENDING,
00112   STP_WEAVE_DESCENDING,
00113   STP_WEAVE_ASCENDING_2X,
00114   STP_WEAVE_STAGGERED,
00115   STP_WEAVE_ASCENDING_3X
00116 } stp_weave_strategy_t;
00117 
00118 typedef int stp_packfunc(stp_vars_t *v,
00119                          const unsigned char *line, int height,
00120                          unsigned char *comp_buf,
00121                          unsigned char **comp_ptr,
00122                          int *first, int *last);
00123 typedef void stp_fillfunc(stp_vars_t *v, int row, int subpass,
00124                           int width, int missingstartrows, int color);
00125 typedef void stp_flushfunc(stp_vars_t *v, int passno, int vertical_subpass);
00126 typedef int stp_compute_linewidth_func(stp_vars_t *v, int n);
00127 
00128 extern void stp_initialize_weave(stp_vars_t *v, int jets, int separation,
00129                                  int oversample, int horizontal,
00130                                  int vertical, int ncolors, int bitwidth,
00131                                  int linewidth, int line_count,
00132                                  int first_line, int page_height,
00133                                  const int *head_offset,
00134                                  stp_weave_strategy_t,
00135                                  stp_flushfunc,
00136                                  stp_fillfunc,
00137                                  stp_packfunc,
00138                                  stp_compute_linewidth_func);
00139 
00140 extern stp_packfunc stp_pack_tiff;
00141 extern stp_packfunc stp_pack_uncompressed;
00142 
00143 extern stp_fillfunc stp_fill_tiff;
00144 extern stp_fillfunc stp_fill_uncompressed;
00145 
00146 extern stp_compute_linewidth_func stp_compute_tiff_linewidth;
00147 extern stp_compute_linewidth_func stp_compute_uncompressed_linewidth;
00148 
00149 extern void stp_flush_all(stp_vars_t *v);
00150 
00151 extern void
00152 stp_write_weave(stp_vars_t *v, unsigned char *const cols[]);
00153 
00154 extern stp_lineoff_t *
00155 stp_get_lineoffsets_by_pass(const stp_vars_t *v, int pass);
00156 
00157 extern stp_lineactive_t *
00158 stp_get_lineactive_by_pass(const stp_vars_t *v, int pass);
00159 
00160 extern stp_linecount_t *
00161 stp_get_linecount_by_pass(const stp_vars_t *v, int pass);
00162 
00163 extern const stp_linebufs_t *
00164 stp_get_linebases_by_pass(const stp_vars_t *v, int pass);
00165 
00166 extern stp_pass_t *
00167 stp_get_pass_by_pass(const stp_vars_t *v, int pass);
00168 
00169 extern void
00170 stp_weave_parameters_by_row(const stp_vars_t *v, int row,
00171                             int vertical_subpass, stp_weave_t *w);
00172 
00173 #ifdef __cplusplus
00174   }
00175 #endif
00176 
00177 #endif /* GUTENPRINT_WEAVE_H */
00178 /*
00179  * End of "$Id: weave.h,v 1.1 2004/09/17 18:38:01 rleigh Exp $".
00180  */

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