CaptureMoment
0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
worker_context.cpp
Go to the documentation of this file.
1
8
#include "
workers/worker_context.h
"
9
#include "
workers/worker_registry.h
"
10
11
#include <spdlog/spdlog.h>
12
13
namespace
CaptureMoment::Core::Workers
{
14
15
WorkerContext::WorkerContext
()
16
{
17
spdlog::info(
"WorkerContext::WorkerContext: Initializing Context..."
);
18
19
// 1. Create the unique instance of the Builder
20
m_builder = std::make_unique<WorkerBuilder>();
21
22
// 2. Register all available worker types in this builder
23
WorkerRegistry::registerAll
(*m_builder);
24
25
// 3. Instantiate concrete workers (Halide only for now)
26
// Note: We assume WorkerBuilder::build returns the correct concrete type.
27
// For Halide, we create the specific worker instance.
28
m_halide_worker = std::make_unique<HalideOperationWorker>();
29
30
if
(!m_halide_worker) {
31
spdlog::error(
"WorkerContext::WorkerContext: Failed to build Halide Worker."
);
32
}
33
34
spdlog::debug(
"WorkerContext::WorkerContext: Context initialized with Builder and Workers."
);
35
spdlog::debug(
"WorkerContext::WorkerContext: Builder and Workers are ready for use."
);
36
37
// Note: The actual execution with operations is done by the caller (StateImageManager)
38
// passing the context and data to the worker.
39
40
spdlog::info(
"WorkerContext::WorkerContext: Initialization complete."
);
41
}
42
43
}
// namespace CaptureMoment::Core::Workers
CaptureMoment::Core::Workers::WorkerContext::WorkerContext
WorkerContext()
Constructor.
Definition
worker_context.cpp:15
CaptureMoment::Core::Workers::WorkerRegistry::registerAll
static void registerAll(WorkerBuilder &builder)
Register all available workers.
Definition
worker_registry.cpp:15
CaptureMoment::Core::Workers
Definition
halide_operation_worker.cpp:15
worker_context.h
Container for worker infrastructure (Builder and Workers).
worker_registry.h
Central registry for all processing workers.
CaptureMoment — footer