Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChannelCorrectionParameters.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2016 "Omnidome" by cr8tr
2  * Dome Mapping Projection Software (http://omnido.me).
3  * Omnidome was created by Michael Winkelmann aka Wilston Oreo (@WilstonOreo)
4  *
5  * This file is part of Omnidome.
6  *
7  * Omnidome is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Affero General Public License for more details.
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OMNI_UI_PROJ_CHANNELCORRECTIONPARAMETERS_H_
20 #define OMNI_UI_PROJ_CHANNELCORRECTIONPARAMETERS_H_
21 
26 
27 class QPushButton;
28 
29 namespace omni {
30  namespace ui {
31  class RangedFloat;
33  using omni::proj::Channel;
34 
35  namespace proj {
36  /// Parameter widget for channel correction
38  public ParameterWidget,
39  public mixin::UnsharedDataModel<ChannelCorrection>{
40  Q_OBJECT
42  public:
43  ChannelCorrectionParameters(QWidget * = nullptr);
45 
46  /// Return channel
47  Channel channel() const;
48 
49  /// Set selected channel
50  void setChannel(Channel _channel);
51 
52  public slots:
53  /// Reset color correction for channel
54  void reset();
55 
56  signals:
57  /// Is emitted when channel correction has changed
58  void dataModelChanged();
59 
60  private:
61  /// Setup widget
62  void setup();
63 
64  /// Update sliders from current warp grid
65  void dataToFrontend();
66 
67  /// Assign slider values to current warp grid
68  bool frontendToData();
69 
71  RangedFloat *contrast_ = nullptr;
72  RangedFloat *gamma_ = nullptr;
74  QPushButton *reset_ = nullptr;
75  Channel channel_ = Channel::ALL;
76  };
77  }
78  }
79 }
80 
81 #endif /* OMNI_UI_PROJ_CHANNELCORRECTIONPARAMETERS_H_ */
void setup()
Setup widget.
Definition: ChannelCorrectionParameters.cpp:85
RangedFloat * brightness_
Definition: ChannelCorrectionParameters.h:70
void setChannel(Channel _channel)
Set selected channel.
Definition: ChannelCorrectionParameters.cpp:42
void reset()
Reset color correction for channel.
Definition: ChannelCorrectionParameters.cpp:75
ChannelCorrectionParameters(QWidget *=nullptr)
Definition: ChannelCorrectionParameters.cpp:28
RangedFloat * gamma_
Definition: ChannelCorrectionParameters.h:72
~ChannelCorrectionParameters()
Definition: ChannelCorrectionParameters.cpp:34
void dataModelChanged()
Is emitted when channel correction has changed.
Brightness, contrast and gamma correction for a single color channel.
Definition: ChannelCorrection.h:27
Channel channel() const
Return channel.
Definition: ChannelCorrectionParameters.cpp:38
Channel
Definition: Channel.h:24
RangedFloat * contrast_
Definition: ChannelCorrectionParameters.h:71
Parameter widget for channel correction.
Definition: ChannelCorrectionParameters.h:37
void dataToFrontend()
Update sliders from current warp grid.
Definition: ChannelCorrectionParameters.cpp:46
QPushButton * reset_
Definition: ChannelCorrectionParameters.h:74
A widget which holds sub-widgets for manipulating parameters.
Definition: ParameterWidget.h:37
A slider with float value within a minimum and maximum.
Definition: RangedFloat.h:30
#define OMNI_UI_UNSHARED_DATAMODEL(MODEL)
Definition: DataModel.h:219
RangedFloat * multiplier_
Definition: ChannelCorrectionParameters.h:73
Holds a specific data model with frontend update mechanism.
Definition: DataModel.h:87
bool frontendToData()
Assign slider values to current warp grid.
Definition: ChannelCorrectionParameters.cpp:67
Channel channel_
Definition: ChannelCorrectionParameters.h:75