Back to index

tetex-bin  3.0
Go to the documentation of this file.
00001 /*  $Header$
00003     This is dvipdfm, a DVI to PDF translator.
00004     Copyright (C) 1998, 1999 by Mark A. Wicks
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     GNU General Public License for more details.
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020     The author may be contacted via the e-mail address
00023 */
00026 #ifndef PDFSPECIAL_H
00028 #define PDFSPECIAL_H
00029 #include "numbers.h"
00030 #include "pdfobj.h"
00032 struct xform_info 
00033 {
00034   double width;
00035   double height;
00036   double depth;
00037   double scale;
00038   double xscale;
00039   double yscale;
00040   double rotate;
00041   /* If the user enters a "bounding box", user_bbox is nonzero */
00042   unsigned char user_bbox;
00043   /* If the user enters a "bounding box", the use specified
00044      coordinates follow */
00045   double u_llx, u_lly, u_urx, u_ury;
00046   /* The following lines are for compatibility with dvips specials.
00047      The method is a bit clumsy, and requires a lengthy explanation,
00048      because dvipdfm uses form xobjects to embed all image types.
00050      Because the image is a form xobject, the image must be clipped
00051      somewhere.  Form xobjects always crop to their bounding box.
00052      However, this is not the dvips behavior.  If the user specifies
00053      "clip", PS and PDF images will be clipped to the user specified
00054      bounding box; in other words, the user specified bounding box and
00055      the clipping bounding box are one and the same.  Otherwise,
00056      dvipdfm will clip the image at the bounding box contained in the
00057      image file.  (The eps header in the case of Metapost images or
00058      the media box or crop box in the case of PDF images.)  In the
00059      case that the user bounding box and clip bounding box are
00060      different, the image is scaled to match any user specified
00061      dimensions.
00063      Processing of all image inclusion specials are handled by common
00064      code which fills in the user bounding box, if any, as well as the
00065      width, height, depth, xscale, yscale, scale, and rotate fields.
00066      That common routine calls a routine specific to each image type.
00067      The routines specific to each file type MUST fill in the c_llx
00068      through c_ury fields, because the source of this information is
00069      image type dependent.  They are also responsible for calling
00070      pdf_scale_image(), which checks the information for consistency
00071      and recalculates ` the scaling required to achieve the desired
00072      effect. */
00073   unsigned char clip;
00074   double c_llx, c_lly, c_urx, c_ury;
00075 };
00077 extern int pdf_parse_special(char *buffer, UNSIGNED_QUAD size, double
00078                      x_user, double y_user);
00079 extern void pdf_finish_specials(void);
00080 extern pdf_obj *get_reference(char **start, char *end);
00081 extern struct xform_info *new_xform_info (void);
00082 extern void release_xform_info (struct xform_info *p);
00083 extern int validate_image_xform_info (struct xform_info *p);
00084 extern void add_xform_matrix (double xoff, double yoff, double xscale, double
00085                      yscale, double rotate);
00087 extern void pdf_special_ignore_colors(void);
00089 extern double parse_one_unit (char **start, char *end);
00090 extern void pdf_scale_image (struct xform_info *p);
00091 extern pdf_obj *embed_image (char *filename, struct xform_info *p, 
00092                           double x_user, double y_user, char
00093                           *objname);
00094 extern void pdf_finish_specials(void);
00095 extern void pdf_special_set_grow (double g);
00096 extern double pdf_special_tell_grow (void);
00098 #ifndef M_PI
00099   #define M_PI (4.0*atan(1.0))
00100 #endif /* M_PI */
00102 #endif  /* PDFSPECIAL_H */