From e4328d24681689a7fd0cb876a5fdd94ffd84f5f9 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 9 Jan 2023 13:30:33 +1100 Subject: Move methods from header to implementation to avoid conversion warnings for each includer. --- src/XPM.cxx | 8 ++++++++ src/XPM.h | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/XPM.cxx b/src/XPM.cxx index 65c2d4835..31d87a06d 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -239,6 +239,14 @@ RGBAImage::RGBAImage(const XPM &xpm) { } } +float RGBAImage::GetScaledHeight() const noexcept { + return static_cast(height) / scale; +} + +float RGBAImage::GetScaledWidth() const noexcept { + return static_cast(width) / scale; +} + int RGBAImage::CountBytes() const noexcept { return width * height * 4; } diff --git a/src/XPM.h b/src/XPM.h index 31753da18..f2298066c 100644 --- a/src/XPM.h +++ b/src/XPM.h @@ -51,8 +51,8 @@ public: int GetHeight() const noexcept { return height; } int GetWidth() const noexcept { return width; } float GetScale() const noexcept { return scale; } - float GetScaledHeight() const noexcept { return height / scale; } - float GetScaledWidth() const noexcept { return width / scale; } + float GetScaledHeight() const noexcept; + float GetScaledWidth() const noexcept; int CountBytes() const noexcept; const unsigned char *Pixels() const noexcept; void SetPixel(int x, int y, ColourRGBA colour) noexcept; -- cgit v1.2.3