diff --git a/app/AboutDialog.cpp b/app/AboutDialog.cpp index 4774895..e07a6d3 100644 --- a/app/AboutDialog.cpp +++ b/app/AboutDialog.cpp @@ -17,14 +17,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - /** * \file AboutDialog.cpp * \brief About Dialog * Based on the work of Glad Deschrijver in KTikZ project */ - #include "AboutDialog.h" #include #include @@ -32,27 +30,25 @@ #include #include - -AboutDialog::AboutDialog(QWidget *parent) - : QDialog(parent) +AboutDialog::AboutDialog( QWidget *parent ) : + QDialog( parent ) { - QPixmap logo = QPixmap(":/images/playuver-backgroud-logo.png").scaled( QSize( 350,350), Qt::KeepAspectRatio ); - QLabel *pixmapLabel = new QLabel; - pixmapLabel->setPixmap( logo ); + QPixmap logo = QPixmap( ":/images/playuver-backgroud-logo.png" ).scaled( QSize( 350, 350 ), Qt::KeepAspectRatio ); + QLabel *pixmapLabel = new QLabel; + pixmapLabel->setPixmap( logo ); + QLabel *label = new QLabel( QString( "

%1 Version %2

%3

%4

" ) + .arg( QApplication::applicationName() ) + .arg( QApplication::applicationVersion() ) + .arg( tr( "Enhanced open-source Qt-based raw video player" ) ) + .arg( tr( "Copyright © 2014–2015 Luis Lucas and Joao Carreira" ) ) ); + label->setWordWrap( true ); - QLabel *label = new QLabel(QString("

%1 Version %2

%3

%4

") - .arg(QApplication::applicationName()) - .arg(QApplication::applicationVersion()) - .arg(tr("Enhanced open-source Qt-based raw video player")) - .arg(tr("Copyright © 2014–2015 Luis Lucas and Joao Carreira"))); - label->setWordWrap(true); - - QWidget *topWidget = new QWidget; - QVBoxLayout *topLayout = new QVBoxLayout; - topLayout->addWidget(pixmapLabel); - topLayout->addWidget(label); - topWidget->setLayout(topLayout); + QWidget *topWidget = new QWidget; + QVBoxLayout *topLayout = new QVBoxLayout; + topLayout->addWidget( pixmapLabel ); + topLayout->addWidget( label ); + topWidget->setLayout( topLayout ); // QTextEdit *textEdit = new QTextEdit(tr("

This program is free " // "software; you can redistribute it and/or modify it under the " @@ -64,17 +60,16 @@ AboutDialog::AboutDialog(QWidget *parent) // "warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. " // "See the GNU General Public License for more details.

