Commit e6d13a7c authored by Simon Eugster's avatar Simon Eugster
Browse files

Scopes: Space optimizations

svn path=/trunk/kdenlive/; revision=4635
parent f8c8ff4e
......@@ -216,7 +216,7 @@ void AbstractScopeWidget::paintEvent(QPaintEvent *)
initialDimensionUpdateDone = true;
}
qDebug() << "Drawing top/left at " << m_scopeRect.topLeft().x() << "/" << m_scopeRect.topLeft().y();
qDebug() << "Drawing top/left at " << m_scopeRect.topLeft().y() << "/" << m_scopeRect.topLeft().x();
QPainter davinci(this);
davinci.drawImage(m_scopeRect.topLeft(), m_imgBackground);
......
......@@ -30,16 +30,11 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
{
Q_ASSERT(accelFactor >= 1);
QImage parade(paradeSize, QImage::Format_ARGB32);
if (paradeSize.width() <= 0 || paradeSize.height() <= 0) {
qCritical("Wave size should not be 0.");
return QImage();
} else {
qDebug() << "Wave calculation started.";
// Fill with transparent color
QImage parade(paradeSize, QImage::Format_ARGB32);
parade.fill(qRgba(0,0,0,0));
QRgb *col;
......@@ -168,10 +163,8 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
return parade;
}
return parade;
}
#undef CHOP255
......@@ -37,7 +37,7 @@ QImage WaveformGenerator::calculateWaveform(const QSize &waveformSize, const QIm
QImage wave(waveformSize, QImage::Format_ARGB32);
if (waveformSize.width() <= 0 || waveformSize.height() <= 0) {
qCritical("Waveform size should not be 0.");
return QImage();
} else {
......
......@@ -32,8 +32,8 @@ QString RGBParade::widgetName() const { return "RGB Parade"; }
QRect RGBParade::scopeRect()
{
QPoint topleft(offset, ui->line->y() + 2*offset);
return QRect(topleft, QPoint(this->size().width() - offset, this->size().height() - offset) - topleft);
QPoint topleft(offset, ui->verticalSpacer->geometry().y() + 2*offset);
return QRect(topleft, QPoint(this->size().width() - offset, this->size().height() - offset));
}
QImage RGBParade::renderHUD(uint) { return QImage(); }
......
......@@ -117,22 +117,20 @@ QString Vectorscope::widgetName() const { return QString("Vectorscope"); }
QRect Vectorscope::scopeRect()
{
// Widget width/height
int ww = this->size().width();
int wh = this->size().height();
// Distance from top/left/right
int offset = 6;
// We want to paint below the controls area. The line is the lowest element.
QPoint topleft(offset, ui->line->y()+offset);
QPoint topleft(offset, ui->verticalSpacer->geometry().y()+offset);
QPoint bottomright(ui->horizontalSpacer->geometry().right()-offset, this->size().height()-offset);
QRect scopeRect(topleft, bottomright);
// Circle Width: min of width and height
cw = wh - topleft.y();
if (ww < cw) { cw = ww; }
cw -= 2*offset;
cw = (scopeRect.height() < scopeRect.width()) ? scopeRect.height() : scopeRect.width();
scopeRect.setWidth(cw);
scopeRect.setHeight(cw);
QRect scopeRect(topleft, QPoint(cw, cw) + topleft);
m_centerPoint = m_vectorscopeGenerator->mapToCircle(scopeRect.size(), QPointF(0,0));
pR75 = m_vectorscopeGenerator->mapToCircle(scopeRect.size(), P75*VectorscopeGenerator::scaling*YUV_R);
......
......@@ -39,7 +39,7 @@ QRect Waveform::scopeRect()
// Distance from top/left/right
int offset = 6;
QPoint topleft(offset, ui->line->y()+offset);
QPoint topleft(offset, ui->verticalSpacer->geometry().y()+offset);
return QRect(topleft, this->size() - QSize(offset+topleft.x(), offset+topleft.y()));
}
......
......@@ -34,7 +34,7 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -47,13 +47,6 @@
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
......@@ -33,7 +33,7 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<item row="0" column="1" colspan="5">
<widget class="QComboBox" name="paintMode">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
......@@ -50,7 +50,7 @@
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<item row="1" column="1" colspan="3">
<widget class="QComboBox" name="backgroundMode">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
......@@ -60,28 +60,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Gain</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSlider" name="sliderGain">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -94,28 +73,42 @@
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QLabel" name="lblGain">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="3" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="minimumSize">
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>0</height>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="4" colspan="2">
<widget class="QLabel" name="lblGain">
<property name="text">
<string notr="true">(notr)</string>
<string>(notr)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QSlider" name="sliderGain">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
......@@ -34,7 +34,7 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -47,13 +47,6 @@
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment