10#include <spdlog/spdlog.h>
23 spdlog::warn(
"[WorkingImageGPU::getFullResImage]: Invalid working image. Cannot export to CPU.");
29 spdlog::warn(
"[WorkingImageGPU::getFullResImage]: Failed to download GPU buffer to Host memory.");
35 auto cpu_image_copy {std::make_unique<Common::ImageRegion>()};
44 if (!cpu_image_copy->isValid()) {
48 return cpu_image_copy;
50 }
catch (
const std::bad_alloc&) {
52 }
catch (
const std::exception& e) {
53 spdlog::error(
"[WorkingImageGPU::getFullResImage]: Unexpected: {}", e.what());
ImageView m_view_data_image
The image view bound to this hardware worker.
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.
@ RGBA_F32
4-channel format: Red, Green, Blue, Alpha in 32-bit float.
CoreError
Enumeration of all error codes for CaptureMoment Core.
@ InvalidImageRegion
The provided ImageRegion dimensions or data are invalid.
@ InvalidWorkingImage
The working image state is invalid or corrupted.
@ AllocationFailed
Memory allocation failed.
@ Unexpected
An unexpected error occurred.
Common::ImageChan channels
std::span< float > working_data
Mutable span for processing.
Image working buffers stored on the GPU.