const float P75 = .75;
const unsigned char DEFAULT_Y = 255;
-//const unsigned int REALTIME_FPS = 15; // in fps.
const QPointF YUV_R(-.147, .615);
const QPointF YUV_G(-.289, -.515);
delete m_a75PBox;
}
-QString Vectorscope::widgetName() const {
- return QString("Vectorscope");
-}
+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);