CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
highlights_model.cpp
Go to the documentation of this file.
1
9#include <spdlog/spdlog.h>
10
12
14 : BaseAdjustmentModel(parent)
15{
17 spdlog::debug("HighlightsModel: Created (inherits default value from BaseAdjustmentModel)");
18}
19
21{
23 descriptor.id = m_operation_id;
25 descriptor.name = "Highlights (" + std::to_string(static_cast<int>(m_params.value * 100)) + "%)";
26 descriptor.enabled = true;
27 descriptor.setParam<float>("value", m_params.value);
28 return descriptor;
29}
30
32{
33 spdlog::debug("HighlightsModel::reset: Resetting to default value ({})", Core::Operations::OperationRanges::getHighlightsDefaultValue());
35}
36
37// Handles successful operation completion from ImageControllerBase.
39{
40 spdlog::debug("HighlightsModel: Operation Completed successfully");
41 emit operationApplied();
42}
43
44// Handles operation failure from ImageControllerBase.
45void HighlightsModel::onOperationFailed(const QString& error)
46{
47 spdlog::error("HighlightsModel: Operation failed - {}", error.toStdString());
48 emit operationFailed(error);
49}
50
51} // namespace CaptureMoment::UI::Models::Operations
Generic base class for operations with a single adjustable value (e.g., brightness,...
void setValue(float val)
Sets the adjustment value and triggers an update.
Domain::RelativeAdjustmentParams m_params
used for the value and activity state
void onOperationCompleted() override
Pure virtual slot to handle successful operation completion. Implementations in derived classes shoul...
Core::Operations::OperationDescriptor getDescriptor() const override
Creates and returns an OperationDescriptor representing the current state of this model....
void onOperationFailed(const QString &error) override
Pure virtual slot to handle operation failure. Implementations in derived classes should react to a f...
void operationApplied()
Signal emitted when an operation is applied successfully. Generic signal name, can be connected by UI...
void operationFailed(QString error)
Signal emitted when an operation fails. Generic signal name, can be connected by UI components or oth...
Highlights operation model inheriting from BaseAdjustmentModel.
@ Highlights
Highlights adjustment. Adjusts the luminosity of the brightest areas of the image....
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.
uint64_t id
Unique identifier for this operation instance.
bool enabled
Whether this operation is currently active. Disabled operations are skipped during pipeline execution...
std::string name
Human-readable name for display purposes. May include parameter values, e.g., "Brightness (100%)".
static consteval float getHighlightsDefaultValue()
Gets the default value for the Highlights operation.
CaptureMoment — footer