Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
SimplePalette.h
Go to the documentation of this file.
1#pragma once
2#include <misc/qt/Macros.h>
4
5namespace sf
6{
7
9{
10 Q_OBJECT
11 Q_PROPERTY(Mode mode READ getMode WRITE setMode)
12 Q_PROPERTY(QColor colorFrom READ getColorFrom WRITE setColorFrom)
13 Q_PROPERTY(QColor colorTo READ getColorTo WRITE setColorTo)
14 Q_PROPERTY(QColor colorCenter READ getColorCenter WRITE setColorCenter)
15 Q_PROPERTY(QString formula READ getFormula WRITE setFormula)
16
17 public:
21 enum Mode
22 {
23 /* Shifts the color rgb values linear */
25 /* Shifts hue and value linear. */
27 /* Shifts hue and lightness linear. */
29 };
30
32
36 explicit SimplePalette(const Parameters&);
37
42
43 /*
44 * @brief Overridden from base class.
45 */
46 [[nodiscard]] ColorTable getColorTable() const override;
47
48 /*
49 * @brief Overridden from base class.
50 */
51 [[nodiscard]] qreal getCurveLevel(qreal x) const override;
52
53 SF_DECL_PROP_GS(QColor, ColorFrom)
54
55 SF_DECL_PROP_GS(QColor, ColorTo)
56
57 SF_DECL_PROP_GS(QColor, ColorCenter)
58
60
61 SF_DECL_PROP_GRS(QString, Formula)
62
63 private:
67 void notify(void*);
71 QColor _colorFrom{Qt::red};
75 QColor _colorTo{Qt::blue};
79 QColor _colorCenter{0, 0, 0, 0};
83 Mode _mode{ShiftRgb};
87 QString _formula{};
88};
89
90}// namespace sf
Base class for the interface.
Definition PaletteInterface.h:20
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
Definition SimplePalette.h:9
Mode
Mode for generation of colors.
Definition SimplePalette.h:22
@ ShiftRgb
Definition SimplePalette.h:24
@ ShiftHsv
Definition SimplePalette.h:26
@ ShiftHsl
Definition SimplePalette.h:28
SimplePalette(const Parameters &)
Interface constructor.
void addPropertyPages(PropertySheetDialog *sheet) override
Overridden from base class.
QString formula
Definition SimplePalette.h:15
QColor colorFrom
Definition SimplePalette.h:12
QColor colorTo
Definition SimplePalette.h:13
Mode mode
Definition SimplePalette.h:11
qreal getCurveLevel(qreal x) const override
Gets calculated level for color shifts.
ColorTable getColorTable() const override
Gets the color table of the implementation.
QColor colorCenter
Definition SimplePalette.h:14
#define SF_DECL_PROP_GRS(Type, Name)
Declares unreferenced getter and referenced setter for a property.
Definition misc/qt/Macros.h:17
#define SF_DECL_PROP_GS(Type, Name)
Declares unreferenced getter and unreferenced setter for a property.
Definition misc/qt/Macros.h:8
Definition Application.h:10
QList< QRgb > ColorTable
Definition ColorTable.h:11
Structure passed as a constructor argument.
Definition PaletteInterface.h:28