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"
23 // This is to be connected to a function that will return a new
24 // instance of a viable derived class.
25 boost::function<Image *()> Image::newImage;
27 /// Return the list of loadable formats.
28 boost::function<Image::FormatList()> Image::loadableFormats;
31 Dimension Image::scaledDimension(Params const & params) const
33 // scale only when value > 0
34 unsigned int w = width();
35 unsigned int h = height();
37 w = (w * params.scale) / 100;
38 h = (h * params.scale) / 100;
41 LYXERR(Debug::GRAPHICS, "graphics::Image::getScaledDimensions()"
42 << "\n\tparams.scale : " << params.scale
43 << "\n\twidth : " << w
44 << "\n\theight : " << h);
46 return Dimension(w, h, 0);
49 } // namespace graphics