CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
working_image_halide.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <span>
11
13
14#include "Halide.h"
15
16namespace CaptureMoment::Core {
17
18namespace ImageProcessing {
19
28public:
32 virtual ~WorkingImageHalide() = default;
33
45 [[nodiscard]] Halide::Buffer<float>& getHalideBuffer() { return m_halide_buffer; };
46
51 [[nodiscard]] bool isHalideBufferValid() const noexcept;
52
53protected:
58 Halide::Buffer<float> m_halide_buffer;
59
63 WorkingImageHalide() = default;
64
85 void initializeHalide(std::span<float> data, Common::ImageDim width, Common::ImageDim height, Common::ImageChan channels);
86
90 [[nodiscard]] std::pair<Common::ImageDim, Common::ImageDim> getSizeByHalide() const noexcept;
91
96 [[nodiscard]] Common::ImageChan getChannelsByHalide() const noexcept;
97
102 [[nodiscard]] Common::ImageSize getPixelCountByHalide() const noexcept;
103
108 [[nodiscard]] Common::ImageSize getDataSizeByHalide() const noexcept;
109};
110
111} // namespace ImageProcessing
112
113} // namespace CaptureMoment::Core
Base class providing common Halide buffer functionality for image processing.
Common::ImageSize getDataSizeByHalide() const noexcept
Gets the total data element count from the Halide buffer.
virtual ~WorkingImageHalide()=default
Virtual destructor.
void initializeHalide(std::span< float > data, Common::ImageDim width, Common::ImageDim height, Common::ImageChan channels)
Creates a Halide buffer view over existing pixel data.
Halide::Buffer< float > & getHalideBuffer()
Gets a reference to the internal Halide buffer managed by this object.
Halide::Buffer< float > m_halide_buffer
Internal Halide buffer holding the image data. Managed directly by this object. Halide::Buffer handle...
Common::ImageChan getChannelsByHalide() const noexcept
Gets the number of color channels from the Halide buffer.
Common::ImageSize getPixelCountByHalide() const noexcept
Gets the total pixel count from the Halide buffer.
std::pair< Common::ImageDim, Common::ImageDim > getSizeByHalide() const noexcept
bool isHalideBufferValid() const noexcept
Checks if the Halide buffer is defined.
Common type definitions for all image types in CaptureMoment.
@ ImageProcessing
Errors related to Image Processing, GPU, or Memory.
Manages the lifecycle of a single IWorkingImage instance.
CaptureMoment — footer