Update slot to use the frame instead of the stream

updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *)
This commit is contained in:
2014-04-17 20:31:59 +01:00
parent 9e666117b2
commit 9cc3c792e8
4 changed files with 18 additions and 16 deletions
+6 -5
View File
@@ -53,6 +53,7 @@ ViewArea::ViewArea( QWidget *parent ) :
// setAttribute( Qt::WA_NoBackground );
setMouseTracking( true );
m_pcCurrFrame = NULL;
m_pixmap = QPixmap();
m_grid = GridManager();
m_mask = QBitmap();
@@ -70,8 +71,9 @@ ViewArea::ViewArea( QWidget *parent ) :
void ViewArea::setImage( PlaYUVerFrame* pcFrame )
{
pcFrame->FrametoRGB8();
QImage qimg = QImage( pcFrame->getQImageBuffer(), pcFrame->getWidth(), pcFrame->getHeight(), QImage::Format_RGB888 );
m_pcCurrFrame = pcFrame;
m_pcCurrFrame->FrametoRGB8();
QImage qimg = QImage( m_pcCurrFrame->getQImageBuffer(), m_pcCurrFrame->getWidth(), m_pcCurrFrame->getHeight(), QImage::Format_RGB888 );
setImage( QPixmap::fromImage( qimg ) );
}
@@ -363,7 +365,6 @@ void ViewArea::paintEvent( QPaintEvent *event )
{
Int imageWidth = m_pixmap.width();
Int imageHeight = m_pixmap.height();
PlaYUVerFrame *curFrame = getInputStream()->getCurrFrame();
Pixel sPixelValue;
QFont font("Helvetica");
@@ -378,7 +379,7 @@ void ViewArea::paintEvent( QPaintEvent *event )
for(Int j=vr.y() ; j<=vr.bottom() ; j++)
{
QPoint pixelTopLeft(i,j);
sPixelValue = curFrame->getPixelValue( pixelTopLeft, PlaYUVerFrame::COLOR_YUV );
sPixelValue = m_pcCurrFrame->getPixelValue( pixelTopLeft, PlaYUVerFrame::COLOR_YUV );
QRect pixelRect(viewToWindow(pixelTopLeft), QSize(m_zoomFactor,m_zoomFactor));
if( sPixelValue.Luma < 128 )
@@ -611,7 +612,7 @@ void ViewArea::mouseMoveEvent( QMouseEvent *event )
QPoint actualPos = windowToView( event->pos() );
QRect updateRect;
emit positionChanged( actualPos , getInputStream() );
emit positionChanged( actualPos , m_pcCurrFrame );
// If mouse left button pressed
if( event->buttons() == Qt::LeftButton && m_lastPos != QPoint( -1, -1 ) )