Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes
omni::ui::ColorCorrection Class Reference

Dockwidget for editing color correction of a projector. More...

#include <ColorCorrection.h>

Inheritance diagram for omni::ui::ColorCorrection:
Inheritance graph
[legend]
Collaboration diagram for omni::ui::ColorCorrection:
Collaboration graph
[legend]

Public Types

typedef omni::proj::Channel Channel
 
- Public Types inherited from omni::ui::mixin::DataModel< DATAMODEL, SHARED >
typedef DATAMODEL data_model_type
 Data type. More...
 
typedef DataModel
< data_model_type, SHARED > 
type
 This type. More...
 
typedef detail::PointerType
< data_model_type, SHARED > 
pointer_type_handler
 Pointer type handler. More...
 
typedef pointer_type_handler::type pointer_type
 Derived pointer type. More...
 

Public Slots

void setAllChannels ()
 Select color correction for all channels. More...
 
void setRedChannel ()
 Select color correction for red channel. More...
 
void setGreenChannel ()
 Select color correction for green channel. More...
 
void setBlueChannel ()
 Select color correction for blue channel. More...
 
void setChannel (Channel _channel)
 Select color correction for custom channel. More...
 
void setUsed (bool)
 Select whether color correction is used. More...
 

Signals

void dataModelChanged ()
 

Public Member Functions

 ColorCorrection (QWidget *_parent=nullptr)
 
 ~ColorCorrection ()
 
- Public Member Functions inherited from omni::ui::DockWidget
 DockWidget (QWidget *=nullptr)
 
template<typename UI >
 DockWidget (UI &_ui, QWidget *_parent=nullptr)
 
virtual ~DockWidget ()
 
- Public Member Functions inherited from omni::ui::mixin::DataModel< DATAMODEL, SHARED >
 DataModel ()
 
void setDataModel (pointer_type _dataModel)
 Set new data model. More...
 
pointer_type dataModel ()
 Return pointer to data model. More...
 
const pointer_type dataModel () const
 Return pointer to data model (const version) More...
 
virtual void updateFrontend ()
 Push data to frontend widgets and all child widgets. More...
 
virtual void updateDataModel ()
 Update the data model interface. More...
 

Private Member Functions

void dataToFrontend ()
 Update sliders from current color correction. More...
 
bool frontendToData ()
 Assign slider values to current color correction. More...
 

Private Attributes

std::unique_ptr
< Ui::ColorCorrection > 
ui_
 

Additional Inherited Members

- Protected Member Functions inherited from omni::ui::DockWidget
template<typename UI >
void setup (UI &_ui)
 Setup ui form UI parameter is smart pointer (e.g. unique_ptr) to UI form. More...
 
- Protected Member Functions inherited from omni::ui::mixin::Locked
template<typename F >
void locked (F f)
 Lock widget and execute given functor. More...
 
bool isLocked () const
 Return true if widget is locked. More...
 

Detailed Description

Dockwidget for editing color correction of a projector.

Member Typedef Documentation

Constructor & Destructor Documentation

omni::ui::ColorCorrection::ColorCorrection ( QWidget *  _parent = nullptr)
28  :
29  DockWidget(_parent),
30  ui_(new Ui::ColorCorrection)
31  {
32  this->setup(ui_);
33 
34  connect(ui_->params, SIGNAL(dataModelChanged()), ui_->graph,
35  SLOT(update()));
36  connect(ui_->params, SIGNAL(dataModelChanged()), this,
37  SIGNAL(dataModelChanged()));
38 
39  connect(ui_->btnAll, SIGNAL(clicked()), this, SLOT(setAllChannels()));
40  connect(ui_->btnRed, SIGNAL(clicked()), this, SLOT(setRedChannel()));
41  connect(ui_->btnGreen, SIGNAL(clicked()), this, SLOT(setGreenChannel()));
42  connect(ui_->btnBlue, SIGNAL(clicked()), this, SLOT(setBlueChannel()));
43 
44  connect(ui_->chkIsUsed, SIGNAL(clicked(bool)), this, SLOT(setUsed(bool)));
45  }
void setBlueChannel()
Select color correction for blue channel.
Definition: ColorCorrection.cpp:61
void setup(UI &_ui)
Setup ui form UI parameter is smart pointer (e.g. unique_ptr) to UI form.
Definition: DockWidget.h:44
std::unique_ptr< Ui::ColorCorrection > ui_
Definition: ColorCorrection.h:75
DockWidget(QWidget *=nullptr)
Definition: DockWidget.cpp:24
void setAllChannels()
Select color correction for all channels.
Definition: ColorCorrection.cpp:49
void setUsed(bool)
Select whether color correction is used.
Definition: ColorCorrection.cpp:65
void setGreenChannel()
Select color correction for green channel.
Definition: ColorCorrection.cpp:57
void setRedChannel()
Select color correction for red channel.
Definition: ColorCorrection.cpp:53
omni::ui::ColorCorrection::~ColorCorrection ( )
47 {}

