Widget which draws the graph for color corrections for each channel.
More...
#include <ColorCorrectionGraph.h>
Widget which draws the graph for color corrections for each channel.
omni::ui::proj::ColorCorrectionGraph::ColorCorrectionGraph |
( |
QWidget * |
_parent = nullptr | ) |
|
omni::ui::proj::ColorCorrectionGraph::~ColorCorrectionGraph |
( |
| ) |
|
Channel omni::ui::proj::ColorCorrectionGraph::channel |
( |
| ) |
const |
Return selected channel.
Channel channel_
Definition: ColorCorrectionGraph.h:88
void omni::ui::proj::ColorCorrectionGraph::dataModelChanged |
( |
| ) |
|
|
signal |
void omni::ui::proj::ColorCorrectionGraph::dataToFrontend |
( |
| ) |
|
|
privatevirtual |
void omni::ui::proj::ColorCorrectionGraph::drawGraphForChannel |
( |
QPainter & |
_p, |
|
|
omni::proj::ChannelCorrection const & |
_correction, |
|
|
QColor |
_color, |
|
|
bool |
_selected |
|
) |
| const |
|
private |
Draw graph for a channel correction.
94 QRectF _rect = QRectF(rect()).adjusted(2,2,-2,-2);
96 _p.setBrush(Qt::NoBrush);
99 QPen _pen(_color,_selected ? 1.5 : 1,Qt::SolidLine);
103 for (
double _posX = _rect.left(); _posX <= _rect.right(); _posX += 2) {
104 double _x = (_posX - _rect.left()) /
double(_rect.width());
105 double _y = qBound(0.0,_correction.corrected(_x),1.0);
106 double _posY = float(_rect.height()) - _y*_rect.height() + _rect.top();
107 if (_posX == _rect.left()) {
108 _path.moveTo(_posX,_posY);
110 _path.lineTo(_posX,_posY);
void omni::ui::proj::ColorCorrectionGraph::drawGraphForChannel |
( |
QPainter & |
_p, |
|
|
Channel |
_channel |
|
) |
| const |
|
private |
Draw graph for a channel.
120 bool _selected =
channel() == _channel;
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
static QColor channelColor(Channel)
Definition: ColorCorrection.cpp:117
void drawGraphForChannel(QPainter &, omni::proj::ChannelCorrection const &, QColor _color, bool _selected) const
Draw graph for a channel correction.
Definition: ColorCorrectionGraph.cpp:89
Channel channel() const
Return selected channel.
Definition: ColorCorrectionGraph.cpp:45
void omni::ui::proj::ColorCorrectionGraph::drawGraphs |
( |
QPainter & |
_p, |
|
|
bool |
_selected |
|
) |
| const |
|
private |
Draw selected graphs.
79 auto _drawGraph = [&](
Channel _channel) {
80 if ((
channel() == _channel) == _selected)
83 _drawGraph(Channel::ALL);
84 _drawGraph(Channel::RED);
85 _drawGraph(Channel::GREEN);
86 _drawGraph(Channel::BLUE);
Channel
Definition: Channel.h:24
void drawGraphForChannel(QPainter &, omni::proj::ChannelCorrection const &, QColor _color, bool _selected) const
Draw graph for a channel correction.
Definition: ColorCorrectionGraph.cpp:89
Channel channel() const
Return selected channel.
Definition: ColorCorrectionGraph.cpp:45
void omni::ui::proj::ColorCorrectionGraph::drawGridLines |
( |
QPainter & |
_p | ) |
|
|
private |
Draw grid lines in background.
126 QRectF _rect = QRectF(rect()).adjusted(2,2,-2,-2);
127 QPen _pen(
"#080808");
130 for (
double _posX = _rect.left(); _posX <= _rect.right(); _posX += _rect.width()/8) {
131 _p.drawLine(_posX,_rect.top(),_posX,_rect.bottom());
135 for (
double _posY = _rect.top(); _posY <= _rect.bottom(); _posY += _rect.height()/8) {
136 _p.drawLine(_rect.left(),_posY,_rect.right(),_posY);
bool omni::ui::proj::ColorCorrectionGraph::frontendToData |
( |
| ) |
|
|
inlineprivatevirtual |
void omni::ui::proj::ColorCorrectionGraph::paintEvent |
( |
QPaintEvent * |
_paintEvent | ) |
|
|
protected |
Paint graph event.
54 QPainter _painter(
this);
55 _painter.setRenderHint(QPainter::HighQualityAntialiasing);
56 _painter.setRenderHint(QPainter::Antialiasing,
true);
60 _painter.setBrush(QBrush(
"#212121"));
61 _painter.setPen(Qt::NoPen);
62 _painter.drawRect(_rect);
65 if (!isEnabled())
return;
void drawGraphs(QPainter &_p, bool _selected) const
Draw selected graphs.
Definition: ColorCorrectionGraph.cpp:78
void drawGridLines(QPainter &)
Draw grid lines in background.
Definition: ColorCorrectionGraph.cpp:125
void omni::ui::proj::ColorCorrectionGraph::resizeEvent |
( |
QResizeEvent * |
_resizeEvent | ) |
|
|
protected |
void omni::ui::proj::ColorCorrectionGraph::setChannel |
( |
Channel |
_channel | ) |
|
Set selected channel.
Channel channel_
Definition: ColorCorrectionGraph.h:88
Channel omni::ui::proj::ColorCorrectionGraph::channel_ = Channel::ALL |
|
private |
The documentation for this class was generated from the following files: