Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
PaletteInterface.h
Go to the documentation of this file.
1#pragma once
4#include <misc/gen/TClosure.h>
5#include <misc/gen/Value.h>
8#include <pal/iface/global.h>
9#include <utility>
10
11namespace sf
12{
13
18 : public QObject
19 , public Persistent
20{
21 Q_OBJECT
22
23 public:
28 {
30
31 explicit Parameters(const Callback& callback, QObject* parent = nullptr)
32 : _parent(parent)
33 , _callback(callback)
34 {}
35
36 QObject* _parent{};
38 };
39
43 explicit PaletteInterface(const Parameters&);
44
48 ~PaletteInterface() override = default;
49
55
62 virtual void setSizes(qsizetype colorsUsed, qsizetype colorsSize);
63
67 [[nodiscard]] virtual ColorTable getColorTable() const = 0;
68
77 [[nodiscard]] virtual qreal getCurveLevel(qreal x) const = 0;
78
79 protected:
81 qsizetype _colorsSize{256};
82 qsizetype _colorsUsed{_colorsSize};
83
84 // Declarations of static functions and data members to be able to create registered implementations.
86};
87
88}// namespace sf
#define SF_DECL_IFACE(InterfaceType, ParamType, FuncName)
Declares a public static function in the class where it is used. Where: InterfaceType: Global typenam...
Definition TClassRegistration.h:71
Base class for the interface.
Definition PaletteInterface.h:20
virtual void setSizes(qsizetype colorsUsed, qsizetype colorsSize)
Sets the size of the color table of the implementation.
Parameters::Callback _callback
Definition PaletteInterface.h:80
virtual ColorTable getColorTable() const =0
Gets the color table of the implementation.
virtual void addPropertyPages(PropertySheetDialog *sheet)
~PaletteInterface() override=default
Virtual destructor for derived classes.
PaletteInterface(const Parameters &)
Constructor for passing general structure for derived classes.
virtual qreal getCurveLevel(qreal x) const =0
Gets calculated level for color shifts.
Class to multiple inherit which adds functions to read and write properties from a given object....
Definition Persistent.h:14
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
Encapsulates the std::function() template.
Definition TClosure.h:14
Definition Application.h:10
QList< QRgb > ColorTable
Definition ColorTable.h:11
#define _PAL_CLASS
Definition pal/iface/global.h:35
Structure passed as a constructor argument.
Definition PaletteInterface.h:28
Parameters(const Callback &callback, QObject *parent=nullptr)
Definition PaletteInterface.h:31
Callback _callback
Definition PaletteInterface.h:37
TClosure< void > Callback
Definition PaletteInterface.h:29