CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
halide_operation_worker.cpp
Go to the documentation of this file.
1
10
11#include <spdlog/spdlog.h>
12#include <future>
13
14namespace CaptureMoment::Core {
15namespace Workers {
16
20{
21 spdlog::trace("[HalideOperationWorker] Executing Halide pipeline.");
22
23 // 1. Retrieve the specific manager from the context
24 // We use the context to avoid passing the manager directly as a parameter.
25 auto& halide_manager { context.getHalideManager() };
26
27 // 2. Wrap the execution in a future
28 // Since the manager's execute() is synchronous (blocks until done),
29 // we use std::async to create a future that runs this logic.
30 // This satisfies the IWorkerRequest interface requirement.
31 return std::async(std::launch::deferred, [&halide_manager, &working_image]() {
32 bool success { halide_manager.execute(working_image) };
33
34 if (!success) {
35 spdlog::error("[HalideOperationWorker] Execution failed.");
36 }
37
38 return success;
39 });
40}
41
42} // namespace Workers
43} // namespace CaptureMoment::Core
Abstract interface representing an image used as a working buffer.
Central container for pipeline infrastructure.
Strategies::PipelineHalideOperationManager & getHalideManager() noexcept
Gets a reference to the Halide Operation Manager.
std::future< bool > execute(Pipeline::PipelineContext &context, ImageProcessing::IWorkingImageHardware &working_image) override
Executes the Halide pipeline asynchronously.
Concrete worker for Halide-based adjustment operations.
Manages the lifecycle of a single IWorkingImage instance.
Concrete manager for Halide-based adjustment operations.
CaptureMoment — footer