From 367882ae233669366c781e21908c2b0326dadd05 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sun, 7 Jan 2024 00:52:27 -0500 Subject: [PATCH] LibGfx: Make ExifOrientedBitmap::oriented_size be public This will be useful for image decoders to expose the image size while considering the orientation. A rotated image might have different dimensions. --- .../LibGfx/ImageFormats/ExifOrientedBitmap.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/ExifOrientedBitmap.h b/Userland/Libraries/LibGfx/ImageFormats/ExifOrientedBitmap.h index 9070bebb4c..c80b926829 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/ExifOrientedBitmap.h +++ b/Userland/Libraries/LibGfx/ImageFormats/ExifOrientedBitmap.h @@ -31,18 +31,7 @@ public: return m_bitmap; } -private: - using Orientation = TIFF::Orientation; - - ExifOrientedBitmap(NonnullRefPtr bitmap, IntSize size, Orientation orientation) - : m_bitmap(move(bitmap)) - , m_orientation(orientation) - , m_width(size.width()) - , m_height(size.height()) - { - } - - static IntSize oriented_size(IntSize size, Orientation orientation) + static IntSize oriented_size(IntSize size, TIFF::Orientation orientation) { switch (orientation) { case Orientation::Default: @@ -59,6 +48,17 @@ private: VERIFY_NOT_REACHED(); } +private: + using Orientation = TIFF::Orientation; + + ExifOrientedBitmap(NonnullRefPtr bitmap, IntSize size, Orientation orientation) + : m_bitmap(move(bitmap)) + , m_orientation(orientation) + , m_width(size.width()) + , m_height(size.height()) + { + } + IntPoint oriented_position(IntPoint point) { auto const flip_horizontally = [this](IntPoint point) {