| 1 |
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. |
| 2 |
|
| 3 |
Copyright (C) 2002-2020 by Jin-Hwan Cho and Shunsaku Hirata, |
| 4 |
the dvipdfmx project team. |
| 5 |
|
| 6 |
Copyright (C) 1998, 1999 by Mark A. Wicks <[email protected]> |
| 7 |
|
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 2 of the License, or |
| 11 |
(at your option) any later version. |
| 12 |
|
| 13 |
This program is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with this program; if not, write to the Free Software |
| 20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef _PDFXIMAGE_H_ |
| 24 |
#define _PDFXIMAGE_H_ |
| 25 |
|
| 26 |
#include "pdfdev.h" |
| 27 |
#include "pdfdoc.h" |
| 28 |
|
| 29 |
#define PDF_XOBJECT_TYPE_FORM 0 |
| 30 |
#define PDF_XOBJECT_TYPE_IMAGE 1 |
| 31 |
|
| 32 |
typedef struct { |
| 33 |
int flags; |
| 34 |
|
| 35 |
int width; |
| 36 |
int height; |
| 37 |
|
| 38 |
int bits_per_component; |
| 39 |
int num_components; |
| 40 |
|
| 41 |
int min_dpi; /* NOT USED YET */ |
| 42 |
|
| 43 |
double xdensity, ydensity; /* scale factor for bp */ |
| 44 |
} ximage_info; |
| 45 |
|
| 46 |
typedef struct { |
| 47 |
int flags; |
| 48 |
|
| 49 |
pdf_rect bbox; |
| 50 |
pdf_tmatrix matrix; |
| 51 |
} xform_info; |
| 52 |
|
| 53 |
typedef struct { |
| 54 |
int page_no; |
| 55 |
enum pdf_page_boundary bbox_type; |
| 56 |
pdf_obj *dict; |
| 57 |
char *page_name; |
| 58 |
} load_options; |
| 59 |
|
| 60 |
typedef struct pdf_ximage_ pdf_ximage; |
| 61 |
|
| 62 |
extern void pdf_init_images (void); |
| 63 |
extern void pdf_close_images (void); |
| 64 |
|
| 65 |
extern char *pdf_ximage_get_resname (int xobj_id); |
| 66 |
extern pdf_obj *pdf_ximage_get_reference (int xobj_id); |
| 67 |
|
| 68 |
extern int pdf_ximage_findresource (const char *ident); |
| 69 |
extern int pdf_ximage_load_image (const char *ident, const char *filename, load_options options); |
| 70 |
extern int pdf_ximage_defineresource (const char *ident, int subtype, void *cdata, pdf_obj *resource); |
| 71 |
extern int pdf_ximage_reserve (const char *ident); |
| 72 |
|
| 73 |
/* Called by pngimage, jpegimage, epdf, mpost, etc. */ |
| 74 |
extern void pdf_ximage_init_image_info (ximage_info *info); |
| 75 |
extern void pdf_ximage_init_form_info (xform_info *info); |
| 76 |
extern void pdf_ximage_set_image (pdf_ximage *ximage, |
| 77 |
void *info, pdf_obj *resource); |
| 78 |
extern void pdf_ximage_set_form (pdf_ximage *ximage, |
| 79 |
void *info, pdf_obj *resource); |
| 80 |
extern int pdf_ximage_get_page (pdf_ximage *I); |
| 81 |
|
| 82 |
/* from pdfximage.c */ |
| 83 |
extern void set_distiller_template (char *s); |
| 84 |
extern char *get_distiller_template (void); |
| 85 |
|
| 86 |
extern int |
| 87 |
pdf_ximage_scale_image (int id, |
| 88 |
pdf_tmatrix *M, /* ret */ |
| 89 |
pdf_rect *r, /* ret */ |
| 90 |
transform_info *p /* arg */ |
| 91 |
); |
| 92 |
|
| 93 |
/* from spc_pdfm.c */ |
| 94 |
extern int pdf_ximage_get_subtype (int xobj_id); |
| 95 |
extern void |
| 96 |
pdf_ximage_set_attr (int xobj_id, |
| 97 |
int width, int height, double xdensity, double ydensity, |
| 98 |
double llx, double lly, double urx, double ury); |
| 99 |
|
| 100 |
/* Migrated from pdfobj.h. Those are not PDF object related... */ |
| 101 |
|
| 102 |
extern void pdf_error_cleanup_cache (void); |
| 103 |
|
| 104 |
#endif /* _PDFXIMAGE_H_ */ |