2 * \file GraphicsImage.C
3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
6 * \author Baruch Even <baruch.even@writeme.com>
7 * \author Angus Leeming <leeming@lyx.org>
8 * \author Herbert Voss <voss@lyx.org>
14 #pragma implementation
17 #include "GraphicsImage.h"
18 #include "GraphicsParams.h"
26 // This is to be connected to a function that will return a new
27 // instance of a viable derived class.
28 boost::function0<Image::ImagePtr> Image::newImage;
30 /// Return the list of loadable formats.
31 boost::function0<Image::FormatList> Image::loadableFormats;
34 std::pair<unsigned int, unsigned int>
35 Image::getScaledDimensions(Params const & params) const
37 // scale only when value > 0
41 width = (getWidth() * params.scale) / 100;
42 height = (getHeight() * params.scale) / 100;
48 lyxerr[Debug::GRAPHICS]
49 << "GraphicsImage::getScaledDImensions()"
50 << "\n\tparams.scale : " << params.scale
51 << "\n\twidth : " << width
52 << "\n\theight : " << height
55 return std::make_pair(width, height);