00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00033
00034
00035
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
00053 {
00054 int row;
00055 int pass;
00056 int jet;
00057 int missingstartrows;
00058
00059
00060
00061 int logicalpassstart;
00062
00063
00064 int physpassstart;
00065
00066
00067 int physpassend;
00068
00069
00070
00071 } stp_weave_t;
00072
00073 typedef struct
00074 {
00075 int pass;
00076 int missingstartrows;
00077 int logicalpassstart;
00078 int physpassstart;
00079 int physpassend;
00080 int subpass;
00081 } stp_pass_t;
00082
00083 typedef struct {
00084 int ncolors;
00085 unsigned long *v;
00086 } stp_lineoff_t;
00087
00088 typedef struct {
00089 int ncolors;
00090 char *v;
00091 } stp_lineactive_t;
00092
00093 typedef struct {
00094 int ncolors;
00095 int *v;
00096 } stp_linecount_t;
00097
00098 typedef struct {
00099 int ncolors;
00100 unsigned char **v;
00101 } stp_linebufs_t;
00102
00103 typedef struct {
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
00178
00179
00180