CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
operation_registry.cpp
Go to the documentation of this file.
1
9
16
17// #include "operations/operation_saturation.h" // TODO: Implement
18// #include "operations/operation_hue.h" // TODO: Implement
19// #include "operations/operation_exposure.h" // TODO: Implement
20// #include "operations/operation_vibrance.h" // TODO: Implement
21// #include "operations/operation_clarity.h" // TODO: Implement
22// #include "operations/operation_sharpen.h" // TODO: Implement
23// #include "operations/operation_color_profile.h" // TODO: Implement
24// #include "operations/operation_blur.h" // TODO: Implement
25// #include "operations/operation_vignette.h" // TODO: Implement
26// #include "operations/operation_grain.h" // TODO: Implement
27#include <spdlog/spdlog.h>
28
30
32 spdlog::info("OperationRegistry: Registering all operations");
33
34 registerToneAdjustments(factory);
35 // registerColorOperations(factory);
36 // registerColorProfiles(factory);
37 // registerDetailOperations(factory);
38 // registerEffects(factory);
39
40 spdlog::info("OperationRegistry: All operations registered");
41}
42
43void OperationRegistry::registerToneAdjustments(OperationFactory& factory) {
44 spdlog::debug("OperationRegistry: Registering tone adjustment operations");
45
46 // Brightness
47 factory.registerCreator(OperationType::Brightness, []() { return std::make_unique<OperationBrightness>(); });
48 spdlog::trace("Factory register Brightness");
49
50 // Contrast
51 factory.registerCreator(OperationType::Contrast, []() { return std::make_unique<OperationContrast>(); });
52 spdlog::trace("Factory register Contrast");
53
54 // Highlights
55 factory.registerCreator(OperationType::Highlights, []() { return std::make_unique<OperationHighlights>(); });
56 spdlog::trace("Factory register Highlights");
57
58 // Shadows
59 factory.registerCreator(OperationType::Shadows, []() { return std::make_unique<OperationShadows>(); });
60 spdlog::trace("Factory register Shadows");
61
62 // Whites
63 factory.registerCreator(OperationType::Whites, []() { return std::make_unique<OperationWhites>(); });
64 spdlog::trace("Factory register Whites");
65
66 // Blacks
67 factory.registerCreator(OperationType::Blacks, []() { return std::make_unique<OperationBlacks>(); });
68 spdlog::trace("Factory register Blacks");
69
70 // factory.registerCreator(OperationType::Exposure, []() { return std::make_unique<OperationExposure>(); });
71 // spdlog::trace("ok: Exposure");
72
73 // REMOVED DUPLICATE: factory.registerCreator(OperationType::Shadows, []() { return std::make_unique<OperationShadows>(); });
74}
75
76void OperationRegistry::registerColorOperations(OperationFactory& factory) {
77 spdlog::debug("OperationRegistry: Registering color operations");
78
79 // TODO: Add color operations as they are implemented
80 // factory.registerCreator(OperationType::Saturation, []() { return std::make_unique<OperationSaturation>(); });
81 // spdlog::trace("ok: Saturation");
82
83 // factory.registerCreator(OperationType::Hue, []() { return std::make_unique<OperationHue>(); });
84 // spdlog::trace("ok: Hue");
85
86 // factory.registerCreator(OperationType::Vibrance, []() { return std::make_unique<OperationVibrance>(); });
87 // spdlog::trace("ok: Vibrance");
88
89 // factory.registerCreator(OperationType::ColorGrade, []() { return std::make_unique<OperationColorGrade>(); });
90 // spdlog::trace("ok: Color Grade");
91}
92
93void OperationRegistry::registerColorProfiles(OperationFactory& factory) {
94 spdlog::debug("OperationRegistry: Registering color profile operations");
95
96 // TODO: Add color profile operations as they are implemented
97 // factory.registerCreator(OperationType::ColorProfile, []() { return std::make_unique<OperationColorProfile>(); });
98 // spdlog::trace("ok: Color Profile");
99
100 // factory.registerCreator(OperationType::WhiteBalance, []() { return std::make_unique<OperationWhiteBalance>(); });
101 // spdlog::trace("ok: White Balance");
102
103 // factory.registerCreator(OperationType::ColorSpaceConversion, []() { return std::make_unique<OperationColorSpaceConversion>(); });
104 // spdlog::trace("ok: Color Space Conversion");
105}
106
107void OperationRegistry::registerDetailOperations(OperationFactory& factory) {
108 spdlog::debug("OperationRegistry: Registering detail operations");
109
110 // TODO: Add detail operations as they are implemented
111 // factory.registerCreator(OperationType::Sharpen, []() { return std::make_unique<OperationSharpen>(); });
112 // spdlog::trace("ok: Sharpen");
113
114 // factory.registerCreator(OperationType::Clarity, []() { return std::make_unique<OperationClarity>(); });
115 // spdlog::trace("ok: Clarity");
116
117 // factory.registerCreator(OperationType::Texture, []() { return std::make_unique<OperationTexture>(); });
118 // spdlog::trace("ok: Texture");
119
120 // factory.registerCreator(OperationType::Denoise, []() { return std::make_unique<OperationDenoise>(); });
121 // spdlog::trace("ok: Denoise");
122}
123
124void OperationRegistry::registerEffects(OperationFactory& factory) {
125 spdlog::debug("OperationRegistry: Registering effect operations");
126
127 // TODO: Add effect operations as they are implemented
128 // factory.registerCreator(OperationType::Blur, []() { return std::make_unique<OperationBlur>(); });
129 // spdlog::trace("ok: Blur");
130
131 // factory.registerCreator(OperationType::Vignette, []() { return std::make_unique<OperationVignette>(); });
132 // spdlog::trace("ok: Vignette");
133
134 // factory.registerCreator(OperationType::Grain, []() { return std::make_unique<OperationGrain>(); });
135 // spdlog::trace("ok: Grain");
136
137 // factory.registerCreator(OperationType::Perspective, []() { return std::make_unique<OperationPerspective>(); });
138 // spdlog::trace("ok: Perspective");
139}
140
141} // namespace CaptureMoment::Core::Operations
Factory Pattern - creates operations from OperationDescriptor.
void registerCreator(OperationType type, std::function< std::unique_ptr< IOperation >()> creator)
Register an operation creator for a given type using a lambda/function.
static void registerAll(OperationFactory &factory)
Register all available operations.
@ Blacks
Blacks adjustment. Adjusts the luminosity of the black point of the image. Increasing blacks makes th...
@ Whites
Whites adjustment. Adjusts the luminosity of the white point of the image. Increasing whites makes th...
@ Brightness
Brightness adjustment (Additive). Adds a constant value to all pixels. Use sparingly as it can wash o...
@ Contrast
Contrast adjustment (Multiplicative around a midpoint). Expands or compresses the dynamic range aroun...
@ Highlights
Highlights adjustment. Adjusts the luminosity of the brightest areas of the image....
@ Shadows
Shadows adjustment. Adjusts the luminosity of the darkest areas of the image. Increasing shadows brig...
Concrete implementation of Blacks adjustment.
Concrete implementation of Brightness adjustment.
Concrete implementation of Contrast adjustment.
Concrete implementation of Highlights adjustment.
Central registry for all image operations.
Concrete implementation of Shadows adjustment.
Concrete implementation of Whites adjustment.
CaptureMoment — footer