CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
operation_state_manager.h
Go to the documentation of this file.
1
8#pragma once
9
11#include "engine/photo_engine.h"
12#include <vector>
13#include <memory>
14#include <mutex>
15#include <string_view>
16
17#include <spdlog/spdlog.h>
18
19namespace CaptureMoment::UI {
20
21namespace Controller {
22class ImageControllerBase; // Forward declaration
23}
24
25namespace Managers {
26
36class OperationStateManager {
37public:
45 std::shared_ptr<Core::Engine::PhotoEngine> engine
46 );
47
49
50 // Disable copy and assignment
53
64
74
80 void clearAllOperations();
81
88 [[nodiscard]] std::vector<Core::Operations::OperationDescriptor> getActiveOperations() const;
89
90private:
91 mutable std::mutex m_mutex;
92 std::vector<Core::Operations::OperationDescriptor> m_active_operations;
93
95 std::shared_ptr<Core::Engine::PhotoEngine> m_engine;
96
101 void applyCurrentOperationsToEngine();
102};
103
104} // namespace Managers
105} // namespace CaptureMoment::UI
Manages the state of active image operations.
void clearAllOperations()
Clears all active operations, resetting the state to the original image.
void addOrUpdateOperation(const Core::Operations::OperationDescriptor &descriptor)
Adds or updates an operation in the active state.
OperationStateManager(const OperationStateManager &)=delete
OperationStateManager(Controller::ImageControllerBase *controller, std::shared_ptr< Core::Engine::PhotoEngine > engine)
Constructs an OperationStateManager.
std::vector< Core::Operations::OperationDescriptor > getActiveOperations() const
Gets the current list of active operation descriptors.
void removeOperation(Core::Operations::OperationType type)
Removes an operation of a specific type from the active state.
OperationStateManager & operator=(const OperationStateManager &)=delete
OperationType
Identifies the type of an image processing operation.
Descriptor of an operation with its parameters and unique identifier.
Declaration of PhotoEngine class.
A universal container for operation settings with unique identifier.
CaptureMoment — footer