Member Function Documentation

void omni::ui::ColorCorrection::dataModelChanged ( )
signal
void omni::ui::ColorCorrection::dataToFrontend ( )
privatevirtual

Update sliders from current color correction.

Implements omni::ui::mixin::DataModel< DATAMODEL, SHARED >.

106  {
107  auto _tuning = dataModel()->tunings().current();
108 
109  setAllChannels();
110 
111  if (!_tuning) return;
112 
113  setUsed(_tuning->colorCorrection().isUsed());
114  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
void setAllChannels()
Select color correction for all channels.
Definition: ColorCorrection.cpp:49
void setUsed(bool)
Select whether color correction is used.
Definition: ColorCorrection.cpp:65
bool omni::ui::ColorCorrection::frontendToData ( )
privatevirtual

Assign slider values to current color correction.

Implements omni::ui::mixin::DataModel< DATAMODEL, SHARED >.

116  {
117  return false;
118  }
void omni::ui::ColorCorrection::setAllChannels ( )
slot

Select color correction for all channels.

49  {
50  setChannel(Channel::ALL);
51  }
void setChannel(Channel _channel)
Select color correction for custom channel.
Definition: ColorCorrection.cpp:85
void omni::ui::ColorCorrection::setBlueChannel ( )
slot

Select color correction for blue channel.

61  {
62  setChannel(Channel::BLUE);
63  }
void setChannel(Channel _channel)
Select color correction for custom channel.
Definition: ColorCorrection.cpp:85
void omni::ui::ColorCorrection::setChannel ( Channel  _channel)
slot

Select color correction for custom channel.

85  {
86  if (!dataModel()) return;
87 
88  auto _tuning = dataModel()->tunings().current();
89 
90  if (!_tuning) return;
91 
92  this->locked([&] {
93  ui_->btnAll->setChecked(_channel == Channel::ALL);
94  ui_->btnRed->setChecked(_channel == Channel::RED);
95  ui_->btnGreen->setChecked(_channel == Channel::GREEN);
96  ui_->btnBlue->setChecked(_channel == Channel::BLUE);
97 
98  auto *_colorCorrection = &_tuning->colorCorrection();
99  ui_->graph->setChannel(_channel);
100  ui_->graph->setDataModel(_colorCorrection);
101  ui_->params->setChannel(_channel);
102  ui_->params->setDataModel(_colorCorrection->correction(_channel));
103  });
104  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
void locked(F f)
Lock widget and execute given functor.
Definition: Locked.h:30
std::unique_ptr< Ui::ColorCorrection > ui_
Definition: ColorCorrection.h:75
void omni::ui::ColorCorrection::setGreenChannel ( )
slot

Select color correction for green channel.

57  {
58  setChannel(Channel::GREEN);
59  }
void setChannel(Channel _channel)
Select color correction for custom channel.
Definition: ColorCorrection.cpp:85
void omni::ui::ColorCorrection::setRedChannel ( )
slot

Select color correction for red channel.

53  {
54  setChannel(Channel::RED);
55  }
void setChannel(Channel _channel)
Select color correction for custom channel.
Definition: ColorCorrection.cpp:85
void omni::ui::ColorCorrection::setUsed ( bool  _isUsed)
slot

Select whether color correction is used.

65  {
66  auto _tuning = dataModel()->tunings().current();
67 
68  if (!_tuning) return;
69 
70  this->locked([&] {
71  auto& _colorCorrection = _tuning->colorCorrection();
72  _colorCorrection.setUsed(_isUsed);
73 
74  ui_->chkIsUsed->setChecked(_isUsed);
75  ui_->btnAll->setEnabled(_isUsed);
76  ui_->btnRed->setEnabled(_isUsed);
77  ui_->btnGreen->setEnabled(_isUsed);
78  ui_->btnBlue->setEnabled(_isUsed);
79  ui_->graph->setEnabled(_isUsed);
80  ui_->params->setEnabled(_isUsed);
81  emit dataModelChanged();
82  });
83  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
void locked(F f)
Lock widget and execute given functor.
Definition: Locked.h:30
std::unique_ptr< Ui::ColorCorrection > ui_
Definition: ColorCorrection.h:75

Field Documentation

std::unique_ptr<Ui::ColorCorrection> omni::ui::ColorCorrection::ui_
private

The documentation for this class was generated from the following files: