diff --git a/Source/Core/VideoCore.cpp b/Source/Core/VideoCore.cpp index 70087c868..ab2e7643b 100644 --- a/Source/Core/VideoCore.cpp +++ b/Source/Core/VideoCore.cpp @@ -274,7 +274,7 @@ const struct per_item VideoPerItem [Item_VideoMax]= { Group_Y, Group_VideoMax, "Y MIN", "lavfi.signalstats.YMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "gray", 1, }, // "Y LOW;green;0.5" }, { Group_Y, Group_VideoMax, "Y LOW", "lavfi.signalstats.YLOW", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "green", 2, }, // "Y LOW;transparent;0.5" }, { Group_Y, Group_VideoMax, "Y AVG", "lavfi.signalstats.YAVG", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, "yellow", 3, }, // "Y LOW;red;0.5" }, - { Group_Y, Group_VideoMax, "Y HIGH", "lavfi.signalstats.YHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1, "Y AVG;yellow;0.8" }, + { Group_Y, Group_VideoMax, "Y HIGH", "lavfi.signalstats.YHIGH", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1, "10.0;yellow;0.8" }, { Group_Y, Group_VideoMax, "Y MAX", "lavfi.signalstats.YMAX", 0, true, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1, "Y HIGH;green;0.5" }, //U { Group_U, Group_VideoMax, "U MIN", "lavfi.signalstats.UMIN", 0, false, DBL_MAX, DBL_MAX, ActiveFilter_Video_signalstats, nullptr, -1 }, diff --git a/Source/GUI/Plot.cpp b/Source/GUI/Plot.cpp index 6dfa56117..62bc185a2 100644 --- a/Source/GUI/Plot.cpp +++ b/Source/GUI/Plot.cpp @@ -251,8 +251,12 @@ class PlotCurve : public QwtPlotCurve { m_count = count; } - void setClipCurve(QwtPlotCurve* curve) { - m_clipCurve = curve; + void setFillCurve(QwtPlotCurve* curve) { + m_fillCurve = curve; + } + + void setFillBaseLine(float value) { + m_fillBaseline = value; } void setFillBrush(QBrush brush) { @@ -263,7 +267,7 @@ class PlotCurve : public QwtPlotCurve { virtual void drawCurve( QPainter* painter , int style, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& canvasRect, int from, int to ) const { QwtPlotCurve::drawCurve(painter, style, xMap, yMap, canvasRect, from, to); - if(m_clipCurve && !symbol()) + if((m_fillBaseline || m_fillCurve) && !symbol()) { auto brush = m_fillBrush; @@ -288,7 +292,13 @@ class PlotCurve : public QwtPlotCurve { mapper.setBoundingRect( canvasRect ); QPolygonF polygon = mapper.toPolygonF( xMap, yMap, data(), from, to); - QPolygonF baselinePolygon = mapper.toPolygonF( xMap, yMap, m_clipCurve->data(), from, to); + QPolygonF baselinePolygon; + if(m_fillCurve) + baselinePolygon = mapper.toPolygonF( xMap, yMap, m_fillCurve->data(), from, to); + else if(m_fillBaseline) { + baselinePolygon += QPointF(xMap.transform(qreal(from)), yMap.transform(m_fillBaseline.value())); + baselinePolygon += QPointF(xMap.transform(qreal(to)), yMap.transform(m_fillBaseline.value())); + } for(auto it = baselinePolygon.rbegin(); it != baselinePolygon.rend(); ++it) { polygon += *it; @@ -362,7 +372,8 @@ class PlotCurve : public QwtPlotCurve { int m_index; int m_count; QBrush m_fillBrush; - QwtPlotCurve* m_clipCurve { nullptr }; + QwtPlotCurve* m_fillCurve { nullptr }; + std::optional m_fillBaseline; }; //*************************************************************************** @@ -630,9 +641,13 @@ Plot::Plot( size_t streamPos, size_t Type, size_t Group, const FileInformation* auto curve = curvesByName[item.Name]; curve->setFillBrush(QBrush(color)); - auto fillCurve = curvesByName[curveName]; - - curve->setClipCurve(fillCurve); + if(curvesByName.contains(curveName)) { + auto fillCurve = curvesByName[curveName]; + curve->setFillCurve(fillCurve); + } else { + auto fillValue = curveName.toFloat(); + curve->setFillBaseLine(fillValue); + } } }