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