00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __HPGS_H
00035 #define __HPGS_H
00036
00037 #include<stdio.h>
00038 #include<stdarg.h>
00039 #include<stdlib.h>
00040
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044
00045 #ifndef __GNUC__
00046 #ifdef _MSC_VER
00047 #define __inline__ __inline
00048 #else
00049 #define __inline__ inline
00050 #endif
00051 #endif
00052
00053
00054
00055
00056
00057
00058
00059 #ifdef HPGS_SHARED
00060 # ifdef WIN32
00061 # ifdef __GNUC__
00062 # ifdef HPGS_BUILD_SLIB
00063 # define HPGS_API __attribute__((dllexport))
00064 # define HPGS_PRINTF_API(i) __attribute__((dllexport,format(printf,i,i+1)))
00065 # define HPGS_I18N_API __attribute__((dllexport,format_arg (1)))
00066 # define HPGS_I18N_N_API __attribute__((dllexport,format_arg (1),format_arg (2)))
00067 # else
00068 # define HPGS_API __attribute__((dllimport))
00069 # define HPGS_PRINTF_API(i) __attribute__((dllimport,format(printf,i,i+1)))
00070 # define HPGS_I18N_API __attribute__((dllimport,format_arg (1)))
00071 # define HPGS_I18N_N_API __attribute__((dllimport,format_arg (1),format_arg (2)))
00072 # endif
00073 # define HPGS_INTERNAL_PRINTF_API(i) __attribute__((format(printf,i,i+1)))
00074 # else
00075 # ifdef HPGS_BUILD_SLIB
00076 # define HPGS_API __declspec(dllexport)
00077 # else
00078 # define HPGS_API __declspec(dllimport)
00079 # endif
00080 # endif
00081 # else
00082 # ifdef __GNUC__
00083 # define HPGS_PRINTF_API(i) __attribute__((format(printf,i,i+1)))
00084 # define HPGS_I18N_API __attribute__((format_arg (1)))
00085 # define HPGS_I18N_N_API __attribute__((format_arg (1),format_arg (2)))
00086 # define HPGS_INTERNAL_API __attribute__((visibility("hidden")))
00087 # define HPGS_INTERNAL_PRINTF_API(i) __attribute__((visibility("hidden"),format(printf,i,i+1)))
00088 # endif
00089 # endif
00090 #endif
00091
00092 #ifndef HPGS_API
00093 #define HPGS_API
00094 #endif
00095 #ifndef HPGS_PRINTF_API
00096 #define HPGS_PRINTF_API(i) HPGS_API
00097 #endif
00098 #ifndef HPGS_I18N_API
00099 #define HPGS_I18N_API HPGS_API
00100 #endif
00101 #ifndef HPGS_I18N_N_API
00102 #define HPGS_I18N_N_API HPGS_API
00103 #endif
00104 #ifndef HPGS_INTERNAL_API
00105 #define HPGS_INTERNAL_API
00106 #endif
00107 #ifndef HPGS_INTERNAL_PRINTF_API
00108 #define HPGS_INTERNAL_PRINTF_API(i) HPGS_INTERNAL_API
00109 #endif
00110
00111
00112
00113 #define HPGS_PRINTF1_API HPGS_PRINTF_API(1)
00114 #define HPGS_PRINTF2_API HPGS_PRINTF_API(2)
00115 #define HPGS_INTERNAL_PRINTF1_API HPGS_INTERNAL_PRINTF_API(1)
00116 #define HPGS_INTERNAL_PRINTF2_API HPGS_INTERNAL_PRINTF_API(2)
00117
00118 #ifdef WIN32
00119 # ifdef WIN64
00120 # define HPGS_SIZE_T_FMT "%I64u"
00121 # define HPGS_SIZE_T_FMT_ARG(i) (unsigned long long)(i)
00122 # define HPGS_SIZE_T_FMT_ARG_P(i) (unsigned long long *)(i)
00123 # else
00124 # define HPGS_SIZE_T_FMT "%lu"
00125 # define HPGS_SIZE_T_FMT_ARG(i) (unsigned long)(i)
00126 # define HPGS_SIZE_T_FMT_ARG_P(i) (unsigned long *)(i)
00127 # endif
00128 #else
00129 # define HPGS_SIZE_T_FMT "%zu"
00130 # define HPGS_SIZE_T_FMT_ARG(i) i
00131 # define HPGS_SIZE_T_FMT_ARG_P(i) i
00132 #endif
00133
00144 #define HPGS_STRINGIFYIFY(i) #i
00145 #define HPGS_STRINGIFY(i) HPGS_STRINGIFYIFY(i)
00146
00147 #define HPGS_MAJOR_VERSION 1
00148 #define HPGS_MINOR_VERSION 1
00149 #define HPGS_PATCH_VERSION 9
00150 #define HPGS_EXTRA_VERSION
00151
00152
00153 #define HPGS_VERSION HPGS_STRINGIFY(HPGS_MAJOR_VERSION) "." HPGS_STRINGIFY(HPGS_MINOR_VERSION) "." HPGS_STRINGIFY(HPGS_PATCH_VERSION) HPGS_STRINGIFY(HPGS_EXTRA_VERSION)
00154
00155 #define HPGS_ESC '\033'
00156
00157 #define HPGS_MAX_LABEL_SIZE 256
00158
00159 #define hpgs_alloca(sz) alloca(sz)
00160
00164 typedef int hpgs_bool;
00165
00166 #define HPGS_TRUE 1
00167 #define HPGS_FALSE 0
00168
00169 HPGS_API int hpgs_array_safe_resize (size_t itemsz, void **pptr, size_t *psz, size_t nsz);
00170
00171 #define HPGS_MIN(a,b) ((a)<(b)?(a):(b))
00172 #define HPGS_MAX(a,b) ((a)>(b)?(a):(b))
00173
00174 #define HPGS_INIT_ARRAY(st,type,pmemb,nmemb,szmemb,insz) \
00175 (st->szmemb=insz,st->nmemb=0,(st->pmemb=(type*)malloc(sizeof(type)*insz))?0:-1)
00176
00177 #define HPGS_GROW_ARRAY_FOR_PUSH(st,type,pmemb,nmemb,szmemb) \
00178 ((st->nmemb >= st->szmemb)?hpgs_array_safe_resize(sizeof(type),(void **)(&st->pmemb),&st->szmemb,st->szmemb*2):(0))
00179
00180 #define HPGS_GROW_ARRAY_MIN_SIZE(st,type,pmemb,nmemb,szmemb,msz) \
00181 ((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))
00182
00183 #ifdef WIN32
00184 #define HPGS_PATH_SEPARATOR '\\'
00185 #else
00186 #define HPGS_PATH_SEPARATOR '/'
00187 #endif
00188
00189 HPGS_API void hpgs_init (const char *prefix);
00190 HPGS_API const char *hpgs_get_prefix();
00191 HPGS_API void hpgs_cleanup (void);
00192 HPGS_API char *hpgs_share_filename(const char *rel_filename);
00193
00194 HPGS_API char *hpgs_vsprintf_malloc(const char *fmt, va_list ap);
00195 HPGS_PRINTF1_API char *hpgs_sprintf_malloc(const char *fmt, ...);
00196
00197 HPGS_PRINTF1_API int hpgs_set_error(const char *fmt, ...);
00198 HPGS_PRINTF1_API int hpgs_error_ctxt(const char *fmt, ...);
00199 HPGS_API int hpgs_set_verror(const char *fmt, va_list ap);
00200 HPGS_API int hpgs_verror_ctxt(const char *fmt, va_list ap);
00201 HPGS_API const char *hpgs_get_error();
00202 HPGS_API hpgs_bool hpgs_have_error();
00203 HPGS_API void hpgs_clear_error();
00204
00205 HPGS_API int hpgs_next_utf8(const char **p);
00206 HPGS_API int hpgs_utf8_strlen(const char *p, int n);
00207
00208 HPGS_I18N_API const char *hpgs_i18n(const char *msg);
00209 HPGS_I18N_N_API const char *hpgs_i18n_n(const char *msg,
00210 const char *msg_plural,
00211 unsigned long n);
00212
00213 typedef void (*hpgs_logger_func_t) (const char *fmt, va_list ap);
00214 HPGS_API void hpgs_set_logger(hpgs_logger_func_t func);
00215 HPGS_PRINTF1_API void hpgs_log(const char *fmt, ...);
00216 HPGS_API void hpgs_vlog(const char *fmt, va_list ap);
00217
00218 HPGS_API hpgs_bool hpgs_get_arg_value(const char *opt, const char *argv[],
00219 const char **value, int *narg);
00220
00227 typedef struct hpgs_point_st {
00228 double x, y;
00229 } hpgs_point;
00230
00238 typedef struct hpgs_color_st {
00239 double r, g, b;
00240 } hpgs_color;
00241
00242 typedef struct hpgs_palette_color_st hpgs_palette_color;
00243
00250 struct hpgs_palette_color_st
00251 {
00252 unsigned char r;
00253 unsigned char g;
00254 unsigned char b;
00255 };
00256
00257 typedef void (*hpgs_rop3_func_t) (unsigned char *, unsigned char, unsigned char);
00258
00259 HPGS_API hpgs_rop3_func_t hpgs_rop3_func(int rop3,
00260 hpgs_bool src_transparency,
00261 hpgs_bool pattern_transparency);
00262
00263 typedef unsigned (*hpgs_xrop3_func_t) (unsigned char, unsigned char);
00264
00265 HPGS_API hpgs_xrop3_func_t hpgs_xrop3_func(int rop3,
00266 hpgs_bool src_transparency,
00267 hpgs_bool pattern_transparency);
00268
00269 typedef struct hpgs_paint_color_st hpgs_paint_color;
00270
00282 struct hpgs_paint_color_st
00283 {
00284 unsigned char r;
00285 unsigned char g;
00286 unsigned char b;
00287 unsigned char index;
00288 };
00289
00290 typedef struct hpgs_bbox_st hpgs_bbox;
00291
00296 struct hpgs_bbox_st
00297 {
00298 double llx;
00299 double lly;
00300 double urx;
00301 double ury;
00302 };
00303
00304 HPGS_API hpgs_bool hpgs_bbox_isequal(const hpgs_bbox *bb1, const hpgs_bbox *bb2);
00305 HPGS_API hpgs_bool hpgs_bbox_isnull (const hpgs_bbox *bb);
00306 HPGS_API hpgs_bool hpgs_bbox_isempty (const hpgs_bbox *bb);
00307 HPGS_API void hpgs_bbox_distance (hpgs_point *d, const hpgs_bbox *bb1, const hpgs_bbox *bb2);
00308 HPGS_API void hpgs_bbox_null (hpgs_bbox *bb);
00309 HPGS_API void hpgs_bbox_expand (hpgs_bbox *bb1, const hpgs_bbox *bb2);
00310 HPGS_API void hpgs_bbox_intersect (hpgs_bbox *bb1, const hpgs_bbox *bb2);
00312 static void hpgs_bbox_addborder (hpgs_bbox *bb, double border);
00315 static void hpgs_bbox_add (hpgs_bbox *bb, const hpgs_point *p);
00316
00317 __inline__ void hpgs_bbox_addborder (hpgs_bbox *bb, double border)
00318 {
00319 bb->llx -= border;
00320 bb->urx += border;
00321 bb->lly -= border;
00322 bb->ury += border;
00323 }
00324
00325 __inline__ void hpgs_bbox_add (hpgs_bbox *bb, const hpgs_point *p)
00326 {
00327 if (p->x < bb->llx) bb->llx = p->x;
00328 if (p->x > bb->urx) bb->urx = p->x;
00329 if (p->y < bb->lly) bb->lly = p->y;
00330 if (p->y > bb->ury) bb->ury = p->y;
00331 }
00332
00333 typedef struct hpgs_matrix_st hpgs_matrix;
00334
00340 struct hpgs_matrix_st
00341 {
00342 double dx;
00343 double dy;
00344 double mxx;
00345 double mxy;
00346 double myx;
00347 double myy;
00348 };
00349
00350 HPGS_API void hpgs_matrix_set_identity(hpgs_matrix *m);
00351
00352 HPGS_API void hpgs_matrix_xform(hpgs_point *res,
00353 const hpgs_matrix *m, const hpgs_point *p);
00354 HPGS_API void hpgs_matrix_ixform(hpgs_point *res,
00355 const hpgs_point *p, const hpgs_matrix *m);
00356 HPGS_API void hpgs_matrix_scale(hpgs_point *res,
00357 const hpgs_matrix *m, const hpgs_point *p);
00358 HPGS_API void hpgs_matrix_iscale(hpgs_point *res,
00359 const hpgs_point *p, const hpgs_matrix *m);
00360 HPGS_API void hpgs_matrix_concat(hpgs_matrix *res,
00361 const hpgs_matrix *a, const hpgs_matrix *b);
00362 HPGS_API void hpgs_matrix_invert(hpgs_matrix *res, const hpgs_matrix *m);
00363
00364 HPGS_API void hpgs_matrix_xform_bbox(hpgs_bbox *res,
00365 const hpgs_matrix *m, const hpgs_bbox *bb);
00366 HPGS_API void hpgs_matrix_ixform_bbox(hpgs_bbox *res,
00367 const hpgs_bbox *bb, const hpgs_matrix *m);
00368
00370 typedef enum {
00371 hpgs_cap_butt = 0,
00372 hpgs_cap_round = 1,
00373 hpgs_cap_square = 2
00374 } hpgs_line_cap;
00375
00377 typedef enum {
00378 hpgs_join_miter = 0,
00379 hpgs_join_round = 1,
00380 hpgs_join_bevel = 2
00381 } hpgs_line_join;
00382
00383
00384 typedef struct hpgs_istream_st hpgs_istream;
00385 typedef struct hpgs_istream_vtable_st hpgs_istream_vtable;
00386
00387 typedef int (*hpgs_istream_getc_func_t)(void *);
00388 typedef int (*hpgs_istream_ungetc_func_t)(int ,void *);
00389 typedef int (*hpgs_istream_close_func_t)(void *);
00390 typedef int (*hpgs_istream_iseof_func_t)(void *);
00391 typedef int (*hpgs_istream_iserror_func_t)(void *);
00392 typedef int (*hpgs_istream_seek_func_t)(void *, size_t);
00393 typedef int (*hpgs_istream_tell_func_t)(void *, size_t*);
00394 typedef size_t (*hpgs_istream_read_func_t)(void *, size_t, size_t, void *);
00395 typedef int (*hpgs_istream_seekend_func_t)(void *, size_t);
00396
00406 struct hpgs_istream_vtable_st
00407 {
00408 hpgs_istream_getc_func_t getc_func;
00409 hpgs_istream_ungetc_func_t ungetc_func;
00410 hpgs_istream_close_func_t close_func;
00411 hpgs_istream_iseof_func_t iseof_func;
00412 hpgs_istream_iserror_func_t iserror_func;
00413 hpgs_istream_seek_func_t seek_func;
00414 hpgs_istream_tell_func_t tell_func;
00415 hpgs_istream_read_func_t read_func;
00416 hpgs_istream_seekend_func_t seekend_func;
00417 };
00418
00426 struct hpgs_istream_st
00427 {
00428 hpgs_istream_vtable *vtable;
00429
00430 void *stream;
00431 };
00432
00433 HPGS_API hpgs_istream *hpgs_new_file_istream (const char *fn);
00434 HPGS_API hpgs_istream *hpgs_new_mem_istream (const unsigned char *data,
00435 size_t data_size,
00436 hpgs_bool dup);
00437
00438
00440 static int hpgs_getc (hpgs_istream *_this);
00442 static int hpgs_ungetc (int c, hpgs_istream *_this);
00445 static int hpgs_istream_close (hpgs_istream *_this);
00447 static int hpgs_istream_iseof (hpgs_istream *_this);
00449 static int hpgs_istream_iserror(hpgs_istream *_this);
00451 static int hpgs_istream_seek (hpgs_istream *_this, size_t pos);
00453 static int hpgs_istream_seekend (hpgs_istream *_this, size_t pos);
00455 static int hpgs_istream_tell (hpgs_istream *_this, size_t *pos);
00457 static size_t hpgs_istream_read (void *ptr, size_t size, size_t nmemb, hpgs_istream *_this);
00458
00459 __inline__ int hpgs_getc (hpgs_istream *_this)
00460 { return _this->vtable->getc_func(_this->stream); }
00461
00462 __inline__ int hpgs_ungetc (int c, hpgs_istream *_this)
00463 { return _this->vtable->ungetc_func(c,_this->stream); }
00464
00465 __inline__ int hpgs_istream_close (hpgs_istream *_this)
00466 { int ret = _this->vtable->close_func(_this->stream); free(_this); return ret; }
00467
00468 __inline__ int hpgs_istream_iseof (hpgs_istream *_this)
00469 { return _this->vtable->iseof_func(_this->stream); }
00470
00471 __inline__ int hpgs_istream_iserror (hpgs_istream *_this)
00472 { return _this->vtable->iserror_func(_this->stream); }
00473
00474 __inline__ int hpgs_istream_seek (hpgs_istream *_this, size_t pos)
00475 { return _this->vtable->seek_func(_this->stream,pos); }
00476
00477 __inline__ int hpgs_istream_seekend (hpgs_istream *_this, size_t pos)
00478 { return _this->vtable->seekend_func(_this->stream,pos); }
00479
00480 __inline__ int hpgs_istream_tell (hpgs_istream *_this, size_t *pos)
00481 { return _this->vtable->tell_func(_this->stream,pos); }
00482
00483 __inline__ size_t hpgs_istream_read (void *ptr, size_t size, size_t nmemb, hpgs_istream *_this)
00484 { return _this->vtable->read_func(ptr,size,nmemb,_this->stream); }
00485
00486
00487 typedef struct hpgs_ostream_st hpgs_ostream;
00488 typedef struct hpgs_ostream_vtable_st hpgs_ostream_vtable;
00489
00490 typedef int (*hpgs_ostream_putc_func_t)(int, void *);
00491 typedef size_t (*hpgs_ostream_write_func_t)(const void *, size_t, size_t, void *);
00492 typedef int (*hpgs_ostream_vprintf_func_t)(void *, const char *, va_list);
00493 typedef int (*hpgs_ostream_flush_func_t)(void *);
00494 typedef int (*hpgs_ostream_close_func_t)(void *);
00495 typedef int (*hpgs_ostream_iserror_func_t)(void *);
00496 typedef hpgs_istream *(*hpgs_ostream_getbuf_func_t)(void *);
00497 typedef int (*hpgs_ostream_tell_func_t)(void *, int layer, size_t *);
00498 typedef int (*hpgs_ostream_seek_func_t)(void *, size_t);
00499
00509 struct hpgs_ostream_vtable_st
00510 {
00511 hpgs_ostream_putc_func_t putc_func;
00512 hpgs_ostream_write_func_t write_func;
00513 hpgs_ostream_vprintf_func_t vprintf_func;
00514 hpgs_ostream_flush_func_t flush_func;
00515 hpgs_ostream_close_func_t close_func;
00516 hpgs_ostream_iserror_func_t iserror_func;
00517 hpgs_ostream_getbuf_func_t getbuf_func;
00518 hpgs_ostream_tell_func_t tell_func;
00519 hpgs_ostream_seek_func_t seek_func;
00520 };
00521
00529 struct hpgs_ostream_st
00530 {
00531 hpgs_ostream_vtable *vtable;
00532
00533 void *stream;
00534 };
00535
00536 HPGS_API hpgs_ostream *hpgs_new_file_ostream (const char *fn);
00537 HPGS_API hpgs_ostream *hpgs_new_mem_ostream (size_t data_reserve);
00538 HPGS_API hpgs_ostream *hpgs_new_z_ostream (hpgs_ostream *base, int compression, hpgs_bool take_base);
00539
00540 HPGS_API int hpgs_copy_streams (hpgs_ostream *out, hpgs_istream *in);
00541
00542 HPGS_PRINTF2_API int hpgs_ostream_printf (hpgs_ostream *_this, const char *msg, ...);
00543 HPGS_API int hpgs_ostream_vprintf (hpgs_ostream *_this, const char *msg, va_list ap);
00544
00546 static int hpgs_ostream_putc (int c, hpgs_ostream *_this);
00548 static size_t hpgs_ostream_write (const void *ptr, size_t size, size_t nmemb, hpgs_ostream *_this);
00550 static int hpgs_ostream_flush (hpgs_ostream *_this);
00553 static int hpgs_ostream_close (hpgs_ostream *_this);
00555 static int hpgs_ostream_iserror(hpgs_ostream *_this);
00558 static hpgs_istream *hpgs_ostream_getbuf(hpgs_ostream *_this);
00560 static int hpgs_ostream_tell(hpgs_ostream *_this, int layer, size_t *pos);
00562 static int hpgs_ostream_seek (hpgs_ostream *_this, size_t pos);
00563
00564 __inline__ int hpgs_ostream_putc (int c, hpgs_ostream *_this)
00565 { return _this->vtable->putc_func(c,_this->stream); }
00566
00567 __inline__ size_t hpgs_ostream_write (const void *ptr, size_t size, size_t nmemb, hpgs_ostream *_this)
00568 { return _this->vtable->write_func(ptr,size,nmemb,_this->stream); }
00569
00570 __inline__ int hpgs_ostream_flush (hpgs_ostream *_this)
00571 { return _this->vtable->flush_func ? _this->vtable->flush_func(_this->stream) : 0; }
00572
00573 __inline__ int hpgs_ostream_close (hpgs_ostream *_this)
00574 { int ret = _this->vtable->close_func(_this->stream); free(_this); return ret; }
00575
00576 __inline__ int hpgs_ostream_iserror (hpgs_ostream *_this)
00577 { return _this->vtable->iserror_func(_this->stream); }
00578
00579 __inline__ hpgs_istream *hpgs_ostream_getbuf (hpgs_ostream *_this)
00580 { return _this->vtable->getbuf_func ? _this->vtable->getbuf_func(_this->stream) : 0; }
00581
00582 __inline__ int hpgs_ostream_tell(hpgs_ostream *_this, int layer, size_t *pos)
00583 { return _this->vtable->tell_func ? _this->vtable->tell_func(_this->stream,layer,pos) : -1; }
00584
00585 __inline__ int hpgs_ostream_seek (hpgs_ostream *_this, size_t pos)
00586 { return _this->vtable->seek_func ? _this->vtable->seek_func(_this->stream,pos) : -1; }
00587
00588 HPGS_API int hpgs_parse_papersize(const char *str, double *pt_width, double *pt_height);
00589 HPGS_API int hpgs_parse_length(const char *str, double *pt_length);
00590
00592
00596 typedef struct hpgs_device_st hpgs_device;
00597 typedef struct hpgs_plotsize_device_st hpgs_plotsize_device;
00598 typedef struct hpgs_eps_device_st hpgs_eps_device;
00599 typedef struct hpgs_gs_device_st hpgs_gs_device;
00600 typedef struct hpgs_device_vtable_st hpgs_device_vtable;
00601 typedef struct hpgs_image_st hpgs_image;
00602 typedef struct hpgs_image_vtable_st hpgs_image_vtable;
00603 typedef struct hpgs_png_image_st hpgs_png_image;
00604 typedef struct hpgs_paint_device_st hpgs_paint_device;
00605 typedef struct hpgs_gstate_st hpgs_gstate;
00606 typedef struct hpgs_font_st hpgs_font;
00607
00613 struct hpgs_gstate_st
00614 {
00615 hpgs_line_cap line_cap;
00616 hpgs_line_join line_join;
00617 hpgs_color color;
00618 double miterlimit;
00619 double linewidth;
00620
00621 int rop3;
00622 hpgs_bool src_transparency;
00623 hpgs_bool pattern_transparency;
00624
00625 hpgs_color pattern_color;
00626
00627 int n_dashes;
00628 float *dash_lengths;
00629 double dash_offset;
00630 };
00631
00632 HPGS_API hpgs_gstate *hpgs_new_gstate(void);
00633 HPGS_API void hpgs_gstate_destroy(hpgs_gstate *gstate);
00634 HPGS_API int hpgs_gstate_setdash(hpgs_gstate *gstate,
00635 const float *, unsigned, double);
00636
00637
00638 #define HPGS_DEVICE_CAP_RASTER (1<<0) //!< This device is a raster device.
00639 #define HPGS_DEVICE_CAP_ANTIALIAS (1<<1) //!< This device supports anitaliasing.
00640 #define HPGS_DEVICE_CAP_VECTOR (1<<2) //!< This device is a true vector device.
00641 #define HPGS_DEVICE_CAP_MULTIPAGE (1<<3) //!< This device supports multiple pages.
00642 #define HPGS_DEVICE_CAP_PAGECOLLATION (1<<4) //!< This device is able to write multiple pages to a single file.
00643 #define HPGS_DEVICE_CAP_MULTISIZE (1<<5) //!< This device is able to cope with distinct sizes per page.
00644 #define HPGS_DEVICE_CAP_DRAWIMAGE (1<<6) //!< The device may draw an image.
00645 #define HPGS_DEVICE_CAP_NULLIMAGE (1<<7) //!< The device accepts a null image in drawimage.
00646 #define HPGS_DEVICE_CAP_PLOTSIZE (1<<8) //!< This device is a plotsize device.
00647 #define HPGS_DEVICE_CAP_ROP3 (1<<9) //!< This device supports rop3 operations.
00648
00658 struct hpgs_device_vtable_st {
00659 const char * rtti;
00660 int (*moveto) (hpgs_device *_this, const hpgs_point *p);
00661 int (*lineto) (hpgs_device *_this, const hpgs_point *p);
00662 int (*curveto) (hpgs_device *_this, const hpgs_point *p1,
00663 const hpgs_point *p2, const hpgs_point *p3 );
00664 int (*newpath) (hpgs_device *_this);
00665 int (*closepath) (hpgs_device *_this);
00666 int (*stroke) (hpgs_device *_this);
00667 int (*fill) (hpgs_device *_this, hpgs_bool winding);
00668 int (*clip) (hpgs_device *_this, hpgs_bool winding);
00669 int (*clipsave) (hpgs_device *_this);
00670 int (*cliprestore) (hpgs_device *_this);
00671 int (*setrgbcolor) (hpgs_device *_this, const hpgs_color *rgb);
00672 int (*setdash) (hpgs_device *_this, const float *, unsigned, double);
00673 int (*setlinewidth)(hpgs_device *_this, double);
00674 int (*setlinecap) (hpgs_device *_this, hpgs_line_cap);
00675 int (*setlinejoin) (hpgs_device *_this, hpgs_line_join);
00676 int (*setmiterlimit) (hpgs_device *_this, double l);
00677 int (*setrop3) (hpgs_device *_this, int rop,
00678 hpgs_bool src_transparency, hpgs_bool pattern_transparency);
00679 int (*setpatcol) (hpgs_device *_this, const hpgs_color *rgb);
00680 int (*drawimage) (hpgs_device *_this, const hpgs_image *img,
00681 const hpgs_point *ll, const hpgs_point *lr,
00682 const hpgs_point *ur);
00683 int (*setplotsize) (hpgs_device *_this, const hpgs_bbox *bb);
00684 int (*getplotsize) (hpgs_device *_this, int i, hpgs_bbox *bb);
00685 int (*showpage) (hpgs_device *_this, int i);
00686 int (*finish) (hpgs_device *_this);
00687 int (*capabilities)(hpgs_device *_this);
00688 void (*destroy) (hpgs_device *_this);
00689 };
00690
00699 struct hpgs_device_st {
00700 hpgs_device_vtable *vtable;
00701 };
00702
00703 #define HPGS_BASE_CLASS(d) (&(d->inherited))
00704
00705 HPGS_API hpgs_plotsize_device *hpgs_new_plotsize_device(hpgs_bool ignore_ps,
00706 hpgs_bool do_linewidth);
00707
00708 HPGS_API hpgs_eps_device *hpgs_new_eps_device(const char *filename,
00709 const hpgs_bbox *bb,
00710 hpgs_bool do_rop3 );
00711
00712 HPGS_API hpgs_eps_device *hpgs_new_ps_device(const char *filename,
00713 const hpgs_bbox *bb,
00714 hpgs_bool do_rop3);
00715
00716 typedef int (*hpgs_reader_asset_func_t)(void *, hpgs_device *,
00717 const hpgs_matrix *,
00718 const hpgs_matrix *,
00719 const hpgs_bbox *, int);
00720
00721 HPGS_API int hpgs_new_plugin_device( hpgs_device **device,
00722 void **page_asset_ctxt,
00723 hpgs_reader_asset_func_t *page_asset_func,
00724 void **frame_asset_ctxt,
00725 hpgs_reader_asset_func_t *frame_asset_func,
00726 const char *dev_name,
00727 const char *filename,
00728 const hpgs_bbox *bb,
00729 double xres, double yres,
00730 hpgs_bool do_rop3,
00731 int argc, const char *argv[]);
00732
00733 HPGS_API const char *hpgs_device_rtti(hpgs_device *_this);
00734
00736 static int hpgs_moveto (hpgs_device *_this, const hpgs_point *p);
00738 static int hpgs_lineto (hpgs_device *_this, const hpgs_point *p);
00740 static int hpgs_curveto (hpgs_device *_this, const hpgs_point *p1,
00741 const hpgs_point *p2, const hpgs_point *p3 );
00743 static int hpgs_closepath (hpgs_device *_this);
00745 static int hpgs_newpath (hpgs_device *_this);
00747 static int hpgs_stroke (hpgs_device *_this);
00750 static int hpgs_fill (hpgs_device *_this, hpgs_bool winding);
00753 static int hpgs_clip (hpgs_device *_this, hpgs_bool winding);
00756 static int hpgs_clipsave (hpgs_device *_this);
00758 static int hpgs_cliprestore (hpgs_device *_this);
00760 static int hpgs_setrgbcolor (hpgs_device *_this, const hpgs_color *rgb);
00762 static int hpgs_setdash (hpgs_device *_this, const float *d,
00763 unsigned nd, double s);
00765 static int hpgs_setlinewidth(hpgs_device *_this, double w);
00767 static int hpgs_setlinecap (hpgs_device *_this, hpgs_line_cap c);
00769 static int hpgs_setlinejoin (hpgs_device *_this, hpgs_line_join j);
00771 static int hpgs_setmiterlimit (hpgs_device *_this, double l);
00773 static int hpgs_device_capabilities (hpgs_device *_this);
00774
00775 HPGS_API int hpgs_setrop3 (hpgs_device *_this, int rop,
00776 hpgs_bool src_transparency, hpgs_bool pattern_transparency);
00777 HPGS_API int hpgs_setpatcol (hpgs_device *_this, const hpgs_color *rgb);
00778
00779 HPGS_API int hpgs_drawimage(hpgs_device *_this, const hpgs_image *img,
00780 const hpgs_point *ll, const hpgs_point *lr,
00781 const hpgs_point *ur);
00782
00783 HPGS_API int hpgs_setplotsize (hpgs_device *_this, const hpgs_bbox *bb);
00784 HPGS_API int hpgs_getplotsize (hpgs_device *_this, int i, hpgs_bbox *bb);
00785 HPGS_API int hpgs_showpage (hpgs_device *_this, int i);
00786 HPGS_API int hpgs_device_finish (hpgs_device *_this);
00787 HPGS_API void hpgs_device_destroy (hpgs_device *_this);
00788
00789 __inline__ int hpgs_moveto (hpgs_device *_this, const hpgs_point *p)
00790 { return _this->vtable->moveto(_this,p); }
00791
00792 __inline__ int hpgs_lineto (hpgs_device *_this, const hpgs_point *p)
00793 { return _this->vtable->lineto(_this,p); }
00794
00795 __inline__ int hpgs_curveto (hpgs_device *_this, const hpgs_point *p1,
00796 const hpgs_point *p2, const hpgs_point *p3 )
00797 { return _this->vtable->curveto(_this,p1,p2,p3); }
00798
00799 __inline__ int hpgs_closepath (hpgs_device *_this)
00800 { return _this->vtable->closepath(_this); }
00801
00802 __inline__ int hpgs_newpath (hpgs_device *_this)
00803 { return _this->vtable->newpath(_this); }
00804
00805 __inline__ int hpgs_stroke (hpgs_device *_this)
00806 { return _this->vtable->stroke(_this); }
00807
00808 __inline__ int hpgs_fill (hpgs_device *_this, hpgs_bool winding)
00809 { return _this->vtable->fill(_this,winding); }
00810
00811 __inline__ int hpgs_clip (hpgs_device *_this, hpgs_bool winding)
00812 { return _this->vtable->clip(_this,winding); }
00813
00814 __inline__ int hpgs_clipsave (hpgs_device *_this)
00815 { return _this->vtable->clipsave(_this); }
00816
00817 __inline__ int hpgs_cliprestore (hpgs_device *_this)
00818 { return _this->vtable->cliprestore(_this); }
00819
00820 __inline__ int hpgs_setrgbcolor (hpgs_device *_this, const hpgs_color *rgb)
00821 { return _this->vtable->setrgbcolor ? _this->vtable->setrgbcolor(_this,rgb) : 0; }
00822
00823 __inline__ int hpgs_setdash (hpgs_device *_this, const float *d,
00824 unsigned nd, double s)
00825 { return _this->vtable->setdash ? _this->vtable->setdash(_this,d,nd,s) : 0; }
00826
00827 __inline__ int hpgs_setlinewidth(hpgs_device *_this, double w)
00828 { return _this->vtable->setlinewidth ? _this->vtable->setlinewidth(_this,w) : 0; }
00829
00830 __inline__ int hpgs_setlinecap (hpgs_device *_this, hpgs_line_cap c)
00831 { return _this->vtable->setlinecap ? _this->vtable->setlinecap(_this,c) : 0; }
00832
00833 __inline__ int hpgs_setlinejoin (hpgs_device *_this, hpgs_line_join j)
00834 { return _this->vtable->setlinejoin ? _this->vtable->setlinejoin(_this,j) : 0; }
00835
00836 __inline__ int hpgs_setmiterlimit (hpgs_device *_this, double l)
00837 { return _this->vtable->setmiterlimit ? _this->vtable->setmiterlimit(_this,l) : 0; }
00838
00839 __inline__ int hpgs_device_capabilities (hpgs_device *_this)
00840 { return _this->vtable->capabilities(_this); }
00841
00843
00847 typedef struct hpgs_reader_st hpgs_reader;
00848
00849 HPGS_API hpgs_reader *hpgs_new_reader(hpgs_istream *in, hpgs_device *dev,
00850 hpgs_bool multipage, int v);
00851
00852 HPGS_API void hpgs_reader_set_lw_factor(hpgs_reader *reader, double lw_factor);
00853
00854 HPGS_API void hpgs_reader_set_fixed_page(hpgs_reader *reader,
00855 hpgs_bbox *bbox,
00856 double page_width,
00857 double page_height,
00858 double border,
00859 double angle );
00860
00861 HPGS_API void hpgs_reader_set_dynamic_page(hpgs_reader *reader,
00862 hpgs_bbox *bbox,
00863 double max_page_width,
00864 double max_page_height,
00865 double border,
00866 double angle );
00867
00868 HPGS_API void hpgs_reader_set_page_asset_func(hpgs_reader *reader,
00869 void * ctxt,
00870 hpgs_reader_asset_func_t func);
00871
00872 HPGS_API void hpgs_reader_set_frame_asset_func(hpgs_reader *reader,
00873 void * ctxt,
00874 hpgs_reader_asset_func_t func);
00875
00876 HPGS_API void hpgs_reader_interrupt(hpgs_reader *reader);
00877 HPGS_API int hpgs_reader_get_current_pen(hpgs_reader *reader);
00878
00879 HPGS_API int hpgs_reader_imbue(hpgs_reader *reader, hpgs_device *dev);
00880 HPGS_API int hpgs_reader_attach(hpgs_reader *reader, hpgs_istream *in);
00881 HPGS_API int hpgs_reader_stamp(hpgs_reader *reader,
00882 const hpgs_bbox *bb,
00883 const char *stamp, const char *encoding,
00884 double stamp_size);
00885
00886 HPGS_API int hpgs_device_stamp(hpgs_device *dev,
00887 const hpgs_bbox *bb,
00888 const char *stamp, const char *encoding,
00889 double stamp_size);
00890
00891 HPGS_API int hpgs_reader_set_png_dump(hpgs_reader *reader, const char *filename);
00892 HPGS_API int hpgs_read(hpgs_reader *reader, hpgs_bool finish);
00893 HPGS_API void hpgs_destroy_reader(hpgs_reader *reader);
00894
00896
00901 HPGS_API hpgs_font *hpgs_find_font(const char *name);
00902 HPGS_API void hpgs_destroy_font(hpgs_font *font);
00903 HPGS_API double hpgs_font_get_ascent(hpgs_font *font);
00904 HPGS_API double hpgs_font_get_descent(hpgs_font *font);
00905 HPGS_API double hpgs_font_get_line_gap(hpgs_font *font);
00906 HPGS_API double hpgs_font_get_cap_height(hpgs_font *font);
00907 HPGS_API unsigned hpgs_font_get_glyph_count(hpgs_font *font);
00908 HPGS_API unsigned hpgs_font_get_glyph_id(hpgs_font *font, int uc);
00909 HPGS_API const char *hpgs_font_get_glyph_name(hpgs_font *font, unsigned gid);
00910 HPGS_API int hpgs_font_get_glyph_bbox(hpgs_font *font, hpgs_bbox *bb, unsigned gid);
00911 HPGS_API int hpgs_font_get_glyph_metrics(hpgs_font *font, hpgs_point *m, unsigned gid);
00912 HPGS_API int hpgs_font_get_kern_metrics(hpgs_font *font, hpgs_point *m, unsigned gid_l, unsigned gid_r);
00913 HPGS_API int hpgs_font_get_utf8_metrics(hpgs_font *font, hpgs_point *m, const char *str, int strlen);
00914
00915 typedef int (*hpgs_moveto_func_t) (void *ctxt, const hpgs_point *p);
00916 typedef int (*hpgs_lineto_func_t) (void *ctxt, const hpgs_point *p);
00917 typedef int (*hpgs_curveto_func_t) (void *ctxt, const hpgs_point *p1, const hpgs_point *p2, const hpgs_point *p3);
00918 typedef int (*hpgs_fill_func_t) (void *ctxt, hpgs_bool winding);
00919
00920 HPGS_API int hpgs_font_decompose_glyph(hpgs_font *font,
00921 void *ctxt,
00922 hpgs_moveto_func_t moveto_func,
00923 hpgs_lineto_func_t lineto_func,
00924 hpgs_curveto_func_t curveto_func,
00925 const hpgs_matrix *m,
00926 unsigned gid);
00927
00928 HPGS_API int hpgs_font_draw_glyph(hpgs_font *font,
00929 hpgs_device *device,
00930 const hpgs_matrix *m,
00931 unsigned gid);
00932
00933 HPGS_API int hpgs_font_decompose_utf8(hpgs_font *font,
00934 void *ctxt,
00935 hpgs_moveto_func_t moveto_func,
00936 hpgs_lineto_func_t lineto_func,
00937 hpgs_curveto_func_t curveto_func,
00938 hpgs_fill_func_t fill_func,
00939 const hpgs_matrix *m,
00940 const char *str, int strlen);
00941
00942 HPGS_API int hpgs_font_draw_utf8(hpgs_font *font,
00943 hpgs_device *device,
00944 const hpgs_matrix *m,
00945 const char *str, int strlen);
00946
00948
00959 struct hpgs_image_vtable_st {
00960 int (*get_pixel) (const hpgs_image *_this,
00961 int x, int y, hpgs_paint_color *c, double *alpha);
00962 int (*put_pixel) (hpgs_image *_this,
00963 int x, int y, const hpgs_paint_color *c, double alpha);
00964 int (*put_chunk) (hpgs_image *_this,
00965 int x1, int x2, int y, const hpgs_paint_color *c);
00966 int (*rop3_pixel) (hpgs_image *_this,
00967 int x, int y, const hpgs_paint_color *c, double alpha);
00968 int (*rop3_chunk) (hpgs_image *_this,
00969 int x1, int x2, int y, const hpgs_paint_color *c);
00970 int (*setrop3) (hpgs_image *_this, hpgs_rop3_func_t rop3);
00971 int (*setpatcol) (hpgs_image *_this, const hpgs_palette_color *p);
00972 int (*resize) (hpgs_image *_this, int w, int h);
00973 int (*set_resolution)(hpgs_image *pim, double x_dpi, double y_dpi);
00974 int (*clear) (hpgs_image *_this);
00975 int (*write) (hpgs_image *_this, const char *filename);
00976 int (*get_data) (hpgs_image *_this, unsigned char **data, int *stride, int *depth);
00977 void (*destroy) (hpgs_image *_this);
00978 };
00979
00989 struct hpgs_image_st {
00990 hpgs_image_vtable *vtable;
00991 int width;
00992 int height;
00993
00994 hpgs_palette_color *palette;
00995 unsigned *palette_idx;
00996 int palette_ncolors;
00997 };
00998
00999 HPGS_API int hpgs_image_define_color_func (hpgs_image *image, hpgs_paint_color *c);
01000
01001 static int hpgs_image_define_color (hpgs_image *image, hpgs_paint_color *c);
01002
01009 __inline__ int hpgs_image_define_color (hpgs_image *image, hpgs_paint_color *c)
01010 {
01011 if (image->palette) return hpgs_image_define_color_func (image,c); else return 0;
01012 }
01013
01014 HPGS_API int hpgs_image_set_palette (hpgs_image *image,
01015 hpgs_palette_color *p, int np);
01016
01017 HPGS_API hpgs_png_image *hpgs_new_png_image(int width, int height,
01018 int depth, hpgs_bool palette,
01019 hpgs_bool do_rop3);
01020
01021 HPGS_API int hpgs_png_image_set_compression(hpgs_png_image *pim, int compression);
01022
01023 HPGS_API int hpgs_image_set_resolution(hpgs_image *pim, double x_dpi, double y_dpi);
01024
01025 HPGS_API int hpgs_image_get_data(hpgs_image *_this,
01026 unsigned char **data, int *stride,
01027 int *depth);
01028
01031 static int hpgs_image_get_pixel (const hpgs_image *_this,
01032 int x, int y,
01033 hpgs_paint_color *c, double *alpha);
01036 static int hpgs_image_put_pixel (hpgs_image *_this,
01037 int x, int y,
01038 const hpgs_paint_color *c, double alpha);
01042 static int hpgs_image_put_chunk (hpgs_image *_this,
01043 int x1, int x2, int y, const hpgs_paint_color *c);
01044
01049 static int hpgs_image_rop3_pixel (hpgs_image *_this,
01050 int x, int y,
01051 const hpgs_paint_color *c, double alpha);
01057 static int hpgs_image_rop3_chunk (hpgs_image *_this,
01058 int x1, int x2, int y, const hpgs_paint_color *c);
01059
01060 HPGS_API int hpgs_image_resize (hpgs_image *_this, int w, int h);
01061 HPGS_API int hpgs_image_clear (hpgs_image *_this);
01062 HPGS_API int hpgs_image_write (hpgs_image *_this, const char *filename);
01063 HPGS_API int hpgs_image_setrop3 (hpgs_image *_this, hpgs_rop3_func_t rop3);
01064 HPGS_API int hpgs_image_setpatcol (hpgs_image *_this, const hpgs_palette_color *p);
01065
01066 HPGS_API void hpgs_image_destroy (hpgs_image *_this);
01067
01068 __inline__ int hpgs_image_get_pixel (const hpgs_image *_this,
01069 int x, int y,
01070 hpgs_paint_color *c, double *alpha)
01071 { return _this->vtable->get_pixel(_this,x,y,c,alpha); }
01072
01073 __inline__ int hpgs_image_put_pixel (hpgs_image *_this,
01074 int x, int y,
01075 const hpgs_paint_color *c, double alpha)
01076 { return _this->vtable->put_pixel(_this,x,y,c,alpha); }
01077
01078 __inline__ int hpgs_image_put_chunk (hpgs_image *_this,
01079 int x1, int x2, int y, const hpgs_paint_color *c)
01080 { return _this->vtable->put_chunk(_this,x1,x2,y,c); }
01081
01082 __inline__ int hpgs_image_rop3_pixel (hpgs_image *_this,
01083 int x, int y,
01084 const hpgs_paint_color *c, double alpha)
01085 { return _this->vtable->rop3_pixel(_this,x,y,c,alpha); }
01086
01087 __inline__ int hpgs_image_rop3_chunk (hpgs_image *_this,
01088 int x1, int x2, int y, const hpgs_paint_color *c)
01089 { return _this->vtable->rop3_chunk(_this,x1,x2,y,c); }
01090
01091 HPGS_API int hpgs_image_rop3_clip(hpgs_device *device,
01092 hpgs_palette_color *data,
01093 const hpgs_image *img,
01094 const hpgs_point *ll, const hpgs_point *lr,
01095 const hpgs_point *ur,
01096 const hpgs_palette_color *p,
01097 hpgs_xrop3_func_t xrop3);
01098
01100
01105 typedef struct hpgs_path_point_st hpgs_path_point;
01106 typedef struct hpgs_paint_path_st hpgs_paint_path;
01107
01108 #define HPGS_POINT_ROLE_MASK 0xF //!< A mask for retrieving the role of a point in the path
01109 #define HPGS_POINT_UNDEFINED 0x0 //!< point is undefined
01110 #define HPGS_POINT_LINE 0x1 //!< start of line
01111 #define HPGS_POINT_BEZIER 0x2 //!< start of bezier curve
01112 #define HPGS_POINT_CONTROL 0x3 //!< bezier control point
01113 #define HPGS_POINT_FILL_LINE 0x4 //!< line fill only (implicit closepath)
01114 #define HPGS_POINT_DOT 0x8 //!< indicates a moveto/lineto with the same coordinates at the start of a subpath.
01115
01116 #define HPGS_POINT_SUBPATH_START 0x10 //!< a subpath starts at this point
01117 #define HPGS_POINT_SUBPATH_END 0x20 //!< a subpath ends at this point
01118 #define HPGS_POINT_SUBPATH_CLOSE 0x40 //!< indicates an explicit closepath at the end of a subpath
01119
01125 struct hpgs_path_point_st
01126 {
01127 hpgs_point p;
01128 int flags;
01129 };
01130
01137 struct hpgs_paint_path_st
01138 {
01144 hpgs_path_point *points;
01145 int n_points;
01146 int last_start;
01147 int points_malloc_size;
01150 hpgs_bbox bb;
01151 };
01152
01153 HPGS_API hpgs_paint_path *hpgs_new_paint_path(void);
01154 HPGS_API void hpgs_paint_path_destroy(hpgs_paint_path *_this);
01155 HPGS_API void hpgs_paint_path_truncate(hpgs_paint_path *_this);
01156
01157 HPGS_API int hpgs_paint_path_moveto(hpgs_paint_path *_this,
01158 const hpgs_point *p );
01159
01160 HPGS_API int hpgs_paint_path_lineto(hpgs_paint_path *_this,
01161 const hpgs_point *p );
01162
01163 HPGS_API int hpgs_paint_path_curveto(hpgs_paint_path *_this,
01164 const hpgs_point *p1,
01165 const hpgs_point *p2,
01166 const hpgs_point *p3 );
01167
01168 HPGS_API int hpgs_paint_path_closepath(hpgs_paint_path *_this);
01169
01170 HPGS_API int hpgs_paint_path_buldgeto(hpgs_paint_path *_this,
01171 const hpgs_point *p,
01172 double buldge);
01173
01174 HPGS_API hpgs_paint_path *hpgs_paint_path_stroke_path(const hpgs_paint_path *_this,
01175 const hpgs_gstate *gstate);
01176
01177 HPGS_API hpgs_paint_path *hpgs_paint_path_decompose_dashes(const hpgs_paint_path *_this,
01178 const hpgs_gstate *gstate);
01179
01180 HPGS_API double hpgs_bezier_path_x (const hpgs_paint_path *path, int i, double t);
01181 HPGS_API double hpgs_bezier_path_y (const hpgs_paint_path *path, int i, double t);
01182 HPGS_API double hpgs_bezier_path_delta_x (const hpgs_paint_path *path, int i, double t);
01183 HPGS_API double hpgs_bezier_path_delta_y (const hpgs_paint_path *path, int i, double t);
01184
01185
01186 HPGS_API double hpgs_bezier_path_xmin (const hpgs_paint_path *path, int i);
01187 HPGS_API double hpgs_bezier_path_xmax (const hpgs_paint_path *path, int i);
01188 HPGS_API double hpgs_bezier_path_ymin (const hpgs_paint_path *path, int i);
01189 HPGS_API double hpgs_bezier_path_ymax (const hpgs_paint_path *path, int i);
01190
01191 HPGS_API void hpgs_bezier_path_point(const hpgs_paint_path *path, int i,
01192 double t, hpgs_point *p);
01193
01194 HPGS_API void hpgs_bezier_path_delta(const hpgs_paint_path *path, int i,
01195 double t, hpgs_point *p);
01196
01197 HPGS_API void hpgs_bezier_path_tangent(const hpgs_paint_path *path, int i,
01198 double t, int orientation,
01199 double ytol,
01200 hpgs_point *p);
01201
01202 HPGS_API void hpgs_bezier_path_singularities(const hpgs_paint_path *path, int i,
01203 double t0, double t1,
01204 int *nx, double *tx);
01205
01206 HPGS_API void hpgs_bezier_path_to_quadratic(const hpgs_paint_path *path, int i,
01207 double t0, double t1,
01208 int *nx, hpgs_point *points);
01209
01211
01215 HPGS_API hpgs_paint_device *hpgs_new_paint_device(hpgs_image *image,
01216 const char *filename,
01217 const hpgs_bbox *bb,
01218 hpgs_bool antialias);
01219
01220 HPGS_API void hpgs_paint_device_set_image_interpolation (hpgs_paint_device *pdv, int i);
01221 HPGS_API void hpgs_paint_device_set_thin_alpha (hpgs_paint_device *pdv, double a);
01222
01224
01225 #ifdef __cplusplus
01226 }
01227 #endif
01228
01229 #endif