52 [[nodiscard]] std::expected<void, ErrorHandling::CoreError>
58 [[nodiscard]]
bool isValid()
const override;
109 void initDataForHalide();
114 void buildDownsamplePipeline();
117 Halide::Buffer<float> m_original_halide_buffer;
120 Halide::Pipeline m_reset_pipeline;
121 Halide::Pipeline m_downsample_pipeline;
124 Halide::ImageParam m_downsample_input{Halide::Float(32), 3,
"downsample_src"};
125 Halide::Param<float> m_downsample_scale_x{
"downsample_scale_x"};
126 Halide::Param<float> m_downsample_scale_y{
"downsample_scale_y"};
127 Halide::Buffer<float> m_downsample_src_buffer;
129 bool m_downsample_built{
false};
130 bool m_pipelines_initialized{
false};
Concrete implementation of WorkingImageGPU using Halide for processing.
Halide::Buffer< float > & getOriginalHalideBuffer()
Provides access to the Halide buffer containing the original image on GPU.
bool isValid() const override
Checks if the GPU view AND the Halide buffer are valid.
std::expected< void, ErrorHandling::CoreError > transferToVRAM() override
Transfers the current image data to GPU VRAM With Halide.
Halide::Buffer< float > & getExecutionBuffer()
Provides access to the Halide buffer used for GPU execution.
void resetExecutionBuffer()
Resets the execution buffer on the GPU to prepare for a new Halide pipeline execution.
bool downloadDeviceToHost() override
A pure method that specific backends (Halide, Vulkan, etc.) must implement.
void syncToHostRAM()
Synchronizes the GPU buffer back to Host RAM.
~WorkingImageGPU_Halide() override=default
std::expected< std::unique_ptr< Common::ImageRegion >, ErrorHandling::CoreError > downsample(Common::ImageDim target_width, Common::ImageDim target_height) override
Downsamples the current image to the target dimensions using Halide on GPU.
bool isOriginalHalideBufferValid() const
Checks if the original GPU buffer is valid.
WorkingImageGPU_Halide()=default
Default constructor
bool bindView(const ImageView &view) override
Binds the view and initializes the Halide buffer on the device.
Class extending IWorkingImageHardware for GPU-specific implementations.
Base class providing common Halide buffer functionality for image processing.
Central error handling system for CaptureMoment Core library.
Lightweight, non-owning view over image memory and its geometry.
std::size_t ImageDim
Type for image dimensions (width, height).
@ ImageProcessing
Errors related to Image Processing, GPU, or Memory.
CoreError
Enumeration of all error codes for CaptureMoment Core.
Manages the lifecycle of a single IWorkingImage instance.
Represents a zero-copy window over contiguous image memory.
Image working buffers stored on the GPU.
Base class for Halide-based working image implementations.