47 #define __inline__ __inline 49 #define __inline__ inline 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))) 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))) 73 # define HPGS_INTERNAL_PRINTF_API(i) __attribute__((format(printf,i,i+1))) 75 # ifdef HPGS_BUILD_SLIB 76 # define HPGS_API __declspec(dllexport) 78 # define HPGS_API __declspec(dllimport) 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))) 95 #ifndef HPGS_PRINTF_API 96 #define HPGS_PRINTF_API(i) HPGS_API 99 #define HPGS_I18N_API HPGS_API 101 #ifndef HPGS_I18N_N_API 102 #define HPGS_I18N_N_API HPGS_API 104 #ifndef HPGS_INTERNAL_API 105 #define HPGS_INTERNAL_API 107 #ifndef HPGS_INTERNAL_PRINTF_API 108 #define HPGS_INTERNAL_PRINTF_API(i) HPGS_INTERNAL_API 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) 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) 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) 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 144 #define HPGS_STRINGIFYIFY(i) #i 145 #define HPGS_STRINGIFY(i) HPGS_STRINGIFYIFY(i) 147 #define HPGS_MAJOR_VERSION 1 148 #define HPGS_MINOR_VERSION 1 149 #define HPGS_PATCH_VERSION 9 150 #define HPGS_EXTRA_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) 155 #define HPGS_ESC '\033' 157 #define HPGS_MAX_LABEL_SIZE 256 159 #define hpgs_alloca(sz) alloca(sz) 164 typedef int hpgs_bool;
171 #define HPGS_MIN(a,b) ((a)<(b)?(a):(b)) 172 #define HPGS_MAX(a,b) ((a)>(b)?(a):(b)) 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) 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)) 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)) 184 #define HPGS_PATH_SEPARATOR '\\' 186 #define HPGS_PATH_SEPARATOR '/' 189 HPGS_API
void hpgs_init (
const char *prefix);
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,
213 typedef void (*hpgs_logger_func_t) (
const char *fmt, va_list ap);
215 HPGS_PRINTF1_API
void hpgs_log(
const char *fmt, ...);
216 HPGS_API
void hpgs_vlog(
const char *fmt, va_list ap);
219 const char **value,
int *narg);
257 typedef void (*hpgs_rop3_func_t) (
unsigned char *,
unsigned char,
unsigned char);
259 HPGS_API hpgs_rop3_func_t hpgs_rop3_func(
int rop3,
260 hpgs_bool src_transparency,
261 hpgs_bool pattern_transparency);
263 typedef unsigned (*hpgs_xrop3_func_t) (
unsigned char,
unsigned char);
265 HPGS_API hpgs_xrop3_func_t hpgs_xrop3_func(
int rop3,
266 hpgs_bool src_transparency,
267 hpgs_bool pattern_transparency);
304 HPGS_API hpgs_bool
hpgs_bbox_isequal(
const hpgs_bbox *bb1,
const hpgs_bbox *bb2);
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;
361 const hpgs_matrix *a,
const hpgs_matrix *b);
365 const hpgs_matrix *m,
const hpgs_bbox *bb);
367 const hpgs_bbox *bb,
const hpgs_matrix *m);
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);
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;
460 {
return _this->vtable->getc_func(_this->stream); }
463 {
return _this->vtable->ungetc_func(c,_this->stream); }
466 {
int ret = _this->vtable->close_func(_this->stream); free(_this);
return ret; }
469 {
return _this->vtable->iseof_func(_this->stream); }
472 {
return _this->vtable->iserror_func(_this->stream); }
475 {
return _this->vtable->seek_func(_this->stream,pos); }
478 {
return _this->vtable->seekend_func(_this->stream,pos); }
481 {
return _this->vtable->tell_func(_this->stream,pos); }
484 {
return _this->vtable->read_func(ptr,size,nmemb,_this->stream); }
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);
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;
531 hpgs_ostream_vtable *vtable;
538 HPGS_API hpgs_ostream *
hpgs_new_z_ostream (hpgs_ostream *base,
int compression, hpgs_bool take_base);
540 HPGS_API
int hpgs_copy_streams (hpgs_ostream *out,
hpgs_istream *in);
548 static size_t hpgs_ostream_write (
const void *ptr,
size_t size,
size_t nmemb, hpgs_ostream *_this);
565 {
return _this->vtable->putc_func(c,_this->stream); }
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); }
571 {
return _this->vtable->flush_func ? _this->vtable->flush_func(_this->stream) : 0; }
574 {
int ret = _this->vtable->close_func(_this->stream); free(_this);
return ret; }
577 {
return _this->vtable->iserror_func(_this->stream); }
580 {
return _this->vtable->getbuf_func ? _this->vtable->getbuf_func(_this->stream) : 0; }
583 {
return _this->vtable->tell_func ? _this->vtable->tell_func(_this->stream,layer,pos) : -1; }
586 {
return _this->vtable->seek_func ? _this->vtable->seek_func(_this->stream,pos) : -1; }
599 typedef struct hpgs_gs_device_st hpgs_gs_device;
622 hpgs_bool src_transparency;
623 hpgs_bool pattern_transparency;
635 const float *,
unsigned,
double);
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) 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,
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);
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,
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);
700 hpgs_device_vtable *vtable;
703 #define HPGS_BASE_CLASS(d) (&(d->inherited)) 706 hpgs_bool do_linewidth);
716 typedef int (*hpgs_reader_asset_func_t)(
void *, hpgs_device *,
719 const hpgs_bbox *, int);
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,
729 double xres,
double yres,
731 int argc,
const char *argv[]);
750 static int hpgs_fill (hpgs_device *_this, hpgs_bool winding);
753 static int hpgs_clip (hpgs_device *_this, hpgs_bool winding);
762 static int hpgs_setdash (hpgs_device *_this,
const float *d,
763 unsigned nd,
double s);
776 hpgs_bool src_transparency, hpgs_bool pattern_transparency);
779 HPGS_API
int hpgs_drawimage(hpgs_device *_this,
const hpgs_image *img,
790 {
return _this->vtable->moveto(_this,p); }
793 {
return _this->vtable->lineto(_this,p); }
797 {
return _this->vtable->curveto(_this,p1,p2,p3); }
800 {
return _this->vtable->closepath(_this); }
803 {
return _this->vtable->newpath(_this); }
806 {
return _this->vtable->stroke(_this); }
808 __inline__
int hpgs_fill (hpgs_device *_this, hpgs_bool winding)
809 {
return _this->vtable->fill(_this,winding); }
811 __inline__
int hpgs_clip (hpgs_device *_this, hpgs_bool winding)
812 {
return _this->vtable->clip(_this,winding); }
815 {
return _this->vtable->clipsave(_this); }
818 {
return _this->vtable->cliprestore(_this); }
821 {
return _this->vtable->setrgbcolor ? _this->vtable->setrgbcolor(_this,rgb) : 0; }
824 unsigned nd,
double s)
825 {
return _this->vtable->setdash ? _this->vtable->setdash(_this,d,nd,s) : 0; }
828 {
return _this->vtable->setlinewidth ? _this->vtable->setlinewidth(_this,w) : 0; }
831 {
return _this->vtable->setlinecap ? _this->vtable->setlinecap(_this,c) : 0; }
834 {
return _this->vtable->setlinejoin ? _this->vtable->setlinejoin(_this,j) : 0; }
837 {
return _this->vtable->setmiterlimit ? _this->vtable->setmiterlimit(_this,l) : 0; }
840 {
return _this->vtable->capabilities(_this); }
850 hpgs_bool multipage,
int v);
863 double max_page_width,
864 double max_page_height,
870 hpgs_reader_asset_func_t func);
874 hpgs_reader_asset_func_t func);
883 const char *stamp,
const char *encoding,
888 const char *stamp,
const char *encoding,
892 HPGS_API
int hpgs_read(hpgs_reader *reader, hpgs_bool finish);
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);
918 typedef int (*hpgs_fill_func_t) (
void *ctxt, hpgs_bool winding);
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,
930 const hpgs_matrix *m,
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);
944 const hpgs_matrix *m,
945 const char *str,
int strlen);
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);
1015 hpgs_palette_color *p,
int np);
1018 int depth, hpgs_bool palette,
1026 unsigned char **data,
int *stride,
1033 hpgs_paint_color *c,
double *alpha);
1038 const hpgs_paint_color *c,
double alpha);
1043 int x1,
int x2,
int y,
const hpgs_paint_color *c);
1051 const hpgs_paint_color *c,
double alpha);
1058 int x1,
int x2,
int y,
const hpgs_paint_color *c);
1070 hpgs_paint_color *c,
double *alpha)
1071 {
return _this->
vtable->get_pixel(_this,x,y,c,alpha); }
1075 const hpgs_paint_color *c,
double alpha)
1076 {
return _this->
vtable->put_pixel(_this,x,y,c,alpha); }
1079 int x1,
int x2,
int y,
const hpgs_paint_color *c)
1080 {
return _this->
vtable->put_chunk(_this,x1,x2,y,c); }
1084 const hpgs_paint_color *c,
double alpha)
1085 {
return _this->
vtable->rop3_pixel(_this,x,y,c,alpha); }
1088 int x1,
int x2,
int y,
const hpgs_paint_color *c)
1089 {
return _this->
vtable->rop3_chunk(_this,x1,x2,y,c); }
1092 hpgs_palette_color *data,
1093 const hpgs_image *img,
1096 const hpgs_palette_color *p,
1097 hpgs_xrop3_func_t xrop3);
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 1116 #define HPGS_POINT_SUBPATH_START 0x10 1117 #define HPGS_POINT_SUBPATH_END 0x20 1118 #define HPGS_POINT_SUBPATH_CLOSE 0x40 1147 int points_malloc_size;
1175 const hpgs_gstate *gstate);
1178 const hpgs_gstate *gstate);
1198 double t,
int orientation,
1203 double t0,
double t1,
1204 int *nx,
double *tx);
1207 double t0,
double t1,
1216 const char *filename,
1217 const hpgs_bbox *bb,
1218 hpgs_bool antialias);
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