From 7dcbdef9d6ae95e7c9232418d12195582faaa54b Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 21 Jul 2012 16:57:24 +1000 Subject: Scale factor implemented for RGBAImages to allow for high definition markers on retina displays. --- src/XPM.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/XPM.h') diff --git a/src/XPM.h b/src/XPM.h index 77ab0806e..e047ca8ad 100644 --- a/src/XPM.h +++ b/src/XPM.h @@ -80,13 +80,17 @@ class RGBAImage { RGBAImage &operator=(const RGBAImage &); int height; int width; + float scale; std::vector pixelBytes; public: - RGBAImage(int width_, int height_, const unsigned char *pixels_); + RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_); RGBAImage(const XPM &xpm); virtual ~RGBAImage(); int GetHeight() const { return height; } int GetWidth() const { return width; } + float GetScale() const { return scale; } + float GetScaledHeight() const { return height / scale; } + float GetScaledWidth() const { return width / scale; } int CountBytes() const; const unsigned char *Pixels() const; void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff); -- cgit v1.2.3