2 * \file GraphicsImage.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
15 #include "GraphicsImage.h"
16 #include "GraphicsParams.h"
18 #include "support/debug.h"
24 // This is to be connected to a function that will return a new
25 // instance of a viable derived class.
26 boost::function<Image *()> Image::newImage;
28 Dimension Image::scaledDimension(Params const & params) const
30 // scale only when value > 0
31 unsigned int w = width();
32 unsigned int h = height();
34 w = (w * params.scale) / 100;
35 h = (h * params.scale) / 100;
38 LYXERR(Debug::GRAPHICS, "graphics::Image::getScaledDimensions()"
39 << "\n\tparams.scale : " << params.scale
40 << "\n\twidth : " << w
41 << "\n\theight : " << h);
43 return Dimension(w, h, 0);
46 } // namespace graphics