From 11bf3f6bfdd3089c4f40e30238cd38bcccb0137c Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 13 Feb 2021 03:12:28 +0000 Subject: [PATCH] Format code --- app/CalypAppModuleIf.cpp | 4 +- app/CalypAppModuleIf.h | 10 ++-- app/GridManager.cpp | 6 +- app/GridManager.h | 1 + app/MainWindow.cpp | 18 +++--- app/MdiSubWindow.cpp | 4 +- app/MdiSubWindow.h | 1 + app/ModulesHandle.h | 7 +-- app/PlotSubWindow.h | 4 +- app/QualityHandle.cpp | 6 +- app/QualityHandle.h | 1 + app/SubWindowAbstract.cpp | 4 +- app/SubWindowAbstract.h | 1 + app/SubWindowHandle.cpp | 8 +-- app/SubWindowHandle.h | 4 +- app/VideoHandle.cpp | 16 ++--- app/VideoHandle.h | 6 +- app/VideoSubWindow.h | 1 + app/ViewArea.cpp | 17 ++---- app/ViewArea.h | 10 ++-- app/dialog/AboutDialog.cpp | 4 +- app/dialog/ConfigureFormatDialog.cpp | 4 +- app/dialog/ModulesHandleOptDialog.cpp | 4 +- app/dialog/ModulesHandleOptDialog.h | 6 +- app/dialog/ProgressBar.h | 4 +- app/dialog/SeekStreamDialog.cpp | 4 +- app/dialog/SeekStreamDialog.h | 6 +- app/dialog/SubWindowSelectorDialog.cpp | 6 +- app/dialog/SubWindowSelectorDialog.h | 7 +-- app/docks/FramePropertiesDock.h | 4 +- app/docks/ModuleHandleDock.cpp | 6 +- app/docks/ModuleHandleDock.h | 6 +- app/docks/QualityMeasurementSidebar.cpp | 4 +- app/docks/QualityMeasurementSidebar.h | 4 +- app/widgets/FrameNumberWidget.h | 4 +- app/widgets/HistogramWidget.h | 6 +- config.h.in | 8 +-- .../AbsoluteFrameDifferenceExample.cpp | 1 + .../modules/AbsoluteFrameDifferenceExample.h | 4 +- lib/CalypDefs.h | 2 +- lib/CalypFrame.cpp | 15 ++--- lib/CalypFrame.h | 1 - lib/CalypModuleIf.h | 2 +- lib/CalypPixel.cpp | 10 ++-- lib/PixelFormats.cpp | 60 +++++++++---------- lib/PixelFormats.h | 4 +- lib/StreamHandlerLibav.cpp | 6 +- lib/StreamHandlerLibav.h | 1 + lib/StreamHandlerOpenCV.cpp | 6 +- lib/StreamHandlerPortableMap.cpp | 6 +- lib/StreamHandlerRaw.cpp | 4 +- modules/AbsoluteFrameDifference.cpp | 3 +- modules/CalypModulesFactory.cpp | 6 +- modules/FrameDifference.cpp | 10 ++-- modules/FrameResampling.cpp | 6 +- modules/FrameResampling.h | 3 +- modules/HEVCIntraPrediction.cpp | 10 ++-- modules/MeasureOpticalFlowDualTVL1.cpp | 6 +- modules/OpticalFlow.cpp | 6 +- modules/OptimiseDisplay.cpp | 4 +- modules/ThreeSixtyFaceConcatenation.cpp | 2 +- modules/ThreeSixtyFaceExtraction.cpp | 2 +- tools/CalypTools.cpp | 57 ++++++++++-------- tools/CalypTools.h | 3 +- 64 files changed, 233 insertions(+), 223 deletions(-) diff --git a/app/CalypAppModuleIf.cpp b/app/CalypAppModuleIf.cpp index 7af6e18..c2fcab9 100644 --- a/app/CalypAppModuleIf.cpp +++ b/app/CalypAppModuleIf.cpp @@ -24,12 +24,12 @@ #include "CalypAppModuleIf.h" -#include "VideoSubWindow.h" - #include #include #include +#include "VideoSubWindow.h" + CalypAppModuleIf::CalypAppModuleIf( QObject* parent, QAction* action, CalypModuleIf* module ) : m_bIsRunning( false ) , m_pcModuleAction( action ) diff --git a/app/CalypAppModuleIf.h b/app/CalypAppModuleIf.h index 1ee4e57..689fc11 100644 --- a/app/CalypAppModuleIf.h +++ b/app/CalypAppModuleIf.h @@ -25,6 +25,11 @@ #ifndef __CALYPAPPMODULESIF_H__ #define __CALYPAPPMODULESIF_H__ +#include +#include +#include +#include + #include "CommonDefs.h" #include "ModuleHandleDock.h" #include "config.h" @@ -32,11 +37,6 @@ #include "lib/CalypModuleIf.h" #include "lib/CalypStream.h" -#include -#include -#include -#include - class QAction; class QDockWidget; diff --git a/app/GridManager.cpp b/app/GridManager.cpp index 6081bf8..911ab66 100644 --- a/app/GridManager.cpp +++ b/app/GridManager.cpp @@ -71,8 +71,7 @@ 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 ) @@ -99,8 +98,7 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter } break; } - case Dashed: - { + case Dashed: { // Change pen to the dashed line mainPen.setStyle( Qt::DashLine ); } diff --git a/app/GridManager.h b/app/GridManager.h index b8b3a35..3131fbf 100644 --- a/app/GridManager.h +++ b/app/GridManager.h @@ -29,6 +29,7 @@ #include #include #include + #include "CommonDefs.h" #include "config.h" diff --git a/app/MainWindow.cpp b/app/MainWindow.cpp index 7a77109..feb96e6 100644 --- a/app/MainWindow.cpp +++ b/app/MainWindow.cpp @@ -25,6 +25,15 @@ #include "MainWindow.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "AboutDialog.h" #include "ModulesHandle.h" #include "QualityHandle.h" @@ -34,15 +43,6 @@ #include "VideoHandle.h" #include "VideoSubWindow.h" #include "lib/CalypOptions.h" - -#include -#include -#include -#include -#include -#include -#include -#include #ifdef USE_FERVOR #include "fvupdater.h" #endif diff --git a/app/MdiSubWindow.cpp b/app/MdiSubWindow.cpp index 4482e06..af683b7 100644 --- a/app/MdiSubWindow.cpp +++ b/app/MdiSubWindow.cpp @@ -24,10 +24,10 @@ #include "MdiSubWindow.h" -#include "SubWindowAbstract.h" - #include +#include "SubWindowAbstract.h" + MdiSubWindow::MdiSubWindow( QWidget* parent ) : QMdiSubWindow( parent ) { diff --git a/app/MdiSubWindow.h b/app/MdiSubWindow.h index a9d258f..3a2e91d 100644 --- a/app/MdiSubWindow.h +++ b/app/MdiSubWindow.h @@ -26,6 +26,7 @@ #define __MDISUBWINDOW_H_ #include + #include "CommonDefs.h" #include "config.h" diff --git a/app/ModulesHandle.h b/app/ModulesHandle.h index 3c08c5d..58d0620 100644 --- a/app/ModulesHandle.h +++ b/app/ModulesHandle.h @@ -24,15 +24,14 @@ #ifndef __MODULESHANDLE_H__ #define __MODULESHANDLE_H__ -#include "config.h" - +#include +#include #include #include -#include -#include #include "CalypAppModuleIf.h" #include "CommonDefs.h" +#include "config.h" #include "lib/CalypFrame.h" class VideoHandle; diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index beb141e..212f442 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -25,12 +25,12 @@ #ifndef __PLOTWINDOWHANDLE_H__ #define __PLOTWINDOWHANDLE_H__ +#include + #include "CommonDefs.h" #include "SubWindowAbstract.h" #include "config.h" -#include - class QCustomPlot; class PlotSubWindow : public SubWindowAbstract diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index f54b29c..637fe18 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -24,16 +24,16 @@ #include "QualityHandle.h" +#include + #include "PlotSubWindow.h" #include "ProgressBar.h" +#include "QtConcurrent/qtconcurrentrun.h" #include "SubWindowHandle.h" #include "SubWindowSelectorDialog.h" #include "VideoSubWindow.h" #include "lib/LibMemory.h" -#include -#include "QtConcurrent/qtconcurrentrun.h" - QualityHandle::QualityHandle( QWidget* parent, SubWindowHandle* windowManager ) : m_pcParet( parent ), m_pcMainWindowManager( windowManager ) { diff --git a/app/QualityHandle.h b/app/QualityHandle.h index da18d22..d1627d3 100644 --- a/app/QualityHandle.h +++ b/app/QualityHandle.h @@ -27,6 +27,7 @@ #include #include + #include "CommonDefs.h" #include "QFuture" #include "QualityMeasurementSidebar.h" diff --git a/app/SubWindowAbstract.cpp b/app/SubWindowAbstract.cpp index c6017d1..318b830 100644 --- a/app/SubWindowAbstract.cpp +++ b/app/SubWindowAbstract.cpp @@ -24,14 +24,14 @@ #include "SubWindowAbstract.h" -#include "MdiSubWindow.h" - #include #include #include #include #include +#include "MdiSubWindow.h" + SubWindowAbstract::SubWindowAbstract( QWidget* parent, unsigned int category ) : QWidget( parent ), m_cSubWindow( NULL ) { diff --git a/app/SubWindowAbstract.h b/app/SubWindowAbstract.h index 0020a72..b080672 100644 --- a/app/SubWindowAbstract.h +++ b/app/SubWindowAbstract.h @@ -41,6 +41,7 @@ #include #include #include + #include "CommonDefs.h" #include "config.h" diff --git a/app/SubWindowHandle.cpp b/app/SubWindowHandle.cpp index e852e05..dcf9f2b 100644 --- a/app/SubWindowHandle.cpp +++ b/app/SubWindowHandle.cpp @@ -25,10 +25,6 @@ #include "SubWindowHandle.h" -#include "MainWindow.h" -#include "MdiSubWindow.h" -#include "SubWindowAbstract.h" - #include #include #include @@ -41,6 +37,10 @@ #include #include +#include "MainWindow.h" +#include "MdiSubWindow.h" +#include "SubWindowAbstract.h" + class MdiArea : public QMdiArea { public: diff --git a/app/SubWindowHandle.h b/app/SubWindowHandle.h index d84db3e..79afefb 100644 --- a/app/SubWindowHandle.h +++ b/app/SubWindowHandle.h @@ -25,12 +25,12 @@ #ifndef __SUBWINDOWHANDLE_H__ #define __SUBWINDOWHANDLE_H__ -#include "CommonDefs.h" - #include #include #include +#include "CommonDefs.h" + class QAction; class QActionGroup; class QHBoxLayout; diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index 3446c4d..555578c 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -24,14 +24,6 @@ #include "VideoHandle.h" -#include "FrameNumberWidget.h" -#include "FramePropertiesDock.h" -#include "MainWindow.h" -#include "SeekStreamDialog.h" -#include "SubWindowHandle.h" -#include "SubWindowSelectorDialog.h" -#include "VideoSubWindow.h" - #include #include #include @@ -39,6 +31,14 @@ #include #include #include + +#include "FrameNumberWidget.h" +#include "FramePropertiesDock.h" +#include "MainWindow.h" +#include "SeekStreamDialog.h" +#include "SubWindowHandle.h" +#include "SubWindowSelectorDialog.h" +#include "VideoSubWindow.h" #if( _CONTROL_PLAYING_TIME_ == 1 ) #include #endif diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 1a2f3d0..6850265 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -25,15 +25,15 @@ #ifndef __VIDEOHANDLE_H__ #define __VIDEOHANDLE_H__ -#include "CommonDefs.h" -#include "config.h" - #include #include #include #include #include +#include "CommonDefs.h" +#include "config.h" + //#define _CONTROL_PLAYING_TIME_ 1 class QToolBar; diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 59019c4..32cafc2 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -30,6 +30,7 @@ #include #include #include + #include "CommonDefs.h" #include "SubWindowAbstract.h" #include "ViewArea.h" diff --git a/app/ViewArea.cpp b/app/ViewArea.cpp index 99e383c..b3c5991 100644 --- a/app/ViewArea.cpp +++ b/app/ViewArea.cpp @@ -25,8 +25,6 @@ #include "ViewArea.h" -#include "GridManager.h" - #include #include #include @@ -38,9 +36,10 @@ #include #include #include - #include +#include "GridManager.h" + static const QColor selectionColor = Qt::cyan; static const QColor imageMaskColor = Qt::green; static const QColor eraserColor = Qt::red; @@ -688,8 +687,7 @@ void ViewArea::paintEvent( QPaintEvent* event ) { switch( tool() ) { - case MaskTool: - { + case MaskTool: { if( m_maskColor.isValid() ) color = m_maskColor; else @@ -697,8 +695,7 @@ void ViewArea::paintEvent( QPaintEvent* event ) break; } - case EraserTool: - { + case EraserTool: { color = eraserColor; break; } @@ -1075,8 +1072,7 @@ void ViewArea::updateMask( const QRect& rect ) { switch( tool() ) { - case MaskTool: - { + case MaskTool: { // Add rect to the mask QPainter painter( &m_mask ); painter.setBrush( Qt::color1 ); @@ -1085,8 +1081,7 @@ void ViewArea::updateMask( const QRect& rect ) painter.end(); break; } - case EraserTool: - { + 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 33593f9..afefb11 100644 --- a/app/ViewArea.h +++ b/app/ViewArea.h @@ -26,17 +26,17 @@ #ifndef __VIEWAREA_H__ #define __VIEWAREA_H__ -#include "CommonDefs.h" -#include "GridManager.h" -#include "config.h" -#include "lib/CalypFrame.h" - #include #include #include #include #include +#include "CommonDefs.h" +#include "GridManager.h" +#include "config.h" +#include "lib/CalypFrame.h" + class CalypStream; /** diff --git a/app/dialog/AboutDialog.cpp b/app/dialog/AboutDialog.cpp index f48d8bd..d5fb80e 100644 --- a/app/dialog/AboutDialog.cpp +++ b/app/dialog/AboutDialog.cpp @@ -27,14 +27,14 @@ #include "AboutDialog.h" -#include "config.h" - #include #include #include #include #include +#include "config.h" + #define TAB_FROM_SPACES "   " AboutDialog::AboutDialog( QWidget* parent ) diff --git a/app/dialog/ConfigureFormatDialog.cpp b/app/dialog/ConfigureFormatDialog.cpp index ab6468f..6d0e67a 100644 --- a/app/dialog/ConfigureFormatDialog.cpp +++ b/app/dialog/ConfigureFormatDialog.cpp @@ -24,8 +24,6 @@ #include "ConfigureFormatDialog.h" -#include "lib/CalypFrame.h" - #include #include #include @@ -39,6 +37,8 @@ #include #include +#include "lib/CalypFrame.h" + #define MAX_SUPPORTED_RESOLUTION 99999 QDataStream& operator<<( QDataStream& out, const CalypStandardResolutionVector& array ) diff --git a/app/dialog/ModulesHandleOptDialog.cpp b/app/dialog/ModulesHandleOptDialog.cpp index f5d1012..d2b0f64 100644 --- a/app/dialog/ModulesHandleOptDialog.cpp +++ b/app/dialog/ModulesHandleOptDialog.cpp @@ -24,8 +24,6 @@ #include "ModulesHandleOptDialog.h" -#include "lib/CalypOptions.h" - #include #include #include @@ -34,6 +32,8 @@ #include #include +#include "lib/CalypOptions.h" + class QLineEdit; class OpionConfiguration : public QWidget diff --git a/app/dialog/ModulesHandleOptDialog.h b/app/dialog/ModulesHandleOptDialog.h index d946b33..13c44e0 100644 --- a/app/dialog/ModulesHandleOptDialog.h +++ b/app/dialog/ModulesHandleOptDialog.h @@ -25,13 +25,13 @@ #ifndef __MODULEHANDLEOPTDIALOG_H__ #define __MODULEHANDLEOPTDIALOG_H__ +#include +#include + #include "CalypAppModuleIf.h" #include "CommonDefs.h" #include "config.h" -#include -#include - class OpionConfiguration; /** diff --git a/app/dialog/ProgressBar.h b/app/dialog/ProgressBar.h index 4aa7c4a..bbd95ee 100644 --- a/app/dialog/ProgressBar.h +++ b/app/dialog/ProgressBar.h @@ -25,11 +25,11 @@ #ifndef __PROGRESSBAR_H__ #define __PROGRESSBAR_H__ -#include "CommonDefs.h" - #include #include +#include "CommonDefs.h" + class QProgressBar; class ProgressBar : public QWidget diff --git a/app/dialog/SeekStreamDialog.cpp b/app/dialog/SeekStreamDialog.cpp index 487da98..aae2e99 100644 --- a/app/dialog/SeekStreamDialog.cpp +++ b/app/dialog/SeekStreamDialog.cpp @@ -24,8 +24,6 @@ #include "SeekStreamDialog.h" -#include "lib/CalypStream.h" - #include #include #include @@ -33,6 +31,8 @@ #include #include +#include "lib/CalypStream.h" + SeekStreamDialog::SeekStreamDialog( CalypStream* pcCurrStream, QWidget* parent ) : QDialog( parent, Qt::Dialog | Qt::WindowTitleHint ), m_iSelectedFrameNum() { diff --git a/app/dialog/SeekStreamDialog.h b/app/dialog/SeekStreamDialog.h index d559a87..a0adc23 100644 --- a/app/dialog/SeekStreamDialog.h +++ b/app/dialog/SeekStreamDialog.h @@ -25,13 +25,13 @@ #ifndef __SEEKSTREAMDIALOG_H__ #define __SEEKSTREAMDIALOG_H__ +#include +#include + #include "CalypAppModuleIf.h" #include "CommonDefs.h" #include "config.h" -#include -#include - class QSpinBox; /** diff --git a/app/dialog/SubWindowSelectorDialog.cpp b/app/dialog/SubWindowSelectorDialog.cpp index d4766d3..6c0f721 100644 --- a/app/dialog/SubWindowSelectorDialog.cpp +++ b/app/dialog/SubWindowSelectorDialog.cpp @@ -24,12 +24,12 @@ #include "SubWindowSelectorDialog.h" -#include "SubWindowHandle.h" -#include "VideoSubWindow.h" - #include #include +#include "SubWindowHandle.h" +#include "VideoSubWindow.h" + SubWindowSelectorDialog::SubWindowSelectorDialog( QWidget* parent, SubWindowHandle* windowManager, unsigned int uiCategory, int minWindowsSelected, int maxWindowsSelected ) : QDialog( parent ) diff --git a/app/dialog/SubWindowSelectorDialog.h b/app/dialog/SubWindowSelectorDialog.h index a86953c..0dbd532 100644 --- a/app/dialog/SubWindowSelectorDialog.h +++ b/app/dialog/SubWindowSelectorDialog.h @@ -25,13 +25,12 @@ #ifndef __DIALOGSUBWINDOWSELECTOR_H__ #define __DIALOGSUBWINDOWSELECTOR_H__ -#include "CommonDefs.h" -#include "config.h" - +#include #include #include -#include +#include "CommonDefs.h" +#include "config.h" class QPixmap; class QColor; diff --git a/app/docks/FramePropertiesDock.h b/app/docks/FramePropertiesDock.h index 5d90504..62db6b6 100644 --- a/app/docks/FramePropertiesDock.h +++ b/app/docks/FramePropertiesDock.h @@ -25,14 +25,14 @@ #ifndef __FRAMEPROPERTIESDOCK_H__ #define __FRAMEPROPERTIESDOCK_H__ +#include + #include "CommonDefs.h" #include "HistogramWidget.h" #include "config.h" #include "lib/CalypFrame.h" #include "lib/CalypStream.h" -#include - class FramePropertiesDock : public QWidget { Q_OBJECT diff --git a/app/docks/ModuleHandleDock.cpp b/app/docks/ModuleHandleDock.cpp index 600b9d0..c0f4a4d 100644 --- a/app/docks/ModuleHandleDock.cpp +++ b/app/docks/ModuleHandleDock.cpp @@ -24,14 +24,14 @@ #include "ModuleHandleDock.h" -#include "CalypAppModuleIf.h" -#include "ModulesHandle.h" - #include #include #include #include +#include "CalypAppModuleIf.h" +#include "ModulesHandle.h" + ModuleHandleDock::ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf ) : QWidget( parent ), m_pcCurrModuleIf( moduleIf ) { diff --git a/app/docks/ModuleHandleDock.h b/app/docks/ModuleHandleDock.h index eabb48d..c99327f 100644 --- a/app/docks/ModuleHandleDock.h +++ b/app/docks/ModuleHandleDock.h @@ -25,12 +25,12 @@ #ifndef __MODULEHANDLEDOCK_H__ #define __MODULEHANDLEDOCK_H__ -#include "CommonDefs.h" -#include "config.h" - #include #include +#include "CommonDefs.h" +#include "config.h" + class QLabel; class CalypAppModuleIf; diff --git a/app/docks/QualityMeasurementSidebar.cpp b/app/docks/QualityMeasurementSidebar.cpp index f309887..79e7723 100644 --- a/app/docks/QualityMeasurementSidebar.cpp +++ b/app/docks/QualityMeasurementSidebar.cpp @@ -24,11 +24,11 @@ #include "QualityMeasurementSidebar.h" +#include + #include "SubWindowHandle.h" #include "VideoSubWindow.h" -#include - QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, SubWindowHandle* windowManager ) : QWidget( parent ), m_pcMainWindowManager( windowManager ), m_pcCurrentVideoSubWindow( NULL ) { diff --git a/app/docks/QualityMeasurementSidebar.h b/app/docks/QualityMeasurementSidebar.h index 792c7c7..7b258a5 100644 --- a/app/docks/QualityMeasurementSidebar.h +++ b/app/docks/QualityMeasurementSidebar.h @@ -25,14 +25,14 @@ #ifndef __QUALITYMEASUREMENTSIDEBAR_H__ #define __QUALITYMEASUREMENTSIDEBAR_H__ +#include + #include "CommonDefs.h" #include "HistogramWidget.h" #include "config.h" #include "lib/CalypFrame.h" #include "lib/CalypStream.h" -#include - class SubWindowHandle; class VideoSubWindow; diff --git a/app/widgets/FrameNumberWidget.h b/app/widgets/FrameNumberWidget.h index 4595d8b..199aec9 100644 --- a/app/widgets/FrameNumberWidget.h +++ b/app/widgets/FrameNumberWidget.h @@ -25,11 +25,11 @@ #ifndef __WIDGETFRAMENUMBER_H__ #define __WIDGETFRAMENUMBER_H__ +#include + #include "CommonDefs.h" #include "config.h" -#include - class QLabel; class FrameNumberWidget : public QWidget diff --git a/app/widgets/HistogramWidget.h b/app/widgets/HistogramWidget.h index a097d95..8de2548 100644 --- a/app/widgets/HistogramWidget.h +++ b/app/widgets/HistogramWidget.h @@ -26,13 +26,13 @@ #ifndef __HISTOGRAMWIDGET_H__ #define __HISTOGRAMWIDGET_H__ +#include +#include + #include "CommonDefs.h" #include "config.h" #include "lib/CalypFrame.h" -#include -#include - class QEvent; class HistogramWorker; diff --git a/config.h.in b/config.h.in index 5c503ae..1c1580d 100644 --- a/config.h.in +++ b/config.h.in @@ -26,10 +26,10 @@ #define __CONFIG_CALYP_H__ /* Version definition */ -#define CALYP_VERSION_MAJOR @CALYP_VERSION_MAJOR@ -#define CALYP_VERSION_MINOR @CALYP_VERSION_MINOR@ -#define CALYP_VERSION_PATCH @CALYP_VERSION_PATCH@ -#define CALYP_VERSION @CALYP_VERSION@ +#define CALYP_VERSION_MAJOR @CALYP_VERSION_MAJOR @ +#define CALYP_VERSION_MINOR @CALYP_VERSION_MINOR @ +#define CALYP_VERSION_PATCH @CALYP_VERSION_PATCH @ +#define CALYP_VERSION @CALYP_VERSION @ #define CALYP_VERSION_STRING "@CALYP_VERSION_STRING@" #define UPDATE_CHANNEL "@UPDATE_CHANNEL@" diff --git a/examples/modules/AbsoluteFrameDifferenceExample.cpp b/examples/modules/AbsoluteFrameDifferenceExample.cpp index 3dd7efd..acc26c7 100644 --- a/examples/modules/AbsoluteFrameDifferenceExample.cpp +++ b/examples/modules/AbsoluteFrameDifferenceExample.cpp @@ -23,6 +23,7 @@ */ #include "AbsoluteFrameDifferenceExample.h" + #include REGISTER_CLASS_MAKER( AbsoluteFrameDifferenceExample ) diff --git a/examples/modules/AbsoluteFrameDifferenceExample.h b/examples/modules/AbsoluteFrameDifferenceExample.h index 117176b..8bab796 100644 --- a/examples/modules/AbsoluteFrameDifferenceExample.h +++ b/examples/modules/AbsoluteFrameDifferenceExample.h @@ -25,10 +25,10 @@ #ifndef __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__ #define __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__ -#include "CalypModuleIf.h" - #include +#include "CalypModuleIf.h" + class AbsoluteFrameDifferenceExample : public CalypModuleIf { REGISTER_CLASS_FACTORY( AbsoluteFrameDifferenceExample ) diff --git a/lib/CalypDefs.h b/lib/CalypDefs.h index b0199d5..b0095c3 100644 --- a/lib/CalypDefs.h +++ b/lib/CalypDefs.h @@ -27,9 +27,9 @@ #define __CALYPDEFS_H__ #include +#include #include #include -#include typedef unsigned short ClpPel; ///< 16-bit pixel type typedef unsigned char ClpByte; diff --git a/lib/CalypFrame.cpp b/lib/CalypFrame.cpp index 4024fcb..eba688d 100644 --- a/lib/CalypFrame.cpp +++ b/lib/CalypFrame.cpp @@ -24,13 +24,13 @@ #include "CalypFrame.h" +#include +#include + #include "LibMemory.h" #include "PixelFormats.h" #include "config.h" -#include -#include - #ifdef USE_OPENCV #include #include @@ -507,7 +507,7 @@ ClpPel CalypFrame::operator()( unsigned int ch, unsigned int xPos, unsigned int { retValue = d->m_pppcInputPel[ch][yPos][xPos]; if( !absolute && d->m_bHasNegativeValues ) - retValue = retValue - int(d->m_uiHalfPelValue); + retValue = retValue - int( d->m_uiHalfPelValue ); } return ClpPel( retValue ); } @@ -735,7 +735,8 @@ void CalypFrame::fillRGBBuffer() { #define PEL_ARGB( a, r, g, b ) ( ( a & 0xff ) << 24 ) | ( ( r & 0xff ) << 16 ) | ( ( g & 0xff ) << 8 ) | ( b & 0xff ) #define PEL_RGB( r, g, b ) PEL_ARGB( 0xffu, r, g, b ) -#define CLAMP_YUV2RGB( X ) X = X < 0 ? 0 : X > 255 ? 255 : X; +#define CLAMP_YUV2RGB( X ) X = X < 0 ? 0 : X > 255 ? 255 : \ + X; #define YUV2RGB( iY, iU, iV, iR, iG, iB ) \ iR = iY + ( ( 1436 * ( iV - 128 ) ) >> 10 ); \ iG = iY - ( ( 352 * ( iU - 128 ) + 731 * ( iV - 128 ) ) >> 10 ); \ @@ -1147,12 +1148,12 @@ double CalypFrame::getEntropy( unsigned channel, unsigned int start, unsigned in for( unsigned b = start; b <= end; b++ ) { - if (d->m_puiHistogram[indexStart + b] == 0) + if( d->m_puiHistogram[indexStart + b] == 0 ) continue; double prob = d->m_puiHistogram[indexStart + b] / numValues; - entropy -= prob * log2(prob); + entropy -= prob * log2( prob ); } return entropy; diff --git a/lib/CalypFrame.h b/lib/CalypFrame.h index 4272ebe..6e89524 100644 --- a/lib/CalypFrame.h +++ b/lib/CalypFrame.h @@ -299,7 +299,6 @@ public: */ CalypPixel getPixel( unsigned int xPos, unsigned int yPos ) const; - /** * Get pixel value at coordinates * in the desired color space diff --git a/lib/CalypModuleIf.h b/lib/CalypModuleIf.h index 9a47977..00e14b6 100644 --- a/lib/CalypModuleIf.h +++ b/lib/CalypModuleIf.h @@ -164,7 +164,7 @@ public: * Module API version 3 */ virtual CalypFrame* getProcessedFrame() { return m_pcOutputFrame; } - virtual bool needFrame() { return m_iFrameBufferCount == 0? true : false; }; + virtual bool needFrame() { return m_iFrameBufferCount == 0 ? true : false; }; virtual bool flush() { m_iFrameBufferCount = 0; diff --git a/lib/CalypPixel.cpp b/lib/CalypPixel.cpp index 3f3d57c..9b9ea67 100644 --- a/lib/CalypPixel.cpp +++ b/lib/CalypPixel.cpp @@ -23,7 +23,6 @@ */ #include "CalypFrame.h" - #include "PixelFormats.h" #include "config.h" @@ -51,9 +50,12 @@ static inline void yuvToRgb( const int& iY, const int& iU, const int& iV, int& i 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; - iG = iG < 0 ? 0 : iG > 255 ? 255 : iG; - iB = iB < 0 ? 0 : iB > 255 ? 255 : iB; + iR = iR < 0 ? 0 : iR > 255 ? 255 : + iR; + iG = iG < 0 ? 0 : iG > 255 ? 255 : + iG; + iB = iB < 0 ? 0 : iB > 255 ? 255 : + iB; } static inline void rgbToYuv( const int& iR, const int& iG, const int& iB, int& iY, int& iU, int& iV ) diff --git a/lib/PixelFormats.cpp b/lib/PixelFormats.cpp index f600035..dca2ffb 100644 --- a/lib/PixelFormats.cpp +++ b/lib/PixelFormats.cpp @@ -56,9 +56,9 @@ const std::map g_CalypPixFmtDescriptorsMap = { 1, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV420P ), { - {0, 0, 1}, /* Y */ - {1, 0, 1}, /* U */ - {2, 0, 1}, /* V */ + { 0, 0, 1 }, /* Y */ + { 1, 0, 1 }, /* U */ + { 2, 0, 1 }, /* V */ }, }, }, @@ -73,9 +73,9 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV422P ), { - {0, 0, 1}, /* Y */ - {1, 0, 1}, /* U */ - {2, 0, 1}, /* V */ + { 0, 0, 1 }, /* Y */ + { 1, 0, 1 }, /* U */ + { 2, 0, 1 }, /* V */ }, }, }, @@ -90,9 +90,9 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV444P ), { - {0, 0, 1}, /* Y */ - {1, 0, 1}, /* U */ - {2, 0, 1}, /* V */ + { 0, 0, 1 }, /* Y */ + { 1, 0, 1 }, /* U */ + { 2, 0, 1 }, /* V */ }, }, }, @@ -107,9 +107,9 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUYV422 ), { - {0, 1, 1}, /* Y */ - {0, 3, 2}, /* U */ - {0, 3, 4}, /* V */ + { 0, 1, 1 }, /* Y */ + { 0, 3, 2 }, /* U */ + { 0, 3, 4 }, /* V */ }, }, }, @@ -123,7 +123,7 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_GRAY8 ), - {{0, 0, 1}}, /* Y */ + { { 0, 0, 1 } }, /* Y */ }, }, { @@ -137,9 +137,9 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_NONE ), { - {0, 0, 1}, /* R */ - {1, 0, 1}, /* G */ - {2, 0, 1}, /* B */ + { 0, 0, 1 }, /* R */ + { 1, 0, 1 }, /* G */ + { 2, 0, 1 }, /* B */ }, }, }, @@ -154,9 +154,9 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_RGB24 ), { - {0, 2, 1}, /* R */ - {0, 2, 2}, /* G */ - {0, 2, 3}, /* B */ + { 0, 2, 1 }, /* R */ + { 0, 2, 2 }, /* G */ + { 0, 2, 3 }, /* B */ }, }, }, @@ -171,9 +171,9 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_BGR24 ), { - {0, 2, 3}, /* R */ - {0, 2, 2}, /* G */ - {0, 2, 1}, /* B */ + { 0, 2, 3 }, /* R */ + { 0, 2, 2 }, /* G */ + { 0, 2, 1 }, /* B */ }, }, }, @@ -188,10 +188,10 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_RGBA ), { - {0, 3, 1}, /* R */ - {0, 3, 2}, /* G */ - {0, 3, 3}, /* B */ - {0, 3, 4}, /* A */ + { 0, 3, 1 }, /* R */ + { 0, 3, 2 }, /* G */ + { 0, 3, 3 }, /* B */ + { 0, 3, 4 }, /* A */ }, }, }, @@ -206,10 +206,10 @@ const std::map g_CalypPixFmtDescriptorsMap = { 0, ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_BGRA ), { - {0, 3, 3}, /* R */ - {0, 3, 2}, /* G */ - {0, 3, 1}, /* B */ - {0, 3, 4}, /* A */ + { 0, 3, 3 }, /* R */ + { 0, 3, 2 }, /* G */ + { 0, 3, 1 }, /* B */ + { 0, 3, 4 }, /* A */ }, }, }, diff --git a/lib/PixelFormats.h b/lib/PixelFormats.h index 7143d07..1ea22ea 100644 --- a/lib/PixelFormats.h +++ b/lib/PixelFormats.h @@ -25,10 +25,10 @@ #ifndef __PIXELFORMATS_H__ #define __PIXELFORMATS_H__ -#include "CalypFrame.h" - #include +#include "CalypFrame.h" + #define CHROMA_RESAMPLING( X ) ( ( ( X + 1 ) >> 1 ) << 1 ) #define CHROMARATIO( SIZE, RATIO ) ( RATIO > 1 ? ( ( SIZE + 1 ) / RATIO ) : SIZE ) diff --git a/lib/StreamHandlerLibav.cpp b/lib/StreamHandlerLibav.cpp index 36d67b8..b98c6ec 100644 --- a/lib/StreamHandlerLibav.cpp +++ b/lib/StreamHandlerLibav.cpp @@ -24,13 +24,13 @@ #include "StreamHandlerLibav.h" +#include +#include + #include "CalypFrame.h" #include "LibMemory.h" #include "PixelFormats.h" -#include -#include - #if( ( LIBAVCODEC_VERSION_MAJOR > 57 ) || ( LIBAVCODEC_VERSION_MAJOR == 57 ) && ( LIBAVCODEC_VERSION_MINOR >= 37 ) ) #define FF_SEND_RECEIVE_API #define FF_USER_CODEC_PARAM diff --git a/lib/StreamHandlerLibav.h b/lib/StreamHandlerLibav.h index 1e5e5b8..99032d2 100644 --- a/lib/StreamHandlerLibav.h +++ b/lib/StreamHandlerLibav.h @@ -27,6 +27,7 @@ #define __STREAMHANDLERLIBAV_H__ #include + #include #include diff --git a/lib/StreamHandlerOpenCV.cpp b/lib/StreamHandlerOpenCV.cpp index 9a8bf69..ddefb63 100644 --- a/lib/StreamHandlerOpenCV.cpp +++ b/lib/StreamHandlerOpenCV.cpp @@ -24,11 +24,11 @@ #include "StreamHandlerOpenCV.h" -#include "CalypFrame.h" -#include "LibMemory.h" - #include #include + +#include "CalypFrame.h" +#include "LibMemory.h" #if CV_MAJOR_VERSION >= 3 #include #endif diff --git a/lib/StreamHandlerPortableMap.cpp b/lib/StreamHandlerPortableMap.cpp index 1e764a4..4e2d4ed 100644 --- a/lib/StreamHandlerPortableMap.cpp +++ b/lib/StreamHandlerPortableMap.cpp @@ -24,12 +24,12 @@ #include "StreamHandlerPortableMap.h" -#include "CalypFrame.h" -#include "LibMemory.h" - #include #include +#include "CalypFrame.h" +#include "LibMemory.h" + std::vector StreamHandlerPortableMap::supportedReadFormats() { INI_REGIST_CALYP_SUPPORTED_FMT; diff --git a/lib/StreamHandlerRaw.cpp b/lib/StreamHandlerRaw.cpp index 01a7de1..a43efea 100644 --- a/lib/StreamHandlerRaw.cpp +++ b/lib/StreamHandlerRaw.cpp @@ -24,11 +24,11 @@ #include "StreamHandlerRaw.h" +#include + #include "CalypFrame.h" #include "LibMemory.h" -#include - std::vector StreamHandlerRaw::supportedReadFormats() { INI_REGIST_CALYP_SUPPORTED_FMT; diff --git a/modules/AbsoluteFrameDifference.cpp b/modules/AbsoluteFrameDifference.cpp index 41c4f85..a56527c 100644 --- a/modules/AbsoluteFrameDifference.cpp +++ b/modules/AbsoluteFrameDifference.cpp @@ -49,8 +49,7 @@ bool AbsoluteFrameDifference::create( std::vector apcFrameList ) _BASIC_MODULE_API_2_CHECK_ for( unsigned int i = 1; i < apcFrameList.size(); i++ ) - if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], CalypFrame::MATCH_COLOR_SPACE_IGNORE_GRAY - | CalypFrame::MATCH_COLOR_SPACE | CalypFrame::MATCH_RESOLUTION | CalypFrame::MATCH_BITS ) ) + if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], CalypFrame::MATCH_COLOR_SPACE_IGNORE_GRAY | CalypFrame::MATCH_COLOR_SPACE | CalypFrame::MATCH_RESOLUTION | CalypFrame::MATCH_BITS ) ) return false; m_pcFrameDifference = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), CLP_GRAY, apcFrameList[0]->getBitsPel() ); diff --git a/modules/CalypModulesFactory.cpp b/modules/CalypModulesFactory.cpp index d05558b..fa0c143 100644 --- a/modules/CalypModulesFactory.cpp +++ b/modules/CalypModulesFactory.cpp @@ -23,19 +23,21 @@ */ #include "CalypModulesFactory.h" -#include "config.h" #include #include + +#include "config.h" #ifdef USE_DYNLOAD #include + #include #endif // Generated by cmake #include "ModulesListHeader.h" -CalypModulesFactory::CalypModulesFactory(){REGISTER_ALL_MODULES} +CalypModulesFactory::CalypModulesFactory(){ REGISTER_ALL_MODULES } CalypModulesFactory::~CalypModulesFactory() { diff --git a/modules/FrameDifference.cpp b/modules/FrameDifference.cpp index 1e68e90..b5a2316 100644 --- a/modules/FrameDifference.cpp +++ b/modules/FrameDifference.cpp @@ -37,7 +37,7 @@ FrameDifference::FrameDifference() m_uiModuleRequirements = CLP_MODULE_REQUIRES_NEW_WINDOW | CLP_MODULE_REQUIRES_OPTIONS; m_uiNumberOfFrames = 2; - m_cModuleOptions.addOptions() /**/ + m_cModuleOptions.addOptions() /**/ ( "BitsPerpixel", m_uiBitsPixel, "Bits per pixel (use zero to avoid scaling) [0]" ) /**/ ( "SumOperation", m_uiSumOperation, "Sum instead of difference [0]" ); @@ -68,7 +68,7 @@ bool FrameDifference::create( std::vector apcFrameList ) } uiMaxBitsPixel = m_uiSumOperation ? uiMaxBitsPixel : uiMaxBitsPixel + 1; - m_uiBitsPixel = !m_uiBitsPixel ? uiMaxBitsPixel & 0x0F : m_uiBitsPixel; + m_uiBitsPixel = !m_uiBitsPixel ? uiMaxBitsPixel & 0x0F : m_uiBitsPixel; m_iDiffBitShift = uiMaxBitsPixel - m_uiBitsPixel; m_iMaxDiffValue = ( 1 << ( m_uiSumOperation ? m_uiBitsPixel : m_uiBitsPixel - 1 ) ); @@ -76,7 +76,7 @@ bool FrameDifference::create( std::vector apcFrameList ) m_pcFrameDifference = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), apcFrameList[0]->getPelFormat(), m_uiBitsPixel, m_uiSumOperation == 1 ? false : true ); - m_iOperation = m_uiSumOperation == 0 ? -1 : 1 ; + m_iOperation = m_uiSumOperation == 0 ? -1 : 1; return true; } @@ -92,8 +92,8 @@ CalypFrame* FrameDifference::process( std::vector apcFrameList ) for( unsigned int y = 0; y < m_pcFrameDifference->getHeight( ch ); y++ ) for( unsigned int x = 0; x < m_pcFrameDifference->getWidth( ch ); x++ ) { - aux_pel_1 = frame1(ch, x, y, false ); - aux_pel_2 = frame2(ch, x, y, false ); + aux_pel_1 = frame1( ch, x, y, false ); + aux_pel_2 = frame2( ch, x, y, false ); diff = aux_pel_1 + m_iOperation * aux_pel_2; diff = m_iDiffBitShift > 0 ? diff >> m_iDiffBitShift : diff << -m_iDiffBitShift; diff = std::min( diff, m_iMaxDiffValue - 1 ); diff --git a/modules/FrameResampling.cpp b/modules/FrameResampling.cpp index 0d88e54..169a68e 100644 --- a/modules/FrameResampling.cpp +++ b/modules/FrameResampling.cpp @@ -45,10 +45,10 @@ FrameResampling::FrameResampling() m_uiNumberOfFrames = 1; m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS; - m_cModuleOptions.addOptions() /**/ - ( "width", m_iWidth, "Width of the crop region [-1]" ) /**/ + m_cModuleOptions.addOptions() /**/ + ( "width", m_iWidth, "Width of the crop region [-1]" ) /**/ ( "height", m_iHeight, "Height of the crop region [-1]" ) /**/ - ( "Interpolation", m_iInterpolation, "Interpolation method (1-4) [4]" ) ; + ( "Interpolation", m_iInterpolation, "Interpolation method (1-4) [4]" ); m_iInterpolation = 4; m_iWidth = -1; diff --git a/modules/FrameResampling.h b/modules/FrameResampling.h index bde5ded..3a34363 100644 --- a/modules/FrameResampling.h +++ b/modules/FrameResampling.h @@ -42,7 +42,8 @@ class FrameResampling : public CalypModuleIf private: int m_iWidth; int m_iHeight; -int m_iInterpolation; + int m_iInterpolation; + public: FrameResampling(); virtual ~FrameResampling() {} diff --git a/modules/HEVCIntraPrediction.cpp b/modules/HEVCIntraPrediction.cpp index 74d12b9..965204e 100644 --- a/modules/HEVCIntraPrediction.cpp +++ b/modules/HEVCIntraPrediction.cpp @@ -23,7 +23,9 @@ */ #include "HEVCIntraPrediction.h" + #include + #include "lib/LibMemory.h" HEVCIntraPrediction::HEVCIntraPrediction() @@ -67,11 +69,11 @@ bool HEVCIntraPrediction::create( std::vector apcFrameList ) return true; } -static const int g_AngularParamLookUp[] = {32, 26, 21, 17, 13, 9, 5, 2, 0, -2, -5, -9, -13, -17, -21, -26, // Horizontal - -32, -26, -21, -17, -13, -9, -5, -2, 0, 2, 5, 9, 13, 17, 21, 26, 32}; // Vertical +static const int g_AngularParamLookUp[] = { 32, 26, 21, 17, 13, 9, 5, 2, 0, -2, -5, -9, -13, -17, -21, -26, // Horizontal + -32, -26, -21, -17, -13, -9, -5, -2, 0, 2, 5, 9, 13, 17, 21, 26, 32 }; // Vertical -static const int g_InverAngularParamLookup[2][8] = {{-32, -26, -21, -17, -13, -9, -5, -2}, - {-256, -315, -390, -482, -630, -910, -1638, -4096}}; +static const int g_InverAngularParamLookup[2][8] = { { -32, -26, -21, -17, -13, -9, -5, -2 }, + { -256, -315, -390, -482, -630, -910, -1638, -4096 } }; int getAngularParam( int mode ) { diff --git a/modules/MeasureOpticalFlowDualTVL1.cpp b/modules/MeasureOpticalFlowDualTVL1.cpp index 40ec989..5fc29f5 100644 --- a/modules/MeasureOpticalFlowDualTVL1.cpp +++ b/modules/MeasureOpticalFlowDualTVL1.cpp @@ -64,11 +64,11 @@ bool MeasureOpticalFlowDualTVL1::create( std::vector apcFrameList ) return false; m_iStep = 16; - #if CV_MAJOR_VERSION >= 4 +#if CV_MAJOR_VERSION >= 4 m_cTvl1 = cv::optflow::createOptFlow_DualTVL1(); - #else +#else m_cTvl1 = cv::createOptFlow_DualTVL1(); - #endif +#endif m_pcOutputFrame = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), CLP_GRAY ); return true; diff --git a/modules/OpticalFlow.cpp b/modules/OpticalFlow.cpp index b23e2c8..681fd38 100644 --- a/modules/OpticalFlow.cpp +++ b/modules/OpticalFlow.cpp @@ -166,11 +166,11 @@ bool OpticalFlowDualTVL1::create( std::vector apcFrameList ) bool bRet = commonCreate( apcFrameList ); if( !bRet ) return bRet; - #if CV_MAJOR_VERSION >= 4 +#if CV_MAJOR_VERSION >= 4 m_cOpticalFlow = cv::optflow::createOptFlow_DualTVL1(); - #else +#else m_cOpticalFlow = cv::createOptFlow_DualTVL1(); - #endif +#endif return bRet; } diff --git a/modules/OptimiseDisplay.cpp b/modules/OptimiseDisplay.cpp index 8db4119..ec0ed74 100644 --- a/modules/OptimiseDisplay.cpp +++ b/modules/OptimiseDisplay.cpp @@ -25,10 +25,10 @@ #include "OptimiseDisplay.h" -#include "lib/LibMemory.h" - #include +#include "lib/LibMemory.h" + OptimiseDisplay::OptimiseDisplay() { /* Module Definition */ diff --git a/modules/ThreeSixtyFaceConcatenation.cpp b/modules/ThreeSixtyFaceConcatenation.cpp index db6acfc..6cfbcdc 100644 --- a/modules/ThreeSixtyFaceConcatenation.cpp +++ b/modules/ThreeSixtyFaceConcatenation.cpp @@ -94,7 +94,7 @@ CalypFrame* ThreeSixtyFaceConcatenation::process( std::vector apcFr switch( m_uiProjectionType ) { - case 1: // Cube-map + case 1: // Cube-map for( unsigned i = 0; i < m_uiFacesX * m_uiFacesY; i++ ) { CalypFrame* pcFrame = apcFrameList[i]; diff --git a/modules/ThreeSixtyFaceExtraction.cpp b/modules/ThreeSixtyFaceExtraction.cpp index 868187c..1fd87f9 100644 --- a/modules/ThreeSixtyFaceExtraction.cpp +++ b/modules/ThreeSixtyFaceExtraction.cpp @@ -91,7 +91,7 @@ CalypFrame* ThreeSixtyFaceExtraction::process( std::vector apcFrame switch( m_uiProjectionType ) { - case 1: // Cube-map + case 1: // Cube-map x = m_uiFaceNum % m_uiFacesX * m_pcOutputFrame->getWidth(); y = ( m_uiFaceNum / m_uiFacesX ) * m_pcOutputFrame->getHeight(); break; diff --git a/tools/CalypTools.cpp b/tools/CalypTools.cpp index 8876806..199d407 100644 --- a/tools/CalypTools.cpp +++ b/tools/CalypTools.cpp @@ -688,23 +688,23 @@ int CalypTools::ModuleOperation() return 0; } -int CalypTools::ListStatistics () +int CalypTools::ListStatistics() { log( CLP_LOG_RESULT, "\n\x1B[35mCalyp Statistics:\x1B[0m\n\n" ); - CalypFrame *currFrame; + CalypFrame* currFrame; bool abEOF; unsigned min[MAX_NUMBER_CHANNELS], max[MAX_NUMBER_CHANNELS]; - for ( unsigned input = 0; input < m_apcInputStreams.size(); input++ ) + for( unsigned input = 0; input < m_apcInputStreams.size(); input++ ) { - log( CLP_LOG_RESULT, "\x1B[32mInput:\t\t\t%d\x1B[0m\n", input); - log( CLP_LOG_RESULT, "No. Frames:\t\t%d\n", m_apcInputStreams[input]->getFrameNum()); - log( CLP_LOG_RESULT, "Pixels:\t\t\t%d\n", m_apcInputStreams[input]->getHeight() * m_apcInputStreams[input]->getWidth()); + log( CLP_LOG_RESULT, "\x1B[32mInput:\t\t\t%d\x1B[0m\n", input ); + log( CLP_LOG_RESULT, "No. Frames:\t\t%d\n", m_apcInputStreams[input]->getFrameNum() ); + log( CLP_LOG_RESULT, "Pixels:\t\t\t%d\n", m_apcInputStreams[input]->getHeight() * m_apcInputStreams[input]->getWidth() ); for( unsigned int frame = 0; frame < m_apcInputStreams[input]->getFrameNum(); frame++ ) { - log( CLP_LOG_RESULT, "\x1B[34m Frame: %d\x1B[0m\n", frame); + log( CLP_LOG_RESULT, "\x1B[34m Frame: %d\x1B[0m\n", frame ); currFrame = m_apcInputStreams[input]->getCurrFrame(); abEOF = m_apcInputStreams[input]->setNextFrame(); @@ -715,49 +715,56 @@ int CalypTools::ListStatistics () currFrame->calcHistogram(); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) { min[channel] = currFrame->getMinimumPelValue( channel ); max[channel] = currFrame->getMaximumPelValue( channel ); } log( CLP_LOG_RESULT, " Channel: " ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) log( CLP_LOG_RESULT, "| %13d ", channel); - log( CLP_LOG_RESULT, "|\n"); + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + log( CLP_LOG_RESULT, "| %13d ", channel ); + log( CLP_LOG_RESULT, "|\n" ); log( CLP_LOG_RESULT, " ----------------" ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) log( CLP_LOG_RESULT, "----------------"); - log( CLP_LOG_RESULT, "-\n"); + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + log( CLP_LOG_RESULT, "----------------" ); + log( CLP_LOG_RESULT, "-\n" ); log( CLP_LOG_RESULT, " Range: " ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) { char buffer[14]; - sprintf(buffer, "[%d:%d]", min[channel], max[channel]); + sprintf( buffer, "[%d:%d]", min[channel], max[channel] ); log( CLP_LOG_RESULT, "| %13s ", buffer ); } - log( CLP_LOG_RESULT, "|\n"); + log( CLP_LOG_RESULT, "|\n" ); log( CLP_LOG_RESULT, " Non empty bins: " ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) log( CLP_LOG_RESULT, "| %13d ", currFrame->getNEBins( channel ) ); - log( CLP_LOG_RESULT, "|\n"); + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + log( CLP_LOG_RESULT, "| %13d ", currFrame->getNEBins( channel ) ); + log( CLP_LOG_RESULT, "|\n" ); log( CLP_LOG_RESULT, " Mean: " ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) log( CLP_LOG_RESULT, "| %13.1f ", currFrame->getMean( channel, min[channel], max[channel] ) ); - log( CLP_LOG_RESULT, "|\n"); + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + log( CLP_LOG_RESULT, "| %13.1f ", currFrame->getMean( channel, min[channel], max[channel] ) ); + log( CLP_LOG_RESULT, "|\n" ); log( CLP_LOG_RESULT, " Std. deviation: " ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) log( CLP_LOG_RESULT, "| %13.1f ", currFrame->getStdDev( channel, min[channel], max[channel] ) ); - log( CLP_LOG_RESULT, "|\n"); + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + log( CLP_LOG_RESULT, "| %13.1f ", currFrame->getStdDev( channel, min[channel], max[channel] ) ); + log( CLP_LOG_RESULT, "|\n" ); log( CLP_LOG_RESULT, " Median: " ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) log( CLP_LOG_RESULT, "| %13d ", currFrame->getMedian( channel, min[channel], max[channel] ) ); - log( CLP_LOG_RESULT, "|\n"); + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + log( CLP_LOG_RESULT, "| %13d ", currFrame->getMedian( channel, min[channel], max[channel] ) ); + log( CLP_LOG_RESULT, "|\n" ); log( CLP_LOG_RESULT, " Entropy: " ); - for ( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) log( CLP_LOG_RESULT, "| %13.2f ", currFrame->getEntropy( channel, min[channel], max[channel] ) ); - log( CLP_LOG_RESULT, "|\n"); + for( unsigned channel = 0; channel < currFrame->getNumberChannels(); channel++ ) + log( CLP_LOG_RESULT, "| %13.2f ", currFrame->getEntropy( channel, min[channel], max[channel] ) ); + log( CLP_LOG_RESULT, "|\n" ); } } diff --git a/tools/CalypTools.h b/tools/CalypTools.h index 558df4a..b5a5191 100644 --- a/tools/CalypTools.h +++ b/tools/CalypTools.h @@ -44,9 +44,8 @@ * */ -#include "lib/CalypFrame.h" - #include "CalypToolsCmdParser.h" +#include "lib/CalypFrame.h" class CalypFrame; class CalypStream;