CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
i_rendering_item_base.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <QObject>
11#include <QMutex>
12#include <QPointF>
13#include <memory>
14
15#include "common/image_region.h"
16
17namespace CaptureMoment::UI {
18
25namespace Rendering {
26
35
36public:
40 virtual ~IRenderingItemBase() = default;
41
50 virtual void setImage(std::unique_ptr<Core::Common::ImageRegion> image) = 0;
51
61 virtual void updateTile(std::unique_ptr<Core::Common::ImageRegion> tile) = 0;
62
67 virtual void setZoom(float zoom) = 0;
68
73 virtual void setPan(const QPointF& pan) = 0;
74
79 [[nodiscard]] virtual float zoom() const = 0;
80
85 [[nodiscard]] virtual QPointF pan() const = 0;
86
91 [[nodiscard]] virtual int imageWidth() const = 0;
92
97 [[nodiscard]] virtual int imageHeight() const = 0;
98
103 [[nodiscard]] virtual bool isImageValid() const = 0;
104
111 [[nodiscard]] virtual QMutex* getImageMutex() const = 0;
112
118 [[nodiscard]] virtual const Core::Common::ImageRegion* getFullImage() const = 0;
119};
120
121} // namespace Rendering
122
123} // namespace CaptureMoment::UI
Abstract base class for image display items managing common state (zoom, pan, dimensions).
virtual ~IRenderingItemBase()=default
Virtual destructor for safe inheritance.
virtual QMutex * getImageMutex() const =0
Gets a pointer to the mutex protecting the image data. This method provides access to the mutex for t...
virtual void setImage(std::unique_ptr< Core::Common::ImageRegion > image)=0
Sets the full image to be displayed.
virtual bool isImageValid() const =0
Checks if the full image data is loaded and valid.
virtual int imageWidth() const =0
Get the width of the image.
virtual float zoom() const =0
Gets the current zoom level.
virtual const Core::Common::ImageRegion * getFullImage() const =0
Gets a pointer to the full image data. This method provides access to the internal image data pointer...
virtual void updateTile(std::unique_ptr< Core::Common::ImageRegion > tile)=0
Updates a specific tile of the displayed image.
virtual void setPan(const QPointF &pan)=0
Sets the pan offset.
virtual int imageHeight() const =0
Get the height of the image.
virtual void setZoom(float zoom)=0
Sets the zoom level.
virtual QPointF pan() const =0
Gets the current pan offset.
Defines the ImageRegion structure for representing pixel buffers in the CaptureMoment Core library.
Represents a rectangular region of an image and its pixel data.
CaptureMoment — footer