HPGS - HPGl Script
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
hpgspaint.h
Go to the documentation of this file.
1 /***********************************************************************
2  * *
3  * $Id: hpgspaint.h 607 2011-03-10 10:43:05Z hpgs $
4  * *
5  * hpgs - HPGl Script, a hpgl/2 interpreter, which uses a Postscript *
6  * API for rendering a scene and thus renders to a variety of *
7  * devices and fileformats. *
8  * *
9  * (C) 2004-2009 ev-i Informationstechnologie GmbH http://www.ev-i.at *
10  * *
11  * Author: Wolfgang Glas *
12  * *
13  * hpgs is free software; you can redistribute it and/or *
14  * modify it under the terms of the GNU Lesser General Public *
15  * License as published by the Free Software Foundation; either *
16  * version 2.1 of the License, or (at your option) any later version. *
17  * *
18  * hpgs is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
21  * Lesser General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU Lesser General Public *
24  * License along with this library; if not, write to the *
25  * Free Software Foundation, Inc., 59 Temple Place, Suite 330, *
26  * Boston, MA 02111-1307 USA *
27  * *
28  ***********************************************************************
29  * *
30  * The declarations for the pixel painter. *
31  * *
32  ***********************************************************************/
33 
34 #ifndef __HPGS_PAINT_H
35 #define __HPGS_PAINT_H
36 
37 #include<hpgs.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
54 
59 #define HPGS_PAINT_MAX_CLIP_DEPTH 16
60 
78 {
83  char *filename;
85  hpgs_bbox page_bb;
88  double xres;
89  double yres;
91  hpgs_bool overscan;
93  double thin_alpha;
100  hpgs_paint_clipper *clippers[HPGS_PAINT_MAX_CLIP_DEPTH];
105  int clip_depth;
115 };
116 
117 HPGS_INTERNAL_API int hpgs_paint_device_fill(hpgs_paint_device *pdv,
118  hpgs_paint_path *path,
119  hpgs_bool winding,
120  hpgs_bool stroke);
121 
122 HPGS_INTERNAL_API int hpgs_paint_device_clip(hpgs_paint_device *pdv,
123  hpgs_paint_path *path,
124  hpgs_bool winding);
125 
126 HPGS_INTERNAL_API int hpgs_paint_device_drawimage(hpgs_paint_device *pdv,
127  const hpgs_image *img,
128  const hpgs_point *ll, const hpgs_point *lr,
129  const hpgs_point *ur);
130  /* end of group paint_device */
132 
137 #define HPGS_BEZIER_NSEGS 16
138 
140 
149 {
150  double l[HPGS_BEZIER_NSEGS+1];
151  double dl[HPGS_BEZIER_NSEGS+1];
152 };
153 
154 HPGS_INTERNAL_API void hpgs_bezier_length_init(hpgs_bezier_length *b,
155  const hpgs_paint_path *path, int i);
156 HPGS_INTERNAL_API double hpgs_bezier_length_param(const hpgs_bezier_length *b, double l);
157 
162 HPGS_INTERNAL_API void hpgs_bezier_minmax_comp (double c0, double c1,
163  double c2, double c3,
164  double *cmin, double *cmax);
165  /* end of group path */
167 
178 {
179  double x;
182  int order;
191 };
192 
199 {
204  int points_malloc_size;
205  int n_points;
207 };
208 
237 {
242  int n_scanlines;
245  hpgs_bbox bb;
247 
251  double yfac; // height of a single scanline.
252  double y0; // y for scanline 0
255  hpgs_bool overscan;
256  int height;
258  int iscan0;
259  int iscan1;
260 };
261 
262 HPGS_INTERNAL_API hpgs_paint_clipper *hpgs_new_paint_clipper(const hpgs_bbox *bb,
263  int height,
264  int scanline_msize,
265  int overscan);
266 
267 HPGS_INTERNAL_API hpgs_paint_clipper *hpgs_paint_clipper_clip(const hpgs_paint_clipper *orig,
268  const hpgs_paint_clipper *clip,
269  hpgs_bool winding);
270 
271 HPGS_INTERNAL_API int hpgs_paint_clipper_cut(hpgs_paint_clipper *c,
272  hpgs_paint_path *path);
273 
274 HPGS_INTERNAL_API int hpgs_paint_clipper_thin_cut(hpgs_paint_clipper *c,
275  hpgs_paint_path *path,
276  const hpgs_gstate *gstate);
277 
278 HPGS_INTERNAL_API int hpgs_paint_clipper_emit (hpgs_image *image,
279  const hpgs_paint_clipper *img,
280  const hpgs_paint_clipper *clip,
281  const hpgs_paint_color *c,
282  hpgs_bool winding,
283  hpgs_bool stroke);
284 
285 HPGS_INTERNAL_API int hpgs_paint_clipper_reset(hpgs_paint_clipper *c, double llx, double urx);
286 HPGS_INTERNAL_API void hpgs_paint_clipper_clear(hpgs_paint_clipper *c);
287 HPGS_INTERNAL_API void hpgs_paint_clipper_destroy(hpgs_paint_clipper *c);
288  /* end of group scanline */
290 
291 #ifdef __cplusplus
292 } // end of extern "C"
293 #endif
294 
295 #endif /* ! __HPGS_PAINT_H */