CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
i_working_image_hardware.h
Go to the documentation of this file.
1
20#pragma once
21
23#include "common/image_region.h"
26
28
29#include <memory>
30#include <expected>
31#include <span>
32
33namespace CaptureMoment::Core {
34
35namespace ImageProcessing {
45public:
49 virtual ~IWorkingImageHardware() = default;
50
62 [[nodiscard]] virtual bool bindView(const ImageView& view) {
63 m_view_data_image = view;
64 return !m_view_data_image.working_data.empty();
65 }
66
82 [[nodiscard]] virtual std::expected<std::unique_ptr<Common::ImageRegion>, ErrorHandling::CoreError>
84
94 [[nodiscard]] virtual std::expected<std::unique_ptr<Common::ImageRegion>, ErrorHandling::CoreError>
95 downsample(Common::ImageDim target_width, Common::ImageDim target_height) = 0;
96
101 [[nodiscard]] virtual bool isValid() const = 0;
102
107 [[nodiscard]] virtual Common::MemoryType getMemoryType() const = 0;
108
109protected:
114
119};
120
121} // namespace ImageProcessing
122
123} // namespace CaptureMoment::Core
Abstract interface representing an image used as a working buffer.
virtual Common::MemoryType getMemoryType() const =0
Gets the memory type where data resides.
virtual ~IWorkingImageHardware()=default
Virtual destructor.
virtual std::expected< std::unique_ptr< Common::ImageRegion >, ErrorHandling::CoreError > downsample(Common::ImageDim target_width, Common::ImageDim target_height)=0
Exports a downscaled version of the image directly from GPU.
virtual std::expected< std::unique_ptr< Common::ImageRegion >, ErrorHandling::CoreError > getFullResImage()=0
Exports current internal image data to a new CPU-based ImageRegion (Deep Copy).
IWorkingImageHardware()=default
Protected constructor to enforce abstract nature.
virtual bool bindView(const ImageView &view)
Binds a view of the image data to this hardware worker.
ImageView m_view_data_image
The image view bound to this hardware worker.
virtual bool isValid() const =0
Checks if the image data is valid.
Central error handling system for CaptureMoment Core library.
Defines the ImageRegion structure for representing pixel buffers in the CaptureMoment Core library.
Common type definitions for all image types in CaptureMoment.
Lightweight, non-owning view over image memory and its geometry.
Enum representing the memory type where image data is stored (CPU or GPU).
std::size_t ImageDim
Type for image dimensions (width, height).
Definition image_types.h:20
MemoryType
Enum representing the memory type where image data is stored.
Definition memory_type.h:24
@ ImageProcessing
Errors related to Image Processing, GPU, or Memory.
CoreError
Enumeration of all error codes for CaptureMoment Core.
Definition core_error.h:36
Manages the lifecycle of a single IWorkingImage instance.
Represents a zero-copy window over contiguous image memory.
Definition image_view.h:26
std::span< float > working_data
Mutable span for processing.
Definition image_view.h:27
CaptureMoment — footer