diff --git a/source/ModulesHandle.h b/source/ModulesHandle.h index 4b32fb7..9fc5023 100644 --- a/source/ModulesHandle.h +++ b/source/ModulesHandle.h @@ -42,15 +42,6 @@ namespace plaYUVer { -#define REGISTER_MODULE(X) \ - { \ - if( USE_##X ) \ - { \ - X *pMod = new X(); \ - appendModule( pMod ); \ - } \ - } - class ModulesHandle : public QObject { Q_OBJECT diff --git a/source/PlaYUVerModuleIf.h b/source/PlaYUVerModuleIf.h index 257c6b2..4ed88e6 100644 --- a/source/PlaYUVerModuleIf.h +++ b/source/PlaYUVerModuleIf.h @@ -44,6 +44,22 @@ enum __PlaYUVerModuleTypes VIDEO_LEVEL_MODULE, }; +enum __PlaYUVerModuleRequirements +{ + MODULE_REQUIRES_FRAME = 1, + MODULE_REQUIRES_TWOFRAMES = 2, + MODULE_REQUIRES_SIDEBAR = 4, +}; + +#define REGISTER_MODULE(X) \ + { \ + if( USE_##X ) \ + { \ + X *pMod = new X(); \ + appendModule( pMod ); \ + } \ + } + typedef struct __PlaYUVerModuleDefinition { int m_pchModuleType; diff --git a/source/SubWindowHandle.cpp b/source/SubWindowHandle.cpp index 923879f..09e1996 100644 --- a/source/SubWindowHandle.cpp +++ b/source/SubWindowHandle.cpp @@ -47,6 +47,9 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : m_cScrollArea->setWidget( m_cViewArea ); m_cScrollArea->setWidgetResizable(true); + m_pCurrStream = new InputStream; + + m_pCurrFrameQImage = NULL; m_pcCurrentModule = NULL; m_cWindowName = QString( " " ); @@ -58,19 +61,22 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : SubWindowHandle::~SubWindowHandle() { delete m_cViewArea; - if( !m_pcCurrentModule ) - return; - m_pcCurrentModule->m_pcAction->setChecked( false ); - m_pcCurrentModule->destroy(); - m_pcCurrentModule = NULL; + delete m_cScrollArea; + delete m_pCurrStream; + if( m_pCurrFrameQImage ) + delete m_pCurrFrameQImage; + if( m_pcCurrentModule ) + { + m_pcCurrentModule->m_pcAction->setChecked( false ); + m_pcCurrentModule->destroy(); + m_pcCurrentModule = NULL; + } } bool SubWindowHandle::loadFile( const QString &fileName ) { ConfigureFormatDialog formatDialog( this ); - m_pCurrStream = new InputStream; - if( m_pCurrStream->needFormatDialog( fileName ) ) { if( formatDialog.exec() == QDialog::Rejected ) @@ -166,7 +172,7 @@ Void SubWindowHandle::refreshFrame() } else { - FrameToQImage( m_pCurrStream->getFrame( (PlaYUVerFrame*) NULL ) ); + FrameToQImage( m_pCurrStream->getFrame() ); } m_cViewArea->setImage( QPixmap::fromImage( *m_pCurrFrameQImage ) ); } diff --git a/source/plaYUVerApp.cpp b/source/plaYUVerApp.cpp index 47f6ca5..fa6cf15 100644 --- a/source/plaYUVerApp.cpp +++ b/source/plaYUVerApp.cpp @@ -632,12 +632,12 @@ void plaYUVerApp::setActiveSubWindow( QWidget *window ) void plaYUVerApp::updatePixelValueStatusBar(const QPoint & pos, InputStream* stream) { - Pel luma, chromaU, chromaV; + Pel luma, chromaU = 0, chromaV = 0; Int iWidth, iHeight; Int posX = pos.x(), posY = pos.y(); QString strPixel; QString strStatus = QString("(%1,%2) ").arg(posX).arg(posY); - PlaYUVerFrame *curFrame = stream->getCurrentFrame(); + PlaYUVerFrame *curFrame = stream->getFrame(); iWidth = stream->getWidth(); iHeight = stream->getHeight(); @@ -645,8 +645,8 @@ void plaYUVerApp::updatePixelValueStatusBar(const QPoint & pos, InputStream* str if( (posX=0) && (posY=0) ) { luma = curFrame->getPixelValueFromYUV(pos, LUMA); - chromaU = curFrame->getPixelValueFromYUV(pos, CHROMA_U); - chromaV = curFrame->getPixelValueFromYUV(pos, CHROMA_V); + //chromaU = curFrame->getPixelValueFromYUV(pos, CHROMA_U); + //chromaV = curFrame->getPixelValueFromYUV(pos, CHROMA_V); strPixel = QString("Y: %1 U: %2 V: %3").arg(luma).arg(chromaU).arg(chromaV); } else