Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ColorCorrection.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 blueistribute 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_PROJ_COLORCORRECTION_H_
20 #define OMNI_PROJ_COLORCORRECTION_H_
21 
23 #include <omni/proj/Channel.h>
24 #include <QColor>
25 
26 namespace omni {
27  namespace proj {
28  /// Color correction for RGB color space
30  public:
31  bool isUsed() const;
32  void setUsed(bool _isUsed);
33 
34  /// Return reference to channel correction for all channels
36 
37  /// Return reference to channel correction for all channels (const)
38  ChannelCorrection const& all() const;
39 
40  /// Set channel correction for all channels
41  void setAll(ChannelCorrection const&);
42 
43  /// Return reference to channel correction for red channel
45 
46  /// Return reference to channel correction for red channel
47  ChannelCorrection const& red() const;
48 
49  /// Set channel correction for red channel
50  void setRed(ChannelCorrection const&);
51 
52  /// Return reference to channel correction for green channel
54 
55  /// Return reference to channel correction for green channel
56  ChannelCorrection const& green() const;
57 
58  /// Set channel correction for green channel
59  void setGreen(ChannelCorrection const&);
60 
61  /// Return reference to channel correction for blue channel
63 
64  /// Return reference to channel correction for blue channel
65  ChannelCorrection const& blue() const;
66 
67  /// Set channel correction for blue channel
68  void setBlue(ChannelCorrection const&);
69 
70  /// Return corrected color
71  QColor corrected(QColor) const;
72 
73  /// Return color correction for given channel
75 
76  /// Return color correction for given channel (const version)
77  ChannelCorrection const *correction(Channel) const;
78 
79  static QColor channelColor(Channel);
80 
81  // Test if two color corrections are equal
82  friend bool operator==(ColorCorrection const&,
83  ColorCorrection const&);
84 
85  private:
86  bool isUsed_ = true;
88  };
89  }
90 
92 }
93 
94 QDataStream& operator>>(QDataStream&,
96 QDataStream& operator<<(QDataStream&,
98 
99 #endif /* OMNI_PROJ_COLORCORRECTION_H_ */
ChannelCorrection all_
Definition: ColorCorrection.h:87
Brightness, contrast and gamma correction for a single color channel.
Definition: ChannelCorrection.h:27
ChannelCorrection red_
Definition: ColorCorrection.h:87
QColor corrected(QColor) const
Return corrected color.
Definition: ColorCorrection.cpp:84
void setGreen(ChannelCorrection const &)
Set channel correction for green channel.
Definition: ColorCorrection.cpp:68
Channel
Definition: Channel.h:24
ChannelCorrection * correction(Channel)
Return color correction for given channel.
Definition: ColorCorrection.cpp:95
bool isUsed() const
Definition: ColorCorrection.cpp:28
static QColor channelColor(Channel)
Definition: ColorCorrection.cpp:117
Color correction for RGB color space.
Definition: ColorCorrection.h:29
ChannelCorrection & all()
Return reference to channel correction for all channels.
Definition: ColorCorrection.cpp:36
QDataStream & operator<<(QDataStream &, omni::proj::ColorCorrection const &)
Definition: ColorCorrection.cpp:151
void setBlue(ChannelCorrection const &)
Set channel correction for blue channel.
Definition: ColorCorrection.cpp:80
void setRed(ChannelCorrection const &)
Set channel correction for red channel.
Definition: ColorCorrection.cpp:56
friend bool operator==(ColorCorrection const &, ColorCorrection const &)
Definition: ColorCorrection.cpp:128
ChannelCorrection & red()
Return reference to channel correction for red channel.
Definition: ColorCorrection.cpp:48
ChannelCorrection & green()
Return reference to channel correction for green channel.
Definition: ColorCorrection.cpp:60
void setUsed(bool _isUsed)
Definition: ColorCorrection.cpp:32
bool isUsed_
Definition: ColorCorrection.h:86
ChannelCorrection blue_
Definition: ColorCorrection.h:87
void setAll(ChannelCorrection const &)
Set channel correction for all channels.
Definition: ColorCorrection.cpp:44
QDataStream & operator>>(QDataStream &, omni::proj::ColorCorrection &)
Definition: ColorCorrection.cpp:139
ChannelCorrection & blue()
Return reference to channel correction for blue channel.
Definition: ColorCorrection.cpp:72
ChannelCorrection green_
Definition: ColorCorrection.h:87