28class IRenderingItemBase;
166 [[nodiscard]] Rendering::IRenderingItemBase*
renderingItem() const noexcept {
return m_rendering_item; };
220 [[nodiscard]]
float zoom() const noexcept {
return m_zoom; };
229 Q_INVOKABLE
void setPan(
const QPointF&
pan);
235 [[nodiscard]] QPointF
pan() const noexcept {
return m_pan; };
246 Q_INVOKABLE
void zoomAt(
const QPointF& point,
float zoom_delta);
266 Q_INVOKABLE
void zoomIn();
352 [[nodiscard]] QSize
downsampleSize() const noexcept {
return m_downsample_size; };
358 [[nodiscard]]
float displayScale() const noexcept {
return m_display_scale; };
453 [[nodiscard]] QSize calculateDisplaySize(const QSize& source_size) const;
471 QSize m_source_image_size;
474 QSize m_display_image_size;
477 QSize m_downsample_size;
480 float m_display_scale{1.0f};
483 Rendering::IRenderingItemBase* m_rendering_item{
nullptr};
486 float m_fit_zoom{1.0f};
Central manager for image display, zoom, pan, and viewport coordination.
void viewportSizeChanged(const QSize &size)
Emitted when viewport size changes.
void displayScaleChanged(float scale)
Emitted when display scale changes.
void initialize()
Initializes with auto-detection of screen properties.
void panChanged(const QPointF &pan)
Emitted when pan changes.
void updateDisplayTile(std::unique_ptr< Core::Common::ImageRegion > source_tile)
Updates a specific tile region of the display image.
QSize downsampleSize() const noexcept
Gets the downsampled image size (GPU texture size).
void displayImageSizeChanged(const QSize &size)
Emitted when display image size changes.
void setRenderingItem(Rendering::IRenderingItemBase *item)
Assigns the rendering item that will receive image updates.
void displayImageRequest(int target_width, int target_height)
Emitted when a new downsampled image is needed.
Rendering::IRenderingItemBase * renderingItem() const noexcept
Gets the current rendering item.
void createDisplayImage(std::unique_ptr< Core::Common::ImageRegion > source_image)
Creates the display buffer from a downsampled source image.
Q_INVOKABLE void setQualityMargin(float margin)
Sets the quality margin for zoom headroom.
Q_INVOKABLE QPointF mapBackendToDisplay(int backend_x, int backend_y) const
Maps backend (source) coordinates to display coordinates.
Q_INVOKABLE void setSourceImageSize(int width, int height)
Sets the source image size metadata.
Q_INVOKABLE void setZoom(float zoom)
Sets the zoom level.
Q_INVOKABLE QPoint mapDisplayToBackend(float display_x, float display_y) const
Maps display coordinates to backend (source) coordinates.
bool isInitialized() const noexcept
Checks if the manager has been initialized.
void maxDownsampleChanged(int max_dim)
Emitted when max downsample changes.
Q_INVOKABLE void resetView()
Resets the view to default fit state.
void downsampleSizeChanged(const QSize &size)
Emitted when downsample size changes.
Q_INVOKABLE void setViewportSize(const QSize &size)
Sets the viewport size.
void zoomChanged(float zoom)
Emitted when zoom changes.
Q_INVOKABLE void zoomAt(const QPointF &point, float zoom_delta)
Performs a zoom centered on a specific point.
Q_INVOKABLE void zoomOut()
Zooms out by 20% (divides zoom by 1.2).
float displayScale() const noexcept
Gets the display scale factor.
void sourceImageSizeChanged(const QSize &size)
Emitted when source image size changes.
QSize displayImageSize() const noexcept
Gets the display image size.
void initializedChanged(bool initialized)
Emitted when initialization completes.
Q_INVOKABLE void setPan(const QPointF &pan)
Sets the pan offset.
Q_INVOKABLE void zoomIn()
Zooms in by 20%.
float zoom() const noexcept
Gets the current zoom level.
Q_INVOKABLE void fitToView()
Fits the image to fill the viewport.
QPointF pan() const noexcept
Gets the current pan offset.
Manages viewport calculations for optimal display across all screen types.
Defines the ImageRegion structure for representing pixel buffers in the CaptureMoment Core library.
Namespace containing Qt-specific UI components for CaptureMoment.
Physical screen characteristics.
Central viewport management for optimal display across all screen types.