CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
working_image_gpu.h
Go to the documentation of this file.
1
8#pragma once
9
11
12namespace CaptureMoment::Core {
13
14namespace ImageProcessing {
15
26public:
28 WorkingImageGPU() = default;
29
33 virtual ~WorkingImageGPU() = default;
34
38 [[nodiscard]] bool isValid() const override;
39
44 [[nodiscard]] Common::MemoryType getMemoryType() const override {
46 }
47
53 [[nodiscard]] std::expected<std::unique_ptr<Common::ImageRegion>, ErrorHandling::CoreError>
54 getFullResImage() override;
55
56
61 [[nodiscard]] virtual std::expected<void, ErrorHandling::CoreError>
63
64protected:
69 [[nodiscard]] virtual bool downloadDeviceToHost() = 0;
70};
71
72} // namespace ImageProcessing
73
74} // namespace CaptureMoment::Core
Abstract interface representing an image used as a working buffer.
Class extending IWorkingImageHardware for GPU-specific implementations.
virtual ~WorkingImageGPU()=default
Virtual destructor for safe inheritance and polymorphic deletion.
bool isValid() const override
Checks if the GPU buffer is valid and allocated.
std::expected< std::unique_ptr< Common::ImageRegion >, ErrorHandling::CoreError > getFullResImage() override
Exports current internal image data by downloading from the GPU device to Host memory.
virtual bool downloadDeviceToHost()=0
A pure method that specific backends (Halide, Vulkan, etc.) must implement.
virtual std::expected< void, ErrorHandling::CoreError > transferToVRAM()=0
Transfers the image data to GPU VRAM.
Common::MemoryType getMemoryType() const override
Gets the memory type where data resides.
Abstract interface representing an image used as a working buffer, abstracting hardware location.
MemoryType
Enum representing the memory type where image data is stored.
Definition memory_type.h:24
@ GPU_MEMORY
Data is stored in GPU memory.
@ 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.
CaptureMoment — footer