2 * \file GraphicsImage.C
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"
24 // This is to be connected to a function that will return a new
25 // instance of a viable derived class.
26 boost::function0<Image::ImagePtr> Image::newImage;
28 /// Return the list of loadable formats.
29 boost::function0<Image::FormatList> Image::loadableFormats;
32 std::pair<unsigned int, unsigned int>
33 Image::getScaledDimensions(Params const & params) const
35 // scale only when value > 0
39 width = (getWidth() * params.scale) / 100;
40 height = (getHeight() * params.scale) / 100;
46 lyxerr[Debug::GRAPHICS]
47 << "GraphicsImage::getScaledDImensions()"
48 << "\n\tparams.scale : " << params.scale
49 << "\n\twidth : " << width
50 << "\n\theight : " << height
53 return std::make_pair(width, height);