OSDN Git Service

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