")); // textEdit->setReadOnly(true); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); + QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok ); + connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); - QVBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(topWidget); - //mainLayout->addWidget(textEdit); - mainLayout->addWidget(buttonBox); - mainLayout->setSpacing(10); - buttonBox->setFocus(); + QVBoxLayout *mainLayout = new QVBoxLayout( this ); + mainLayout->addWidget( topWidget ); + //mainLayout->addWidget(textEdit); + mainLayout->addWidget( buttonBox ); + mainLayout->setSpacing( 10 ); + buttonBox->setFocus(); - setWindowTitle(tr("About %1").arg(QApplication::applicationName())); + setWindowTitle( tr( "About %1" ).arg( QApplication::applicationName() ) ); } - diff --git a/app/AboutDialog.h b/app/AboutDialog.h index d1a6cf9..f2e1617 100644 --- a/app/AboutDialog.h +++ b/app/AboutDialog.h @@ -28,13 +28,12 @@ #include - -class AboutDialog : public QDialog +class AboutDialog: public QDialog { - Q_OBJECT +Q_OBJECT public: - AboutDialog(QWidget *parent = 0); + AboutDialog( QWidget *parent = 0 ); }; #endif // __ABOUTDIALOG_H__ diff --git a/app/ConfigureFormatDialog.cpp b/app/ConfigureFormatDialog.cpp index 40f8f74..45a2984 100644 --- a/app/ConfigureFormatDialog.cpp +++ b/app/ConfigureFormatDialog.cpp @@ -181,7 +181,6 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 1 ); pixelGridLayout->addWidget( m_comboBoxPixelFormat, 1, 2 ); - QLabel* bitsPerPelLabel = new QLabel(); bitsPerPelLabel->setFont( normalFont ); bitsPerPelLabel->setText( "Pixel bit depth" ); @@ -205,13 +204,13 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : m_comboBoxEndianness->setFont( normalFont ); m_comboBoxEndianness->setSizePolicy( sizePolicy ); m_comboBoxEndianness->clear(); - m_comboBoxEndianness->addItem( QStringLiteral("Big Endian") ); - m_comboBoxEndianness->addItem( QStringLiteral("Little Endian") ); + m_comboBoxEndianness->addItem( QStringLiteral( "Big Endian" ) ); + m_comboBoxEndianness->addItem( QStringLiteral( "Little Endian" ) ); endiannessLayout->addWidget( endiannessLabel ); endiannessLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); endiannessLayout->addWidget( m_comboBoxEndianness ); m_widgetEndianness = new QWidget(); - m_widgetEndianness->setContentsMargins( 0,0,0,0 ); + m_widgetEndianness->setContentsMargins( 0, 0, 0, 0 ); m_widgetEndianness->setLayout( endiannessLayout ); m_widgetEndianness->setVisible( true ); @@ -231,7 +230,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : framerateFormatLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); framerateFormatLayout->addWidget( m_spinBoxFrameRate ); QWidget* framerateWidget = new QWidget(); - framerateWidget->setContentsMargins( 0,0,0,0 ); + framerateWidget->setContentsMargins( 0, 0, 0, 0 ); framerateWidget->setLayout( framerateFormatLayout ); /* @@ -267,7 +266,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : } -Int ConfigureFormatDialog::runConfigureFormatDialog( QString Filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBits, Int& rEndianess, UInt& rFrameRate ) +Int ConfigureFormatDialog::runConfigureFormatDialog( QString Filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBits, Int& rEndianess, + UInt& rFrameRate ) { // Set default values //setWindowTitle( "Configure resolution for " + Filename ); @@ -392,4 +392,3 @@ Void ConfigureFormatDialog::slotBitsChange( Int idx ) } } - diff --git a/app/DialogSubWindowSelector.cpp b/app/DialogSubWindowSelector.cpp index ab53ea5..2d7d0dc 100644 --- a/app/DialogSubWindowSelector.cpp +++ b/app/DialogSubWindowSelector.cpp @@ -28,7 +28,6 @@ #include "DialogSubWindowSelector.h" #include "VideoSubWindow.h" - DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, PlaYUVerSubWindowHandle *windowManager, UInt uiCategory, Int minWindowsSelected, Int maxWindowsSelected ) : QDialog( parent ), diff --git a/app/DialogSubWindowSelector.h b/app/DialogSubWindowSelector.h index c281b91..9857cba 100644 --- a/app/DialogSubWindowSelector.h +++ b/app/DialogSubWindowSelector.h @@ -41,7 +41,6 @@ class QColor; class QCheckBox; class QGroupBox; - class PlaYUVerSubWindowHandle; class SubWindowAbstract; diff --git a/app/FramePropertiesDock.cpp b/app/FramePropertiesDock.cpp index 8e56ad7..cb67391 100644 --- a/app/FramePropertiesDock.cpp +++ b/app/FramePropertiesDock.cpp @@ -27,7 +27,6 @@ #include #include "FramePropertiesDock.h" - FramePropertiesDock::FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch ) : QWidget( parent ), m_pbIsPlaying( pbMainPlaySwitch ) @@ -615,5 +614,3 @@ Void FramePropertiesDock::slotUpdateIntervRange( Int range ) maxInterv->blockSignals( false ); } - - diff --git a/app/FramePropertiesDock.h b/app/FramePropertiesDock.h index 45caaca..90071ef 100644 --- a/app/FramePropertiesDock.h +++ b/app/FramePropertiesDock.h @@ -37,11 +37,10 @@ #include "lib/PlaYUVerFrame.h" #include "HistogramWidget.h" - class FramePropertiesDock: public QWidget { Q_OBJECT -public: + public: FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch ); ~FramePropertiesDock(); @@ -76,7 +75,6 @@ private: Bool* m_pbIsPlaying; - QComboBox *channelCB; QComboBox *colorsCB; QComboBox *renderingCB; diff --git a/app/GridManager.cpp b/app/GridManager.cpp index 01a5dba..ba4b1a3 100644 --- a/app/GridManager.cpp +++ b/app/GridManager.cpp @@ -34,7 +34,6 @@ #include "GridManager.h" - //////////////////////////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////////////////////////// @@ -67,8 +66,8 @@ void GridManager::drawGrid( QPixmap &image, const QRect& area, QPainter *painter switch( style ) { case IntersectionDot: - case IntersectionCross: - { + case IntersectionCross: + { painter->setPen( mainPen ); // Draw crosses or dots on intersections for( int x = offsetx; x <= area.right(); x += hSpacing ) @@ -96,7 +95,7 @@ void GridManager::drawGrid( QPixmap &image, const QRect& area, QPainter *painter break; } case Dashed: - { + { // Change pen to the dashed line mainPen.setStyle( Qt::DashLine ); } @@ -136,12 +135,12 @@ void GridManager::drawGrid( QPixmap &image, const QRect& area, QPainter *painter //////////////////////////////////////////////////////////////////////////////// QRect GridManager::rectContains( const QPoint &pos ) const -{ + { return rectContains( pos.x(), pos.y() ); } QRect GridManager::rectContains( int x, int y ) const -{ + { QRect rect; QPoint pos; int multiPosX; diff --git a/app/GridManager.h b/app/GridManager.h index ea9d0bb..3291151 100644 --- a/app/GridManager.h +++ b/app/GridManager.h @@ -36,7 +36,6 @@ class QPoint; class QBitmap; class QPainter; - /** * */ @@ -46,7 +45,10 @@ public: enum Style { - IntersectionDot = 0, IntersectionCross, Dashed, Solid + IntersectionDot = 0, + IntersectionCross, + Dashed, + Solid }; GridManager(); diff --git a/app/HistogramWidget.cpp b/app/HistogramWidget.cpp index e3d57ba..a2a89dc 100644 --- a/app/HistogramWidget.cpp +++ b/app/HistogramWidget.cpp @@ -31,7 +31,6 @@ #include #include "HistogramWidget.h" - class HistogramWorker: public QThread { private: @@ -97,17 +96,18 @@ public: }; const QBrush g_eColorPallet[][3] = -{ - { - Qt::darkGray, // Luma - Qt::blue, // Cb - Qt::red, // Cr - }, - { - Qt::red, // Channel Red - Qt::green, // Channel Green - Qt::blue, // Channel Blue - }, }; + { + { + Qt::darkGray, // Luma + Qt::blue, // Cb + Qt::red, // Cr + }, + { + Qt::red, // Channel Red + Qt::green, // Channel Green + Qt::blue, // Channel Blue + }, + }; class HistogramWidgetPrivate { @@ -1099,5 +1099,3 @@ Void HistogramWidget::slotMaxValueChanged( int max ) } } - - diff --git a/app/HistogramWidget.h b/app/HistogramWidget.h index f58b3df..a10a0d1 100644 --- a/app/HistogramWidget.h +++ b/app/HistogramWidget.h @@ -34,7 +34,6 @@ class QEvent; - class HistogramWorker; class HistogramWidgetPrivate; @@ -170,7 +169,6 @@ private: HistogramWidgetPrivate* d; }; - Q_DECLARE_OPERATORS_FOR_FLAGS( HistogramWidget::HistogramOptions ) #endif // __HISTOGRAMWIDGET_H__ diff --git a/app/ModuleHandleDock.cpp b/app/ModuleHandleDock.cpp index df6d31f..e39fab2 100644 --- a/app/ModuleHandleDock.cpp +++ b/app/ModuleHandleDock.cpp @@ -27,7 +27,6 @@ #include "PlaYUVerAppModuleIf.h" #include "ModulesHandle.h" - ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf ) : QWidget( parent ), m_pcCurrModuleIf( moduleIf ) @@ -88,5 +87,3 @@ QSize ModuleHandleDock::sizeHint() const return currSize; } - - diff --git a/app/ModuleHandleDock.h b/app/ModuleHandleDock.h index a8bfa3a..0103451 100644 --- a/app/ModuleHandleDock.h +++ b/app/ModuleHandleDock.h @@ -34,14 +34,12 @@ #include #endif - - class PlaYUVerAppModuleIf; class ModuleHandleDock: public QWidget { -Q_OBJECT -public: + Q_OBJECT + public: ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf ); ~ModuleHandleDock(); diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 2feee91..f2b8a99 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -32,7 +32,6 @@ #include "ModulesHandleOptDialog.h" #include "modules/PlaYUVerModuleFactory.h" - ModulesHandle::ModulesHandle( QWidget* parent, PlaYUVerSubWindowHandle *windowManager, VideoHandle *moduleVideo ) : QWidget( parent ), m_pcParent( parent ), @@ -593,5 +592,3 @@ Void ModulesHandle::customEvent( QEvent *event ) } } - - diff --git a/app/ModulesHandle.h b/app/ModulesHandle.h index f72892c..9b98540 100644 --- a/app/ModulesHandle.h +++ b/app/ModulesHandle.h @@ -39,7 +39,6 @@ #include "PlaYUVerAppDefs.h" #include "lib/PlaYUVerFrame.h" - class VideoHandle; class PlaYUVerSubWindowHandle; class PlaYUVerAppModuleIf; @@ -48,7 +47,7 @@ class SubWindowHandle; class ModulesHandle: public QWidget { Q_OBJECT -public: + public: ModulesHandle( QWidget*, PlaYUVerSubWindowHandle*, VideoHandle* ); ~ModulesHandle(); @@ -62,7 +61,7 @@ public: Void writeSettings(); static Void destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ); - static Void applyModuleIf( QList pcCurrModuleIfList, Bool isPlaying = false, Bool disableThreads = false ); + static Void applyModuleIf( QList pcCurrModuleIfList, Bool isPlaying = false, Bool disableThreads = false ); private: QWidget* m_pcParent; diff --git a/app/ModulesHandleOptDialog.cpp b/app/ModulesHandleOptDialog.cpp index 6e1a61b..94a9530 100644 --- a/app/ModulesHandleOptDialog.cpp +++ b/app/ModulesHandleOptDialog.cpp @@ -32,7 +32,6 @@ #include "lib/PlaYUVerOptions.h" - class OpionConfiguration: public QWidget { public: @@ -147,4 +146,3 @@ Int ModulesHandleOptDialog::runConfiguration() return QDialog::Accepted; } - diff --git a/app/ModulesHandleOptDialog.h b/app/ModulesHandleOptDialog.h index cfdfda1..e20ca7f 100644 --- a/app/ModulesHandleOptDialog.h +++ b/app/ModulesHandleOptDialog.h @@ -31,7 +31,6 @@ #include #include - class OpionConfiguration; /** @@ -44,7 +43,7 @@ Q_OBJECT public: ModulesHandleOptDialog( QWidget *parent, PlaYUVerAppModuleIf *pcCurrModuleIf ); Int runConfiguration(); -private: + private: PlaYUVerAppModuleIf *m_pcCurrModuleIf; QVector m_apcOptionList; }; diff --git a/app/PlaYUVerApp.cpp b/app/PlaYUVerApp.cpp index 798fa98..178f451 100644 --- a/app/PlaYUVerApp.cpp +++ b/app/PlaYUVerApp.cpp @@ -46,7 +46,6 @@ #define SYNCHRONISED_ZOON 1 - PlaYUVerApp::PlaYUVerApp() : m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), @@ -110,13 +109,13 @@ Bool PlaYUVerApp::parseArgs( Int argc, Char *argv[] ) bRet |= true; } - if( pcCmdParser.hasOpt("help") ) + if( pcCmdParser.hasOpt( "help" ) ) { printf( "Usage: %s [options] input_file[s]\n", argv[0] ); pcCmdParser.doHelp( std::cout ); bRet |= true; } - if( pcCmdParser.hasOpt("input") ) + if( pcCmdParser.hasOpt( "input" ) ) { for( UInt i = 1; i < m_apcInputs.size(); i++ ) { @@ -175,7 +174,7 @@ Void PlaYUVerApp::closeEvent( QCloseEvent *event ) } break; case QMessageBox::No: - default: + default: event->ignore(); } } @@ -380,10 +379,11 @@ Void PlaYUVerApp::reload() Void PlaYUVerApp::reloadAll() { UInt windowCategoryOrder[] = - { - SubWindowAbstract::VIDEO_STREAM_SUBWINDOW, - SubWindowAbstract::MODULE_SUBWINDOW, - SubWindowAbstract::MODULE_SUBWINDOW }; + { + SubWindowAbstract::VIDEO_STREAM_SUBWINDOW, + SubWindowAbstract::MODULE_SUBWINDOW, + SubWindowAbstract::MODULE_SUBWINDOW, + }; for( UInt c = 0; c < 3; c++ ) { @@ -919,4 +919,3 @@ Void PlaYUVerApp::writeSettings() m_pcWindowHandle->writeSettings(); } - diff --git a/app/PlaYUVerApp.h b/app/PlaYUVerApp.h index 02826b7..6030c42 100644 --- a/app/PlaYUVerApp.h +++ b/app/PlaYUVerApp.h @@ -54,7 +54,6 @@ class QActionGroup; class QAction; class QSignalMapper; - class PlaYUVerOptions; class PlaYUVerStream; class PlaYUVerSubWindowHandle; diff --git a/app/PlaYUVerAppAdaptor.cpp b/app/PlaYUVerAppAdaptor.cpp index 32801d8..dd5b795 100644 --- a/app/PlaYUVerAppAdaptor.cpp +++ b/app/PlaYUVerAppAdaptor.cpp @@ -26,7 +26,6 @@ #include "PlaYUVerAppAdaptor.h" #include "PlaYUVerApp.h" - PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp *app ) : QDBusAbstractAdaptor( app ), m_app( app ) @@ -62,4 +61,3 @@ bool PlaYUVerAppAdaptor::loadFile( const QString& filename ) return true; } - diff --git a/app/PlaYUVerAppAdaptor.h b/app/PlaYUVerAppAdaptor.h index ab1f6c9..a4e9779 100644 --- a/app/PlaYUVerAppAdaptor.h +++ b/app/PlaYUVerAppAdaptor.h @@ -32,7 +32,6 @@ #include #include - #define PLAYUVER_DBUS_SESSION_NAME "org.pixlra.PlaYUVer.application" #define PLAYUVER_DBUS_PATH "/MainApplication" @@ -41,7 +40,7 @@ class PlaYUVerApp; class PlaYUVerAppAdaptor: public QDBusAbstractAdaptor { Q_OBJECT -Q_CLASSINFO("D-Bus Interface", "org.pixlra.PlaYUVer.application") + Q_CLASSINFO("D-Bus Interface", "org.pixlra.PlaYUVer.application") Q_PROPERTY(QString activeSession READ activeSession) public: PlaYUVerAppAdaptor( PlaYUVerApp *app ); @@ -75,7 +74,7 @@ Q_SIGNALS: //void documentClosed(const QString &token); public: QString activeSession(); -private: + private: PlaYUVerApp *m_app; }; diff --git a/app/PlaYUVerAppDefs.h b/app/PlaYUVerAppDefs.h index 7d7f4b8..48a86af 100644 --- a/app/PlaYUVerAppDefs.h +++ b/app/PlaYUVerAppDefs.h @@ -27,7 +27,6 @@ #include "lib/PlaYUVerDefs.h" - // ==================================================================================================================== // Qt compatibility redefinition // ==================================================================================================================== @@ -39,7 +38,4 @@ # define QStringLiteral(str) QString::fromUtf8("" str "", sizeof(str) - 1) #endif - - - #endif // __PLAYUVERAPPDEFS_H__ diff --git a/app/PlaYUVerAppModuleIf.cpp b/app/PlaYUVerAppModuleIf.cpp index 65f0119..82ddf83 100644 --- a/app/PlaYUVerAppModuleIf.cpp +++ b/app/PlaYUVerAppModuleIf.cpp @@ -26,7 +26,6 @@ #include "VideoSubWindow.h" #include "VideoSubWindow.h" - PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaYUVerModuleIf* module ) : m_bIsRunning( false ), m_pcModuleAction( action ), @@ -141,7 +140,7 @@ Void PlaYUVerAppModuleIf::run() #ifdef PLAYUVER_THREADED_MODULES EventData *eventData = new EventData( true, this ); if( parent() ) - QCoreApplication::postEvent( parent(), eventData ); + QCoreApplication::postEvent( parent(), eventData ); #endif return; } @@ -217,5 +216,3 @@ Void PlaYUVerAppModuleIf::destroy() } - - diff --git a/app/PlaYUVerAppModuleIf.h b/app/PlaYUVerAppModuleIf.h index 58c6cbe..e80c80c 100644 --- a/app/PlaYUVerAppModuleIf.h +++ b/app/PlaYUVerAppModuleIf.h @@ -37,16 +37,15 @@ class QAction; - //#define PLAYUVER_THREADED_MODULES class VideoSubWindow; class PlaYUVerAppModuleIf -#ifdef PLAYUVER_THREADED_MODULES + #ifdef PLAYUVER_THREADED_MODULES : public QThread #else -: public QObject + : public QObject #endif { friend class ModulesHandle; @@ -113,7 +112,7 @@ public: Bool apply( Bool isPlaying = false, Bool disableThreads = false ); Void show(); Void destroy(); -protected: + protected: virtual void run(); }; diff --git a/app/PlaYUVerMdiSubWindow.cpp b/app/PlaYUVerMdiSubWindow.cpp index 04aef7b..d30c06f 100644 --- a/app/PlaYUVerMdiSubWindow.cpp +++ b/app/PlaYUVerMdiSubWindow.cpp @@ -26,7 +26,6 @@ #include "PlaYUVerMdiSubWindow.h" #include "SubWindowAbstract.h" - PlaYUVerMdiSubWindow::PlaYUVerMdiSubWindow( QWidget *parent ) : QMdiSubWindow( parent ) { @@ -49,4 +48,3 @@ Void PlaYUVerMdiSubWindow::closeEvent( QCloseEvent *event ) event->accept(); } - diff --git a/app/PlaYUVerMdiSubWindow.h b/app/PlaYUVerMdiSubWindow.h index e43b759..440225a 100644 --- a/app/PlaYUVerMdiSubWindow.h +++ b/app/PlaYUVerMdiSubWindow.h @@ -29,8 +29,6 @@ #include "PlaYUVerAppDefs.h" #include - - class PlaYUVerMdiSubWindow: public QMdiSubWindow { Q_OBJECT diff --git a/app/PlaYUVerSubWindowHandle.cpp b/app/PlaYUVerSubWindowHandle.cpp index 4eb4768..1a0332f 100644 --- a/app/PlaYUVerSubWindowHandle.cpp +++ b/app/PlaYUVerSubWindowHandle.cpp @@ -39,7 +39,6 @@ #include "PlaYUVerMdiSubWindow.h" #include "SubWindowAbstract.h" - class PlaYUVerMdiArea: public QMdiArea { public: @@ -304,7 +303,7 @@ SubWindowAbstract* PlaYUVerSubWindowHandle::activeSubWindow() const } QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const -{ + { QList apcSubWindowList; if( uiCategory == 0 ) { @@ -322,7 +321,7 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiC } QList PlaYUVerSubWindowHandle::findSubWindow( const QString &windowName, const UInt uiCategory ) const -{ + { QList subWindowList = findSubWindow( uiCategory ); QList apcSubWindowList; if( !windowName.isEmpty() ) @@ -337,7 +336,7 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const QString } SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow( const SubWindowAbstract* subWindow ) const -{ + { QList subWindowList = findSubWindow(); for( Int i = 0; i < subWindowList.size(); i++ ) { @@ -588,4 +587,3 @@ Void PlaYUVerSubWindowHandle::writeSettings() appSettings.setValue( "SubWindowManager/SubWindowMode", m_iWindowMode ); } - diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index 2fe23e9..ddd7411 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -25,7 +25,6 @@ #include "PlotSubWindow.h" #include "qcustomplot.h" - Void PlotSubWindow::definePlotColors() { m_arrayColorList.append( Qt::blue ); @@ -175,7 +174,7 @@ QSize PlotSubWindow::sizeHint() const } QSize PlotSubWindow::sizeHint( const QSize & maxSize ) const -{ + { return maxSize * 2 / 3; } @@ -239,4 +238,3 @@ Void PlotSubWindow::addPlot( const QVector &arrayX, const QVector #include - ProgressBar::ProgressBar( QWidget *parent, UInt maxValue ) : QWidget( parent ), m_uiTotalProgress( maxValue ), diff --git a/app/ProgressBar.h b/app/ProgressBar.h index e13184f..4cbe919 100644 --- a/app/ProgressBar.h +++ b/app/ProgressBar.h @@ -31,7 +31,6 @@ class QProgressBar; - class ProgressBar: public QWidget { Q_OBJECT diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index bb44c07..d9fd426 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -34,7 +34,6 @@ #include "QtConcurrent/qtconcurrentrun.h" #endif - QualityHandle::QualityHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager ) : m_pcParet( parent ), m_pcMainWindowManager( windowManager ) @@ -328,5 +327,3 @@ Void QualityHandle::slotPlotQualitySeveral() } } - - diff --git a/app/QualityHandle.h b/app/QualityHandle.h index 328173d..7df0c03 100644 --- a/app/QualityHandle.h +++ b/app/QualityHandle.h @@ -36,14 +36,13 @@ #include "QFuture" #include "QualityMeasurementSidebar.h" - class PlaYUVerSubWindowHandle; class VideoSubWindow; class QualityHandle: public QWidget { Q_OBJECT -public: + public: QualityHandle( QWidget*, PlaYUVerSubWindowHandle * ); ~QualityHandle(); diff --git a/app/QualityMeasurementSidebar.cpp b/app/QualityMeasurementSidebar.cpp index 59fd21b..b96cb4a 100644 --- a/app/QualityMeasurementSidebar.cpp +++ b/app/QualityMeasurementSidebar.cpp @@ -27,7 +27,6 @@ #include "QualityMeasurementSidebar.h" #include "VideoSubWindow.h" - QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, PlaYUVerSubWindowHandle *windowManager ) : QWidget( parent ), m_pcMainWindowManager( windowManager ), @@ -258,5 +257,3 @@ Void QualityMeasurementSidebar::slotQualityMetricChanged( Int idx ) //updateQualityMetric( idx ); } - - diff --git a/app/QualityMeasurementSidebar.h b/app/QualityMeasurementSidebar.h index 5d93cd5..8785507 100644 --- a/app/QualityMeasurementSidebar.h +++ b/app/QualityMeasurementSidebar.h @@ -37,14 +37,13 @@ #include "lib/PlaYUVerFrame.h" #include "HistogramWidget.h" - class PlaYUVerSubWindowHandle; class VideoSubWindow; class QualityMeasurementSidebar: public QWidget { Q_OBJECT -public: + public: QualityMeasurementSidebar( QWidget*, PlaYUVerSubWindowHandle * ); ~QualityMeasurementSidebar(); diff --git a/app/SeekStreamDialog.cpp b/app/SeekStreamDialog.cpp index 5221b72..31b1f72 100644 --- a/app/SeekStreamDialog.cpp +++ b/app/SeekStreamDialog.cpp @@ -30,7 +30,6 @@ #include #include - SeekStreamDialog::SeekStreamDialog( PlaYUVerStream *pcCurrStream, QWidget *parent ) : QDialog( parent, Qt::Dialog | Qt::WindowTitleHint ), m_iSelectedFrameNum() @@ -81,4 +80,3 @@ Int SeekStreamDialog::runDialog() return m_iSelectedFrameNum; } - diff --git a/app/SeekStreamDialog.h b/app/SeekStreamDialog.h index 7eff039..6542605 100644 --- a/app/SeekStreamDialog.h +++ b/app/SeekStreamDialog.h @@ -31,7 +31,6 @@ #include #include - /** * */ @@ -42,7 +41,7 @@ Q_OBJECT public: SeekStreamDialog( PlaYUVerStream *pcCurrStream, QWidget *parent = 0 ); Int runDialog(); -private: + private: QSpinBox* m_spinFrameNum; Int m_iSelectedFrameNum; }; diff --git a/app/SubWindowAbstract.cpp b/app/SubWindowAbstract.cpp index d5197d1..d4832ea 100644 --- a/app/SubWindowAbstract.cpp +++ b/app/SubWindowAbstract.cpp @@ -30,7 +30,6 @@ #include "SubWindowAbstract.h" #include "PlaYUVerMdiSubWindow.h" - SubWindowAbstract::SubWindowAbstract( QWidget * parent, UInt category ) : QWidget( parent ), m_cSubWindow( NULL ) @@ -38,7 +37,7 @@ SubWindowAbstract::SubWindowAbstract( QWidget * parent, UInt category ) : setParent( parent ); setVisible( false ); //setFocusPolicy( Qt::WheelFocus ); - setFocusPolicy(Qt::StrongFocus); + setFocusPolicy( Qt::StrongFocus ); setAttribute( Qt::WA_DeleteOnClose ); setBackgroundRole( QPalette::Background ); @@ -91,7 +90,7 @@ QSize SubWindowAbstract::sizeHint() const } QSize SubWindowAbstract::sizeHint( const QSize & ) const -{ + { return QSize(); } @@ -113,4 +112,3 @@ Void SubWindowAbstract::closeSubWindow() m_cSubWindow->close(); } - diff --git a/app/SubWindowAbstract.h b/app/SubWindowAbstract.h index c6d7515..3d2ea4f 100644 --- a/app/SubWindowAbstract.h +++ b/app/SubWindowAbstract.h @@ -48,7 +48,6 @@ class QHBoxLayout; class QFocusEvent; class QCloseEvent; - class PlaYUVerMdiSubWindow; class SubWindowAbstract: public QWidget @@ -70,10 +69,9 @@ public: VIDEO_STREAM_SUBWINDOW = 2, MODULE_SUBWINDOW = 4, PLOT_SUBWINDOW = 8, - }; Q_DECLARE_FLAGS( SubWindowCategories, SubWindowCategory ) + };Q_DECLARE_FLAGS( SubWindowCategories, SubWindowCategory ) - - SubWindowAbstract( QWidget *, UInt ); +SubWindowAbstract ( QWidget *, UInt ); ~SubWindowAbstract(); /** @@ -152,7 +150,7 @@ protected: Void setWidget( QWidget* widget ); -Q_SIGNALS: + Q_SIGNALS: /** * Notify that zoom factor was changed by internal event (e.g. by mouse wheel) */ diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index 27871eb..9b9738e 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -41,7 +41,6 @@ #include #endif - VideoHandle::VideoHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager ) : m_pcParet( parent ), m_pcMainWindowManager( windowManager ) @@ -774,5 +773,3 @@ Void VideoHandle::toggleGrid( Bool checked ) } } - - diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 5fa5699..81d5285 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -42,7 +42,6 @@ class QLabel; class QSlider; class QElapsedTimer; - class PlaYUVerSubWindowHandle; class SubWindowAbstract; class VideoSubWindow; @@ -52,7 +51,7 @@ class WidgetFrameNumber; class VideoHandle: public QWidget { Q_OBJECT -public: + public: VideoHandle( QWidget*, PlaYUVerSubWindowHandle * ); ~VideoHandle(); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 7413d1e..7dc7798 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -32,7 +32,6 @@ #include "QtConcurrent/qtconcurrentrun.h" #endif - /** * \brief Functions to control data stream from stream information */ @@ -96,7 +95,7 @@ private: QFont m_cTopLeftTextFont; QFont m_cCenterTextFont; Bool m_bBusyWindow; -public: + public: VideoInformation( QWidget *parent ) : QWidget( parent ), m_bBusyWindow( false ) @@ -259,7 +258,7 @@ QSize VideoSubWindow::sizeHint() const } QSize VideoSubWindow::sizeHint( const QSize & maxSize ) const -{ + { QSize isize; if( m_pcCurrFrame ) isize = QSize( m_pcCurrFrame->getWidth() + 50, m_pcCurrFrame->getHeight() + 50 ); @@ -320,7 +319,8 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) if( guessFormat( cFilename, Width, Height, InputFormat, FrameRate ) || bForceDialog ) { - if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate ) == QDialog::Rejected ) + if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate ) + == QDialog::Rejected ) { return false; } @@ -332,7 +332,8 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) } catch( const char *msg ) { - if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate ) == QDialog::Rejected ) + if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate ) + == QDialog::Rejected ) { return false; } @@ -367,7 +368,7 @@ Bool VideoSubWindow::loadFile( PlaYUVerStreamInfo* streamInfo ) } if( !m_pCurrStream->open( streamInfo->m_cFilename.toStdString(), streamInfo->m_uiWidth, streamInfo->m_uiHeight, streamInfo->m_iPelFormat, - streamInfo->m_uiBitsPelPixel, streamInfo->m_iEndianness, streamInfo->m_uiFrameRate, true) ) + streamInfo->m_uiBitsPelPixel, streamInfo->m_iEndianness, streamInfo->m_uiFrameRate, true ) ) { return false; } @@ -621,7 +622,7 @@ Void VideoSubWindow::refreshFrameOperation() if( m_pcCurrentDisplayModule ) { m_bWindowBusy = true; - m_pcCurrentDisplayModule->apply( m_bIsPlaying, !m_bIsPlaying && m_apcCurrentModule.size() ); + m_pcCurrentDisplayModule->apply( m_bIsPlaying, !m_bIsPlaying && m_apcCurrentModule.size() ); bSetFrame = false; } if( bSetFrame ) @@ -643,7 +644,7 @@ Void VideoSubWindow::refreshFrame( Bool bThreaded ) m_cRefreshResult = QtConcurrent::run( this, &VideoSubWindow::refreshFrameOperation ); } else -#endif + #endif { refreshFrameOperation(); } diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 7de26cb..c448eca 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -38,7 +38,6 @@ class QScrollArea; - class VideoInformation; class VideoSubWindow; class PlaYUVerAppModuleIf; diff --git a/app/ViewArea.cpp b/app/ViewArea.cpp index f5a991c..de6428d 100644 --- a/app/ViewArea.cpp +++ b/app/ViewArea.cpp @@ -39,7 +39,6 @@ #include "ViewArea.h" #include "GridManager.h" - static const QColor selectionColor = Qt::cyan; static const QColor imageMaskColor = Qt::green; static const QColor eraserColor = Qt::red; @@ -686,7 +685,7 @@ Void ViewArea::paintEvent( QPaintEvent *event ) switch( tool() ) { case MaskTool: - { + { if( m_maskColor.isValid() ) color = m_maskColor; else @@ -695,7 +694,7 @@ Void ViewArea::paintEvent( QPaintEvent *event ) break; } case EraserTool: - { + { color = eraserColor; break; } @@ -999,7 +998,7 @@ Void ViewArea::mouseReleaseEvent( QMouseEvent *event ) //////////////////////////////////////////////////////////////////////////////// Bool ViewArea::isPosValid( const QPoint &pos ) const -{ + { if( pos.x() < 0 || pos.y() < 0 || pos.x() >= m_pixmap.width() || pos.y() >= m_pixmap.height() ) return false; @@ -1010,7 +1009,7 @@ Bool ViewArea::isPosValid( const QPoint &pos ) const //////////////////////////////////////////////////////////////////////////////// QPoint ViewArea::windowToView( const QPoint& pt ) const -{ + { QPoint p; p.setX( static_cast( ( pt.x() - m_xOffset ) / m_dZoomFactor ) ); p.setY( static_cast( ( pt.y() - m_yOffset ) / m_dZoomFactor ) ); @@ -1019,7 +1018,7 @@ QPoint ViewArea::windowToView( const QPoint& pt ) const } QRect ViewArea::windowToView( const QRect& rc ) const -{ + { QRect r; r.setTopLeft( windowToView( rc.topLeft() ) ); @@ -1032,7 +1031,7 @@ QRect ViewArea::windowToView( const QRect& rc ) const } QPoint ViewArea::viewToWindow( const QPoint& pt ) const -{ + { QPoint p; p.setX( static_cast( pt.x() * m_dZoomFactor + m_xOffset ) ); @@ -1042,7 +1041,7 @@ QPoint ViewArea::viewToWindow( const QPoint& pt ) const } QRect ViewArea::viewToWindow( const QRect& rc ) const -{ + { QRect r; r.setTopLeft( viewToWindow( rc.topLeft() ) ); @@ -1066,7 +1065,7 @@ Void ViewArea::updateMask( const QRect &rect ) switch( tool() ) { case MaskTool: - { + { // Add rect to the mask QPainter paInter( &m_mask ); paInter.setBrush( Qt::color1 ); @@ -1076,7 +1075,7 @@ Void ViewArea::updateMask( const QRect &rect ) break; } case EraserTool: - { + { // Clears rect area in the mask QPainter paInter( &m_mask ); paInter.setBrush( Qt::color0 ); diff --git a/app/ViewArea.h b/app/ViewArea.h index 0b61acc..31a5e17 100644 --- a/app/ViewArea.h +++ b/app/ViewArea.h @@ -36,7 +36,6 @@ #include "GridManager.h" #include "lib/PlaYUVerFrame.h" - class PlaYUVerStream; /** @@ -124,7 +123,7 @@ public Q_SLOTS: // Void setNormalSelectionTool(); // Void setBlockSelectionTool(); void setSnapToGrid( bool enable ); -// void setSelectedArea( QRect &rect ); + // void setSelectedArea( QRect &rect ); protected: Void paintEvent( QPaintEvent *event ); diff --git a/app/WidgetFrameNumber.cpp b/app/WidgetFrameNumber.cpp index 4f7f4b0..81d94ca 100644 --- a/app/WidgetFrameNumber.cpp +++ b/app/WidgetFrameNumber.cpp @@ -31,7 +31,6 @@ #endif #include "WidgetFrameNumber.h" - WidgetFrameNumber::WidgetFrameNumber( QWidget *parent ) : QWidget( parent ) { @@ -67,5 +66,3 @@ Void WidgetFrameNumber::clear() m_pcTotalFrameNumLabel->setText( "-" ); } - - diff --git a/app/WidgetFrameNumber.h b/app/WidgetFrameNumber.h index 93619bf..d9af7f9 100644 --- a/app/WidgetFrameNumber.h +++ b/app/WidgetFrameNumber.h @@ -25,7 +25,6 @@ #ifndef __WIDGETFRAMENUMBER_H__ #define __WIDGETFRAMENUMBER_H__ - #include "config.h" #include "PlaYUVerAppDefs.h" #include @@ -35,7 +34,6 @@ #include #endif - class WidgetFrameNumber: public QWidget { public: @@ -43,7 +41,7 @@ public: Void setCurrFrameNum( Int number ); Void setTotalFrameNum( Int number ); Void clear(); -private: + private: QLabel *m_pcCurrFrameNumLabel; QLabel *m_pcTotalFrameNumLabel; diff --git a/app/main.cpp b/app/main.cpp index 6f6cfee..e707bfa 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -45,7 +45,7 @@ int main( int argc, char *argv[] ) QApplication application( argc, argv ); QApplication::setApplicationName( "PlaYUVer" ); - QApplication::setApplicationVersion( PLAYUVER_VERSION_STRING ); + QApplication::setApplicationVersion (PLAYUVER_VERSION_STRING); QApplication::setOrganizationName( "PixLRA" ); #ifdef USE_QTDBUS @@ -90,32 +90,33 @@ int main( int argc, char *argv[] ) QStringList tokens; // open given files... - foreach(const QString & file, filenameList){ - QDBusMessage m = QDBusMessage::createMethodCall(PLAYUVER_DBUS_SESSION_NAME, - QStringLiteral(PLAYUVER_DBUS_PATH), QStringLiteral(PLAYUVER_DBUS_SESSION_NAME), QStringLiteral("loadFile")); - - QList dbusargs; - dbusargs.append( file ); - m.setArguments(dbusargs); - - QDBusMessage res = QDBusConnection::sessionBus().call(m); - if (res.type() == QDBusMessage::ReplyMessage) + foreach(const QString & file, filenameList) { - if (res.arguments().count() == 1) + QDBusMessage m = QDBusMessage::createMethodCall(PLAYUVER_DBUS_SESSION_NAME, + QStringLiteral(PLAYUVER_DBUS_PATH), QStringLiteral(PLAYUVER_DBUS_SESSION_NAME), QStringLiteral("loadFile")); + + QList dbusargs; + dbusargs.append( file ); + m.setArguments(dbusargs); + + QDBusMessage res = QDBusConnection::sessionBus().call(m); + if (res.type() == QDBusMessage::ReplyMessage) { - QVariant v = res.arguments()[0]; - if (v.isValid()) + if (res.arguments().count() == 1) { - QString s = v.toString(); - if ((!s.isEmpty()) && (s != QStringLiteral("ERROR"))) + QVariant v = res.arguments()[0]; + if (v.isValid()) { - tokens << s; + QString s = v.toString(); + if ((!s.isEmpty()) && (s != QStringLiteral("ERROR"))) + { + tokens << s; + } } } } } - } - // this will wait until exiting is emitted by the used instance, if wanted... + // this will wait until exiting is emitted by the used instance, if wanted... return needToBlock ? application.exec() : 0; } } diff --git a/examples/modules/AbsoluteFrameDifference_APIv2.cpp b/examples/modules/AbsoluteFrameDifference_APIv2.cpp index 6b45546..a772410 100644 --- a/examples/modules/AbsoluteFrameDifference_APIv2.cpp +++ b/examples/modules/AbsoluteFrameDifference_APIv2.cpp @@ -25,7 +25,6 @@ #include "AbsoluteFrameDifference_APIv2.h" #include - REGISTER_CLASS_MAKER( AbsoluteFrameDifference ) AbsoluteFrameDifference::AbsoluteFrameDifference() @@ -78,5 +77,3 @@ Void AbsoluteFrameDifference::destroy() m_pcFrameDifference = NULL; } - - diff --git a/examples/modules/AbsoluteFrameDifference_APIv2.h b/examples/modules/AbsoluteFrameDifference_APIv2.h index a1e987b..40825f5 100644 --- a/examples/modules/AbsoluteFrameDifference_APIv2.h +++ b/examples/modules/AbsoluteFrameDifference_APIv2.h @@ -29,7 +29,6 @@ #include - class AbsoluteFrameDifference: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( AbsoluteFrameDifference ) diff --git a/examples/modules/FrameBinarization_APIv1.cpp b/examples/modules/FrameBinarization_APIv1.cpp index 6fee1ee..1ce3531 100644 --- a/examples/modules/FrameBinarization_APIv1.cpp +++ b/examples/modules/FrameBinarization_APIv1.cpp @@ -24,7 +24,6 @@ #include "FrameBinarization_APIv1.h" - REGISTER_CLASS_MAKER( FrameBinarization ) FrameBinarization::FrameBinarization() @@ -69,5 +68,3 @@ Void FrameBinarization::destroy() m_pcBinFrame = NULL; } - - diff --git a/examples/modules/FrameBinarization_APIv1.h b/examples/modules/FrameBinarization_APIv1.h index 1de89cf..e3b74e1 100644 --- a/examples/modules/FrameBinarization_APIv1.h +++ b/examples/modules/FrameBinarization_APIv1.h @@ -27,7 +27,6 @@ #include "PlaYUVerModuleIf.h" - class FrameBinarization: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( FrameBinarization ) @@ -35,7 +34,7 @@ REGISTER_CLASS_FACTORY( FrameBinarization ) private: PlaYUVerFrame* m_pcBinFrame; UInt m_uiThreshold; -public: + public: FrameBinarization(); virtual ~FrameBinarization() { diff --git a/lib/LibMemory.h b/lib/LibMemory.h index c3e1076..d212f63 100644 --- a/lib/LibMemory.h +++ b/lib/LibMemory.h @@ -30,7 +30,6 @@ #include #include - typedef void Void; typedef char Char; typedef int Int; @@ -231,6 +230,4 @@ Void freeMem3ImageComponents( T*** array3D ) } } - - #endif // __LIBMEMORY_H__ diff --git a/lib/PlaYUVerDefs.h b/lib/PlaYUVerDefs.h index ef182f7..09a2a44 100644 --- a/lib/PlaYUVerDefs.h +++ b/lib/PlaYUVerDefs.h @@ -30,7 +30,6 @@ #include #include - // ==================================================================================================================== // Basic type redefinition // ==================================================================================================================== @@ -92,7 +91,6 @@ typedef UChar Byte; // Macro functions // ==================================================================================================================== - // ==================================================================================================================== // PlaYUVer definitions // ==================================================================================================================== @@ -120,7 +118,6 @@ enum RGBcomponent COLOR_A, }; - inline String lowercase( const String& in ) { String out; @@ -140,11 +137,17 @@ struct PlaYUVerFailure: public std::exception String m_class_name; String m_error_msg; PlaYUVerFailure( String error_msg ) throw() : - m_error_msg( error_msg ) { } + m_error_msg( error_msg ) + { + } PlaYUVerFailure( String class_name, String error_msg ) throw() : - m_class_name( class_name ), - m_error_msg( error_msg ) { } - ~PlaYUVerFailure() throw() { } + m_class_name( class_name ), + m_error_msg( error_msg ) + { + } + ~PlaYUVerFailure() throw() + { + } const Char* what() const throw() { String* msg = new String( "[" + m_class_name + "] " + m_error_msg ); @@ -152,5 +155,4 @@ struct PlaYUVerFailure: public std::exception } }; - #endif // __PLAYUVERDEFS_H__ diff --git a/lib/PlaYUVerFrame.cpp b/lib/PlaYUVerFrame.cpp index 6f26d66..bdff173 100644 --- a/lib/PlaYUVerFrame.cpp +++ b/lib/PlaYUVerFrame.cpp @@ -125,23 +125,25 @@ struct PlaYUVerFramePrivate Bool m_bHasHistogram; }; - /*! \brief Constructors * * Constructors and init functions */ -PlaYUVerFrame::PlaYUVerFrame( UInt width, UInt height, Int pelFormat, Int bitsPixel, Int endianness ) : d( new PlaYUVerFramePrivate ) +PlaYUVerFrame::PlaYUVerFrame( UInt width, UInt height, Int pelFormat, Int bitsPixel, Int endianness ) : + d( new PlaYUVerFramePrivate ) { d->init( width, height, pelFormat, bitsPixel, endianness ); } -PlaYUVerFrame::PlaYUVerFrame( PlaYUVerFrame *other, Bool bCopy ) : d( new PlaYUVerFramePrivate ) +PlaYUVerFrame::PlaYUVerFrame( PlaYUVerFrame *other, Bool bCopy ) : + d( new PlaYUVerFramePrivate ) { d->init( other->getWidth(), other->getHeight(), other->getPelFormat(), other->getBitsPel(), other->getEndianness() ); copyFrom( other ); } -PlaYUVerFrame::PlaYUVerFrame( PlaYUVerFrame *other, UInt posX, UInt posY, UInt areaWidth, UInt areaHeight ) : d( new PlaYUVerFramePrivate ) +PlaYUVerFrame::PlaYUVerFrame( PlaYUVerFrame *other, UInt posX, UInt posY, UInt areaWidth, UInt areaHeight ) : + d( new PlaYUVerFramePrivate ) { PlaYUVerPixFmtDescriptor* pcPelFormat = &( g_PlaYUVerPixFmtDescriptorsList[other->getPelFormat()] ); if( pcPelFormat->log2ChromaWidth ) @@ -174,10 +176,10 @@ static Int getMem3ImageComponents( Pel**** array3D, Int dim1, Int dim2, Int log2 total_mem_size += getMem2D( array3D, dim0, dim1 ); - if( ( ( *array3D )[0][0] = ( Pel* )xCallocMem( mem_size, sizeof( Pel ) ) ) == NULL ) + if( ( ( *array3D )[0][0] = ( Pel* )xCallocMem( mem_size, sizeof(Pel) ) ) == NULL ) printf( "getMem3DImageComponents: array1D" ); - total_mem_size += mem_size * sizeof( Pel ); + total_mem_size += mem_size * sizeof(Pel); // Luma for( i = 1; i < dim1; i++ ) @@ -288,7 +290,7 @@ Void PlaYUVerFrame::clear() } Bool PlaYUVerFrame::haveSameFmt( PlaYUVerFrame* other, UInt match ) const -{ + { Bool bRet = true; if( other ) { @@ -331,16 +333,16 @@ UInt PlaYUVerFrame::getNumberChannels() const } UInt PlaYUVerFrame::getWidth( Int channel ) const -{ + { return CHROMASHIFT( d->m_uiWidth, channel > 0 ? d->m_pcPelFormat->log2ChromaWidth : 0 ); } UInt PlaYUVerFrame::getHeight( Int channel ) const -{ + { return CHROMASHIFT( d->m_uiHeight, channel > 0 ? d->m_pcPelFormat->log2ChromaHeight : 0 ); } UInt PlaYUVerFrame::getPixels( Int channel ) const -{ + { return getWidth( channel ) * getWidth( channel ); } @@ -471,7 +473,7 @@ Void PlaYUVerFrame::copyFrom( PlaYUVerFrame* input_frame ) return; d->m_bHasRGBPel = false; d->m_bHasHistogram = false; - memcpy( *d->m_pppcInputPel[LUMA], input_frame->getPelBufferYUV()[LUMA][0], getBytesPerFrame() * sizeof( Pel ) ); + memcpy( *d->m_pppcInputPel[LUMA], input_frame->getPelBufferYUV()[LUMA][0], getBytesPerFrame() * sizeof(Pel) ); } Void PlaYUVerFrame::copyFrom( PlaYUVerFrame* input_frame, UInt xPos, UInt yPos ) @@ -485,7 +487,7 @@ Void PlaYUVerFrame::copyFrom( PlaYUVerFrame* input_frame, UInt xPos, UInt yPos ) Int ratioW = ch > 0 ? d->m_pcPelFormat->log2ChromaHeight : 0; for( UInt i = 0; i < CHROMASHIFT( d->m_uiHeight, ratioH ); i++ ) { - memcpy( d->m_pppcInputPel[ch][i], &( pInput[ch][( yPos >> ratioH ) + i][( xPos >> ratioW )] ), ( d->m_uiWidth >> ratioW ) * sizeof( Pel ) ); + memcpy( d->m_pppcInputPel[ch][i], &( pInput[ch][( yPos >> ratioH ) + i][( xPos >> ratioW )] ), ( d->m_uiWidth >> ratioW ) * sizeof(Pel) ); } } d->m_bHasRGBPel = false; @@ -1086,13 +1088,13 @@ Bool PlaYUVerFrame::fromMat( cv::Mat& cvMat ) { switch( cvMat.channels() ) { - case 1: + case 1: d->m_iPixelFormat = findPixelFormat( "GRAY" ); break; - case 3: + case 3: d->m_iPixelFormat = findPixelFormat( "BGR24" ); break; - default: + default: return false; } } @@ -1276,5 +1278,3 @@ Double PlaYUVerFrame::getSSIM( PlaYUVerFrame* Org, Int component ) return dSSIM; } - - diff --git a/lib/PlaYUVerFrame.h b/lib/PlaYUVerFrame.h index a9a11db..0e6b784 100644 --- a/lib/PlaYUVerFrame.h +++ b/lib/PlaYUVerFrame.h @@ -33,7 +33,6 @@ namespace cv class Mat; } - struct PlaYUVerPixFmtDescriptor; struct PlaYUVerFramePrivate; diff --git a/lib/PlaYUVerFramePixelFormats.cpp b/lib/PlaYUVerFramePixelFormats.cpp index c4f8790..d870a56 100644 --- a/lib/PlaYUVerFramePixelFormats.cpp +++ b/lib/PlaYUVerFramePixelFormats.cpp @@ -37,8 +37,6 @@ #include "StreamHandlerLibav.h" #endif - - /* ************************************************************** * Handle different pel formats @@ -202,121 +200,217 @@ Void fillARGB32bufferYUV420p( Pel*** in, UChar* out, UInt width, UInt height, UI #endif PlaYUVerPixFmtDescriptor yuv420p = -{ - "YUV420p", - PlaYUVerPixel::COLOR_YUV, - 3, - 3, - 1, - 1, - ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV420P ), - { - { 0, 0, 1, 0, 7 }, /* Y */ - { 1, 0, 1, 0, 7 }, /* U */ - { 2, 0, 1, 0, 7 }, /* V */ - }, -}; + { + "YUV420p", + PlaYUVerPixel::COLOR_YUV, + 3, + 3, + 1, + 1, + ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV420P ), + { + { + 0, + 0, + 1, + 0, + 7 }, /* Y */ + { + 1, + 0, + 1, + 0, + 7 }, /* U */ + { + 2, + 0, + 1, + 0, + 7 }, /* V */ + }, + }; PlaYUVerPixFmtDescriptor yuv422p = -{ - "YUV422p", - PlaYUVerPixel::COLOR_YUV, - 3, - 3, - 1, - 0, - ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV422P ), - { - { 0, 0, 1, 0, 7 }, /* Y */ - { 1, 0, 1, 0, 7 }, /* U */ - { 2, 0, 1, 0, 7 }, /* V */ - }, -}; + { + "YUV422p", + PlaYUVerPixel::COLOR_YUV, + 3, + 3, + 1, + 0, + ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV422P ), + { + { + 0, + 0, + 1, + 0, + 7 }, /* Y */ + { + 1, + 0, + 1, + 0, + 7 }, /* U */ + { + 2, + 0, + 1, + 0, + 7 }, /* V */ + }, + }; PlaYUVerPixFmtDescriptor yuv444p = -{ - "YUV444p", - PlaYUVerPixel::COLOR_YUV, - 3, - 3, - 0, - 0, - ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV444P ), - { - { 0, 0, 1, 0, 7 }, /* Y */ - { 1, 0, 1, 0, 7 }, /* U */ - { 2, 0, 1, 0, 7 }, /* V */ - }, -}; + { + "YUV444p", + PlaYUVerPixel::COLOR_YUV, + 3, + 3, + 0, + 0, + ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV444P ), + { + { + 0, + 0, + 1, + 0, + 7 }, /* Y */ + { + 1, + 0, + 1, + 0, + 7 }, /* U */ + { + 2, + 0, + 1, + 0, + 7 }, /* V */ + }, + }; PlaYUVerPixFmtDescriptor yuyv422 = -{ - "YUYV422", - PlaYUVerPixel::COLOR_YUV, - 3, - 1, - 1, - 0, - ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUYV422 ), - { - { 0, 1, 1, 0, 7 }, /* Y */ - { 0, 3, 2, 0, 7 }, /* U */ - { 0, 3, 4, 0, 7 }, /* V */ - }, -}; + { + "YUYV422", + PlaYUVerPixel::COLOR_YUV, + 3, + 1, + 1, + 0, + ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUYV422 ), + { + { + 0, + 1, + 1, + 0, + 7 }, /* Y */ + { + 0, + 3, + 2, + 0, + 7 }, /* U */ + { + 0, + 3, + 4, + 0, + 7 }, /* V */ + }, + }; PlaYUVerPixFmtDescriptor gray = -{ - "GRAY", - PlaYUVerPixel::COLOR_GRAY, - 1, - 1, - 0, - 0, - ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_GRAY8 ), - { { 0, 0, 1, 0, 7 } }, /* Y */ -}; + { + "GRAY", + PlaYUVerPixel::COLOR_GRAY, + 1, + 1, + 0, + 0, + ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_GRAY8 ), + { + { + 0, + 0, + 1, + 0, + 7 } }, /* Y */ + }; PlaYUVerPixFmtDescriptor RGB24 = -{ - "RGB24", - PlaYUVerPixel::COLOR_RGB, - 3, - 1, - 0, - 0, - ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_RGB24 ), - { - { 0, 2, 1, 0, 7 }, /* R */ - { 0, 2, 2, 0, 7 }, /* G */ - { 0, 2, 3, 0, 7 }, /* B */ - }, -}; + { + "RGB24", + PlaYUVerPixel::COLOR_RGB, + 3, + 1, + 0, + 0, + ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_RGB24 ), + { + { + 0, + 2, + 1, + 0, + 7 }, /* R */ + { + 0, + 2, + 2, + 0, + 7 }, /* G */ + { + 0, + 2, + 3, + 0, + 7 }, /* B */ + }, + }; PlaYUVerPixFmtDescriptor BGR24 = -{ - "BGR24", - PlaYUVerPixel::COLOR_RGB, - 3, - 1, - 0, - 0, - ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_BGR24 ), - { - { 0, 2, 3, 0, 7 }, /* R */ - { 0, 2, 2, 0, 7 }, /* G */ - { 0, 2, 1, 0, 7 }, /* B */ - }, -}; + { + "BGR24", + PlaYUVerPixel::COLOR_RGB, + 3, + 1, + 0, + 0, + ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_BGR24 ), + { + { + 0, + 2, + 3, + 0, + 7 }, /* R */ + { + 0, + 2, + 2, + 0, + 7 }, /* G */ + { + 0, + 2, + 1, + 0, + 7 }, /* B */ + }, + }; PlaYUVerPixFmtDescriptor g_PlaYUVerPixFmtDescriptorsList[PLAYUVER_NUMBER_FORMATS] = -{ - yuv420p, - yuv444p, - yuv422p, - yuyv422, - gray, - RGB24, - BGR24, -}; + { + yuv420p, + yuv444p, + yuv422p, + yuyv422, + gray, + RGB24, + BGR24, + }; diff --git a/lib/PlaYUVerFramePixelFormats.h b/lib/PlaYUVerFramePixelFormats.h index ae7c3b8..2036b44 100644 --- a/lib/PlaYUVerFramePixelFormats.h +++ b/lib/PlaYUVerFramePixelFormats.h @@ -143,6 +143,4 @@ typedef struct PlaYUVerPixFmtDescriptor #define PLAYUVER_NUMBER_FORMATS 7 extern PlaYUVerPixFmtDescriptor g_PlaYUVerPixFmtDescriptorsList[PLAYUVER_NUMBER_FORMATS]; - - #endif // __PLAYUVERFRAMEPIXELFORMATS_H__ diff --git a/lib/PlaYUVerModuleIf.h b/lib/PlaYUVerModuleIf.h index 17e9a76..439fea4 100644 --- a/lib/PlaYUVerModuleIf.h +++ b/lib/PlaYUVerModuleIf.h @@ -40,7 +40,6 @@ #include "PlaYUVerOptions.h" #include - #define REGISTER_CLASS_MAKER(X) \ extern "C" PlaYUVerModuleIf* Maker() { return new X; } @@ -115,7 +114,6 @@ enum Module_Key_Supported MODULE_KEY_DOWN, }; - /** * \class PlaYUVerModuleIf * \ingroup PlaYUVerLib PlaYUVerLib_Modules diff --git a/lib/PlaYUVerOptions.cpp b/lib/PlaYUVerOptions.cpp index 079174d..729ca56 100644 --- a/lib/PlaYUVerOptions.cpp +++ b/lib/PlaYUVerOptions.cpp @@ -60,22 +60,25 @@ struct ParseFailure: public std::exception String arg; String val; ParseFailure( String arg0, String val0 ) throw() : - arg( arg0 ), - val( val0 ) { } - ~ParseFailure() throw() { } + arg( arg0 ), + val( val0 ) + { + } + ~ParseFailure() throw() + { + } const Char* what() const throw() { return "Option Parse Failure"; } }; - /** Type specific option storage */ class BoolOption: public OptionBase { public: BoolOption( const String& name, const String& desc ) : - OptionBase( name, desc ) + OptionBase( name, desc ) { is_binary = true; } @@ -92,8 +95,8 @@ class StandardOption: public OptionBase { public: StandardOption( const String& name, T& storage, const String& desc ) : - OptionBase( name, desc ), - opt_storage( storage ) + OptionBase( name, desc ), + opt_storage( storage ) { is_binary = false; } @@ -124,7 +127,7 @@ inline void StandardOption::parse( const String& arg ) } template<> -inline void StandardOption< std::vector >::parse( const String& arg ) +inline void StandardOption >::parse( const String& arg ) { UInt aux_opt_storage; std::istringstream arg_ss( arg, std::istringstream::in ); @@ -142,7 +145,7 @@ inline void StandardOption< std::vector >::parse( const String& arg ) } template<> -inline void StandardOption< std::vector >::parse( const String& arg ) +inline void StandardOption >::parse( const String& arg ) { Int aux_opt_storage; std::istringstream arg_ss( arg, std::istringstream::in ); @@ -179,12 +182,12 @@ inline void StandardOption >::parse( const String& arg ) struct FunctionOption: public OptionBase { public: - typedef Void( Func )( PlaYUVerOptions&, const String& ); + typedef Void (Func)( PlaYUVerOptions&, const String& ); FunctionOption( const String& name, PlaYUVerOptions& parent_, Func *func_, const String& desc ) : - OptionBase( name, desc ), - parent( parent_ ), - func( func_ ) + OptionBase( name, desc ), + parent( parent_ ), + func( func_ ) { is_binary = false; } @@ -197,7 +200,7 @@ public: private: PlaYUVerOptions& parent; - void ( *func )( PlaYUVerOptions&, const String& ); + void (*func)( PlaYUVerOptions&, const String& ); }; /* Helper method to initiate adding options to Options */ @@ -247,7 +250,6 @@ template PlaYUVerOptions& PlaYUVerOptions::operator()( const String& name, std:: // addOption( new FunctionOption( name, parent, func, desc ) ); // return *this; // } - PlaYUVerOptions::PlaYUVerOptions( const String& name ) { m_cOptionGroupName = name; @@ -308,7 +310,6 @@ Void PlaYUVerOptions::addDefaultOptions() ( "module_list_full", "detailed list supported modules" ); } - PlaYUVerOptions& PlaYUVerOptions::addOptions() { return *this; @@ -346,8 +347,6 @@ void PlaYUVerOptions::addOption( OptionBase *opt ) opt_list.push_back( names ); } - - static void setOptions( PlaYUVerOptions::OptionsList& opt_list, const string& value ) { /* multiple options may be registered for the same name: @@ -429,7 +428,7 @@ UInt PlaYUVerOptions::parseLONG( UInt argc, Char* argv[] ) * where longopts have to include an =, otherwise they are * booleans */ if( argc == 1 ) - return 0; /* run out of argv for argument */ + return 0; /* run out of argv for argument */ extra_argc_consumed = 1; #endif if( !storePair( true, false, option, "1" ) ) @@ -529,7 +528,6 @@ Bool PlaYUVerOptions::parse( UInt argc, Char *argv[] ) return true; } - list PlaYUVerOptions::scanArgv( UInt argc, Char *argv[] ) { /* a list for anything that didn't get handled as an option */ @@ -725,8 +723,8 @@ Bool PlaYUVerOptions::checkListingOpts() if( hasOpt( "version" ) ) { std::cout << "PlaYUVer version " - << PLAYUVER_VERSION_STRING - << "\n"; + << PLAYUVER_VERSION_STRING + << "\n"; bRet |= true; } if( hasOpt( "pel_fmts" ) ) @@ -810,5 +808,3 @@ Void PlaYUVerOptions::listModules() } } - - diff --git a/lib/PlaYUVerOptions.h b/lib/PlaYUVerOptions.h index d51f31c..795f2b1 100644 --- a/lib/PlaYUVerOptions.h +++ b/lib/PlaYUVerOptions.h @@ -48,7 +48,6 @@ #include "PlaYUVerDefs.h" - /** OptionBase: Virtual base class for storing information relating to a * specific option This base class describes common elements. * Type specific information should be stored in a derived class. @@ -57,12 +56,15 @@ class OptionBase { public: OptionBase( const String& name, const String& desc ) : - arg_count( 0 ), - opt_string( name ), - opt_desc( desc ) - { } + arg_count( 0 ), + opt_string( name ), + opt_desc( desc ) + { + } - virtual ~OptionBase() {} + virtual ~OptionBase() + { + } /* parse argument arg, to obtain a value for the option */ virtual void parse( const String& arg ) = 0; @@ -81,7 +83,6 @@ public: Bool is_binary; }; - class PlaYUVerOptions { public: @@ -89,7 +90,7 @@ public: struct Option { Option() : - opt( 0 ) + opt( 0 ) { } ~Option() @@ -102,7 +103,6 @@ public: OptionBase* opt; }; - typedef std::list OptionsList; PlaYUVerOptions( const String& name = "" ); @@ -151,7 +151,6 @@ public: PlaYUVerOptions& operator()( const String& name, T& storage, const String& desc ); - /** * Add option described by name to the parent Options list, * with desc as an optional help description @@ -162,7 +161,6 @@ public: // PlaYUVerOptions& // operator()( const String& name, OptionFunc::Func *func, const String& desc ); - Bool checkListingOpts(); Void listModules(); @@ -186,5 +184,4 @@ private: }; - #endif // __PROGRAMOPTIONS_H__ diff --git a/lib/PlaYUVerPixel.cpp b/lib/PlaYUVerPixel.cpp index 54e03c4..4f85907 100644 --- a/lib/PlaYUVerPixel.cpp +++ b/lib/PlaYUVerPixel.cpp @@ -28,7 +28,7 @@ #include "PlaYUVerPixel.h" PlaYUVerPixel::PlaYUVerPixel() : - m_iColorSpace( COLOR_INVALID ) + m_iColorSpace( COLOR_INVALID ) { m_iColorSpace = COLOR_INVALID; PixelComponents[0] = 0; @@ -46,7 +46,7 @@ PlaYUVerPixel::PlaYUVerPixel( const Int& ColorSpace ) PixelComponents[3] = 0; } -PlaYUVerPixel::PlaYUVerPixel( const Int& ColorSpace, const Pel& c0, const Pel& c1, const Pel& c2 ) +PlaYUVerPixel::PlaYUVerPixel( const Int& ColorSpace, const Pel& c0, const Pel& c1, const Pel& c2 ) { m_iColorSpace = ColorSpace == COLOR_GRAY ? COLOR_YUV : ColorSpace; PixelComponents[0] = c0; @@ -82,7 +82,6 @@ Pel PlaYUVerPixel::Cr() const return PixelComponents[2]; } - Pel& PlaYUVerPixel::Y() { return PixelComponents[0]; @@ -109,7 +108,7 @@ Pel& PlaYUVerPixel::B() } Pel PlaYUVerPixel::operator[]( const Int& channel ) const -{ + { return PixelComponents[channel]; } Pel& PlaYUVerPixel::operator[]( const Int& channel ) @@ -117,19 +116,19 @@ Pel& PlaYUVerPixel::operator[]( const Int& channel ) return PixelComponents[channel]; } -PlaYUVerPixel PlaYUVerPixel::operator+ ( const PlaYUVerPixel& in ) +PlaYUVerPixel PlaYUVerPixel::operator+( const PlaYUVerPixel& in ) { PlaYUVerPixel out( m_iColorSpace, Y() + in.Y(), Cb() + in.Cb(), Cr() + in.Cr() ); return out; } -PlaYUVerPixel PlaYUVerPixel::operator- ( const PlaYUVerPixel& in ) +PlaYUVerPixel PlaYUVerPixel::operator-( const PlaYUVerPixel& in ) { PlaYUVerPixel out( m_iColorSpace, Y() - in.Y(), Cb() - in.Cb(), Cr() - in.Cr() ); return out; } -PlaYUVerPixel PlaYUVerPixel::operator* ( const Double& op ) +PlaYUVerPixel PlaYUVerPixel::operator*( const Double& op ) { PlaYUVerPixel out( m_iColorSpace, Y() * op, Cb() * op, Cr() * op ); return out; @@ -160,4 +159,3 @@ PlaYUVerPixel PlaYUVerPixel::ConvertPixel( ColorSpace eOutputSpace ) return outPixel; } - diff --git a/lib/PlaYUVerPixel.h b/lib/PlaYUVerPixel.h index d6e7262..ca3281a 100644 --- a/lib/PlaYUVerPixel.h +++ b/lib/PlaYUVerPixel.h @@ -31,10 +31,9 @@ #include #include "PlaYUVerDefs.h" - static inline Void YuvToRgb( const Int &iY, const Int &iU, const Int &iV, Int &iR, Int &iG, Int &iB ) { - iR = iY + ( ( 1436 * ( iV - 128) ) >> 10 ); + iR = iY + ( ( 1436 * ( iV - 128 ) ) >> 10 ); iG = iY - ( ( 352 * ( iU - 128 ) + 731 * ( iV - 128 ) ) >> 10 ); iB = iY + ( ( 1812 * ( iU - 128 ) ) >> 10 ); iR = iR < 0 ? 0 : iR > 255 ? 255 : iR; @@ -50,10 +49,10 @@ static inline Void rgbToYuv( const Int& iR, const Int& iG, const Int& iB, Int &i } /** - * \class PlaYUVerPixel - * \ingroup PlaYUVerLib PlaYUVerLib_Frame - * \brief Pixel handling class - */ + * \class PlaYUVerPixel + * \ingroup PlaYUVerLib PlaYUVerLib_Frame + * \brief Pixel handling class + */ class PlaYUVerPixel { public: @@ -61,11 +60,11 @@ public: static const UInt MAX_NUMBER_COMPONENTS = 5; /** ColorSpace list - * List of supported color spaces - */ + * List of supported color spaces + */ enum ColorSpace { - COLOR_INVALID = -1, //!< Invalid + COLOR_INVALID = -1, //!< Invalid COLOR_YUV = 0, //!< YUV COLOR_RGB = 1, //!< RGB COLOR_GRAY = 2, //!< Grayscale @@ -75,7 +74,7 @@ public: PlaYUVerPixel(); PlaYUVerPixel( const Int& ColorSpace ); - PlaYUVerPixel( const Int& ColorSpace, const Pel& c0, const Pel& c1, const Pel& c2 ); + PlaYUVerPixel( const Int& ColorSpace, const Pel& c0, const Pel& c1, const Pel& c2 ); ~PlaYUVerPixel(); Int ColorSpaceType(); @@ -96,12 +95,12 @@ public: Pel& G(); Pel& B(); - Pel operator[] ( const Int& channel ) const; - Pel& operator[] ( const Int& channel ); + Pel operator[]( const Int& channel ) const; + Pel& operator[]( const Int& channel ); - PlaYUVerPixel operator+ ( const PlaYUVerPixel& ); - PlaYUVerPixel operator- ( const PlaYUVerPixel& ); - PlaYUVerPixel operator* ( const Double& ); + PlaYUVerPixel operator+( const PlaYUVerPixel& ); + PlaYUVerPixel operator-( const PlaYUVerPixel& ); + PlaYUVerPixel operator*( const Double& ); /** * Convert a Pixel to a new color space diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index 09cda71..c8e6f4d 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -38,7 +38,6 @@ #include "StreamHandlerOpenCV.h" #endif - std::vector PlaYUVerStream::supportedReadFormats() { INI_REGIST_PLAYUVER_SUPPORTED_FMT; @@ -97,7 +96,6 @@ std::vector PlaYUVerStream::stdResolutionSizes() return stdResList; } - CreateStreamHandlerFn PlaYUVerStream::findStreamHandler( String strFilename, bool bRead ) { String currExt = strFilename.substr( strFilename.find_last_of( "." ) + 1 ); @@ -114,7 +112,7 @@ CreateStreamHandlerFn PlaYUVerStream::findStreamHandler( String strFilename, boo } for( UInt i = 0; i < supportedFmts.size(); i++ ) { - if( currExt != "" && supportedFmts[i].formatExt == currExt ) + if( currExt != "" && supportedFmts[i].formatExt == currExt ) { return supportedFmts[i].formatFct; } @@ -195,14 +193,14 @@ Bool PlaYUVerStream::open( String filename, UInt width, UInt height, Int input_f m_pfctCreateHandler = PlaYUVerStream::findStreamHandler( filename, m_bIsInput ); if( !m_pfctCreateHandler ) { - throw PlaYUVerFailure("PlaYUVerStream", "Invalid handler"); + throw PlaYUVerFailure( "PlaYUVerStream", "Invalid handler" ); } m_pcHandler = m_pfctCreateHandler(); if( !m_pcHandler ) { - throw PlaYUVerFailure("PlaYUVerStream", "Cannot create handler"); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot create handler" ); } m_cFilename = filename; @@ -215,19 +213,17 @@ Bool PlaYUVerStream::open( String filename, UInt width, UInt height, Int input_f m_pcHandler->m_iEndianness = endianness; m_pcHandler->m_dFrameRate = frame_rate; - if( !m_pcHandler->openHandler( m_cFilename, m_bIsInput ) ) { close(); - throw PlaYUVerFailure("PlaYUVerStream", "Cannot open file " + m_cFilename ); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot open file " + m_cFilename ); return m_bInit; } - if( m_pcHandler->m_uiWidth <= 0 || m_pcHandler->m_uiHeight <= 0 || m_pcHandler->m_iPixelFormat < 0 ) { close(); - throw PlaYUVerFailure("PlaYUVerStream", "Incorrect configuration"); + throw PlaYUVerFailure( "PlaYUVerStream", "Incorrect configuration" ); return m_bInit; } @@ -238,12 +234,13 @@ Bool PlaYUVerStream::open( String filename, UInt width, UInt height, Int input_f { try { - m_ppcFrameBuffer[i] = new PlaYUVerFrame( m_pcHandler->m_uiWidth, m_pcHandler->m_uiHeight, m_pcHandler->m_iPixelFormat, m_pcHandler->m_uiBitsPerPixel, m_pcHandler->m_iEndianness ); + m_ppcFrameBuffer[i] = new PlaYUVerFrame( m_pcHandler->m_uiWidth, m_pcHandler->m_uiHeight, m_pcHandler->m_iPixelFormat, m_pcHandler->m_uiBitsPerPixel, + m_pcHandler->m_iEndianness ); } catch( const char *msg ) { close(); - throw PlaYUVerFailure("PlaYUVerStream", "Cannot allocated frame buffer"); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot allocated frame buffer" ); return m_bInit; } } @@ -260,14 +257,14 @@ Bool PlaYUVerStream::open( String filename, UInt width, UInt height, Int input_f if( m_bIsInput && m_uiTotalFrameNum <= 0 ) { close(); - throw PlaYUVerFailure("PlaYUVerStream", "Incorrect configuration: less than one frame"); + throw PlaYUVerFailure( "PlaYUVerStream", "Incorrect configuration: less than one frame" ); return m_bInit; } if( !m_pcHandler->configureBuffer( m_pcCurrFrame ) ) { close(); - throw PlaYUVerFailure("PlaYUVerStream", "Cannot allocated memory"); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot allocated memory" ); return m_bInit; } @@ -285,13 +282,13 @@ Bool PlaYUVerStream::reload() m_pcHandler->closeHandler(); if( !m_pcHandler->openHandler( m_cFilename, m_bIsInput ) ) { - throw PlaYUVerFailure("PlaYUVerStream", "Cannot open file"); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot open file" ); } m_pcHandler->setBytesPerFrame( m_pcCurrFrame->getBytesPerFrame() ); m_uiTotalFrameNum = m_pcHandler->calculateFrameNumber(); if( m_pcHandler->m_uiWidth <= 0 || m_pcHandler->m_uiHeight <= 0 - || m_pcHandler->m_iPixelFormat < 0 || m_pcHandler->m_uiBitsPerPixel == 0 || m_uiTotalFrameNum < 1 ) + || m_pcHandler->m_iPixelFormat < 0 || m_pcHandler->m_uiBitsPerPixel == 0 || m_uiTotalFrameNum < 1 ) { return false; } @@ -312,8 +309,6 @@ Void PlaYUVerStream::close() m_pcHandler->closeHandler(); - - if( m_ppcFrameBuffer ) { for( UInt i = 0; i < m_uiFrameBufferSize; i++ ) @@ -465,7 +460,7 @@ Void PlaYUVerStream::readFrame() if( !m_pcHandler->read( m_pcNextFrame ) ) { - throw PlaYUVerFailure("PlaYUVerStream", "Cannot read file"); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot read file" ); return; } @@ -482,7 +477,7 @@ Void PlaYUVerStream::writeFrame( PlaYUVerFrame *pcFrame ) { if( !m_pcHandler->write( pcFrame ) ) { - throw PlaYUVerFailure("PlaYUVerStream", "Cannot write into the file"); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot write into the file" ); } return; } @@ -495,7 +490,8 @@ Bool PlaYUVerStream::saveFrame( const String& filename ) Bool PlaYUVerStream::saveFrame( const String& filename, PlaYUVerFrame *saveFrame ) { PlaYUVerStream auxSaveStream; - if( !auxSaveStream.open( filename, saveFrame->getWidth(), saveFrame->getHeight(), saveFrame->getPelFormat(), saveFrame->getBitsPel(), saveFrame->getEndianness(), 1, false ) ) + if( !auxSaveStream.open( filename, saveFrame->getWidth(), saveFrame->getHeight(), saveFrame->getPelFormat(), saveFrame->getBitsPel(), + saveFrame->getEndianness(), 1, false ) ) { return false; } @@ -587,7 +583,7 @@ Bool PlaYUVerStream::seekInput( UInt64 new_frame_num ) if( !m_pcHandler->seek( new_frame_num ) ) { - throw PlaYUVerFailure("PlaYUVerStream", "Cannot write into the file"); + throw PlaYUVerFailure( "PlaYUVerStream", "Cannot write into the file" ); } m_uiCurrFrameFileIdx = new_frame_num; @@ -602,4 +598,3 @@ Bool PlaYUVerStream::seekInput( UInt64 new_frame_num ) return true; } - diff --git a/lib/PlaYUVerStream.h b/lib/PlaYUVerStream.h index f1f3089..fbefab8 100644 --- a/lib/PlaYUVerStream.h +++ b/lib/PlaYUVerStream.h @@ -37,7 +37,6 @@ typedef struct UInt uiHeight; } PlaYUVerStdResolution; - typedef PlaYUVerStreamHandlerIf* (*CreateStreamHandlerFn)( void ); typedef struct @@ -54,7 +53,7 @@ typedef struct #define END_REGIST_PLAYUVER_SUPPORTED_FMT \ return formatsList; - #define REGIST_PLAYUVER_SUPPORTED_FMT( handler, name, ext ) \ +#define REGIST_PLAYUVER_SUPPORTED_FMT( handler, name, ext ) \ formatElem.formatName = name; \ formatElem.formatExt = lowercase( ext ); \ formatElem.formatFct = handler; \ @@ -66,7 +65,6 @@ typedef struct formatsList.insert( formatsList.end(), new_fmts.begin(), new_fmts.end() ); \ } - /** * \class PlaYUVerStream * \ingroup PlaYUVerLib PlaYUVerLib_Stream @@ -98,7 +96,7 @@ public: String getFormatName(); String getCodecName(); - Bool open( String filename, String resolution, String input_format, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput ); + Bool open( String filename, String resolution, String input_format, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput ); Bool open( String filename, UInt width, UInt height, Int input_format, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput ); Bool reload(); Void close(); @@ -134,7 +132,6 @@ public: return m_bInit; } - Void getDuration( Int* duration_array ); private: diff --git a/lib/PlaYUVerStreamHandlerIf.h b/lib/PlaYUVerStreamHandlerIf.h index 04bbab1..445fff9 100644 --- a/lib/PlaYUVerStreamHandlerIf.h +++ b/lib/PlaYUVerStreamHandlerIf.h @@ -29,7 +29,6 @@ #include "PlaYUVerStream.h" #include "PlaYUVerFrame.h" - #define REGISTER_STREAM_HANDLER(X) \ public: \ static PlaYUVerStreamHandlerIf* Create() { return new X(); } \ @@ -43,7 +42,7 @@ class PlaYUVerStreamHandlerIf { friend class PlaYUVerStream; -public: + public: PlaYUVerStreamHandlerIf() { m_bIsInput = true; diff --git a/lib/StreamHandlerLibav.cpp b/lib/StreamHandlerLibav.cpp index 55e1ac6..58b2db5 100644 --- a/lib/StreamHandlerLibav.cpp +++ b/lib/StreamHandlerLibav.cpp @@ -28,7 +28,6 @@ #include "PlaYUVerFramePixelFormats.h" #include "LibMemory.h" - std::vector StreamHandlerLibav::supportedReadFormats() { INI_REGIST_PLAYUVER_SUPPORTED_FMT; @@ -152,7 +151,7 @@ Bool StreamHandlerLibav::openHandler( String strFilename, Bool bInput ) getMem1D( &m_pchFrameBuffer, m_uiFrameBufferSize ); } - m_strFormatName = uppercase (strFilename.substr( strFilename.find_last_of( "." ) + 1 ) ); + m_strFormatName = uppercase( strFilename.substr( strFilename.find_last_of( "." ) + 1 ) ); const char *name = avcodec_get_name( m_cCodecCtx->codec_id ); // sprintf( m_acCodecName, "%s", name ); m_strCodecName = name; @@ -215,7 +214,7 @@ Bool StreamHandlerLibav::openHandler( String strFilename, Bool bInput ) } if( m_iPixelFormat == PlaYUVerFrame::NO_FMT ) { - throw PlaYUVerFailure("Cannot open file using FFmpeg libs - unsupported pixel format"); + throw PlaYUVerFailure( "Cannot open file using FFmpeg libs - unsupported pixel format" ); return false; } @@ -273,7 +272,6 @@ Bool StreamHandlerLibav::configureBuffer( PlaYUVerFrame* pcFrame ) return getMem1D( &m_pStreamBuffer, pcFrame->getBytesPerFrame() ); } - UInt64 StreamHandlerLibav::calculateFrameNumber() { UInt64 num_frames; @@ -355,7 +353,7 @@ Bool StreamHandlerLibav::read( PlaYUVerFrame* pcFrame ) // av_image_copy_to_buffer( m_pchFrameBuffer, m_uiFrameBufferSize, m_cFrame->data, m_cFrame->linesize, m_cCodecCtx->pix_fmt, m_cCodecCtx->width, // m_cCodecCtx->height, 1 ); av_image_copy_to_buffer( m_pStreamBuffer, m_uiFrameBufferSize, m_cFrame->data, m_cFrame->linesize, m_cCodecCtx->pix_fmt, m_cCodecCtx->width, - m_cCodecCtx->height, 1 ); + m_cCodecCtx->height, 1 ); if( orig_pkt.size ) av_free_packet( &orig_pkt ); @@ -378,4 +376,3 @@ Bool StreamHandlerLibav::seek( UInt64 iFrameNum ) return true; } - diff --git a/lib/StreamHandlerLibav.h b/lib/StreamHandlerLibav.h index 9d10861..4e23c94 100644 --- a/lib/StreamHandlerLibav.h +++ b/lib/StreamHandlerLibav.h @@ -49,18 +49,15 @@ extern "C" #include "PlaYUVerStream.h" #include "PlaYUVerStreamHandlerIf.h" - struct AVFormatContext; struct AVCodecContext; struct AVStream; struct AVStream; struct AVPacket; - - class StreamHandlerLibav: public PlaYUVerStreamHandlerIf { - REGISTER_STREAM_HANDLER( StreamHandlerLibav ) +REGISTER_STREAM_HANDLER( StreamHandlerLibav ) public: diff --git a/lib/StreamHandlerOpenCV.cpp b/lib/StreamHandlerOpenCV.cpp index f424c96..f994b94 100644 --- a/lib/StreamHandlerOpenCV.cpp +++ b/lib/StreamHandlerOpenCV.cpp @@ -31,7 +31,6 @@ using cv::Mat; using cv::VideoCapture; - std::vector StreamHandlerOpenCV::supportedReadFormats() { INI_REGIST_PLAYUVER_SUPPORTED_FMT; @@ -68,13 +67,13 @@ Bool StreamHandlerOpenCV::openHandler( String strFilename, Bool bInput ) m_strFormatName = "DEV"; m_strCodecName = "Raw Video"; pcVideoCapture = new VideoCapture( 0 ); - m_uiWidth = pcVideoCapture->get( CV_CAP_PROP_FRAME_WIDTH ); + m_uiWidth = pcVideoCapture->get( CV_CAP_PROP_FRAME_WIDTH ); m_uiHeight = pcVideoCapture->get( CV_CAP_PROP_FRAME_HEIGHT ); m_dFrameRate = 25; } else { - m_strCodecName = m_strFormatName = uppercase (strFilename.substr( strFilename.find_last_of( "." ) + 1 ) ); + m_strCodecName = m_strFormatName = uppercase( strFilename.substr( strFilename.find_last_of( "." ) + 1 ) ); Mat cvMat = cv::imread( m_cFilename ); m_uiWidth = cvMat.cols; m_uiHeight = cvMat.rows; @@ -146,4 +145,3 @@ Bool StreamHandlerOpenCV::write( PlaYUVerFrame* pcFrame ) return bRet; } - diff --git a/lib/StreamHandlerOpenCV.h b/lib/StreamHandlerOpenCV.h index f1ce3ef..aa02b0f 100644 --- a/lib/StreamHandlerOpenCV.h +++ b/lib/StreamHandlerOpenCV.h @@ -34,15 +34,14 @@ namespace cv { - class VideoCapture; +class VideoCapture; } - class PlaYUVerFrame; class StreamHandlerOpenCV: public PlaYUVerStreamHandlerIf { - REGISTER_STREAM_HANDLER( StreamHandlerOpenCV ) +REGISTER_STREAM_HANDLER( StreamHandlerOpenCV ) public: diff --git a/lib/StreamHandlerPortableMap.cpp b/lib/StreamHandlerPortableMap.cpp index c0f0e88..df8460d 100644 --- a/lib/StreamHandlerPortableMap.cpp +++ b/lib/StreamHandlerPortableMap.cpp @@ -29,7 +29,6 @@ #include "PlaYUVerFramePixelFormats.h" #include "LibMemory.h" - Bool StreamHandlerPortableMap::openHandler( String strFilename, Bool bInput ) { m_bIsInput = bInput; @@ -44,10 +43,12 @@ Bool StreamHandlerPortableMap::openHandler( String strFilename, Bool bInput ) if( m_bIsInput ) { char line[101]; - while( fgets( line, 100, m_pFile ) && line[0] == '#' ); - sscanf( line,"P%d", &m_iMagicNumber ); - while( fgets( line, 100, m_pFile ) && line[0] == '#' ); - sscanf( line,"%u %u", &m_uiWidth, &m_uiHeight ); + while( fgets( line, 100, m_pFile ) && line[0] == '#' ) + ; + sscanf( line, "P%d", &m_iMagicNumber ); + while( fgets( line, 100, m_pFile ) && line[0] == '#' ) + ; + sscanf( line, "%u %u", &m_uiWidth, &m_uiHeight ); if( m_iMagicNumber == 1 || m_iMagicNumber == 4 ) { @@ -57,10 +58,11 @@ Bool StreamHandlerPortableMap::openHandler( String strFilename, Bool bInput ) } else { - while( fgets( line, 100, m_pFile ) && line[0] == '#' ); - sscanf( line,"%d", &m_iMaxValue ); - m_uiBitsPerPixel = log( m_iMaxValue + 1 )/log( 2 ); - m_iPixelFormat = m_iMagicNumber == 2 || m_iMagicNumber == 5 ? PlaYUVerFrame::GRAY : PlaYUVerFrame::RGB24; + while( fgets( line, 100, m_pFile ) && line[0] == '#' ) + ; + sscanf( line, "%d", &m_iMaxValue ); + m_uiBitsPerPixel = log( m_iMaxValue + 1 ) / log( 2 ); + m_iPixelFormat = m_iMagicNumber == 2 || m_iMagicNumber == 5 ? PlaYUVerFrame::GRAY : PlaYUVerFrame::RGB24; } } else @@ -103,7 +105,6 @@ Bool StreamHandlerPortableMap::configureBuffer( PlaYUVerFrame* pcFrame ) return getMem1D( &m_pStreamBuffer, pcFrame->getBytesPerFrame() ); } - UInt64 StreamHandlerPortableMap::calculateFrameNumber() { return 1; @@ -116,7 +117,7 @@ Bool StreamHandlerPortableMap::seek( UInt64 iFrameNum ) Bool StreamHandlerPortableMap::read( PlaYUVerFrame* pcFrame ) { - UInt64 processed_bytes = fread( m_pStreamBuffer, sizeof( Byte ), m_uiNBytesPerFrame, m_pFile ); + UInt64 processed_bytes = fread( m_pStreamBuffer, sizeof(Byte), m_uiNBytesPerFrame, m_pFile ); if( processed_bytes != m_uiNBytesPerFrame ) return false; pcFrame->frameFromBuffer( m_pStreamBuffer ); @@ -132,10 +133,9 @@ Bool StreamHandlerPortableMap::write( PlaYUVerFrame* pcFrame ) fprintf( m_pFile, "%d\n", m_iMaxValue ); } pcFrame->frameToBuffer( m_pStreamBuffer ); - UInt64 processed_bytes = fwrite( m_pStreamBuffer, sizeof( Byte ), m_uiNBytesPerFrame, m_pFile ); + UInt64 processed_bytes = fwrite( m_pStreamBuffer, sizeof(Byte), m_uiNBytesPerFrame, m_pFile ); if( processed_bytes != m_uiNBytesPerFrame ) return false; return true; } - diff --git a/lib/StreamHandlerPortableMap.h b/lib/StreamHandlerPortableMap.h index aedd582..f762f4c 100644 --- a/lib/StreamHandlerPortableMap.h +++ b/lib/StreamHandlerPortableMap.h @@ -32,16 +32,19 @@ #include "PlaYUVerStream.h" #include "PlaYUVerStreamHandlerIf.h" - class PlaYUVerFrame; class StreamHandlerPortableMap: public PlaYUVerStreamHandlerIf { - REGISTER_STREAM_HANDLER( StreamHandlerPortableMap ) +REGISTER_STREAM_HANDLER( StreamHandlerPortableMap ) public: - StreamHandlerPortableMap() {} - ~StreamHandlerPortableMap() {} + StreamHandlerPortableMap() + { + } + ~StreamHandlerPortableMap() + { + } Bool openHandler( String strFilename, Bool bInput ); Void closeHandler(); diff --git a/lib/StreamHandlerRaw.cpp b/lib/StreamHandlerRaw.cpp index 8af6ce8..e84d3d6 100644 --- a/lib/StreamHandlerRaw.cpp +++ b/lib/StreamHandlerRaw.cpp @@ -28,7 +28,6 @@ #include "PlaYUVerFramePixelFormats.h" #include "LibMemory.h" - Bool StreamHandlerRaw::openHandler( String strFilename, Bool bInput ) { m_bIsInput = bInput; @@ -54,7 +53,6 @@ Bool StreamHandlerRaw::configureBuffer( PlaYUVerFrame* pcFrame ) return getMem1D( &m_pStreamBuffer, pcFrame->getBytesPerFrame() ); } - UInt64 StreamHandlerRaw::calculateFrameNumber() { if( !m_pFile || m_uiNBytesPerFrame == 0 ) @@ -77,7 +75,7 @@ Bool StreamHandlerRaw::seek( UInt64 iFrameNum ) Bool StreamHandlerRaw::read( PlaYUVerFrame* pcFrame ) { - UInt64 processed_bytes = fread( m_pStreamBuffer, sizeof( Byte ), m_uiNBytesPerFrame, m_pFile ); + UInt64 processed_bytes = fread( m_pStreamBuffer, sizeof(Byte), m_uiNBytesPerFrame, m_pFile ); if( processed_bytes != m_uiNBytesPerFrame ) return false; pcFrame->frameFromBuffer( m_pStreamBuffer ); @@ -87,10 +85,9 @@ Bool StreamHandlerRaw::read( PlaYUVerFrame* pcFrame ) Bool StreamHandlerRaw::write( PlaYUVerFrame* pcFrame ) { pcFrame->frameToBuffer( m_pStreamBuffer ); - UInt64 processed_bytes = fwrite( m_pStreamBuffer, sizeof( Byte ), m_uiNBytesPerFrame, m_pFile ); + UInt64 processed_bytes = fwrite( m_pStreamBuffer, sizeof(Byte), m_uiNBytesPerFrame, m_pFile ); if( processed_bytes != m_uiNBytesPerFrame ) return false; return true; } - diff --git a/lib/StreamHandlerRaw.h b/lib/StreamHandlerRaw.h index fe451bb..f51e1d4 100644 --- a/lib/StreamHandlerRaw.h +++ b/lib/StreamHandlerRaw.h @@ -28,21 +28,24 @@ #include "PlaYUVerDefs.h" #include "PlaYUVerStreamHandlerIf.h" - /** * \class StreamHandlerRaw * \brief Class to handle raw video format */ class StreamHandlerRaw: public PlaYUVerStreamHandlerIf { - REGISTER_STREAM_HANDLER( StreamHandlerRaw ) +REGISTER_STREAM_HANDLER( StreamHandlerRaw ) private: FILE* m_pFile; /**< The input file pointer >*/ public: - StreamHandlerRaw() {} - ~StreamHandlerRaw() {} + StreamHandlerRaw() + { + } + ~StreamHandlerRaw() + { + } Bool openHandler( String strFilename, Bool bInput ); Void closeHandler(); @@ -52,7 +55,6 @@ public: Bool read( PlaYUVerFrame* pcFrame ); Bool write( PlaYUVerFrame* pcFrame ); - }; #endif // __STREAMHANDLERRAW_H__ diff --git a/modules/AbsoluteFrameDifference.cpp b/modules/AbsoluteFrameDifference.cpp index 0792e57..985c7c0 100644 --- a/modules/AbsoluteFrameDifference.cpp +++ b/modules/AbsoluteFrameDifference.cpp @@ -25,7 +25,6 @@ #include "AbsoluteFrameDifference.h" #include - AbsoluteFrameDifference::AbsoluteFrameDifference() { /* Module Definition */ @@ -48,7 +47,7 @@ Bool AbsoluteFrameDifference::create( std::vector apcFrameList ) _BASIC_MODULE_API_2_CHECK_ for( UInt i = 1; i < apcFrameList.size(); i++ ) - if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS) ) + if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE | PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) ) return false; m_pcFrameDifference = new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY ); @@ -81,5 +80,3 @@ Void AbsoluteFrameDifference::destroy() m_pcFrameDifference = NULL; } - - diff --git a/modules/AbsoluteFrameDifference.h b/modules/AbsoluteFrameDifference.h index 5f2aa34..e4956e4 100644 --- a/modules/AbsoluteFrameDifference.h +++ b/modules/AbsoluteFrameDifference.h @@ -29,7 +29,6 @@ #include - class AbsoluteFrameDifference: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( AbsoluteFrameDifference ) diff --git a/modules/DisparityStereoBM.cpp b/modules/DisparityStereoBM.cpp index 2ac0e0a..506eb61 100644 --- a/modules/DisparityStereoBM.cpp +++ b/modules/DisparityStereoBM.cpp @@ -26,7 +26,6 @@ #include "DisparityStereoBM.h" - DisparityStereoBM::DisparityStereoBM() { /* Module Definition */ @@ -111,5 +110,3 @@ Void DisparityStereoBM::destroy() m_pcDisparityFrame = NULL; } - - diff --git a/modules/DisparityStereoBM.h b/modules/DisparityStereoBM.h index 247d5d8..7f851b4 100644 --- a/modules/DisparityStereoBM.h +++ b/modules/DisparityStereoBM.h @@ -31,7 +31,6 @@ #include - class DisparityStereoBM: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( DisparityStereoBM ) @@ -40,11 +39,11 @@ private: PlaYUVerFrame* m_pcDisparityFrame; Int m_uiNumberOfDisparities; UInt m_uiBlockSize; -#if( CV_MAJOR_VERSION == 2) + #if( CV_MAJOR_VERSION == 2) cv::StereoBM m_cStereoBM; #else cv::Ptr m_cStereoBM; -#endif + #endif public: DisparityStereoBM(); diff --git a/modules/DisparityStereoSGBM.cpp b/modules/DisparityStereoSGBM.cpp index c6065fd..ae2b562 100644 --- a/modules/DisparityStereoSGBM.cpp +++ b/modules/DisparityStereoSGBM.cpp @@ -26,7 +26,6 @@ #include "DisparityStereoSGBM.h" - DisparityStereoSGBM::DisparityStereoSGBM() { /* Module Definition */ @@ -114,5 +113,3 @@ Void DisparityStereoSGBM::destroy() m_pcDisparityFrame = NULL; } - - diff --git a/modules/DisparityStereoSGBM.h b/modules/DisparityStereoSGBM.h index 074b816..394208a 100644 --- a/modules/DisparityStereoSGBM.h +++ b/modules/DisparityStereoSGBM.h @@ -43,7 +43,6 @@ #include - class DisparityStereoSGBM: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( DisparityStereoSGBM ) @@ -53,9 +52,9 @@ private: Bool m_bUseHH; Int m_uiNumberOfDisparities; UInt m_uiBlockSize; -#if( CV_MAJOR_VERSION == 3) + #if( CV_MAJOR_VERSION == 3) cv::Ptr m_cStereoMatch; -#else + #else cv::StereoSGBM m_cStereoMatch; #endif diff --git a/modules/DisparityStereoVar.cpp b/modules/DisparityStereoVar.cpp index b1e8764..a6052d5 100644 --- a/modules/DisparityStereoVar.cpp +++ b/modules/DisparityStereoVar.cpp @@ -26,7 +26,6 @@ #include "DisparityStereoVar.h" - DisparityStereoVar::DisparityStereoVar() { /* Module Definition */ @@ -83,5 +82,3 @@ Void DisparityStereoVar::destroy() m_pcDisparityFrame = NULL; } - - diff --git a/modules/DisparityStereoVar.h b/modules/DisparityStereoVar.h index 66c1f85..68cb490 100644 --- a/modules/DisparityStereoVar.h +++ b/modules/DisparityStereoVar.h @@ -31,15 +31,14 @@ #include - class DisparityStereoVar: public PlaYUVerModuleIf { - REGISTER_CLASS_FACTORY( DisparityStereoVar ) +REGISTER_CLASS_FACTORY( DisparityStereoVar ) private: PlaYUVerFrame* m_pcDisparityFrame; cv::StereoVar m_cStereoVar; -public: + public: DisparityStereoVar(); virtual ~DisparityStereoVar() { diff --git a/modules/EightBitsSampling.cpp b/modules/EightBitsSampling.cpp index e77635e..938f81c 100644 --- a/modules/EightBitsSampling.cpp +++ b/modules/EightBitsSampling.cpp @@ -24,7 +24,6 @@ #include "EightBitsSampling.h" - EightBitsSampling::EightBitsSampling() { /* Module Definition */ @@ -80,5 +79,3 @@ Void EightBitsSampling::destroy() m_pcSubSampledFrame = NULL; } - - diff --git a/modules/EightBitsSampling.h b/modules/EightBitsSampling.h index d643436..8adb69c 100644 --- a/modules/EightBitsSampling.h +++ b/modules/EightBitsSampling.h @@ -27,14 +27,13 @@ #include "lib/PlaYUVerModuleIf.h" - class EightBitsSampling: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( EightBitsSampling ) private: PlaYUVerFrame* m_pcSubSampledFrame; -public: + public: EightBitsSampling(); virtual ~EightBitsSampling() { diff --git a/modules/FilterComponent.cpp b/modules/FilterComponent.cpp index 0e88faa..05dc32e 100644 --- a/modules/FilterComponent.cpp +++ b/modules/FilterComponent.cpp @@ -26,7 +26,6 @@ #include #include "FilterComponent.h" - FilterComponentModule::FilterComponentModule() { m_pcFilteredFrame = NULL; @@ -130,5 +129,3 @@ PlaYUVerFrame* FilterComponentChromaV::process( std::vector apcF return filterComponent( apcFrameList[0], CHROMA_V ); } - - diff --git a/modules/FilterComponent.h b/modules/FilterComponent.h index 3f623b9..f9b86a6 100644 --- a/modules/FilterComponent.h +++ b/modules/FilterComponent.h @@ -27,12 +27,11 @@ #include "lib/PlaYUVerModuleIf.h" - class FilterComponentModule: public PlaYUVerModuleIf { private: PlaYUVerFrame* m_pcFilteredFrame; -public: + public: FilterComponentModule(); virtual ~FilterComponentModule() { @@ -48,7 +47,7 @@ public: class FilterComponentLuma: public FilterComponentModule { REGISTER_CLASS_FACTORY( FilterComponentLuma ) -public: + public: FilterComponentLuma(); virtual ~FilterComponentLuma() { @@ -60,7 +59,7 @@ public: class FilterComponentChromaU: public FilterComponentModule { REGISTER_CLASS_FACTORY( FilterComponentChromaU ) -public: + public: FilterComponentChromaU(); virtual ~FilterComponentChromaU() { @@ -72,7 +71,7 @@ public: class FilterComponentChromaV: public FilterComponentModule { REGISTER_CLASS_FACTORY( FilterComponentChromaV ) -public: + public: FilterComponentChromaV(); virtual ~FilterComponentChromaV() { diff --git a/modules/FrameBinarization.cpp b/modules/FrameBinarization.cpp index 5afacac..5ea8d58 100644 --- a/modules/FrameBinarization.cpp +++ b/modules/FrameBinarization.cpp @@ -24,7 +24,6 @@ #include "FrameBinarization.h" - FrameBinarization::FrameBinarization() { /* Module Definition */ @@ -67,5 +66,3 @@ Void FrameBinarization::destroy() m_pcBinFrame = NULL; } - - diff --git a/modules/FrameBinarization.h b/modules/FrameBinarization.h index 3d472ef..4b53a0a 100644 --- a/modules/FrameBinarization.h +++ b/modules/FrameBinarization.h @@ -27,7 +27,6 @@ #include "lib/PlaYUVerModuleIf.h" - class FrameBinarization: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( FrameBinarization ) @@ -35,7 +34,7 @@ REGISTER_CLASS_FACTORY( FrameBinarization ) private: PlaYUVerFrame* m_pcBinFrame; UInt m_uiThreshold; -public: + public: FrameBinarization(); virtual ~FrameBinarization() { diff --git a/modules/FrameCrop.cpp b/modules/FrameCrop.cpp index 2c57a64..82f8082 100644 --- a/modules/FrameCrop.cpp +++ b/modules/FrameCrop.cpp @@ -24,7 +24,6 @@ #include "FrameCrop.h" - FrameCrop::FrameCrop() { /* Module Definition */ @@ -75,5 +74,3 @@ Void FrameCrop::destroy() m_pcCropedFrame = NULL; } - - diff --git a/modules/FrameCrop.h b/modules/FrameCrop.h index df8bf8b..f0d859a 100644 --- a/modules/FrameCrop.h +++ b/modules/FrameCrop.h @@ -27,7 +27,6 @@ #include "lib/PlaYUVerModuleIf.h" - class FrameCrop: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( FrameCrop ) @@ -38,7 +37,7 @@ private: UInt m_uiYPosition; Int m_iXSize; Int m_iYSize; -public: + public: FrameCrop(); virtual ~FrameCrop() { diff --git a/modules/FrameDifference.cpp b/modules/FrameDifference.cpp index dd4deaa..bbfefde 100644 --- a/modules/FrameDifference.cpp +++ b/modules/FrameDifference.cpp @@ -25,7 +25,6 @@ #include "FrameDifference.h" #include - FrameDifference::FrameDifference() { /* Module Definition */ @@ -103,5 +102,3 @@ Void FrameDifference::destroy() m_pcFrameDifference = NULL; } - - diff --git a/modules/FrameDifference.h b/modules/FrameDifference.h index cb497ca..da43c63 100644 --- a/modules/FrameDifference.h +++ b/modules/FrameDifference.h @@ -29,7 +29,6 @@ #include - class FrameDifference: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( FrameDifference ) diff --git a/modules/FrameMask.cpp b/modules/FrameMask.cpp index d29cd7b..f5f6f7e 100644 --- a/modules/FrameMask.cpp +++ b/modules/FrameMask.cpp @@ -26,7 +26,6 @@ #include class be; - FrameMask::FrameMask() { /* Module Definition */ @@ -53,13 +52,13 @@ Bool FrameMask::create( std::vector apcFrameList ) for( UInt i = 1; i < apcFrameList.size(); i++ ) { if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE_IGNORE_GRAY | - PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) ) + PlaYUVerFrame::MATCH_RESOLUTION | PlaYUVerFrame::MATCH_BITS ) ) { return false; } } - m_iWeight = m_iWeight > 100 || m_iWeight < 0 ? 5 : m_iWeight; + m_iWeight = m_iWeight > 100 || m_iWeight < 0 ? 5 : m_iWeight; m_iWeight = m_iWeight > 10 ? m_iWeight / 10 : m_iWeight; Int iPelFmt = 0; @@ -109,7 +108,7 @@ PlaYUVerFrame* FrameMask::process( std::vector apcFrameList ) Bool FrameMask::keyPressed( enum Module_Key_Supported value ) { - if( value == MODULE_KEY_UP && m_iWeight < 10) + if( value == MODULE_KEY_UP && m_iWeight < 10 ) { m_iWeight += 1; return true; @@ -122,7 +121,6 @@ Bool FrameMask::keyPressed( enum Module_Key_Supported value ) return false; } - Void FrameMask::destroy() { if( m_pcFrameProcessed ) @@ -132,5 +130,3 @@ Void FrameMask::destroy() m_pcFrameProcessed = NULL; } - - diff --git a/modules/FrameMask.h b/modules/FrameMask.h index 1a2cd56..09d0430 100644 --- a/modules/FrameMask.h +++ b/modules/FrameMask.h @@ -29,10 +29,9 @@ #include - class FrameMask: public PlaYUVerModuleIf { - REGISTER_CLASS_FACTORY( FrameMask ) +REGISTER_CLASS_FACTORY( FrameMask ) private: Int m_iWeight; @@ -52,6 +51,3 @@ public: #endif // __FRAMEMASK_H__ - - - diff --git a/modules/FrameShift.cpp b/modules/FrameShift.cpp index 257d599..04020b6 100644 --- a/modules/FrameShift.cpp +++ b/modules/FrameShift.cpp @@ -24,7 +24,6 @@ #include "FrameShift.h" - FrameShift::FrameShift() { /* Module Definition */ @@ -93,7 +92,6 @@ PlaYUVerFrame* FrameShift::process( std::vector apcFrameList ) yStartIn = iShiftVerChroma >= 0 ? 0 : -iShiftVerChroma; yEndOut = iShiftVerChroma >= 0 ? m_pcProcessedFrame->getChromaHeight() : m_pcProcessedFrame->getChromaHeight() + iShiftVerChroma; - for( UInt c = 1; c < m_pcProcessedFrame->getNumberChannels(); c++ ) { for( UInt y = yStartOut, yIn = yStartIn; y < yEndOut; y++, yIn++ ) @@ -144,5 +142,3 @@ Void FrameShift::destroy() m_pcProcessedFrame = NULL; } - - diff --git a/modules/FrameShift.h b/modules/FrameShift.h index 4e79c19..758c972 100644 --- a/modules/FrameShift.h +++ b/modules/FrameShift.h @@ -27,7 +27,6 @@ #include "lib/PlaYUVerModuleIf.h" - class FrameShift: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( FrameShift ) @@ -36,12 +35,12 @@ private: PlaYUVerFrame* m_pcProcessedFrame; Int m_iShiftHor; Int m_iShiftVer; -public: + public: FrameShift(); virtual ~FrameShift() { } - Bool create( std::vector apcFrameList); + Bool create( std::vector apcFrameList ); PlaYUVerFrame* process( std::vector apcFrameList ); Bool keyPressed( enum Module_Key_Supported value ); Void destroy(); diff --git a/modules/LumaAverage.h b/modules/LumaAverage.h index 6b5889a..4b51482 100644 --- a/modules/LumaAverage.h +++ b/modules/LumaAverage.h @@ -22,16 +22,14 @@ * \brief Luma frame average */ - #ifndef __LUMAAVERAGE_H__ #define __LUMAAVERAGE_H__ #include "lib/PlaYUVerModuleIf.h" - class LumaAverage: public PlaYUVerModuleIf { - REGISTER_CLASS_FACTORY( LumaAverage ) +REGISTER_CLASS_FACTORY( LumaAverage ) private: public: diff --git a/modules/OpticalFlowDualTVL1.cpp b/modules/OpticalFlowDualTVL1.cpp index d2a8508..26ec038 100644 --- a/modules/OpticalFlowDualTVL1.cpp +++ b/modules/OpticalFlowDualTVL1.cpp @@ -32,8 +32,6 @@ using cv::Ptr; using cv::Point; using cv::Point2f; - - OpticalFlowDualTVL1::OpticalFlowDualTVL1() { /* Module Definition */ @@ -79,7 +77,6 @@ PlaYUVerFrame* OpticalFlowDualTVL1::process( std::vector apcFram Mat_ flow; m_cTvl1->calc( cvMatPrev, cvMatAfter, flow ); - // determine motion range: Double maxrad = 1; @@ -94,17 +91,17 @@ PlaYUVerFrame* OpticalFlowDualTVL1::process( std::vector apcFram } } - Scalar vectorColor( 255,0,0,0 ); + Scalar vectorColor( 255, 0, 0, 0 ); for( int y = m_iStep / 2; y < flow.rows; y += m_iStep ) { for( int x = m_iStep / 2; x < flow.cols; x += m_iStep ) { - Point p = Point( x,y ); + Point p = Point( x, y ); Point2f u = flow( y, x ); Point ui( u.x, u.y ); if( isFlowCorrect( u ) ) - arrowedLine( cvMatAfter, p, p+ui, vectorColor ); + arrowedLine( cvMatAfter, p, p + ui, vectorColor ); } } @@ -119,5 +116,3 @@ Void OpticalFlowDualTVL1::destroy() m_pcOutputFrame = NULL; } - - diff --git a/modules/OpticalFlowDualTVL1.h b/modules/OpticalFlowDualTVL1.h index 5c77981..fa723a0 100644 --- a/modules/OpticalFlowDualTVL1.h +++ b/modules/OpticalFlowDualTVL1.h @@ -29,7 +29,6 @@ #include "lib/PlaYUVerModuleIf.h" - class OpticalFlowDualTVL1: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( OpticalFlowDualTVL1 ) diff --git a/modules/PlaYUVerModuleFactory.cpp b/modules/PlaYUVerModuleFactory.cpp index 668aa29..d80827d 100644 --- a/modules/PlaYUVerModuleFactory.cpp +++ b/modules/PlaYUVerModuleFactory.cpp @@ -31,7 +31,6 @@ #include "PlaYUVerModuleFactory.h" #include "ModulesListHeader.h" - PlaYUVerModuleFactory::PlaYUVerModuleFactory() { REGISTER_ALL_MODULES @@ -54,7 +53,7 @@ Bool PlaYUVerModuleFactory::RegisterDl( const char* dlName ) if( pHndl == NULL ) { std::cerr << dlerror() - << std::endl; + << std::endl; return false; } CreateModuleFn pfnCreate = ( CreateModuleFn )dlsym( pHndl, "Maker" ); @@ -83,4 +82,3 @@ PlaYUVerModuleIf *PlaYUVerModuleFactory::CreateModule( const char* moduleName ) return NULL; } - diff --git a/modules/PlaYUVerModuleFactory.h b/modules/PlaYUVerModuleFactory.h index 56bb0a1..83bbe94 100644 --- a/modules/PlaYUVerModuleFactory.h +++ b/modules/PlaYUVerModuleFactory.h @@ -29,7 +29,6 @@ #include #include "lib/PlaYUVerModuleIf.h" - #define REGISTER_MODULE(X) Register( "X", &(X::Create) ); typedef PlaYUVerModuleIf* (*CreateModuleFn)( void ); @@ -46,7 +45,7 @@ private: } PlaYUVerModuleFactoryMap m_FactoryMap; -public: + public: ~PlaYUVerModuleFactory(); static PlaYUVerModuleFactory *Get() diff --git a/modules/SetChromaHalfScale.cpp b/modules/SetChromaHalfScale.cpp index 3919a98..ae52b76 100644 --- a/modules/SetChromaHalfScale.cpp +++ b/modules/SetChromaHalfScale.cpp @@ -24,7 +24,6 @@ #include "SetChromaHalfScale.h" - SetChromaHalfScale::SetChromaHalfScale() { /* Module Definition */ @@ -69,5 +68,3 @@ Void SetChromaHalfScale::destroy() m_pcProcessedFrame = NULL; } - - diff --git a/modules/SetChromaHalfScale.h b/modules/SetChromaHalfScale.h index 1b0f69e..bcf16ea 100644 --- a/modules/SetChromaHalfScale.h +++ b/modules/SetChromaHalfScale.h @@ -27,14 +27,13 @@ #include "lib/PlaYUVerModuleIf.h" - class SetChromaHalfScale: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( SetChromaHalfScale ) private: PlaYUVerFrame* m_pcProcessedFrame; -public: + public: SetChromaHalfScale(); virtual ~SetChromaHalfScale() { diff --git a/modules/WeightedPSNR.cpp b/modules/WeightedPSNR.cpp index 84cb02d..5c75e9f 100644 --- a/modules/WeightedPSNR.cpp +++ b/modules/WeightedPSNR.cpp @@ -26,7 +26,6 @@ #include #include - WeightedPSNR::WeightedPSNR() { /* Module Definition */ @@ -103,7 +102,6 @@ Double measureWMSE( Int component, PlaYUVerFrame* Org, PlaYUVerFrame* Rec, PlaYU return ssd / Double( count ); } - Double WeightedPSNR::measure( std::vector apcFrameList ) { Double dPSNR = 100; @@ -119,5 +117,3 @@ Void WeightedPSNR::destroy() } - - diff --git a/modules/WeightedPSNR.h b/modules/WeightedPSNR.h index dd91602..c9743ca 100644 --- a/modules/WeightedPSNR.h +++ b/modules/WeightedPSNR.h @@ -29,7 +29,6 @@ #include - class WeightedPSNR: public PlaYUVerModuleIf { REGISTER_CLASS_FACTORY( WeightedPSNR ) diff --git a/tools/PlaYUVerTools.cpp b/tools/PlaYUVerTools.cpp index 5c2c1a1..35703d9 100644 --- a/tools/PlaYUVerTools.cpp +++ b/tools/PlaYUVerTools.cpp @@ -28,7 +28,6 @@ #include "lib/PlaYUVerModuleIf.h" #include "modules/PlaYUVerModuleFactory.h" - PlaYUVerTools::PlaYUVerTools() { m_bVerbose = true; @@ -54,7 +53,6 @@ PlaYUVerTools::~PlaYUVerTools() #define GET_PARAM( X , i ) X[X.size() > i ? i : X.size() - 1] - Int PlaYUVerTools::openInputs() { /** @@ -86,7 +84,7 @@ Int PlaYUVerTools::openInputs() } if( Opts().hasOpt( "endianness" ) ) { - if( GET_PARAM( m_strEndianness, i ) == "big" ) + if( GET_PARAM( m_strEndianness, i )== "big" ) { uiEndianness = 0; } @@ -279,7 +277,8 @@ Int PlaYUVerTools::Open( Int argc, Char *argv[] ) pcModFrame = applyFrameModule(); } PlaYUVerStream* pcModStream = new PlaYUVerStream; - if( !pcModStream->open( outputFileNames[0], pcModFrame->getWidth(), pcModFrame->getHeight(), pcModFrame->getPelFormat(), pcModFrame->getBitsPel(), pcModFrame->getEndianness(), 1, false ) ) + if( !pcModStream->open( outputFileNames[0], pcModFrame->getWidth(), pcModFrame->getHeight(), pcModFrame->getPelFormat(), pcModFrame->getBitsPel(), + pcModFrame->getEndianness(), 1, false ) ) { delete pcModStream; pcModStream = NULL; @@ -500,4 +499,3 @@ Int PlaYUVerTools::ModuleOperation() return 0; } - diff --git a/tools/PlaYUVerTools.h b/tools/PlaYUVerTools.h index 1b8634f..d636f31 100644 --- a/tools/PlaYUVerTools.h +++ b/tools/PlaYUVerTools.h @@ -31,7 +31,6 @@ #include "lib/PlaYUVerStream.h" #include "PlaYUVerToolsCmdParser.h" - class PlaYUVerModuleIf; #define MAX_NUMBER_INPUTS 10 @@ -65,7 +64,7 @@ private: Int openInputs(); - typedef Int (PlaYUVerTools::*FpProcess) (); + typedef Int (PlaYUVerTools::*FpProcess)(); FpProcess m_fpProcess; Int64 m_iFrameNum; diff --git a/tools/PlaYUVerToolsCmdParser.cpp b/tools/PlaYUVerToolsCmdParser.cpp index 012f492..83bd08a 100644 --- a/tools/PlaYUVerToolsCmdParser.cpp +++ b/tools/PlaYUVerToolsCmdParser.cpp @@ -30,7 +30,6 @@ #include "lib/PlaYUVerModuleIf.h" #include "modules/PlaYUVerModuleFactory.h" - PlaYUVerToolsCmdParser::PlaYUVerToolsCmdParser() { m_uiLogLevel = 0; @@ -83,12 +82,12 @@ Int PlaYUVerToolsCmdParser::parseToolsArgs( Int argc, Char *argv[] ) m_uiLogLevel = LOG_RESULT; } - if( m_cOptions.hasOpt("module") && m_cOptions.hasOpt("help") ) + if( m_cOptions.hasOpt( "module" ) && m_cOptions.hasOpt( "help" ) ) { listModuleHelp(); iRet = 1; } - else if( m_cOptions.hasOpt("help") ) + else if( m_cOptions.hasOpt( "help" ) ) { printf( "Usage: %s modules/quality/save [options] -input=input_file [--output=output_file]\n", argv[0] ); m_cOptions.doHelp( std::cout ); @@ -119,4 +118,3 @@ Void PlaYUVerToolsCmdParser::listModuleHelp() } } - diff --git a/tools/PlaYUVerToolsCmdParser.h b/tools/PlaYUVerToolsCmdParser.h index 6aa4e12..e5fb046 100644 --- a/tools/PlaYUVerToolsCmdParser.h +++ b/tools/PlaYUVerToolsCmdParser.h @@ -29,7 +29,6 @@ #include "lib/PlaYUVerDefs.h" #include "lib/PlaYUVerOptions.h" - class PlaYUVerStream; class PlaYUVerToolsCmdParser