HPGS - HPGl Script
hpgs.h
Go to the documentation of this file.
1 /***********************************************************************
2  * *
3  * $Id: hpgs.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 public interfaces, which have to be known to all components. *
31  * *
32  ***********************************************************************/
33 
34 #ifndef __HPGS_H
35 #define __HPGS_H
36 
37 #include<stdio.h>
38 #include<stdarg.h>
39 #include<stdlib.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #ifndef __GNUC__
46 #ifdef _MSC_VER
47 #define __inline__ __inline
48 #else
49 #define __inline__ inline
50 #endif
51 #endif
52 
53 /* All this is needed in order to set the right attributes for functions.
54  This allows us to build fully compliant dlls under Windows and to
55  hide functions needed for the implementation of the API in
56  ELF modules. Additionally, we make use of the 'format' attribute of
57  gcc in order to get the most out of -Wall.
58  */
59 #ifdef HPGS_SHARED
60 # ifdef WIN32
61 # ifdef __GNUC__
62 # ifdef HPGS_BUILD_SLIB
63 # define HPGS_API __attribute__((dllexport))
64 # define HPGS_PRINTF_API(i) __attribute__((dllexport,format(printf,i,i+1)))
65 # define HPGS_I18N_API __attribute__((dllexport,format_arg (1)))
66 # define HPGS_I18N_N_API __attribute__((dllexport,format_arg (1),format_arg (2)))
67 # else
68 # define HPGS_API __attribute__((dllimport))
69 # define HPGS_PRINTF_API(i) __attribute__((dllimport,format(printf,i,i+1)))
70 # define HPGS_I18N_API __attribute__((dllimport,format_arg (1)))
71 # define HPGS_I18N_N_API __attribute__((dllimport,format_arg (1),format_arg (2)))
72 # endif
73 # define HPGS_INTERNAL_PRINTF_API(i) __attribute__((format(printf,i,i+1)))
74 # else
75 # ifdef HPGS_BUILD_SLIB
76 # define HPGS_API __declspec(dllexport)
77 # else
78 # define HPGS_API __declspec(dllimport)
79 # endif
80 # endif
81 # else
82 # ifdef __GNUC__
83 # define HPGS_PRINTF_API(i) __attribute__((format(printf,i,i+1)))
84 # define HPGS_I18N_API __attribute__((format_arg (1)))
85 # define HPGS_I18N_N_API __attribute__((format_arg (1),format_arg (2)))
86 # define HPGS_INTERNAL_API __attribute__((visibility("hidden")))
87 # define HPGS_INTERNAL_PRINTF_API(i) __attribute__((visibility("hidden"),format(printf,i,i+1)))
88 # endif
89 # endif
90 #endif
91 
92 #ifndef HPGS_API
93 #define HPGS_API
94 #endif
95 #ifndef HPGS_PRINTF_API
96 #define HPGS_PRINTF_API(i) HPGS_API
97 #endif
98 #ifndef HPGS_I18N_API
99 #define HPGS_I18N_API HPGS_API
100 #endif
101 #ifndef HPGS_I18N_N_API
102 #define HPGS_I18N_N_API HPGS_API
103 #endif
104 #ifndef HPGS_INTERNAL_API
105 #define HPGS_INTERNAL_API
106 #endif
107 #ifndef HPGS_INTERNAL_PRINTF_API
108 #define HPGS_INTERNAL_PRINTF_API(i) HPGS_INTERNAL_API
109 #endif
110 
111 /* These defines are used in order to allow better doxygen integration
112  of the printf API functions. */
113 #define HPGS_PRINTF1_API HPGS_PRINTF_API(1)
114 #define HPGS_PRINTF2_API HPGS_PRINTF_API(2)
115 #define HPGS_INTERNAL_PRINTF1_API HPGS_INTERNAL_PRINTF_API(1)
116 #define HPGS_INTERNAL_PRINTF2_API HPGS_INTERNAL_PRINTF_API(2)
117 
118 #ifdef WIN32
119 # ifdef WIN64
120 # define HPGS_SIZE_T_FMT "%I64u"
121 # define HPGS_SIZE_T_FMT_ARG(i) (unsigned long long)(i)
122 # define HPGS_SIZE_T_FMT_ARG_P(i) (unsigned long long *)(i)
123 # else
124 # define HPGS_SIZE_T_FMT "%lu"
125 # define HPGS_SIZE_T_FMT_ARG(i) (unsigned long)(i)
126 # define HPGS_SIZE_T_FMT_ARG_P(i) (unsigned long *)(i)
127 # endif
128 #else
129 # define HPGS_SIZE_T_FMT "%zu"
130 # define HPGS_SIZE_T_FMT_ARG(i) i
131 # define HPGS_SIZE_T_FMT_ARG_P(i) i
132 #endif
133 
144 #define HPGS_STRINGIFYIFY(i) #i
145 #define HPGS_STRINGIFY(i) HPGS_STRINGIFYIFY(i)
146 
147 #define HPGS_MAJOR_VERSION 1
148 #define HPGS_MINOR_VERSION 1
149 #define HPGS_PATCH_VERSION 9
150 #define HPGS_EXTRA_VERSION
151 
152 // a string for displaying the version.
153 #define HPGS_VERSION HPGS_STRINGIFY(HPGS_MAJOR_VERSION) "." HPGS_STRINGIFY(HPGS_MINOR_VERSION) "." HPGS_STRINGIFY(HPGS_PATCH_VERSION) HPGS_STRINGIFY(HPGS_EXTRA_VERSION)
154 
155 #define HPGS_ESC '\033'
156 
157 #define HPGS_MAX_LABEL_SIZE 256
158 
159 #define hpgs_alloca(sz) alloca(sz)
160 
164 typedef int hpgs_bool;
165 
166 #define HPGS_TRUE 1
167 #define HPGS_FALSE 0
168 
169 HPGS_API int hpgs_array_safe_resize (size_t itemsz, void **pptr, size_t *psz, size_t nsz);
170 
171 #define HPGS_MIN(a,b) ((a)<(b)?(a):(b))
172 #define HPGS_MAX(a,b) ((a)>(b)?(a):(b))
173 
174 #define HPGS_INIT_ARRAY(st,type,pmemb,nmemb,szmemb,insz) \
175 (st->szmemb=insz,st->nmemb=0,(st->pmemb=(type*)malloc(sizeof(type)*insz))?0:-1)
176 
177 #define HPGS_GROW_ARRAY_FOR_PUSH(st,type,pmemb,nmemb,szmemb) \
178 ((st->nmemb >= st->szmemb)?hpgs_array_safe_resize(sizeof(type),(void **)(&st->pmemb),&st->szmemb,st->szmemb*2):(0))
179 
180 #define HPGS_GROW_ARRAY_MIN_SIZE(st,type,pmemb,nmemb,szmemb,msz) \
181 ((st->nmemb>=st->szmemb||st->szmemb<msz)?hpgs_array_safe_resize(sizeof(type),(void **)(&st->pmemb),&st->szmemb,HPGS_MAX(st->szmemb*2,msz)):(0))
182 
183 #ifdef WIN32
184 #define HPGS_PATH_SEPARATOR '\\'
185 #else
186 #define HPGS_PATH_SEPARATOR '/'
187 #endif
188 
189 HPGS_API void hpgs_init (const char *prefix);
190 HPGS_API const char *hpgs_get_prefix();
191 HPGS_API void hpgs_cleanup (void);
192 HPGS_API char *hpgs_share_filename(const char *rel_filename);
193 
194 HPGS_API char *hpgs_vsprintf_malloc(const char *fmt, va_list ap);
195 HPGS_PRINTF1_API char *hpgs_sprintf_malloc(const char *fmt, ...);
196 
197 HPGS_PRINTF1_API int hpgs_set_error(const char *fmt, ...);
198 HPGS_PRINTF1_API int hpgs_error_ctxt(const char *fmt, ...);
199 HPGS_API int hpgs_set_verror(const char *fmt, va_list ap);
200 HPGS_API int hpgs_verror_ctxt(const char *fmt, va_list ap);
201 HPGS_API const char *hpgs_get_error();
202 HPGS_API hpgs_bool hpgs_have_error();
203 HPGS_API void hpgs_clear_error();
204 
205 HPGS_API int hpgs_next_utf8(const char **p);
206 HPGS_API int hpgs_utf8_strlen(const char *p, int n);
207 
208 HPGS_I18N_API const char *hpgs_i18n(const char *msg);
209 HPGS_I18N_N_API const char *hpgs_i18n_n(const char *msg,
210  const char *msg_plural,
211  unsigned long n);
212 
213 typedef void (*hpgs_logger_func_t) (const char *fmt, va_list ap);
214 HPGS_API void hpgs_set_logger(hpgs_logger_func_t func);
215 HPGS_PRINTF1_API void hpgs_log(const char *fmt, ...);
216 HPGS_API void hpgs_vlog(const char *fmt, va_list ap);
217 
218 HPGS_API hpgs_bool hpgs_get_arg_value(const char *opt, const char *argv[],
219  const char **value, int *narg);
220 
227 typedef struct hpgs_point_st {
228  double x, y;
229 } hpgs_point;
230 
238 typedef struct hpgs_color_st {
239  double r, g, b;
240 } hpgs_color;
241 
242 typedef struct hpgs_palette_color_st hpgs_palette_color;
243 
251 {
252  unsigned char r;
253  unsigned char g;
254  unsigned char b;
255 };
256 
257 typedef void (*hpgs_rop3_func_t) (unsigned char *, unsigned char, unsigned char);
258 
259 HPGS_API hpgs_rop3_func_t hpgs_rop3_func(int rop3,
260  hpgs_bool src_transparency,
261  hpgs_bool pattern_transparency);
262 
263 typedef unsigned (*hpgs_xrop3_func_t) (unsigned char, unsigned char);
264 
265 HPGS_API hpgs_xrop3_func_t hpgs_xrop3_func(int rop3,
266  hpgs_bool src_transparency,
267  hpgs_bool pattern_transparency);
268 
269 typedef struct hpgs_paint_color_st hpgs_paint_color;
270 
283 {
284  unsigned char r;
285  unsigned char g;
286  unsigned char b;
287  unsigned char index;
288 };
289 
290 typedef struct hpgs_bbox_st hpgs_bbox;
291 
297 {
298  double llx;
299  double lly;
300  double urx;
301  double ury;
302 };
303 
304 HPGS_API hpgs_bool hpgs_bbox_isequal(const hpgs_bbox *bb1, const hpgs_bbox *bb2);
305 HPGS_API hpgs_bool hpgs_bbox_isnull (const hpgs_bbox *bb);
306 HPGS_API hpgs_bool hpgs_bbox_isempty (const hpgs_bbox *bb);
307 HPGS_API void hpgs_bbox_distance (hpgs_point *d, const hpgs_bbox *bb1, const hpgs_bbox *bb2);
308 HPGS_API void hpgs_bbox_null (hpgs_bbox *bb);
309 HPGS_API void hpgs_bbox_expand (hpgs_bbox *bb1, const hpgs_bbox *bb2);
310 HPGS_API void hpgs_bbox_intersect (hpgs_bbox *bb1, const hpgs_bbox *bb2);
312 static void hpgs_bbox_addborder (hpgs_bbox *bb, double border);
315 static void hpgs_bbox_add (hpgs_bbox *bb, const hpgs_point *p);
316 
317 __inline__ void hpgs_bbox_addborder (hpgs_bbox *bb, double border)
318 {
319  bb->llx -= border;
320  bb->urx += border;
321  bb->lly -= border;
322  bb->ury += border;
323 }
324 
325 __inline__ void hpgs_bbox_add (hpgs_bbox *bb, const hpgs_point *p)
326 {
327  if (p->x < bb->llx) bb->llx = p->x;
328  if (p->x > bb->urx) bb->urx = p->x;
329  if (p->y < bb->lly) bb->lly = p->y;
330  if (p->y > bb->ury) bb->ury = p->y;
331 }
332 
333 typedef struct hpgs_matrix_st hpgs_matrix;
334 
341 {
342  double dx;
343  double dy;
344  double mxx;
345  double mxy;
346  double myx;
347  double myy;
348 };
349 
350 HPGS_API void hpgs_matrix_set_identity(hpgs_matrix *m);
351 
352 HPGS_API void hpgs_matrix_xform(hpgs_point *res,
353  const hpgs_matrix *m, const hpgs_point *p);
354 HPGS_API void hpgs_matrix_ixform(hpgs_point *res,
355  const hpgs_point *p, const hpgs_matrix *m);
356 HPGS_API void hpgs_matrix_scale(hpgs_point *res,
357  const hpgs_matrix *m, const hpgs_point *p);
358 HPGS_API void hpgs_matrix_iscale(hpgs_point *res,
359  const hpgs_point *p, const hpgs_matrix *m);
360 HPGS_API void hpgs_matrix_concat(hpgs_matrix *res,
361  const hpgs_matrix *a, const hpgs_matrix *b);
362 HPGS_API void hpgs_matrix_invert(hpgs_matrix *res, const hpgs_matrix *m);
363 
364 HPGS_API void hpgs_matrix_xform_bbox(hpgs_bbox *res,
365  const hpgs_matrix *m, const hpgs_bbox *bb);
366 HPGS_API void hpgs_matrix_ixform_bbox(hpgs_bbox *res,
367  const hpgs_bbox *bb, const hpgs_matrix *m);
368 
370 typedef enum {
374 } hpgs_line_cap;
375 
377 typedef enum {
382 
383 // input stream
384 typedef struct hpgs_istream_st hpgs_istream;
386 
387 typedef int (*hpgs_istream_getc_func_t)(void *);
388 typedef int (*hpgs_istream_ungetc_func_t)(int ,void *);
389 typedef int (*hpgs_istream_close_func_t)(void *);
390 typedef int (*hpgs_istream_iseof_func_t)(void *);
391 typedef int (*hpgs_istream_iserror_func_t)(void *);
392 typedef int (*hpgs_istream_seek_func_t)(void *, size_t);
393 typedef int (*hpgs_istream_tell_func_t)(void *, size_t*);
394 typedef size_t (*hpgs_istream_read_func_t)(void *, size_t, size_t, void *);
395 typedef int (*hpgs_istream_seekend_func_t)(void *, size_t);
396 
407 {
408  hpgs_istream_getc_func_t getc_func;
409  hpgs_istream_ungetc_func_t ungetc_func;
410  hpgs_istream_close_func_t close_func;
411  hpgs_istream_iseof_func_t iseof_func;
412  hpgs_istream_iserror_func_t iserror_func;
413  hpgs_istream_seek_func_t seek_func;
414  hpgs_istream_tell_func_t tell_func;
415  hpgs_istream_read_func_t read_func;
416  hpgs_istream_seekend_func_t seekend_func;
417 };
418 
427 {
428  hpgs_istream_vtable *vtable;
429 
430  void *stream;
431 };
432 
433 HPGS_API hpgs_istream *hpgs_new_file_istream (const char *fn);
434 HPGS_API hpgs_istream *hpgs_new_mem_istream (const unsigned char *data,
435  size_t data_size,
436  hpgs_bool dup);
437 
438 
440 static int hpgs_getc (hpgs_istream *_this);
442 static int hpgs_ungetc (int c, hpgs_istream *_this);
445 static int hpgs_istream_close (hpgs_istream *_this);
447 static int hpgs_istream_iseof (hpgs_istream *_this);
449 static int hpgs_istream_iserror(hpgs_istream *_this);
451 static int hpgs_istream_seek (hpgs_istream *_this, size_t pos);
453 static int hpgs_istream_seekend (hpgs_istream *_this, size_t pos);
455 static int hpgs_istream_tell (hpgs_istream *_this, size_t *pos);
457 static size_t hpgs_istream_read (void *ptr, size_t size, size_t nmemb, hpgs_istream *_this);
458 
459 __inline__ int hpgs_getc (hpgs_istream *_this)
460 { return _this->vtable->getc_func(_this->stream); }
461 
462 __inline__ int hpgs_ungetc (int c, hpgs_istream *_this)
463 { return _this->vtable->ungetc_func(c,_this->stream); }
464 
465 __inline__ int hpgs_istream_close (hpgs_istream *_this)
466 { int ret = _this->vtable->close_func(_this->stream); free(_this); return ret; }
467 
468 __inline__ int hpgs_istream_iseof (hpgs_istream *_this)
469 { return _this->vtable->iseof_func(_this->stream); }
470 
471 __inline__ int hpgs_istream_iserror (hpgs_istream *_this)
472 { return _this->vtable->iserror_func(_this->stream); }
473 
474 __inline__ int hpgs_istream_seek (hpgs_istream *_this, size_t pos)
475 { return _this->vtable->seek_func(_this->stream,pos); }
476 
477 __inline__ int hpgs_istream_seekend (hpgs_istream *_this, size_t pos)
478 { return _this->vtable->seekend_func(_this->stream,pos); }
479 
480 __inline__ int hpgs_istream_tell (hpgs_istream *_this, size_t *pos)
481 { return _this->vtable->tell_func(_this->stream,pos); }
482 
483 __inline__ size_t hpgs_istream_read (void *ptr, size_t size, size_t nmemb, hpgs_istream *_this)
484 { return _this->vtable->read_func(ptr,size,nmemb,_this->stream); }
485 
486 // output stream
487 typedef struct hpgs_ostream_st hpgs_ostream;
488 typedef struct hpgs_ostream_vtable_st hpgs_ostream_vtable;
489 
490 typedef int (*hpgs_ostream_putc_func_t)(int, void *);
491 typedef size_t (*hpgs_ostream_write_func_t)(const void *, size_t, size_t, void *);
492 typedef int (*hpgs_ostream_vprintf_func_t)(void *, const char *, va_list);
493 typedef int (*hpgs_ostream_flush_func_t)(void *);
494 typedef int (*hpgs_ostream_close_func_t)(void *);
495 typedef int (*hpgs_ostream_iserror_func_t)(void *);
496 typedef hpgs_istream *(*hpgs_ostream_getbuf_func_t)(void *);
497 typedef int (*hpgs_ostream_tell_func_t)(void *, int layer, size_t *);
498 typedef int (*hpgs_ostream_seek_func_t)(void *, size_t);
499 
510 {
511  hpgs_ostream_putc_func_t putc_func;
512  hpgs_ostream_write_func_t write_func;
513  hpgs_ostream_vprintf_func_t vprintf_func;
514  hpgs_ostream_flush_func_t flush_func;
515  hpgs_ostream_close_func_t close_func;
516  hpgs_ostream_iserror_func_t iserror_func;
517  hpgs_ostream_getbuf_func_t getbuf_func;
518  hpgs_ostream_tell_func_t tell_func;
519  hpgs_ostream_seek_func_t seek_func;
520 };
521 
530 {
531  hpgs_ostream_vtable *vtable;
532 
533  void *stream;
534 };
535 
536 HPGS_API hpgs_ostream *hpgs_new_file_ostream (const char *fn);
537 HPGS_API hpgs_ostream *hpgs_new_mem_ostream (size_t data_reserve);
538 HPGS_API hpgs_ostream *hpgs_new_z_ostream (hpgs_ostream *base, int compression, hpgs_bool take_base);
539 
540 HPGS_API int hpgs_copy_streams (hpgs_ostream *out, hpgs_istream *in);
541 
542 HPGS_PRINTF2_API int hpgs_ostream_printf (hpgs_ostream *_this, const char *msg, ...);
543 HPGS_API int hpgs_ostream_vprintf (hpgs_ostream *_this, const char *msg, va_list ap);
544 
546 static int hpgs_ostream_putc (int c, hpgs_ostream *_this);
548 static size_t hpgs_ostream_write (const void *ptr, size_t size, size_t nmemb, hpgs_ostream *_this);
550 static int hpgs_ostream_flush (hpgs_ostream *_this);
553 static int hpgs_ostream_close (hpgs_ostream *_this);
555 static int hpgs_ostream_iserror(hpgs_ostream *_this);
558 static hpgs_istream *hpgs_ostream_getbuf(hpgs_ostream *_this);
560 static int hpgs_ostream_tell(hpgs_ostream *_this, int layer, size_t *pos);
562 static int hpgs_ostream_seek (hpgs_ostream *_this, size_t pos);
563 
564 __inline__ int hpgs_ostream_putc (int c, hpgs_ostream *_this)
565 { return _this->vtable->putc_func(c,_this->stream); }
566 
567 __inline__ size_t hpgs_ostream_write (const void *ptr, size_t size, size_t nmemb, hpgs_ostream *_this)
568 { return _this->vtable->write_func(ptr,size,nmemb,_this->stream); }
569 
570 __inline__ int hpgs_ostream_flush (hpgs_ostream *_this)
571 { return _this->vtable->flush_func ? _this->vtable->flush_func(_this->stream) : 0; }
572 
573 __inline__ int hpgs_ostream_close (hpgs_ostream *_this)
574 { int ret = _this->vtable->close_func(_this->stream); free(_this); return ret; }
575 
576 __inline__ int hpgs_ostream_iserror (hpgs_ostream *_this)
577 { return _this->vtable->iserror_func(_this->stream); }
578 
579 __inline__ hpgs_istream *hpgs_ostream_getbuf (hpgs_ostream *_this)
580 { return _this->vtable->getbuf_func ? _this->vtable->getbuf_func(_this->stream) : 0; }
581 
582 __inline__ int hpgs_ostream_tell(hpgs_ostream *_this, int layer, size_t *pos)
583 { return _this->vtable->tell_func ? _this->vtable->tell_func(_this->stream,layer,pos) : -1; }
584 
585 __inline__ int hpgs_ostream_seek (hpgs_ostream *_this, size_t pos)
586 { return _this->vtable->seek_func ? _this->vtable->seek_func(_this->stream,pos) : -1; }
587 
588 HPGS_API int hpgs_parse_papersize(const char *str, double *pt_width, double *pt_height);
589 HPGS_API int hpgs_parse_length(const char *str, double *pt_length);
590  /* end of group base */
592 
596 typedef struct hpgs_device_st hpgs_device;
597 typedef struct hpgs_plotsize_device_st hpgs_plotsize_device;
598 typedef struct hpgs_eps_device_st hpgs_eps_device;
599 typedef struct hpgs_gs_device_st hpgs_gs_device;
600 typedef struct hpgs_device_vtable_st hpgs_device_vtable;
601 typedef struct hpgs_image_st hpgs_image;
602 typedef struct hpgs_image_vtable_st hpgs_image_vtable;
603 typedef struct hpgs_png_image_st hpgs_png_image;
604 typedef struct hpgs_paint_device_st hpgs_paint_device;
605 typedef struct hpgs_gstate_st hpgs_gstate;
606 typedef struct hpgs_font_st hpgs_font;
607 
614 {
615  hpgs_line_cap line_cap;
616  hpgs_line_join line_join;
617  hpgs_color color;
618  double miterlimit;
619  double linewidth;
620 
621  int rop3;
622  hpgs_bool src_transparency;
623  hpgs_bool pattern_transparency;
624 
625  hpgs_color pattern_color;
626 
627  int n_dashes;
628  float *dash_lengths;
629  double dash_offset;
630 };
631 
632 HPGS_API hpgs_gstate *hpgs_new_gstate(void);
633 HPGS_API void hpgs_gstate_destroy(hpgs_gstate *gstate);
634 HPGS_API int hpgs_gstate_setdash(hpgs_gstate *gstate,
635  const float *, unsigned, double);
636 
637 
638 #define HPGS_DEVICE_CAP_RASTER (1<<0)
639 #define HPGS_DEVICE_CAP_ANTIALIAS (1<<1)
640 #define HPGS_DEVICE_CAP_VECTOR (1<<2)
641 #define HPGS_DEVICE_CAP_MULTIPAGE (1<<3)
642 #define HPGS_DEVICE_CAP_PAGECOLLATION (1<<4)
643 #define HPGS_DEVICE_CAP_MULTISIZE (1<<5)
644 #define HPGS_DEVICE_CAP_DRAWIMAGE (1<<6)
645 #define HPGS_DEVICE_CAP_NULLIMAGE (1<<7)
646 #define HPGS_DEVICE_CAP_PLOTSIZE (1<<8)
647 #define HPGS_DEVICE_CAP_ROP3 (1<<9)
648 
649 
659  const char * rtti;
660  int (*moveto) (hpgs_device *_this, const hpgs_point *p);
661  int (*lineto) (hpgs_device *_this, const hpgs_point *p);
662  int (*curveto) (hpgs_device *_this, const hpgs_point *p1,
663  const hpgs_point *p2, const hpgs_point *p3 );
664  int (*newpath) (hpgs_device *_this);
665  int (*closepath) (hpgs_device *_this);
666  int (*stroke) (hpgs_device *_this);
667  int (*fill) (hpgs_device *_this, hpgs_bool winding);
668  int (*clip) (hpgs_device *_this, hpgs_bool winding);
669  int (*clipsave) (hpgs_device *_this);
670  int (*cliprestore) (hpgs_device *_this);
671  int (*setrgbcolor) (hpgs_device *_this, const hpgs_color *rgb);
672  int (*setdash) (hpgs_device *_this, const float *, unsigned, double);
673  int (*setlinewidth)(hpgs_device *_this, double);
674  int (*setlinecap) (hpgs_device *_this, hpgs_line_cap);
675  int (*setlinejoin) (hpgs_device *_this, hpgs_line_join);
676  int (*setmiterlimit) (hpgs_device *_this, double l);
677  int (*setrop3) (hpgs_device *_this, int rop,
678  hpgs_bool src_transparency, hpgs_bool pattern_transparency);
679  int (*setpatcol) (hpgs_device *_this, const hpgs_color *rgb);
680  int (*drawimage) (hpgs_device *_this, const hpgs_image *img,
681  const hpgs_point *ll, const hpgs_point *lr,
682  const hpgs_point *ur);
683  int (*setplotsize) (hpgs_device *_this, const hpgs_bbox *bb);
684  int (*getplotsize) (hpgs_device *_this, int i, hpgs_bbox *bb);
685  int (*showpage) (hpgs_device *_this, int i);
686  int (*finish) (hpgs_device *_this);
687  int (*capabilities)(hpgs_device *_this);
688  void (*destroy) (hpgs_device *_this);
689 };
690 
700  hpgs_device_vtable *vtable;
701 };
702 
703 #define HPGS_BASE_CLASS(d) (&(d->inherited))
704 
705 HPGS_API hpgs_plotsize_device *hpgs_new_plotsize_device(hpgs_bool ignore_ps,
706  hpgs_bool do_linewidth);
707 
708 HPGS_API hpgs_eps_device *hpgs_new_eps_device(const char *filename,
709  const hpgs_bbox *bb,
710  hpgs_bool do_rop3 );
711 
712 HPGS_API hpgs_eps_device *hpgs_new_ps_device(const char *filename,
713  const hpgs_bbox *bb,
714  hpgs_bool do_rop3);
715 
716 typedef int (*hpgs_reader_asset_func_t)(void *, hpgs_device *,
717  const hpgs_matrix *,
718  const hpgs_matrix *,
719  const hpgs_bbox *, int);
720 
721 HPGS_API int hpgs_new_plugin_device( hpgs_device **device,
722  void **page_asset_ctxt,
723  hpgs_reader_asset_func_t *page_asset_func,
724  void **frame_asset_ctxt,
725  hpgs_reader_asset_func_t *frame_asset_func,
726  const char *dev_name,
727  const char *filename,
728  const hpgs_bbox *bb,
729  double xres, double yres,
730  hpgs_bool do_rop3,
731  int argc, const char *argv[]);
732 
733 HPGS_API const char *hpgs_device_rtti(hpgs_device *_this);
734 
736 static int hpgs_moveto (hpgs_device *_this, const hpgs_point *p);
738 static int hpgs_lineto (hpgs_device *_this, const hpgs_point *p);
740 static int hpgs_curveto (hpgs_device *_this, const hpgs_point *p1,
741  const hpgs_point *p2, const hpgs_point *p3 );
743 static int hpgs_closepath (hpgs_device *_this);
745 static int hpgs_newpath (hpgs_device *_this);
747 static int hpgs_stroke (hpgs_device *_this);
750 static int hpgs_fill (hpgs_device *_this, hpgs_bool winding);
753 static int hpgs_clip (hpgs_device *_this, hpgs_bool winding);
756 static int hpgs_clipsave (hpgs_device *_this);
758 static int hpgs_cliprestore (hpgs_device *_this);
760 static int hpgs_setrgbcolor (hpgs_device *_this, const hpgs_color *rgb);
762 static int hpgs_setdash (hpgs_device *_this, const float *d,
763  unsigned nd, double s);
765 static int hpgs_setlinewidth(hpgs_device *_this, double w);
767 static int hpgs_setlinecap (hpgs_device *_this, hpgs_line_cap c);
769 static int hpgs_setlinejoin (hpgs_device *_this, hpgs_line_join j);
771 static int hpgs_setmiterlimit (hpgs_device *_this, double l);
773 static int hpgs_device_capabilities (hpgs_device *_this);
774 
775 HPGS_API int hpgs_setrop3 (hpgs_device *_this, int rop,
776  hpgs_bool src_transparency, hpgs_bool pattern_transparency);
777 HPGS_API int hpgs_setpatcol (hpgs_device *_this, const hpgs_color *rgb);
778 
779 HPGS_API int hpgs_drawimage(hpgs_device *_this, const hpgs_image *img,
780  const hpgs_point *ll, const hpgs_point *lr,
781  const hpgs_point *ur);
782 
783 HPGS_API int hpgs_setplotsize (hpgs_device *_this, const hpgs_bbox *bb);
784 HPGS_API int hpgs_getplotsize (hpgs_device *_this, int i, hpgs_bbox *bb);
785 HPGS_API int hpgs_showpage (hpgs_device *_this, int i);
786 HPGS_API int hpgs_device_finish (hpgs_device *_this);
787 HPGS_API void hpgs_device_destroy (hpgs_device *_this);
788 
789 __inline__ int hpgs_moveto (hpgs_device *_this, const hpgs_point *p)
790 { return _this->vtable->moveto(_this,p); }
791 
792 __inline__ int hpgs_lineto (hpgs_device *_this, const hpgs_point *p)
793 { return _this->vtable->lineto(_this,p); }
794 
795 __inline__ int hpgs_curveto (hpgs_device *_this, const hpgs_point *p1,
796  const hpgs_point *p2, const hpgs_point *p3 )
797 { return _this->vtable->curveto(_this,p1,p2,p3); }
798 
799 __inline__ int hpgs_closepath (hpgs_device *_this)
800 { return _this->vtable->closepath(_this); }
801 
802 __inline__ int hpgs_newpath (hpgs_device *_this)
803 { return _this->vtable->newpath(_this); }
804 
805 __inline__ int hpgs_stroke (hpgs_device *_this)
806 { return _this->vtable->stroke(_this); }
807 
808 __inline__ int hpgs_fill (hpgs_device *_this, hpgs_bool winding)
809 { return _this->vtable->fill(_this,winding); }
810 
811 __inline__ int hpgs_clip (hpgs_device *_this, hpgs_bool winding)
812 { return _this->vtable->clip(_this,winding); }
813 
814 __inline__ int hpgs_clipsave (hpgs_device *_this)
815 { return _this->vtable->clipsave(_this); }
816 
817 __inline__ int hpgs_cliprestore (hpgs_device *_this)
818 { return _this->vtable->cliprestore(_this); }
819 
820 __inline__ int hpgs_setrgbcolor (hpgs_device *_this, const hpgs_color *rgb)
821 { return _this->vtable->setrgbcolor ? _this->vtable->setrgbcolor(_this,rgb) : 0; }
822 
823 __inline__ int hpgs_setdash (hpgs_device *_this, const float *d,
824  unsigned nd, double s)
825 { return _this->vtable->setdash ? _this->vtable->setdash(_this,d,nd,s) : 0; }
826 
827 __inline__ int hpgs_setlinewidth(hpgs_device *_this, double w)
828 { return _this->vtable->setlinewidth ? _this->vtable->setlinewidth(_this,w) : 0; }
829 
830 __inline__ int hpgs_setlinecap (hpgs_device *_this, hpgs_line_cap c)
831 { return _this->vtable->setlinecap ? _this->vtable->setlinecap(_this,c) : 0; }
832 
833 __inline__ int hpgs_setlinejoin (hpgs_device *_this, hpgs_line_join j)
834 { return _this->vtable->setlinejoin ? _this->vtable->setlinejoin(_this,j) : 0; }
835 
836 __inline__ int hpgs_setmiterlimit (hpgs_device *_this, double l)
837 { return _this->vtable->setmiterlimit ? _this->vtable->setmiterlimit(_this,l) : 0; }
838 
839 __inline__ int hpgs_device_capabilities (hpgs_device *_this)
840 { return _this->vtable->capabilities(_this); }
841  /* end of group device */
843 
847 typedef struct hpgs_reader_st hpgs_reader;
848 
849 HPGS_API hpgs_reader *hpgs_new_reader(hpgs_istream *in, hpgs_device *dev,
850  hpgs_bool multipage, int v);
851 
852 HPGS_API void hpgs_reader_set_lw_factor(hpgs_reader *reader, double lw_factor);
853 
854 HPGS_API void hpgs_reader_set_fixed_page(hpgs_reader *reader,
855  hpgs_bbox *bbox,
856  double page_width,
857  double page_height,
858  double border,
859  double angle );
860 
861 HPGS_API void hpgs_reader_set_dynamic_page(hpgs_reader *reader,
862  hpgs_bbox *bbox,
863  double max_page_width,
864  double max_page_height,
865  double border,
866  double angle );
867 
868 HPGS_API void hpgs_reader_set_page_asset_func(hpgs_reader *reader,
869  void * ctxt,
870  hpgs_reader_asset_func_t func);
871 
872 HPGS_API void hpgs_reader_set_frame_asset_func(hpgs_reader *reader,
873  void * ctxt,
874  hpgs_reader_asset_func_t func);
875 
876 HPGS_API void hpgs_reader_interrupt(hpgs_reader *reader);
877 HPGS_API int hpgs_reader_get_current_pen(hpgs_reader *reader);
878 
879 HPGS_API int hpgs_reader_imbue(hpgs_reader *reader, hpgs_device *dev);
880 HPGS_API int hpgs_reader_attach(hpgs_reader *reader, hpgs_istream *in);
881 HPGS_API int hpgs_reader_stamp(hpgs_reader *reader,
882  const hpgs_bbox *bb,
883  const char *stamp, const char *encoding,
884  double stamp_size);
885 
886 HPGS_API int hpgs_device_stamp(hpgs_device *dev,
887  const hpgs_bbox *bb,
888  const char *stamp, const char *encoding,
889  double stamp_size);
890 
891 HPGS_API int hpgs_reader_set_png_dump(hpgs_reader *reader, const char *filename);
892 HPGS_API int hpgs_read(hpgs_reader *reader, hpgs_bool finish);
893 HPGS_API void hpgs_destroy_reader(hpgs_reader *reader);
894  /* end of group reader */
896 
901 HPGS_API hpgs_font *hpgs_find_font(const char *name);
902 HPGS_API void hpgs_destroy_font(hpgs_font *font);
903 HPGS_API double hpgs_font_get_ascent(hpgs_font *font);
904 HPGS_API double hpgs_font_get_descent(hpgs_font *font);
905 HPGS_API double hpgs_font_get_line_gap(hpgs_font *font);
906 HPGS_API double hpgs_font_get_cap_height(hpgs_font *font);
907 HPGS_API unsigned hpgs_font_get_glyph_count(hpgs_font *font);
908 HPGS_API unsigned hpgs_font_get_glyph_id(hpgs_font *font, int uc);
909 HPGS_API const char *hpgs_font_get_glyph_name(hpgs_font *font, unsigned gid);
910 HPGS_API int hpgs_font_get_glyph_bbox(hpgs_font *font, hpgs_bbox *bb, unsigned gid);
911 HPGS_API int hpgs_font_get_glyph_metrics(hpgs_font *font, hpgs_point *m, unsigned gid);
912 HPGS_API int hpgs_font_get_kern_metrics(hpgs_font *font, hpgs_point *m, unsigned gid_l, unsigned gid_r);
913 HPGS_API int hpgs_font_get_utf8_metrics(hpgs_font *font, hpgs_point *m, const char *str, int strlen);
914 
915 typedef int (*hpgs_moveto_func_t) (void *ctxt, const hpgs_point *p);
916 typedef int (*hpgs_lineto_func_t) (void *ctxt, const hpgs_point *p);
917 typedef int (*hpgs_curveto_func_t) (void *ctxt, const hpgs_point *p1, const hpgs_point *p2, const hpgs_point *p3);
918 typedef int (*hpgs_fill_func_t) (void *ctxt, hpgs_bool winding);
919 
920 HPGS_API int hpgs_font_decompose_glyph(hpgs_font *font,
921  void *ctxt,
922  hpgs_moveto_func_t moveto_func,
923  hpgs_lineto_func_t lineto_func,
924  hpgs_curveto_func_t curveto_func,
925  const hpgs_matrix *m,
926  unsigned gid);
927 
928 HPGS_API int hpgs_font_draw_glyph(hpgs_font *font,
929  hpgs_device *device,
930  const hpgs_matrix *m,
931  unsigned gid);
932 
933 HPGS_API int hpgs_font_decompose_utf8(hpgs_font *font,
934  void *ctxt,
935  hpgs_moveto_func_t moveto_func,
936  hpgs_lineto_func_t lineto_func,
937  hpgs_curveto_func_t curveto_func,
938  hpgs_fill_func_t fill_func,
939  const hpgs_matrix *m,
940  const char *str, int strlen);
941 
942 HPGS_API int hpgs_font_draw_utf8(hpgs_font *font,
943  hpgs_device *device,
944  const hpgs_matrix *m,
945  const char *str, int strlen);
946  /* end of group font */
948 
960  int (*get_pixel) (const hpgs_image *_this,
961  int x, int y, hpgs_paint_color *c, double *alpha);
962  int (*put_pixel) (hpgs_image *_this,
963  int x, int y, const hpgs_paint_color *c, double alpha);
964  int (*put_chunk) (hpgs_image *_this,
965  int x1, int x2, int y, const hpgs_paint_color *c);
966  int (*rop3_pixel) (hpgs_image *_this,
967  int x, int y, const hpgs_paint_color *c, double alpha);
968  int (*rop3_chunk) (hpgs_image *_this,
969  int x1, int x2, int y, const hpgs_paint_color *c);
970  int (*setrop3) (hpgs_image *_this, hpgs_rop3_func_t rop3);
971  int (*setpatcol) (hpgs_image *_this, const hpgs_palette_color *p);
972  int (*resize) (hpgs_image *_this, int w, int h);
973  int (*set_resolution)(hpgs_image *pim, double x_dpi, double y_dpi);
974  int (*clear) (hpgs_image *_this);
975  int (*write) (hpgs_image *_this, const char *filename);
976  int (*get_data) (hpgs_image *_this, unsigned char **data, int *stride, int *depth);
977  void (*destroy) (hpgs_image *_this);
978 };
979 
990  hpgs_image_vtable *vtable;
991  int width;
992  int height;
993 
994  hpgs_palette_color *palette;
995  unsigned *palette_idx;
997 };
998 
999 HPGS_API int hpgs_image_define_color_func (hpgs_image *image, hpgs_paint_color *c);
1000 
1001 static int hpgs_image_define_color (hpgs_image *image, hpgs_paint_color *c);
1002 
1009 __inline__ int hpgs_image_define_color (hpgs_image *image, hpgs_paint_color *c)
1010 {
1011  if (image->palette) return hpgs_image_define_color_func (image,c); else return 0;
1012 }
1013 
1014 HPGS_API int hpgs_image_set_palette (hpgs_image *image,
1015  hpgs_palette_color *p, int np);
1016 
1017 HPGS_API hpgs_png_image *hpgs_new_png_image(int width, int height,
1018  int depth, hpgs_bool palette,
1019  hpgs_bool do_rop3);
1020 
1021 HPGS_API int hpgs_png_image_set_compression(hpgs_png_image *pim, int compression);
1022 
1023 HPGS_API int hpgs_image_set_resolution(hpgs_image *pim, double x_dpi, double y_dpi);
1024 
1025 HPGS_API int hpgs_image_get_data(hpgs_image *_this,
1026  unsigned char **data, int *stride,
1027  int *depth);
1028 
1031 static int hpgs_image_get_pixel (const hpgs_image *_this,
1032  int x, int y,
1033  hpgs_paint_color *c, double *alpha);
1036 static int hpgs_image_put_pixel (hpgs_image *_this,
1037  int x, int y,
1038  const hpgs_paint_color *c, double alpha);
1042 static int hpgs_image_put_chunk (hpgs_image *_this,
1043  int x1, int x2, int y, const hpgs_paint_color *c);
1044 
1049 static int hpgs_image_rop3_pixel (hpgs_image *_this,
1050  int x, int y,
1051  const hpgs_paint_color *c, double alpha);
1057 static int hpgs_image_rop3_chunk (hpgs_image *_this,
1058  int x1, int x2, int y, const hpgs_paint_color *c);
1059 
1060 HPGS_API int hpgs_image_resize (hpgs_image *_this, int w, int h);
1061 HPGS_API int hpgs_image_clear (hpgs_image *_this);
1062 HPGS_API int hpgs_image_write (hpgs_image *_this, const char *filename);
1063 HPGS_API int hpgs_image_setrop3 (hpgs_image *_this, hpgs_rop3_func_t rop3);
1064 HPGS_API int hpgs_image_setpatcol (hpgs_image *_this, const hpgs_palette_color *p);
1065 
1066 HPGS_API void hpgs_image_destroy (hpgs_image *_this);
1067 
1068 __inline__ int hpgs_image_get_pixel (const hpgs_image *_this,
1069  int x, int y,
1070  hpgs_paint_color *c, double *alpha)
1071 { return _this->vtable->get_pixel(_this,x,y,c,alpha); }
1072 
1073 __inline__ int hpgs_image_put_pixel (hpgs_image *_this,
1074  int x, int y,
1075  const hpgs_paint_color *c, double alpha)
1076 { return _this->vtable->put_pixel(_this,x,y,c,alpha); }
1077 
1078 __inline__ int hpgs_image_put_chunk (hpgs_image *_this,
1079  int x1, int x2, int y, const hpgs_paint_color *c)
1080 { return _this->vtable->put_chunk(_this,x1,x2,y,c); }
1081 
1082 __inline__ int hpgs_image_rop3_pixel (hpgs_image *_this,
1083  int x, int y,
1084  const hpgs_paint_color *c, double alpha)
1085 { return _this->vtable->rop3_pixel(_this,x,y,c,alpha); }
1086 
1087 __inline__ int hpgs_image_rop3_chunk (hpgs_image *_this,
1088  int x1, int x2, int y, const hpgs_paint_color *c)
1089 { return _this->vtable->rop3_chunk(_this,x1,x2,y,c); }
1090 
1091 HPGS_API int hpgs_image_rop3_clip(hpgs_device *device,
1092  hpgs_palette_color *data,
1093  const hpgs_image *img,
1094  const hpgs_point *ll, const hpgs_point *lr,
1095  const hpgs_point *ur,
1096  const hpgs_palette_color *p,
1097  hpgs_xrop3_func_t xrop3);
1098  /* end of group image */
1100 
1105 typedef struct hpgs_path_point_st hpgs_path_point;
1106 typedef struct hpgs_paint_path_st hpgs_paint_path;
1107 
1108 #define HPGS_POINT_ROLE_MASK 0xF
1109 #define HPGS_POINT_UNDEFINED 0x0
1110 #define HPGS_POINT_LINE 0x1
1111 #define HPGS_POINT_BEZIER 0x2
1112 #define HPGS_POINT_CONTROL 0x3
1113 #define HPGS_POINT_FILL_LINE 0x4
1114 #define HPGS_POINT_DOT 0x8
1115 
1116 #define HPGS_POINT_SUBPATH_START 0x10
1117 #define HPGS_POINT_SUBPATH_END 0x20
1118 #define HPGS_POINT_SUBPATH_CLOSE 0x40
1119 
1120 
1126 {
1128  int flags;
1129 };
1130 
1138 {
1144  hpgs_path_point *points;
1145  int n_points;
1146  int last_start;
1147  int points_malloc_size;
1150  hpgs_bbox bb;
1151 };
1152 
1153 HPGS_API hpgs_paint_path *hpgs_new_paint_path(void);
1154 HPGS_API void hpgs_paint_path_destroy(hpgs_paint_path *_this);
1155 HPGS_API void hpgs_paint_path_truncate(hpgs_paint_path *_this);
1156 
1157 HPGS_API int hpgs_paint_path_moveto(hpgs_paint_path *_this,
1158  const hpgs_point *p );
1159 
1160 HPGS_API int hpgs_paint_path_lineto(hpgs_paint_path *_this,
1161  const hpgs_point *p );
1162 
1163 HPGS_API int hpgs_paint_path_curveto(hpgs_paint_path *_this,
1164  const hpgs_point *p1,
1165  const hpgs_point *p2,
1166  const hpgs_point *p3 );
1167 
1168 HPGS_API int hpgs_paint_path_closepath(hpgs_paint_path *_this);
1169 
1170 HPGS_API int hpgs_paint_path_buldgeto(hpgs_paint_path *_this,
1171  const hpgs_point *p,
1172  double buldge);
1173 
1174 HPGS_API hpgs_paint_path *hpgs_paint_path_stroke_path(const hpgs_paint_path *_this,
1175  const hpgs_gstate *gstate);
1176 
1177 HPGS_API hpgs_paint_path *hpgs_paint_path_decompose_dashes(const hpgs_paint_path *_this,
1178  const hpgs_gstate *gstate);
1179 
1180 HPGS_API double hpgs_bezier_path_x (const hpgs_paint_path *path, int i, double t);
1181 HPGS_API double hpgs_bezier_path_y (const hpgs_paint_path *path, int i, double t);
1182 HPGS_API double hpgs_bezier_path_delta_x (const hpgs_paint_path *path, int i, double t);
1183 HPGS_API double hpgs_bezier_path_delta_y (const hpgs_paint_path *path, int i, double t);
1184 
1185 // These four functions are deprecated an will disappear in hpgs-1.2
1186 HPGS_API double hpgs_bezier_path_xmin (const hpgs_paint_path *path, int i);
1187 HPGS_API double hpgs_bezier_path_xmax (const hpgs_paint_path *path, int i);
1188 HPGS_API double hpgs_bezier_path_ymin (const hpgs_paint_path *path, int i);
1189 HPGS_API double hpgs_bezier_path_ymax (const hpgs_paint_path *path, int i);
1190 
1191 HPGS_API void hpgs_bezier_path_point(const hpgs_paint_path *path, int i,
1192  double t, hpgs_point *p);
1193 
1194 HPGS_API void hpgs_bezier_path_delta(const hpgs_paint_path *path, int i,
1195  double t, hpgs_point *p);
1196 
1197 HPGS_API void hpgs_bezier_path_tangent(const hpgs_paint_path *path, int i,
1198  double t, int orientation,
1199  double ytol,
1200  hpgs_point *p);
1201 
1202 HPGS_API void hpgs_bezier_path_singularities(const hpgs_paint_path *path, int i,
1203  double t0, double t1,
1204  int *nx, double *tx);
1205 
1206 HPGS_API void hpgs_bezier_path_to_quadratic(const hpgs_paint_path *path, int i,
1207  double t0, double t1,
1208  int *nx, hpgs_point *points);
1209  /* end of group path */
1211 
1215 HPGS_API hpgs_paint_device *hpgs_new_paint_device(hpgs_image *image,
1216  const char *filename,
1217  const hpgs_bbox *bb,
1218  hpgs_bool antialias);
1219 
1220 HPGS_API void hpgs_paint_device_set_image_interpolation (hpgs_paint_device *pdv, int i);
1221 HPGS_API void hpgs_paint_device_set_thin_alpha (hpgs_paint_device *pdv, double a);
1222  /* end of group paint_device */
1224 
1225 #ifdef __cplusplus
1226 } // end of extern "C"
1227 #endif
1228 
1229 #endif /* ! __HPGS_H */
struct hpgs_point_st hpgs_point
A 2D point.
HPGS_API void hpgs_matrix_xform(hpgs_point *res, const hpgs_matrix *m, const hpgs_point *p)
Definition: hpgsmatrix.c:50
HPGS_API int hpgs_paint_path_buldgeto(hpgs_paint_path *_this, const hpgs_point *p, double buldge)
Definition: hpgspaintpath.c:301
HPGS_API hpgs_ostream * hpgs_new_z_ostream(hpgs_ostream *base, int compression, hpgs_bool take_base)
Definition: hpgszostream.c:328
A virtual input stream for the HPGL reader.
Definition: hpgs.h:426
HPGS_API hpgs_bool hpgs_get_arg_value(const char *opt, const char *argv[], const char **value, int *narg)
Definition: hpgsglobal.c:205
HPGS_API const char * hpgs_device_rtti(hpgs_device *_this)
Definition: hpgsdevices.c:64
HPGS_API int hpgs_reader_get_current_pen(hpgs_reader *reader)
Definition: hpgsreader.c:1030
HPGS_API double hpgs_font_get_ascent(hpgs_font *font)
Definition: hpgsfont.c:1824
HPGS_API void hpgs_vlog(const char *fmt, va_list ap)
Definition: hpgsglobal.c:518
hpgs_image_vtable * vtable
The virtual table.
Definition: hpgs.h:990
A screen RGB color as stored in a palette.
Definition: hpgs.h:250
HPGS_API double hpgs_bezier_path_ymax(const hpgs_paint_path *path, int i)
Definition: hpgsbezier.c:569
HPGS_API int hpgs_reader_stamp(hpgs_reader *reader, const hpgs_bbox *bb, const char *stamp, const char *encoding, double stamp_size)
Definition: hpgsreader.c:853
A transformation matrix for 2D points.
Definition: hpgs.h:340
static int hpgs_curveto(hpgs_device *_this, const hpgs_point *p1, const hpgs_point *p2, const hpgs_point *p3)
Definition: hpgs.h:795
HPGS_API int hpgs_reader_imbue(hpgs_reader *reader, hpgs_device *dev)
Definition: hpgsreader.c:172
HPGS_API int hpgs_font_get_glyph_bbox(hpgs_font *font, hpgs_bbox *bb, unsigned gid)
Definition: hpgsfont.c:1907
HPGS_API hpgs_eps_device * hpgs_new_ps_device(const char *filename, const hpgs_bbox *bb, hpgs_bool do_rop3)
Definition: hpgsdevices.c:1054
HPGS_API int hpgs_parse_length(const char *str, double *pt_length)
Definition: hpgsbase.c:145
HPGS_API void hpgs_reader_set_lw_factor(hpgs_reader *reader, double lw_factor)
Definition: hpgsreader.c:161
HPGS_API hpgs_font * hpgs_find_font(const char *name)
Definition: hpgsfont.c:1745
HPGS_API int hpgs_array_safe_resize(size_t itemsz, void **pptr, size_t *psz, size_t nsz)
Definition: hpgsglobal.c:241
static int hpgs_istream_iseof(hpgs_istream *_this)
Definition: hpgs.h:468
static int hpgs_device_capabilities(hpgs_device *_this)
Definition: hpgs.h:839
static int hpgs_setrgbcolor(hpgs_device *_this, const hpgs_color *rgb)
Definition: hpgs.h:820
HPGS_API int hpgs_parse_papersize(const char *str, double *pt_width, double *pt_height)
Definition: hpgsbase.c:52
HPGS_API hpgs_bool hpgs_have_error()
Definition: hpgsglobal.c:406
HPGS_API void hpgs_bezier_path_singularities(const hpgs_paint_path *path, int i, double t0, double t1, int *nx, double *tx)
Definition: hpgsbezier.c:200
hpgs_line_cap
Definition: hpgs.h:370
static int hpgs_istream_seekend(hpgs_istream *_this, size_t pos)
Definition: hpgs.h:477
struct hpgs_color_st hpgs_color
An application level RGB color.
A stored vector path.
Definition: hpgs.h:1137
HPGS_API int hpgs_image_resize(hpgs_image *_this, int w, int h)
Definition: hpgsimage.c:1282
HPGS_API hpgs_ostream * hpgs_new_mem_ostream(size_t data_reserve)
Definition: hpgsostream.c:305
HPGS_API int hpgs_setrop3(hpgs_device *_this, int rop, hpgs_bool src_transparency, hpgs_bool pattern_transparency)
Definition: hpgsdevices.c:79
A table of virtual function implementing hpgs_image.
Definition: hpgs.h:959
static int hpgs_image_put_pixel(hpgs_image *_this, int x, int y, const hpgs_paint_color *c, double alpha)
Definition: hpgs.h:1073
HPGS_API double hpgs_bezier_path_ymin(const hpgs_paint_path *path, int i)
Definition: hpgsbezier.c:554
HPGS_API double hpgs_font_get_cap_height(hpgs_font *font)
Definition: hpgsfont.c:1849
HPGS_API void hpgs_clear_error()
Definition: hpgsglobal.c:389
HPGS_API double hpgs_bezier_path_xmin(const hpgs_paint_path *path, int i)
Definition: hpgsbezier.c:524
HPGS_API double hpgs_bezier_path_xmax(const hpgs_paint_path *path, int i)
Definition: hpgsbezier.c:539
HPGS_API int hpgs_paint_path_moveto(hpgs_paint_path *_this, const hpgs_point *p)
Definition: hpgspaintpath.c:135
static int hpgs_fill(hpgs_device *_this, hpgs_bool winding)
Definition: hpgs.h:808
static int hpgs_setlinecap(hpgs_device *_this, hpgs_line_cap c)
Definition: hpgs.h:830
HPGS_API int hpgs_font_get_utf8_metrics(hpgs_font *font, hpgs_point *m, const char *str, int strlen)
Definition: hpgsfont.c:1969
A table of virtual function implementing hpgs_istream.
Definition: hpgs.h:509
HPGS_API hpgs_paint_path * hpgs_paint_path_stroke_path(const hpgs_paint_path *_this, const hpgs_gstate *gstate)
Definition: hpgspaintpath.c:1153
HPGS_API double hpgs_bezier_path_delta_x(const hpgs_paint_path *path, int i, double t)
Definition: hpgsbezier.c:64
HPGS_API int hpgs_paint_path_curveto(hpgs_paint_path *_this, const hpgs_point *p1, const hpgs_point *p2, const hpgs_point *p3)
Definition: hpgspaintpath.c:224
HPGS_API int hpgs_read(hpgs_reader *reader, hpgs_bool finish)
Definition: hpgsreader.c:455
static int hpgs_cliprestore(hpgs_device *_this)
Definition: hpgs.h:817
HPGS_API void hpgs_cleanup(void)
Definition: hpgsglobal.c:142
A 2D point.
Definition: hpgs.h:227
static int hpgs_istream_iserror(hpgs_istream *_this)
Definition: hpgs.h:471
HPGS_API unsigned hpgs_font_get_glyph_count(hpgs_font *font)
Definition: hpgsfont.c:1866
HPGS_API int hpgs_image_setpatcol(hpgs_image *_this, const hpgs_palette_color *p)
Definition: hpgsimage.c:1271
Round line join.
Definition: hpgs.h:379
A truetype font.
Definition: hpgsfont.h:249
HPGS_API void hpgs_reader_set_dynamic_page(hpgs_reader *reader, hpgs_bbox *bbox, double max_page_width, double max_page_height, double border, double angle)
Definition: hpgsreader.c:831
static int hpgs_ostream_seek(hpgs_ostream *_this, size_t pos)
Definition: hpgs.h:585
HPGS_API int hpgs_reader_set_png_dump(hpgs_reader *reader, const char *filename)
Definition: hpgsreader.c:994
HPGS_API void hpgs_gstate_destroy(hpgs_gstate *gstate)
Definition: hpgsgstate.c:74
HPGS_API int hpgs_gstate_setdash(hpgs_gstate *gstate, const float *, unsigned, double)
Definition: hpgsgstate.c:88
HPGS_API void hpgs_paint_device_set_image_interpolation(hpgs_paint_device *pdv, int i)
Definition: hpgspaint.c:598
HPGS_API hpgs_paint_path * hpgs_paint_path_decompose_dashes(const hpgs_paint_path *_this, const hpgs_gstate *gstate)
Definition: hpgspaintpath.c:1300
HPGS_API double hpgs_font_get_descent(hpgs_font *font)
Definition: hpgsfont.c:1832
HPGS_API int hpgs_setplotsize(hpgs_device *_this, const hpgs_bbox *bb)
Definition: hpgsdevices.c:121
A point in a stored path.
Definition: hpgs.h:1125
static void hpgs_bbox_add(hpgs_bbox *bb, const hpgs_point *p)
Definition: hpgs.h:325
int width
The number of pixel columns.
Definition: hpgs.h:991
Miter line join.
Definition: hpgs.h:378
static int hpgs_setdash(hpgs_device *_this, const float *d, unsigned nd, double s)
Definition: hpgs.h:823
The vector graphics state.
Definition: hpgs.h:613
HPGS_API const char * hpgs_get_prefix()
Definition: hpgsglobal.c:123
HPGS_API char * hpgs_share_filename(const char *rel_filename)
Definition: hpgsglobal.c:314
static int hpgs_ostream_flush(hpgs_ostream *_this)
Definition: hpgs.h:570
HPGS_API int hpgs_image_set_palette(hpgs_image *image, hpgs_palette_color *p, int np)
Definition: hpgsimage.c:1382
HPGS_API int hpgs_set_verror(const char *fmt, va_list ap)
Definition: hpgsglobal.c:362
HPGS_API hpgs_paint_device * hpgs_new_paint_device(hpgs_image *image, const char *filename, const hpgs_bbox *bb, hpgs_bool antialias)
Definition: hpgspaint.c:507
HPGS_API void hpgs_bezier_path_delta(const hpgs_paint_path *path, int i, double t, hpgs_point *p)
Definition: hpgsbezier.c:44
HPGS_API int hpgs_utf8_strlen(const char *p, int n)
Definition: hpgsglobal.c:579
HPGS_API hpgs_istream * hpgs_new_file_istream(const char *fn)
Definition: hpgsistream.c:86
HPGS_API double hpgs_bezier_path_y(const hpgs_paint_path *path, int i, double t)
Definition: hpgsbezier.c:625
HPGS_API void hpgs_matrix_iscale(hpgs_point *res, const hpgs_point *p, const hpgs_matrix *m)
Definition: hpgsmatrix.c:158
static int hpgs_image_put_chunk(hpgs_image *_this, int x1, int x2, int y, const hpgs_paint_color *c)
Definition: hpgs.h:1078
HPGS_API int hpgs_font_get_glyph_metrics(hpgs_font *font, hpgs_point *m, unsigned gid)
Definition: hpgsfont.c:1930
HPGS_API void hpgs_reader_interrupt(hpgs_reader *reader)
Definition: hpgsreader.c:149
static int hpgs_ostream_iserror(hpgs_ostream *_this)
Definition: hpgs.h:576
HPGS_API int hpgs_image_rop3_clip(hpgs_device *device, hpgs_palette_color *data, const hpgs_image *img, const hpgs_point *ll, const hpgs_point *lr, const hpgs_point *ur, const hpgs_palette_color *p, hpgs_xrop3_func_t xrop3)
Definition: hpgsimagerop.c:124
The pixel rendering vector graphics device.
Definition: hpgspaint.h:77
HPGS_API void hpgs_paint_path_truncate(hpgs_paint_path *_this)
Definition: hpgspaintpath.c:95
double lw_factor
Definition: hpgsreader.h:245
int height
The number of pixel rows.
Definition: hpgs.h:992
HPGS_API void hpgs_matrix_scale(hpgs_point *res, const hpgs_matrix *m, const hpgs_point *p)
Definition: hpgsmatrix.c:141
HPGS_PRINTF2_API int hpgs_ostream_printf(hpgs_ostream *_this, const char *msg,...)
Definition: hpgsostream.c:39
static int hpgs_ostream_tell(hpgs_ostream *_this, int layer, size_t *pos)
Definition: hpgs.h:582
HPGS_API void hpgs_matrix_concat(hpgs_matrix *res, const hpgs_matrix *a, const hpgs_matrix *b)
Definition: hpgsmatrix.c:176
HPGS_API hpgs_png_image * hpgs_new_png_image(int width, int height, int depth, hpgs_bool palette, hpgs_bool do_rop3)
Definition: hpgsimage.c:1111
HPGS_API unsigned hpgs_font_get_glyph_id(hpgs_font *font, int uc)
Definition: hpgsfont.c:1875
HPGS_API hpgs_reader * hpgs_new_reader(hpgs_istream *in, hpgs_device *dev, hpgs_bool multipage, int v)
Definition: hpgsreader.c:58
HPGS_API void hpgs_destroy_font(hpgs_font *font)
Definition: hpgsfont.c:1792
HPGS_API void hpgs_matrix_ixform_bbox(hpgs_bbox *res, const hpgs_bbox *bb, const hpgs_matrix *m)
Definition: hpgsmatrix.c:111
A table of virtual function implementing hpgs_device.
Definition: hpgs.h:658
HPGS_API int hpgs_device_stamp(hpgs_device *dev, const hpgs_bbox *bb, const char *stamp, const char *encoding, double stamp_size)
Definition: hpgsreader.c:868
HPGS_API int hpgs_font_draw_utf8(hpgs_font *font, hpgs_device *device, const hpgs_matrix *m, const char *str, int strlen)
Definition: hpgsfont.c:2274
HPGS_API void hpgs_matrix_invert(hpgs_matrix *res, const hpgs_matrix *m)
Definition: hpgsmatrix.c:208
HPGS_API int hpgs_png_image_set_compression(hpgs_png_image *pim, int compression)
Definition: hpgsimage.c:1224
static int hpgs_clipsave(hpgs_device *_this)
Definition: hpgs.h:814
HPGS_API void hpgs_paint_device_set_thin_alpha(hpgs_paint_device *pdv, double a)
Definition: hpgspaint.c:607
static int hpgs_setlinewidth(hpgs_device *_this, double w)
Definition: hpgs.h:827
HPGS_API void hpgs_set_logger(hpgs_logger_func_t func)
Definition: hpgsglobal.c:491
HPGS_API int hpgs_drawimage(hpgs_device *_this, const hpgs_image *img, const hpgs_point *ll, const hpgs_point *lr, const hpgs_point *ur)
Definition: hpgsdevices.c:106
hpgs_path_point * points
Definition: hpgs.h:1144
A virtual output stream for the HPGL reader.
Definition: hpgs.h:529
unsigned * palette_idx
a compacted rgb color index.
Definition: hpgs.h:995
HPGS_API double hpgs_bezier_path_x(const hpgs_paint_path *path, int i, double t)
Definition: hpgsbezier.c:611
HPGS_PRINTF1_API void hpgs_log(const char *fmt,...)
Definition: hpgsglobal.c:504
HPGS_API int hpgs_image_define_color_func(hpgs_image *image, hpgs_paint_color *c)
Definition: hpgsimage.c:1321
static void hpgs_bbox_addborder(hpgs_bbox *bb, double border)
Definition: hpgs.h:317
static int hpgs_image_define_color(hpgs_image *image, hpgs_paint_color *c)
Definition: hpgs.h:1009
static int hpgs_clip(hpgs_device *_this, hpgs_bool winding)
Definition: hpgs.h:811
HPGS_API int hpgs_image_set_resolution(hpgs_image *pim, double x_dpi, double y_dpi)
Definition: hpgsimage.c:1237
HPGS_API int hpgs_paint_path_closepath(hpgs_paint_path *_this)
Definition: hpgspaintpath.c:261
HPGS_API int hpgs_image_get_data(hpgs_image *_this, unsigned char **data, int *stride, int *depth)
Definition: hpgsimage.c:1251
HPGS_API int hpgs_font_decompose_utf8(hpgs_font *font, void *ctxt, hpgs_moveto_func_t moveto_func, hpgs_lineto_func_t lineto_func, hpgs_curveto_func_t curveto_func, hpgs_fill_func_t fill_func, const hpgs_matrix *m, const char *str, int strlen)
Definition: hpgsfont.c:2218
hpgs_palette_color * palette
The palette for indexed images.
Definition: hpgs.h:994
An abstract pixel image.
Definition: hpgs.h:989
HPGS_API void hpgs_matrix_ixform(hpgs_point *res, const hpgs_point *p, const hpgs_matrix *m)
Definition: hpgsmatrix.c:64
HPGS_API int hpgs_verror_ctxt(const char *fmt, va_list ap)
Definition: hpgsglobal.c:423
HPGS_API int hpgs_font_decompose_glyph(hpgs_font *font, void *ctxt, hpgs_moveto_func_t moveto_func, hpgs_lineto_func_t lineto_func, hpgs_curveto_func_t curveto_func, const hpgs_matrix *m, unsigned gid)
Definition: hpgsfont.c:2174
static int hpgs_lineto(hpgs_device *_this, const hpgs_point *p)
Definition: hpgs.h:792
HPGS_API const char * hpgs_get_error()
Definition: hpgsglobal.c:460
HPGS_API hpgs_plotsize_device * hpgs_new_plotsize_device(hpgs_bool ignore_ps, hpgs_bool do_linewidth)
Definition: hpgsdevices.c:1453
static int hpgs_istream_close(hpgs_istream *_this)
Definition: hpgs.h:465
HPGS_API void hpgs_bezier_path_to_quadratic(const hpgs_paint_path *path, int i, double t0, double t1, int *nx, hpgs_point *points)
Definition: hpgsbezier.c:269
static int hpgs_newpath(hpgs_device *_this)
Definition: hpgs.h:802
static int hpgs_ostream_close(hpgs_ostream *_this)
Definition: hpgs.h:573
Square line cap.
Definition: hpgs.h:373
Butt line cap.
Definition: hpgs.h:371
HPGS_API int hpgs_font_draw_glyph(hpgs_font *font, hpgs_device *device, const hpgs_matrix *m, unsigned gid)
Definition: hpgsfont.c:2195
hpgs_line_join
Definition: hpgs.h:377
HPGS_API int hpgs_reader_attach(hpgs_reader *reader, hpgs_istream *in)
Definition: hpgsreader.c:207
A virtual vector graphics device for the HPGL reader.
Definition: hpgs.h:699
HPGS_API const char * hpgs_font_get_glyph_name(hpgs_font *font, unsigned gid)
Definition: hpgsfont.c:1892
static int hpgs_image_rop3_chunk(hpgs_image *_this, int x1, int x2, int y, const hpgs_paint_color *c)
Definition: hpgs.h:1087
static size_t hpgs_istream_read(void *ptr, size_t size, size_t nmemb, hpgs_istream *_this)
Definition: hpgs.h:483
HPGS_API int hpgs_image_setrop3(hpgs_image *_this, hpgs_rop3_func_t rop3)
Definition: hpgsimage.c:1262
HPGS_API hpgs_bool hpgs_bbox_isequal(const hpgs_bbox *bb1, const hpgs_bbox *bb2)
Definition: hpgsbbox.c:39
HPGS_PRINTF1_API int hpgs_error_ctxt(const char *fmt,...)
Definition: hpgsglobal.c:346
HPGS_API int hpgs_image_write(hpgs_image *_this, const char *filename)
Definition: hpgsimage.c:1300
An application level RGB color.
Definition: hpgs.h:238
HPGS_API void hpgs_reader_set_frame_asset_func(hpgs_reader *reader, void *ctxt, hpgs_reader_asset_func_t func)
Definition: hpgsreader.c:979
double page_height
Definition: hpgsreader.h:290
static hpgs_istream * hpgs_ostream_getbuf(hpgs_ostream *_this)
Definition: hpgs.h:579
static int hpgs_istream_seek(hpgs_istream *_this, size_t pos)
Definition: hpgs.h:474
HPGS_API void hpgs_bbox_intersect(hpgs_bbox *bb1, const hpgs_bbox *bb2)
Definition: hpgsbbox.c:136
HPGS_API int hpgs_ostream_vprintf(hpgs_ostream *_this, const char *msg, va_list ap)
Definition: hpgsostream.c:50
HPGS_API int hpgs_getplotsize(hpgs_device *_this, int i, hpgs_bbox *bb)
Definition: hpgsdevices.c:139
HPGS_API hpgs_paint_path * hpgs_new_paint_path(void)
Definition: hpgspaintpath.c:58
HPGS_API hpgs_gstate * hpgs_new_gstate(void)
Definition: hpgsgstate.c:44
HPGS_API int hpgs_paint_path_lineto(hpgs_paint_path *_this, const hpgs_point *p)
Definition: hpgspaintpath.c:186
HPGS_API double hpgs_bezier_path_delta_y(const hpgs_paint_path *path, int i, double t)
Definition: hpgsbezier.c:79
HPGS_API char * hpgs_vsprintf_malloc(const char *fmt, va_list ap)
Definition: hpgsglobal.c:255
HPGS_API int hpgs_setpatcol(hpgs_device *_this, const hpgs_color *rgb)
Definition: hpgsdevices.c:91
HPGS_API void hpgs_bezier_path_tangent(const hpgs_paint_path *path, int i, double t, int orientation, double ytol, hpgs_point *p)
Definition: hpgsbezier.c:104
static int hpgs_getc(hpgs_istream *_this)
Definition: hpgs.h:459
static int hpgs_closepath(hpgs_device *_this)
Definition: hpgs.h:799
Bevel line join.
Definition: hpgs.h:380
HPGS_API int hpgs_font_get_kern_metrics(hpgs_font *font, hpgs_point *m, unsigned gid_l, unsigned gid_r)
Definition: hpgsfont.c:1951
HPGS_API void hpgs_destroy_reader(hpgs_reader *reader)
Definition: hpgsreader.c:1039
HPGS_API void hpgs_matrix_xform_bbox(hpgs_bbox *res, const hpgs_matrix *m, const hpgs_bbox *bb)
Definition: hpgsmatrix.c:82
HPGS_PRINTF1_API char * hpgs_sprintf_malloc(const char *fmt,...)
Definition: hpgsglobal.c:297
static int hpgs_stroke(hpgs_device *_this)
Definition: hpgs.h:805
A bounding box.
Definition: hpgs.h:296
HPGS_API void hpgs_bbox_null(hpgs_bbox *bb)
Definition: hpgsbbox.c:111
HPGS_API void hpgs_matrix_set_identity(hpgs_matrix *m)
Definition: hpgsmatrix.c:39
HPGS_API hpgs_eps_device * hpgs_new_eps_device(const char *filename, const hpgs_bbox *bb, hpgs_bool do_rop3)
Definition: hpgsdevices.c:963
A vector graphics device for drawing to an eps file.
Definition: hpgsdevices.h:111
static int hpgs_image_rop3_pixel(hpgs_image *_this, int x, int y, const hpgs_paint_color *c, double alpha)
Definition: hpgs.h:1082
Round line cap.
Definition: hpgs.h:372
HPGS_API void hpgs_reader_set_page_asset_func(hpgs_reader *reader, void *ctxt, hpgs_reader_asset_func_t func)
Definition: hpgsreader.c:961
HPGS_API hpgs_bool hpgs_bbox_isnull(const hpgs_bbox *bb)
Definition: hpgsbbox.c:91
static int hpgs_setlinejoin(hpgs_device *_this, hpgs_line_join j)
Definition: hpgs.h:833
A vector graphics device for plotsize calculating.
Definition: hpgsdevices.h:62
HPGS_API int hpgs_image_clear(hpgs_image *_this)
Definition: hpgsimage.c:1291
A table of virtual function implementing hpgs_istream.
Definition: hpgs.h:406
static int hpgs_image_get_pixel(const hpgs_image *_this, int x, int y, hpgs_paint_color *c, double *alpha)
Definition: hpgs.h:1068
HPGS_API double hpgs_font_get_line_gap(hpgs_font *font)
Definition: hpgsfont.c:1840
static size_t hpgs_ostream_write(const void *ptr, size_t size, size_t nmemb, hpgs_ostream *_this)
Definition: hpgs.h:567
static int hpgs_moveto(hpgs_device *_this, const hpgs_point *p)
Definition: hpgs.h:789
A HPGL interpreter.
Definition: hpgsreader.h:235
int palette_ncolors
The number of colors in the palette.
Definition: hpgs.h:996
HPGS_API void hpgs_paint_path_destroy(hpgs_paint_path *_this)
Definition: hpgspaintpath.c:85
HPGS_API void hpgs_device_destroy(hpgs_device *_this)
Definition: hpgsdevices.c:184
HPGS_API void hpgs_init(const char *prefix)
Definition: hpgsglobal.c:95
HPGS_API hpgs_bool hpgs_bbox_isempty(const hpgs_bbox *bb)
Definition: hpgsbbox.c:101
static int hpgs_ungetc(int c, hpgs_istream *_this)
Definition: hpgs.h:462
static int hpgs_setmiterlimit(hpgs_device *_this, double l)
Definition: hpgs.h:836
double page_width
Definition: hpgsreader.h:289
HPGS_API void hpgs_bbox_distance(hpgs_point *d, const hpgs_bbox *bb1, const hpgs_bbox *bb2)
Definition: hpgsbbox.c:51
hpgs_point p
Definition: hpgs.h:1127
HPGS_API void hpgs_bbox_expand(hpgs_bbox *bb1, const hpgs_bbox *bb2)
Definition: hpgsbbox.c:123
HPGS_API void hpgs_reader_set_fixed_page(hpgs_reader *reader, hpgs_bbox *bbox, double page_width, double page_height, double border, double angle)
Definition: hpgsreader.c:796
HPGS_API int hpgs_next_utf8(const char **p)
Definition: hpgsglobal.c:531
static int hpgs_ostream_putc(int c, hpgs_ostream *_this)
Definition: hpgs.h:564
HPGS_API void hpgs_bezier_path_point(const hpgs_paint_path *path, int i, double t, hpgs_point *p)
Definition: hpgsbezier.c:641
HPGS_API hpgs_istream * hpgs_new_mem_istream(const unsigned char *data, size_t data_size, hpgs_bool dup)
Definition: hpgsistream.c:232
HPGS_PRINTF1_API int hpgs_set_error(const char *fmt,...)
Definition: hpgsglobal.c:328
static int hpgs_istream_tell(hpgs_istream *_this, size_t *pos)
Definition: hpgs.h:480
HPGS_API hpgs_ostream * hpgs_new_file_ostream(const char *fn)
Definition: hpgsostream.c:112
Definition: hpgsimage.h:54
int flags
Definition: hpgs.h:1128
An image RGB color with an optional palette index.
Definition: hpgs.h:282
HPGS_API void hpgs_image_destroy(hpgs_image *_this)
Definition: hpgsimage.c:1310
HPGS_API int hpgs_device_finish(hpgs_device *_this)
Definition: hpgsdevices.c:173
HPGS_API int hpgs_showpage(hpgs_device *_this, int i)
Definition: hpgsdevices.c:161