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::ImagePtr()> Image::newImage;
27 /// Return the list of loadable formats.
28 boost::function<Image::FormatList()> Image::loadableFormats;
31 std::pair<unsigned int, unsigned int>
32 Image::getScaledDimensions(Params const & params) const
34 // scale only when value > 0
38 width = (getWidth() * params.scale) / 100;
39 height = (getHeight() * params.scale) / 100;
45 LYXERR(Debug::GRAPHICS)
46 << "graphics::Image::getScaledDimensions()"
47 << "\n\tparams.scale : " << params.scale
48 << "\n\twidth : " << width
49 << "\n\theight : " << height
52 return std::make_pair(width, height);
55 } // namespace graphics