mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
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.
This commit is contained in:
parent
34e9059ae8
commit
367882ae23
1 changed files with 12 additions and 12 deletions
|
@ -31,18 +31,7 @@ public:
|
||||||
return m_bitmap;
|
return m_bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
static IntSize oriented_size(IntSize size, TIFF::Orientation orientation)
|
||||||
using Orientation = TIFF::Orientation;
|
|
||||||
|
|
||||||
ExifOrientedBitmap(NonnullRefPtr<Bitmap> 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)
|
|
||||||
{
|
{
|
||||||
switch (orientation) {
|
switch (orientation) {
|
||||||
case Orientation::Default:
|
case Orientation::Default:
|
||||||
|
@ -59,6 +48,17 @@ private:
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
using Orientation = TIFF::Orientation;
|
||||||
|
|
||||||
|
ExifOrientedBitmap(NonnullRefPtr<Bitmap> 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)
|
IntPoint oriented_position(IntPoint point)
|
||||||
{
|
{
|
||||||
auto const flip_horizontally = [this](IntPoint point) {
|
auto const flip_horizontally = [this](IntPoint point) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue