Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

include/gimp-print/weave.h

Go to the documentation of this file.
00001 /*
00002  * "$Id: weave.h,v 1.3 2004/05/07 19:20:23 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 
00028 /*
00029  * This file must include only standard C header files.  The core code must
00030  * compile on generic platforms that don't support glib, gimp, gtk, etc.
00031  */
00032 
00033 #ifndef GIMP_PRINT_WEAVE_H
00034 #define GIMP_PRINT_WEAVE_H
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 #ifdef HAVE_CONFIG_H
00041 #include <config.h>
00042 #endif
00043 
00044 #define STP_MAX_WEAVE (8)
00045 
00046 
00047 typedef struct                  /* Weave parameters for a specific row */
00048 {
00049   int row;                      /* Absolute row # */
00050   int pass;                     /* Computed pass # */
00051   int jet;                      /* Which physical nozzle we're using */
00052   int missingstartrows;         /* Phantom rows (nonexistent rows that */
00053                                 /* would be printed by nozzles lower than */
00054                                 /* the first nozzle we're using this pass; */
00055                                 /* with the current algorithm, always zero */
00056   int logicalpassstart;         /* Offset in rows (from start of image) */
00057                                 /* that the printer must be for this row */
00058                                 /* to print correctly with the specified jet */
00059   int physpassstart;            /* Offset in rows to the first row printed */
00060                                 /* in this pass.  Currently always equal to */
00061                                 /* logicalpassstart */
00062   int physpassend;              /* Offset in rows (from start of image) to */
00063                                 /* the last row that will be printed this */
00064                                 /* pass (assuming that we're printing a full */
00065                                 /* pass). */
00066 } stp_weave_t;
00067 
00068 typedef struct                  /* Weave parameters for a specific pass */
00069 {
00070   int pass;                     /* Absolute pass number */
00071   int missingstartrows;         /* All other values the same as weave_t */
00072   int logicalpassstart;
00073   int physpassstart;
00074   int physpassend;
00075   int subpass;
00076 } stp_pass_t;
00077 
00078 typedef struct {                /* Offsets from the start of each line */
00079   int ncolors;
00080   unsigned long *v;             /* (really pass) */
00081 } stp_lineoff_t;
00082 
00083 typedef struct {                /* Is this line (really pass) active? */
00084   int ncolors;
00085   char *v;
00086 } stp_lineactive_t;
00087 
00088 typedef struct {                /* number of rows for a pass */
00089   int ncolors;
00090   int *v;
00091 } stp_linecount_t;
00092 
00093 typedef struct {                /* Base pointers for each pass */
00094   int ncolors;
00095   unsigned char **v;
00096 } stp_linebufs_t;
00097 
00098 typedef struct {                /* Width of data actually printed */
00099   int ncolors;
00100   int *start_pos;
00101   int *end_pos;
00102 } stp_linebounds_t;
00103 
00104 typedef enum {
00105   STP_WEAVE_ZIGZAG,
00106   STP_WEAVE_ASCENDING,
00107   STP_WEAVE_DESCENDING,
00108   STP_WEAVE_ASCENDING_2X,
00109   STP_WEAVE_STAGGERED,
00110   STP_WEAVE_ASCENDING_3X
00111 } stp_weave_strategy_t;
00112 
00113 typedef int stp_packfunc(stp_vars_t *v,
00114                          const unsigned char *line, int height,
00115                          unsigned char *comp_buf,
00116                          unsigned char **comp_ptr,
00117                          int *first, int *last);
00118 typedef void stp_fillfunc(stp_vars_t *v, int row, int subpass,
00119                           int width, int missingstartrows, int color);
00120 typedef void stp_flushfunc(stp_vars_t *v, int passno, int vertical_subpass);
00121 typedef int stp_compute_linewidth_func(stp_vars_t *v, int n);
00122 
00123 extern void stp_initialize_weave(stp_vars_t *v, int jets, int separation,
00124                                  int oversample, int horizontal,
00125                                  int vertical, int ncolors, int bitwidth,
00126                                  int linewidth, int line_count,
00127                                  int first_line, int page_height,
00128                                  const int *head_offset,
00129                                  stp_weave_strategy_t,
00130                                  stp_flushfunc,
00131                                  stp_fillfunc,
00132                                  stp_packfunc,
00133                                  stp_compute_linewidth_func);
00134 
00135 extern stp_packfunc stp_pack_tiff;
00136 extern stp_packfunc stp_pack_uncompressed;
00137 
00138 extern stp_fillfunc stp_fill_tiff;
00139 extern stp_fillfunc stp_fill_uncompressed;
00140 
00141 extern stp_compute_linewidth_func stp_compute_tiff_linewidth;
00142 extern stp_compute_linewidth_func stp_compute_uncompressed_linewidth;
00143 
00144 extern void stp_flush_all(stp_vars_t *v);
00145 
00146 extern void
00147 stp_write_weave(stp_vars_t *v, unsigned char *const cols[]);
00148 
00149 extern stp_lineoff_t *
00150 stp_get_lineoffsets_by_pass(const stp_vars_t *v, int pass);
00151 
00152 extern stp_lineactive_t *
00153 stp_get_lineactive_by_pass(const stp_vars_t *v, int pass);
00154 
00155 extern stp_linecount_t *
00156 stp_get_linecount_by_pass(const stp_vars_t *v, int pass);
00157 
00158 extern const stp_linebufs_t *
00159 stp_get_linebases_by_pass(const stp_vars_t *v, int pass);
00160 
00161 extern stp_pass_t *
00162 stp_get_pass_by_pass(const stp_vars_t *v, int pass);
00163 
00164 extern void
00165 stp_weave_parameters_by_row(const stp_vars_t *v, int row,
00166                             int vertical_subpass, stp_weave_t *w);
00167 
00168 #ifdef __cplusplus
00169   }
00170 #endif
00171 
00172 #endif /* GIMP_PRINT_WEAVE_H */
00173 /*
00174  * End of "$Id: weave.h,v 1.3 2004/05/07 19:20:23 rleigh Exp $".
00175  */

Generated on Wed May 12 20:21:27 2004 for libgimpprint API Reference by doxygen1.2.17