Back to index

texmacs  1.0.7.15
pdfximage.h
Go to the documentation of this file.
00001 /*  $Header: /home/cvsroot/dvipdfmx/src/pdfximage.h,v 1.18 2009/09/19 18:43:04 matthias Exp $
00002     
00003     This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
00004 
00005     Copyright (C) 2007 by Jin-Hwan Cho and Shunsaku Hirata,
00006     the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
00007     
00008     Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
00009 
00010     This program is free software; you can redistribute it and/or modify
00011     it under the terms of the GNU General Public License as published by
00012     the Free Software Foundation; either version 2 of the License, or
00013     (at your option) any later version.
00014     
00015     This program is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU General Public License for more details.
00019     
00020     You should have received a copy of the GNU General Public License
00021     along with this program; if not, write to the Free Software
00022     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00023 */
00024 
00025 #ifndef _PDFXIMAGE_H_
00026 #define _PDFXIMAGE_H_
00027 
00028 #include "pdfdev.h"
00029 
00030 #define PDF_XOBJECT_TYPE_FORM  0
00031 #define PDF_XOBJECT_TYPE_IMAGE 1
00032 
00033 typedef struct {
00034   int  flags;
00035 
00036   long width;
00037   long height;
00038 
00039   int  bits_per_component;
00040   int  num_components;
00041 
00042   long min_dpi; /* NOT USED YET */
00043 
00044   double xdensity, ydensity; /* scale factor for bp */
00045 } ximage_info;
00046 
00047 typedef struct {
00048   int         flags;
00049   
00050   pdf_rect    bbox;
00051   pdf_tmatrix matrix;
00052 } xform_info;
00053 
00054 typedef struct pdf_ximage_ pdf_ximage;
00055 
00056 extern void     pdf_ximage_set_verbose    (void);
00057 
00058 extern void     pdf_init_images           (void);
00059 extern void     pdf_close_images          (void);
00060 
00061 extern char    *pdf_ximage_get_resname    (int xobj_id);
00062 extern pdf_obj *pdf_ximage_get_reference  (int xobj_id);
00063 
00064 
00065 extern int      pdf_ximage_findresource   (const char *ident, long page_no,
00066                                            pdf_obj *dict);
00067 extern int      pdf_ximage_defineresource (const char *ident, int subtype,
00068                                            void *cdata, pdf_obj *resource);
00069 
00070 /* Called by pngimage, jpegimage, epdf, mpost, etc. */
00071 extern void pdf_ximage_init_image_info (ximage_info *info);
00072 extern void pdf_ximage_init_form_info  (xform_info  *info);
00073 extern void pdf_ximage_set_image (pdf_ximage *ximage, void *info, pdf_obj *resource);
00074 extern void pdf_ximage_set_form  (pdf_ximage *ximage, void *info, pdf_obj *resource);
00075 extern long pdf_ximage_get_page  (pdf_ximage *I);
00076 
00077 /* from psimage.h */
00078 extern void set_distiller_template (char *s);
00079 
00080 extern int
00081 pdf_ximage_scale_image (int            id,
00082                         pdf_tmatrix    *M, /* ret */
00083                         pdf_rect       *r, /* ret */
00084                         transform_info *p  /* arg */
00085                        );
00086 
00087 /* from dvipdfmx.c */
00088 extern void pdf_ximage_disable_ebb (void);
00089 
00090 /* from spc_pdfm.c */
00091 extern int  pdf_ximage_get_subtype (int xobj_id);
00092 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);
00093 #endif /* _PDFXIMAGE_H_ */