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 /// Return the list of loadable formats.
29 boost::function<Image::FormatList()> Image::loadableFormats;
32 Dimension Image::scaledDimension(Params const & params) const
34 // scale only when value > 0
35 unsigned int w = width();
36 unsigned int h = height();
38 w = (w * params.scale) / 100;
39 h = (h * params.scale) / 100;
42 LYXERR(Debug::GRAPHICS, "graphics::Image::getScaledDimensions()"
43 << "\n\tparams.scale : " << params.scale
44 << "\n\twidth : " << w
45 << "\n\theight : " << h);
47 return Dimension(w, h, 0);
50 } // namespace graphics