14#include <unordered_map>
78 std::unordered_map<std::string, OperationValue>
params;
88 static std::atomic<uint64_t> counter{1};
89 return counter.fetch_add(1, std::memory_order_relaxed);
99 [[nodiscard]] std::expected<T, ErrorHandling::CoreError>
getParam(
const std::string& key)
const
101 auto it =
params.find(key);
106 if (std::holds_alternative<T>(it->second)) {
107 return std::get<T>(it->second);
117 template <
typename T>
118 void setParam(
const std::string& key,
const T& value) {
Central error handling system for CaptureMoment Core library.
@ Unexpected
An unexpected error occurred.
std::variant< float, int, bool, std::string > OperationValue
Supported types for operation parameters. Using variant instead of std::any for compile-time type saf...
OperationType
Identifies the type of an image processing operation.
Manages the lifecycle of a single IWorkingImage instance.
Enumeration of image processing operation types.
A universal container for operation settings with unique identifier.
OperationType type
The operation type (e.g., Brightness, Contrast, Saturation). Used by the factory to create the approp...
void setParam(const std::string &key, const T &value)
Helper to set a parameter value.
static uint64_t generateId()
Generates a unique identifier for a new operation.
bool enabled
Whether this operation is currently active. Disabled operations are skipped during pipeline execution...
std::expected< T, ErrorHandling::CoreError > getParam(const std::string &key) const
Helper to get a parameter value safely with error handling.
std::string name
Human-readable name for display purposes. May include parameter values, e.g., "Brightness (100%)".
std::unordered_map< std::string, OperationValue > params
Generic parameter storage using variant (Type Safe).