2 * \file GraphicsImage.C
3 * Read the file COPYING
6 * \author Angus Leeming
9 * Full author contact details available in file CREDITS
15 #pragma implementation
18 #include "GraphicsImage.h"
19 #include "GraphicsParams.h"
27 // This is to be connected to a function that will return a new
28 // instance of a viable derived class.
29 boost::function0<Image::ImagePtr> Image::newImage;
31 /// Return the list of loadable formats.
32 boost::function0<Image::FormatList> Image::loadableFormats;
35 std::pair<unsigned int, unsigned int>
36 Image::getScaledDimensions(Params const & params) const
38 // scale only when value > 0
42 width = (getWidth() * params.scale) / 100;
43 height = (getHeight() * params.scale) / 100;
49 lyxerr[Debug::GRAPHICS]
50 << "GraphicsImage::getScaledDImensions()"
51 << "\n\tparams.scale : " << params.scale
52 << "\n\twidth : " << width
53 << "\n\theight : " << height
56 return std::make_pair(width, height);