]> mj.ucw.cz Git - paperjam.git/blobdiff - jam.h
Better formatting of PDF numbers
[paperjam.git] / jam.h
diff --git a/jam.h b/jam.h
index 31510d8c2b5f3469d3e6ab831919df33b92d231a..10f547ac55ad7dfe9c58575204a04e9818446328 100644 (file)
--- a/jam.h
+++ b/jam.h
@@ -19,7 +19,7 @@ typedef unsigned int uint;
 
 static inline bool is_zero(double z)
 {
-  return fabs(z) < 0.001;
+  return fabs(z) < 1e-6;
 }
 
 static inline bool is_equal(double x, double y)
@@ -62,8 +62,10 @@ public:
 extern arg_val null_arg;
 
 struct out_context {
+  QPDF *pdf;
   QPDFObjectHandle resources;
   QPDFObjectHandle xobjects;
+  QPDFObjectHandle egstates;
   string contents;
   int res_cnt;
   string new_resource(const string type);
@@ -71,18 +73,18 @@ struct out_context {
 };
 
 struct page {
-  int index;
+  int index;           // Position in the source PDF, 0 for synthesized pages
   double width;                // Physical dimensions of media
   double height;
-  BBox bbox;           // Bounds useful contents
+  BBox image_box;      // Bounds useful contents
   virtual void render(out_context *out UNUSED, pdf_matrix xform UNUSED) { abort(); }
-  page(double _w=0, double _h=0) : index(0), width(_w), height(_h), bbox() { }
+  page(double _w=0, double _h=0) : index(0), width(_w), height(_h), image_box() { }
   page(page *p)
     {
       index = p->index;
       width = p->width;
       height = p->height;
-      bbox = p->bbox;
+      image_box = p->image_box;
     }
 };