CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
working_image_factory.h
Go to the documentation of this file.
1
9#pragma once
10
11
14
15#include <memory>
16#include <functional>
17#include <unordered_map>
18
19namespace CaptureMoment::Core {
20
21namespace ImageProcessing {
22
37public:
42 using CreatorFunction = std::function<std::unique_ptr<IWorkingImageHardware>()>;
43
44
55 [[nodiscard]] static std::unique_ptr<IWorkingImageHardware> create();
56
67 [[nodiscard]] static std::unique_ptr<IWorkingImageHardware> create(
68 Common::MemoryType backend
69 );
70
81 static void registerCreator(
83 CreatorFunction creator
84 );
85
86private:
90 static inline std::unordered_map<Common::MemoryType, CreatorFunction> s_registry;
91};
92
93} // namespace ImageProcessing
94} // namespace CaptureMoment::Core
Factory with registration support for creating IWorkingImageHardware instances.
static void registerCreator(Common::MemoryType type, CreatorFunction creator)
Registers a creator function for a specific backend type.
std::function< std::unique_ptr< IWorkingImageHardware >()> CreatorFunction
Definition of a creator function.
static std::unique_ptr< IWorkingImageHardware > create()
Creates a working image using the application's global configuration.
Abstract interface representing an image used as a working buffer, abstracting hardware location.
Enum representing the memory type where image data is stored (CPU or GPU).
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.
Manages the lifecycle of a single IWorkingImage instance.
CaptureMoment — footer