2 * \file GraphicsParams.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS.
13 #include "GraphicsParams.h"
32 bool operator==(Params const & a, Params const & b)
34 return (a.filename == b.filename &&
35 a.display == b.display &&
42 bool operator!=(Params const & a, Params const & b)
48 ostream & operator<<(ostream & os, BoundingBox const & bb)
50 os << bb.xl << ' ' << bb.yb << ' ' << bb.xr << ' ' << bb.yt;
55 BoundingBox::BoundingBox()
56 : xl(0), yb(0), xr(0), yt(0)
60 BoundingBox::BoundingBox(string const & bb)
61 : xl(0), yb(0), xr(0), yt(0)
66 istringstream is(bb.c_str());
68 is >> a >> b >> c >> d;
70 // inBP returns the length in Postscript points.
71 // Note further that there are 72 Postscript pixels per inch.
72 unsigned int const xl_tmp = abs(Length(a).inBP());
73 unsigned int const yb_tmp = abs(Length(b).inBP());
74 unsigned int const xr_tmp = abs(Length(c).inBP());
75 unsigned int const yt_tmp = abs(Length(d).inBP());
77 if (xr_tmp <= xl_tmp || yt_tmp <= yb_tmp)
87 bool BoundingBox::empty() const
89 return (!xl && !yb && !xr && !yt);
93 bool operator==(BoundingBox const & a, BoundingBox const & b)
95 return (a.xl == b.xl &&
102 bool operator!=(BoundingBox const & a, BoundingBox const & b)
107 } // namespace graphics