From 0b429a0c34cc5295a5fdfe574dda3829fd85add3 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 12 Mar 2018 18:21:07 +0000 Subject: [PATCH] Refactor Playuver into Calyp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 1fd9cf34f06ba2a156919b5c9b73c31d4c6c6257 Author: Joao Carreira Date: Mon Mar 12 18:06:39 2018 +0000 Remove code style commit 165588840126a7ab35b32e5be47f00c613829ef3 Author: Joao Carreira Date: Mon Mar 12 18:06:25 2018 +0000 Update Mainpage.dox commit 5b1a2773c48697346c7b0b64519b81a5aecc0150 Author: Joao Carreira Date: Mon Feb 19 03:46:24 2018 +0000 Re-add CalypPixel.cpp but keep include with frame class commit 2343be49ff4906c3171d2df7791e3cf34494eb21 Author: Joao Santos Date: Sun Feb 18 21:06:57 2018 +0000 Fixed several things: - Removed unused define - Added: #include to MainWindow.cpp - Fixed compilation issue when USE_FFMPEG is OFF on CalypStream.cpp commit 8d1d64bac828a6bcdfa6af977a5d17d0792acb69 Author: Joao Carreira Date: Thu Feb 15 02:14:13 2018 +0000 Fix several things: - Fix examples - Improve code formatting script - Change generated cmake config file commit ea1d0265f1e9300f76fd3f0c8ca03d110ec13eaa Author: Joao Carreira Date: Thu Feb 15 01:28:50 2018 +0000 Fix dump of the module list: remove the use of char arrays commit b4d19dda169715113a74713ca62d05f5a18fd0b5 Author: Joao Carreira Date: Wed Feb 14 23:20:56 2018 +0000 Increase linesize of tools help commit 8b3eab54e376863276b0d7e032f9e1de8aaf90e5 Author: Joao Carreira Date: Wed Feb 14 23:20:35 2018 +0000 Fix CalypPixel commit 1c6ba03c379518acf5fc6f1fdf328ca740a8851d Author: Joao Carreira Date: Wed Feb 14 22:24:10 2018 +0000 Enums CalypPixelFormats and CalypColorSpace are now class independent commit 5dcc35e1716a70095e1720b01823c2e3a3980576 Author: Joao Carreira Date: Wed Feb 14 02:04:31 2018 +0000 Change functions input and return types commit 5514e3e24f9b428d5db71156561b2d8b6f61dd23 Author: Joao Carreira Date: Wed Feb 14 02:04:31 2018 +0000 Change functions input and return types commit fae7a9a91e1899e7a2833c634221f970d44b8fb6 Author: Joao Carreira Date: Wed Feb 14 01:39:14 2018 +0000 Replace custom types with std ones commit 0c3b62b8ea01903e213d9e8dd73a5b49c7c8c36e Author: Joao Carreira Date: Wed Feb 14 00:37:18 2018 +0000 Refactoring entries with Playuver name with Calyp Replace number of frames and add CLP tag into public definitions commit e8cd8d7a219446513a5dda2c183dd892ec25a6f1 Author: Joao Carreira Date: Sat Feb 10 14:42:15 2018 +0000 Fix min opencv version and missing ffmpeg module commit 1233598af8ac15c88fa84569942cc6f865325452 Author: Joao Carreira Date: Sat Feb 10 03:10:12 2018 +0000 Change version to 0.999.0 untill finishing refactoring commit 1fe0cac8f0e70f352bf6c63b8cb2e06ab43fb633 Author: Joao Carreira Date: Sat Feb 10 00:21:47 2018 +0000 Change project library commit 44e9d330bc63b8b8a1687a14ff0be05af0bf2eb5 Author: Joao Carreira Date: Fri Feb 9 01:42:58 2018 +0000 Change doxygen files and upload new ico commit 0d6f3408a2682cfac1533a57a2f1b4e2cc1f0f29 Author: Joao Carreira Date: Thu Feb 8 21:25:31 2018 +0000 Fix logos - different when it is icon or the full logo commit 9f3561acd4b51c7de5f21d63d7e8f2b43c253148 Author: Joao Carreira Date: Thu Feb 8 01:25:39 2018 +0000 fix install files commit 832154e3e40f17a863898a77c929a6c6850ffded Author: Joao Carreira Date: Thu Feb 8 01:21:23 2018 +0000 rename calip to calyp commit 341b32bfcc0133fdbceea9b8390d59190e495b79 Author: Joao Carreira Date: Thu Feb 8 00:58:29 2018 +0000 Refactor lib, modules and tools commit b4b988cf80052fdcfe0e1f9099d5435ef7945584 Author: Joao Carreira Date: Thu Feb 8 00:02:33 2018 +0000 Refactor classes and filename in app commit 6b4ab728202531ad00db1e6299ee69a01f3594ba Author: Joao Carreira Date: Wed Feb 7 17:49:53 2018 +0000 Refactor about dialog and background logo commit d5c954d39fb89d735c4feddf62f529077840ab6c Author: João Santos Date: Wed Feb 7 15:05:19 2018 +0000 Added the misteriously missing new logo. commit f40d81f765bfdd2dc89c0647cf5f4a80eef845c7 Author: João Santos Date: Wed Feb 7 14:45:08 2018 +0000 Added new logo to resource folder. commit 52dc6d60d6590995d32de33f8199e954e0a6e120 Author: João Santos Date: Wed Feb 7 14:41:13 2018 +0000 Added new logo where it was previously forgotten. commit 6d8e064c3154e5202f01b1b10ba6ab3637383ecd Author: João Santos Date: Tue Feb 6 17:44:11 2018 +0000 About window no longer resizable. Added new logo. --- CMakeLists.txt | 50 +- Doxyfile | 136 +- Mainpage.dox | 18 +- PlaYUVerUpdate.xml.in | 49 - README.md | 14 +- app/CMakeLists.txt | 75 +- ...erAppModuleIf.cpp => CalypAppModuleIf.cpp} | 56 +- ...aYUVerAppModuleIf.h => CalypAppModuleIf.h} | 66 +- app/{PlaYUVerAppDefs.h => CommonDefs.h} | 14 +- ...YUVerAppAdaptor.cpp => DBusAppAdaptor.cpp} | 29 +- ...{PlaYUVerAppAdaptor.h => DBusAppAdaptor.h} | 30 +- app/GridManager.cpp | 8 +- app/GridManager.h | 12 +- app/{PlaYUVerApp.cpp => MainWindow.cpp} | 220 +- app/{PlaYUVerApp.h => MainWindow.h} | 76 +- ...YUVerMdiSubWindow.cpp => MdiSubWindow.cpp} | 12 +- ...{PlaYUVerMdiSubWindow.h => MdiSubWindow.h} | 18 +- app/ModulesHandle.cpp | 194 +- app/ModulesHandle.h | 44 +- app/PlotSubWindow.cpp | 26 +- app/PlotSubWindow.h | 34 +- app/QualityHandle.cpp | 76 +- app/QualityHandle.h | 26 +- app/SubWindowAbstract.cpp | 20 +- app/SubWindowAbstract.h | 46 +- ...ubWindowHandle.cpp => SubWindowHandle.cpp} | 122 +- ...VerSubWindowHandle.h => SubWindowHandle.h} | 54 +- app/VideoHandle.cpp | 146 +- app/VideoHandle.h | 36 +- app/VideoSubWindow.cpp | 278 +- app/VideoSubWindow.h | 148 +- app/ViewArea.cpp | 433 +- app/ViewArea.h | 90 +- app/{ => dialog}/AboutDialog.cpp | 23 +- app/{ => dialog}/AboutDialog.h | 2 +- app/{ => dialog}/ConfigureFormatDialog.cpp | 88 +- app/{ => dialog}/ConfigureFormatDialog.h | 26 +- app/{ => dialog}/ModulesHandleOptDialog.cpp | 22 +- app/{ => dialog}/ModulesHandleOptDialog.h | 12 +- app/{ => dialog}/ProgressBar.cpp | 6 +- app/{ => dialog}/ProgressBar.h | 12 +- app/{ => dialog}/SeekStreamDialog.cpp | 8 +- app/{ => dialog}/SeekStreamDialog.h | 12 +- .../SubWindowSelectorDialog.cpp} | 44 +- .../SubWindowSelectorDialog.h} | 26 +- app/{ => docks}/FramePropertiesDock.cpp | 168 +- app/{ => docks}/FramePropertiesDock.h | 38 +- app/{ => docks}/ModuleHandleDock.cpp | 14 +- app/{ => docks}/ModuleHandleDock.h | 14 +- app/{ => docks}/QualityMeasurementSidebar.cpp | 84 +- app/{ => docks}/QualityMeasurementSidebar.h | 24 +- app/external/CMakeLists.txt | 2 +- app/external/qcustomplot/qcustomplot.cpp | 18128 ++++++++-------- app/external/qcustomplot/qcustomplot.h | 5972 +++-- app/main.cpp | 48 +- app/resources/calyp-logo.png | Bin 0 -> 128011 bytes .../{playuver.desktop => calyp.desktop} | 6 +- app/resources/calyp.ico | Bin 0 -> 93062 bytes app/resources/calyp.png | Bin 0 -> 183438 bytes app/resources/{playuver.qrc => calyp.qrc} | 12 +- app/resources/calyp.rc | 1 + app/resources/{playuver.xml => calyp.xml} | 0 app/resources/playuver-background-logo.png | Bin 1122690 -> 0 bytes app/resources/playuver.ico | Bin 174302 -> 0 bytes app/resources/playuver.png | Bin 108119 -> 0 bytes app/resources/playuver.rc | 1 - .../FrameNumberWidget.cpp} | 12 +- .../FrameNumberWidget.h} | 14 +- app/{ => widgets}/HistogramWidget.cpp | 138 +- app/{ => widgets}/HistogramWidget.h | 54 +- cmake/ModulesFct.cmake | 2 +- config.h.in | 24 +- .../AbsoluteFrameDifferenceExample.cpp | 56 +- .../modules/AbsoluteFrameDifferenceExample.h | 18 +- examples/modules/CMakeLists.txt | 8 +- examples/modules/FrameBinarization_APIv1.cpp | 24 +- examples/modules/FrameBinarization_APIv1.h | 24 +- format_source_files.sh | 127 + lib/CMakeLists.txt | 78 +- lib/CalypConfig.cmake.in | 36 + lib/CalypDefs.h | 135 + lib/{PlaYUVerFrame.cpp => CalypFrame.cpp} | 852 +- lib/CalypFrame.h | 371 + lib/{PlaYUVerLib.h => CalypLib.h} | 32 +- lib/CalypModuleIf.h | 152 + lib/{PlaYUVerOptions.cpp => CalypOptions.cpp} | 175 +- lib/{PlaYUVerOptions.h => CalypOptions.h} | 89 +- lib/CalypPixel.cpp | 226 + lib/{PlaYUVerStream.cpp => CalypStream.cpp} | 305 +- lib/CalypStream.h | 119 + lib/CalypStreamHandlerIf.h | 120 + lib/LibMemory.h | 45 +- ...FramePixelFormats.cpp => PixelFormats.cpp} | 60 +- ...UVerFramePixelFormats.h => PixelFormats.h} | 43 +- lib/PlaYUVerConfig.cmake.in | 56 - lib/PlaYUVerDefs.h | 126 - lib/PlaYUVerFrame.h | 423 - lib/PlaYUVerModuleIf.h | 167 - lib/PlaYUVerStream.h | 127 - lib/PlaYUVerStreamHandlerIf.h | 123 - lib/StreamHandlerLibav.cpp | 112 +- lib/StreamHandlerLibav.h | 44 +- lib/StreamHandlerOpenCV.cpp | 57 +- lib/StreamHandlerOpenCV.h | 26 +- lib/StreamHandlerPortableMap.cpp | 55 +- lib/StreamHandlerPortableMap.h | 28 +- lib/StreamHandlerRaw.cpp | 49 +- lib/StreamHandlerRaw.h | 24 +- modules/AbsoluteFrameDifference.cpp | 48 +- modules/AbsoluteFrameDifference.h | 16 +- modules/CMakeLists.txt | 20 +- ...uleFactory.cpp => CalypModulesFactory.cpp} | 25 +- ...rModuleFactory.h => CalypModulesFactory.h} | 44 +- modules/DisparityStereoBM.cpp | 22 +- modules/DisparityStereoBM.h | 20 +- modules/DisparityStereoSGBM.cpp | 24 +- modules/DisparityStereoSGBM.h | 22 +- modules/DisparityStereoVar.cpp | 14 +- modules/DisparityStereoVar.h | 16 +- modules/EightBitsSampling.cpp | 34 +- modules/EightBitsSampling.h | 16 +- modules/FilterComponent.cpp | 48 +- modules/FilterComponent.h | 32 +- modules/FrameBinarization.cpp | 24 +- modules/FrameBinarization.h | 18 +- modules/FrameCrop.cpp | 16 +- modules/FrameCrop.h | 24 +- modules/FrameDifference.cpp | 40 +- modules/FrameDifference.h | 22 +- modules/FrameMask.cpp | 62 +- modules/FrameMask.h | 20 +- modules/FrameRotate.cpp | 40 +- modules/FrameRotate.h | 18 +- modules/FrameShift.cpp | 52 +- modules/FrameShift.h | 22 +- modules/InterFrameVariance.cpp | 66 +- modules/InterFrameVariance.h | 20 +- modules/LumaAverage.cpp | 26 +- modules/LumaAverage.h | 14 +- modules/MeasureOpticalFlowDualTVL1.cpp | 42 +- modules/MeasureOpticalFlowDualTVL1.h | 28 +- modules/OpticalFlow.cpp | 58 +- modules/OpticalFlow.h | 36 +- modules/SaliencyDetection.cpp | 38 +- modules/SaliencyDetection.h | 40 +- modules/SetChromaHalfScale.cpp | 28 +- modules/SetChromaHalfScale.h | 16 +- modules/WeightedPSNR.cpp | 54 +- modules/WeightedPSNR.h | 16 +- playuver-codestyle.xml | 167 - tools/CMakeLists.txt | 12 +- tools/{PlaYUVerTools.cpp => CalypTools.cpp} | 296 +- tools/CalypTools.h | 104 + ...sCmdParser.cpp => CalypToolsCmdParser.cpp} | 76 +- ...ToolsCmdParser.h => CalypToolsCmdParser.h} | 69 +- tools/PlaYUVerTools.h | 105 - tools/main.cpp | 16 +- 157 files changed, 16532 insertions(+), 17759 deletions(-) delete mode 100644 PlaYUVerUpdate.xml.in rename app/{PlaYUVerAppModuleIf.cpp => CalypAppModuleIf.cpp} (74%) rename app/{PlaYUVerAppModuleIf.h => CalypAppModuleIf.h} (59%) rename app/{PlaYUVerAppDefs.h => CommonDefs.h} (85%) rename app/{PlaYUVerAppAdaptor.cpp => DBusAppAdaptor.cpp} (70%) rename app/{PlaYUVerAppAdaptor.h => DBusAppAdaptor.h} (76%) rename app/{PlaYUVerApp.cpp => MainWindow.cpp} (84%) rename app/{PlaYUVerApp.h => MainWindow.h} (74%) rename app/{PlaYUVerMdiSubWindow.cpp => MdiSubWindow.cpp} (82%) rename app/{PlaYUVerMdiSubWindow.h => MdiSubWindow.h} (75%) rename app/{PlaYUVerSubWindowHandle.cpp => SubWindowHandle.cpp} (82%) rename app/{PlaYUVerSubWindowHandle.h => SubWindowHandle.h} (71%) rename app/{ => dialog}/AboutDialog.cpp (84%) rename app/{ => dialog}/AboutDialog.h (96%) rename app/{ => dialog}/ConfigureFormatDialog.cpp (85%) rename app/{ => dialog}/ConfigureFormatDialog.h (72%) rename app/{ => dialog}/ModulesHandleOptDialog.cpp (87%) rename app/{ => dialog}/ModulesHandleOptDialog.h (83%) rename app/{ => dialog}/ProgressBar.cpp (92%) rename app/{ => dialog}/ProgressBar.h (84%) rename app/{ => dialog}/SeekStreamDialog.cpp (93%) rename app/{ => dialog}/SeekStreamDialog.h (84%) rename app/{DialogSubWindowSelector.cpp => dialog/SubWindowSelectorDialog.cpp} (82%) rename app/{DialogSubWindowSelector.h => dialog/SubWindowSelectorDialog.h} (78%) rename app/{ => docks}/FramePropertiesDock.cpp (81%) rename app/{ => docks}/FramePropertiesDock.h (77%) rename app/{ => docks}/ModuleHandleDock.cpp (86%) rename app/{ => docks}/ModuleHandleDock.h (83%) rename app/{ => docks}/QualityMeasurementSidebar.cpp (71%) rename app/{ => docks}/QualityMeasurementSidebar.h (80%) create mode 100644 app/resources/calyp-logo.png rename app/resources/{playuver.desktop => calyp.desktop} (85%) create mode 100644 app/resources/calyp.ico create mode 100644 app/resources/calyp.png rename app/resources/{playuver.qrc => calyp.qrc} (90%) create mode 100755 app/resources/calyp.rc rename app/resources/{playuver.xml => calyp.xml} (100%) delete mode 100644 app/resources/playuver-background-logo.png delete mode 100644 app/resources/playuver.ico delete mode 100755 app/resources/playuver.png delete mode 100755 app/resources/playuver.rc rename app/{WidgetFrameNumber.cpp => widgets/FrameNumberWidget.cpp} (88%) rename app/{WidgetFrameNumber.h => widgets/FrameNumberWidget.h} (82%) rename app/{ => widgets}/HistogramWidget.cpp (90%) rename app/{ => widgets}/HistogramWidget.h (76%) create mode 100755 format_source_files.sh create mode 100644 lib/CalypConfig.cmake.in create mode 100644 lib/CalypDefs.h rename lib/{PlaYUVerFrame.cpp => CalypFrame.cpp} (50%) create mode 100644 lib/CalypFrame.h rename lib/{PlaYUVerLib.h => CalypLib.h} (65%) create mode 100644 lib/CalypModuleIf.h rename lib/{PlaYUVerOptions.cpp => CalypOptions.cpp} (71%) rename lib/{PlaYUVerOptions.h => CalypOptions.h} (60%) create mode 100644 lib/CalypPixel.cpp rename lib/{PlaYUVerStream.cpp => CalypStream.cpp} (50%) create mode 100644 lib/CalypStream.h create mode 100644 lib/CalypStreamHandlerIf.h rename lib/{PlaYUVerFramePixelFormats.cpp => PixelFormats.cpp} (89%) rename lib/{PlaYUVerFramePixelFormats.h => PixelFormats.h} (76%) delete mode 100644 lib/PlaYUVerConfig.cmake.in delete mode 100644 lib/PlaYUVerDefs.h delete mode 100644 lib/PlaYUVerFrame.h delete mode 100644 lib/PlaYUVerModuleIf.h delete mode 100644 lib/PlaYUVerStream.h delete mode 100644 lib/PlaYUVerStreamHandlerIf.h rename modules/{PlaYUVerModuleFactory.cpp => CalypModulesFactory.cpp} (68%) rename modules/{PlaYUVerModuleFactory.h => CalypModulesFactory.h} (51%) delete mode 100644 playuver-codestyle.xml rename tools/{PlaYUVerTools.cpp => CalypTools.cpp} (52%) create mode 100644 tools/CalypTools.h rename tools/{PlaYUVerToolsCmdParser.cpp => CalypToolsCmdParser.cpp} (67%) rename tools/{PlaYUVerToolsCmdParser.h => CalypToolsCmdParser.h} (57%) delete mode 100644 tools/PlaYUVerTools.h diff --git a/CMakeLists.txt b/CMakeLists.txt index c328fc3..3188df9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ ### -### CMakeLists for playuver +### CMakeLists for calyp ### cmake_minimum_required( VERSION 3.2.0 ) @@ -16,13 +16,15 @@ INCLUDE(GNUInstallDirs) # Project Definition ###################################################################################### -set( PROJECT_NAME "playuver" CACHE INTERNAL "" FORCE ) +SET( PROJECT_NAME "calyp" CACHE INTERNAL "" FORCE ) +SET( PROJECT_LIBRARY "Calyp" CACHE INTERNAL "" FORCE ) + PROJECT( ${PROJECT_NAME} ) -SET( PLAYUVER_VERSION_MAJOR "0" ) -SET( PLAYUVER_VERSION_MINOR "18" ) -SET( PLAYUVER_VERSION_PATCH "3" ) -SET( PLAYUVER_VERSION "${PLAYUVER_VERSION_MAJOR}.${PLAYUVER_VERSION_MINOR}.${PLAYUVER_VERSION_PATCH}" CACHE INTERNAL "" FORCE ) +SET( CALYP_VERSION_MAJOR "0" ) +SET( CALYP_VERSION_MINOR "9999" ) +SET( CALYP_VERSION_PATCH "0" ) +SET( CALYP_VERSION "${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}" CACHE INTERNAL "" FORCE ) ###################################################################################### # Variables @@ -50,7 +52,7 @@ OPTION( USE_STATIC "Use static libs" OFF ) OPTION(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON) # Get current version. -set(PLAYUVER_VERSION_STRING "${PLAYUVER_VERSION}") +set(CALYP_VERSION_STRING "${CALYP_VERSION}") if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) # Probably a Git workspace; determine the revision. FIND_PACKAGE(Git QUIET) @@ -58,7 +60,7 @@ if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} ARGS "describe --tags" - OUTPUT_VARIABLE PLAYUVER_GIT_REVISION + OUTPUT_VARIABLE CALYP_GIT_REVISION RETURN_VALUE TAG_RESULT ) # git describe --tags failed; maybe the repository was checked with depth=1. @@ -66,18 +68,18 @@ if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) exec_program(${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} ARGS "describe --always" - OUTPUT_VARIABLE PLAYUVER_GIT_REVISION + OUTPUT_VARIABLE CALYP_GIT_REVISION ) endif() - message(STATUS "PlaYUVer Git revision: ${PLAYUVER_GIT_REVISION}") - set(PLAYUVER_VERSION_STRING "${PLAYUVER_VERSION} (rev. ${PLAYUVER_GIT_REVISION})") + message(STATUS "Calyp Git revision: ${CALYP_GIT_REVISION}") + set(CALYP_VERSION_STRING "${CALYP_VERSION} (rev. ${CALYP_GIT_REVISION})") else() - message(STATUS "PlaYUVer Git revision could not be determined") + message(STATUS "Calyp Git revision could not be determined") endif() endif() SET(UPDATE_CHANNEL "stable" CACHE STRING "Update channel" ) -CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/PlaYUVerUpdate.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PlaYUVerUpdate-${UPDATE_CHANNEL}.xml ) +# CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/CalypUpdate.xml.in ${CMAKE_CURRENT_BINARY_DIR}/CalypUpdate-${UPDATE_CHANNEL}.xml ) ###################################################################################### @@ -101,29 +103,23 @@ IF( BUILD_TESTS ) ENDIF() OPTION( USE_OPENCV "Add OpenCV support" ON ) -SET( OPENCV_OPTFLOW_FOUND OFF ) IF( USE_OPENCV ) LIST(APPEND OPENCV_MODULES core highgui imgproc video videoio ) FIND_PACKAGE( OpenCV COMPONENTS ${OPENCV_MODULES} ) SET(USE_OPENCV ${OpenCV_FOUND}) ENDIF() -SET_PACKAGE_PROPERTIES(OpenCV PROPERTIES URL "http://opencv.willowgarage.com" DESCRIPTION "OpenCV library support in PlaYUVerFrame" TYPE OPTIONAL) +SET_PACKAGE_PROPERTIES(OpenCV PROPERTIES URL "http://opencv.willowgarage.com" DESCRIPTION "OpenCV library support in CalypFrame" TYPE OPTIONAL) OPTION( USE_FFMPEG "Add FFMPEG support" ON ) IF( USE_FFMPEG ) - FIND_PACKAGE( FFmpeg ) + FIND_PACKAGE( FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE ) IF( ${AVCODEC_VERSION} VERSION_LESS 56.0.0 ) SET(FFMPEG_FOUND FALSE ) SET(FFmpeg_FOUND FALSE ) ENDIF() SET(USE_FFMPEG ${FFMPEG_FOUND}) ENDIF() -SET_PACKAGE_PROPERTIES(FFmpeg PROPERTIES URL "http://ffmpeg.org/" DESCRIPTION "Libav library support in PlaYUVerStream" TYPE OPTIONAL) - -ADD_FEATURE_INFO(DynLoad USE_DYNLOAD "Support for dynamic module load" ) -ADD_FEATURE_INFO(SSE USE_SSE "SSE instructions support" ) -ADD_FEATURE_INFO(WErrors USE_WERROR "Warnings as errors" ) - +SET_PACKAGE_PROPERTIES(FFmpeg PROPERTIES URL "http://ffmpeg.org/" DESCRIPTION "Libav library support in CalypStream" TYPE OPTIONAL) IF( WIN32 ) SET( USE_STATIC ON ) @@ -170,9 +166,11 @@ ENDIF() SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0" ) SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" ) - -ADD_FEATURE_INFO(PlaYUVerApp BUILD_APP "Build Graphical Interface") -ADD_FEATURE_INFO(PlaYUVerTools BUILD_TOOLS "Build Command line tool" ) +ADD_FEATURE_INFO(CalypApp BUILD_APP "Build Graphical interface") +ADD_FEATURE_INFO(CalypTools BUILD_TOOLS "Build Command line tool" ) +ADD_FEATURE_INFO(DynLoad USE_DYNLOAD "Support for dynamic module load" ) +ADD_FEATURE_INFO(SSE USE_SSE "SSE instructions support" ) +ADD_FEATURE_INFO(WErrors USE_WERROR "Warnings as errors" ) ADD_SUBDIRECTORY( lib ) ADD_SUBDIRECTORY( modules ) @@ -197,7 +195,7 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_D ###################################################################################### MESSAGE("") MESSAGE( STATUS "${PROJECT_NAME} INFORMATION" ) -MESSAGE( STATUS "Version: " "${PLAYUVER_VERSION_STRING}" ) +MESSAGE( STATUS "Version: " "${CALYP_VERSION_STRING}" ) MESSAGE( STATUS "Configuration:" ) MESSAGE( STATUS " Static libs: " "${USE_STATIC}" ) MESSAGE( STATUS " Build type: " "${CMAKE_BUILD_TYPE}" ) diff --git a/Doxyfile b/Doxyfile index 90b1bf5..add9ce5 100644 --- a/Doxyfile +++ b/Doxyfile @@ -32,26 +32,26 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = PlaYUVer +PROJECT_NAME = Calyp # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = /home/joaoc/Programming/PlaYUVerDev/playuver/app/resources/playuver.ico +PROJECT_LOGO = app/resources/calyp.ico # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -244,7 +244,7 @@ ALIASES = "returns=\"\par Returns\" " # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,10 +790,10 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = +INPUT = # This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# that doxygen parses. internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. @@ -896,7 +896,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -907,13 +907,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -933,7 +933,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -954,7 +954,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -967,7 +967,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -982,14 +982,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1101,7 +1101,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1145,7 +1145,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1155,7 +1155,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1167,7 +1167,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1180,7 +1180,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1190,7 +1190,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1319,7 +1319,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1327,7 +1327,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1340,7 +1340,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1371,7 +1371,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1396,7 +1396,7 @@ QHP_VIRTUAL_FOLDER = doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1404,21 +1404,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1551,7 +1551,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1559,7 +1559,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1619,7 +1619,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1635,7 +1635,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1645,7 +1645,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1709,7 +1709,7 @@ PAPER_TYPE = a4wide # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1725,7 +1725,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1736,7 +1736,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1747,7 +1747,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1755,7 +1755,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1863,14 +1863,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1915,7 +1915,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2028,7 +2028,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2069,7 +2069,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2077,7 +2077,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2087,7 +2087,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2096,7 +2096,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2125,13 +2125,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2180,14 +2180,14 @@ CLASS_DIAGRAMS = YES # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2236,7 +2236,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2367,7 +2367,7 @@ DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. # -# Note that this requires a modern browser other than Internet Explorer. Tested +# Note that this requires a modern browser other than internet Explorer. Tested # and working are Firefox, Chrome, Safari, and Opera. # Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make # the SVG files visible. Older versions of IE do not have SVG support. @@ -2380,26 +2380,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2407,17 +2407,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/Mainpage.dox b/Mainpage.dox index 384716b..6a13770 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -1,9 +1,9 @@ -/** @mainpage PlaYUVer Project +/** @mainpage Calyp Project Description ---------------------------------------------------------------- -PlaYUVer is an open-source video player with the following features: +Calyp is an open-source video player with the following features: - Support for libavformat and libavcodec; - Support for wide range of raw video formats; - Support up to 16 bits per pixel @@ -12,17 +12,17 @@ PlaYUVer is an open-source video player with the following features: - Synchronized zoom across several videos (perfect for comparison operations) - Useful information in status bar, *e.g.*, pixel information Useful sidebars with frame information, *e.g.*, frame histogram -- Constant growing libs for stream and frame processing (PlaYUVerStream and PlaYUVerFrame) +- Constant growing libs for stream and frame processing (CalypStream and CalypFrame) - Advanced API for frame/video processing algorithms -- Frame level quality measurement API based on the PlaYUVerFrame class +- Frame level quality measurement API based on the CalypFrame class - Powefull command-line tool for quality and frame processing algorithms (uses the referred APIs) Modules ---------------------------------------------------------------- -- PlaYUVerLib: Low level library -- PlaYUVerModules: Abstract interface for frame processing modules -- PlaYUVerApp: High level graphical interface -- PlaYUVerTools: High level command line interface +- CalypLib: Low level library +- CalypModules: Abstract interface for frame processing modules +- Calyp: High level graphical interface +- CalypTools: High level command line interface Supported Quality Metrics @@ -83,7 +83,7 @@ Build/Install using cmake - OpenCv - FFmpeg -3. Run the following commands: (this will create an executable named playuver) +3. Run the following commands: (this will create an executable named calyp) ``` mkdir build cd build diff --git a/PlaYUVerUpdate.xml.in b/PlaYUVerUpdate.xml.in deleted file mode 100644 index a312f02..0000000 --- a/PlaYUVerUpdate.xml.in +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Your Great App's Changelog - http://pypt.github.com/fervor/Appcast.xml - Most recent changes with links to updates. - en - - - - Version @PLAYUVER_VERSION_STRING@ - Mon, 09 Jan 2006 19:20:11 +0000 - http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html - - - http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html - http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html - - - - - - - - - - - - - - diff --git a/README.md b/README.md index 24d0bb1..1917aa8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PlaYUVer +# Calyp ## Enhanced YUV video player based on Qt focusing on image/video analysis @@ -11,16 +11,16 @@ - Synchronized zoom across several videos (perfect for comparison operations) - Useful information in status bar, *e.g.*, pixel information Useful sidebars with frame information, *e.g.*, frame histogram -- Constant growing libs for stream and frame processing (PlaYUVerStream and PlaYUVerFrame) +- Constant growing libs for stream and frame processing (CalypStream and CalypFrame) - Advanced API for frame/video processing algorithms -- Frame level quality measurement API based on the PlaYUVerFrame class +- Frame level quality measurement API based on the CalypFrame class - Powefull command-line tool for quality and frame processing algorithms (uses the referred APIs) ## Modules -- PlaYUVerLib: Low level library -- PlaYUVerModules: Abstract interface for frame processing modules -- PlaYUVerApp: High level graphical interface -- PlaYUVerTools: High level command line interface +- CalypLib: Low level library +- CalypModules: Abstract interface for frame processing modules +- Calyp: High level graphical interface +- CalypTools: High level command line interface ## Supported Quality Metrics - PSNR diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index a2da427..ba73bda 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,8 +1,12 @@ ### -### CMakeLists for playuver app component +### CMakeLists for calyp app component ### -INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/external ) +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/external + ${CMAKE_CURRENT_SOURCE_DIR}/dialog + ${CMAKE_CURRENT_SOURCE_DIR}/docks + ${CMAKE_CURRENT_SOURCE_DIR}/widgets ) OPTION( USE_QTDBUS "Build with QtDBus" ON ) OPTION( USE_FERVOR "Add Fervor support" OFF ) @@ -24,50 +28,51 @@ IF( USE_QTDBUS ) ENDIF() ENDIF() -set(plaYUVer_App_SRCS +set(Calyp_App_SRCS # Main main.cpp - PlaYUVerApp.cpp - PlaYUVerSubWindowHandle.cpp - PlaYUVerMdiSubWindow.cpp + MainWindow.cpp +# Module SubWindow + SubWindowHandle.cpp + MdiSubWindow.cpp SubWindowAbstract.cpp # Module Video + VideoHandle.cpp VideoSubWindow.cpp ViewArea.cpp - VideoHandle.cpp - FramePropertiesDock.cpp + GridManager.cpp # Module Quality QualityHandle.cpp - QualityMeasurementSidebar.cpp PlotSubWindow.cpp external/qcustomplot/qcustomplot.cpp # Module Plugins ModulesHandle.cpp - ModulesHandleOptDialog.cpp - ModuleHandleDock.cpp - PlaYUVerAppModuleIf.cpp - GridManager.cpp + CalypAppModuleIf.cpp # Dialogs - AboutDialog.cpp - ConfigureFormatDialog.cpp - DialogSubWindowSelector.cpp - ProgressBar.cpp - SeekStreamDialog.cpp + dialog/AboutDialog.cpp + dialog/ConfigureFormatDialog.cpp + dialog/SubWindowSelectorDialog.cpp + dialog/ProgressBar.cpp + dialog/SeekStreamDialog.cpp + dialog/ModulesHandleOptDialog.cpp # Widgets - HistogramWidget.cpp - WidgetFrameNumber.cpp - WidgetFrameNumber.cpp + widgets/HistogramWidget.cpp + widgets/FrameNumberWidget.cpp +# Docks + docks/FramePropertiesDock.cpp + docks/ModuleHandleDock.cpp + docks/QualityMeasurementSidebar.cpp ) IF( USE_QTDBUS ) - LIST( APPEND plaYUVer_App_SRCS PlaYUVerAppAdaptor.cpp ) + LIST( APPEND Calyp_App_SRCS DBusAppAdaptor.cpp ) ENDIF() -set(PlaYUVer_App_UI "" ) +set(Calyp_App_UI "" ) -set(PlaYUVer_App_RCC - resources/playuver.qrc +set(Calyp_App_RCC + resources/${PROJECT_NAME}.qrc ) @@ -78,7 +83,7 @@ IF( USE_FERVOR ) IF(EXISTS ${FERVOR_DIR} ) SET( FERVOR_APP_NAME ${PROJECT_NAME} ) - SET( FERVOR_APP_VERSION ${PLAYUVER_VERSION_STRING} ) + SET( FERVOR_APP_VERSION ${CALYP_VERSION_STRING} ) ADD_SUBDIRECTORY( ${FERVOR_DIR} ) @@ -106,8 +111,8 @@ ENDIF() SET_PACKAGE_PROPERTIES(Fervor PROPERTIES URL "https://github.com/pypt/fervor" DESCRIPTION "Fervor lib includes check for updates feature" TYPE OPTIONAL ) ADD_FEATURE_INFO(Fervor USE_FERVOR "Fervor lib includes check for updates feature.") -QT5_WRAP_UI( PlaYUVer_App_UI_Wrap ${PlaYUVer_App_UI} ) -QT5_ADD_RESOURCES( PlaYUVer_App_RCC ${PlaYUVer_App_RCC} ) +QT5_WRAP_UI( Calyp_App_UI_Wrap ${Calyp_App_UI} ) +QT5_ADD_RESOURCES( Calyp_App_RCC ${Calyp_App_RCC} ) # Instruct CMake to run moc automatically when needed. SET( CMAKE_AUTOMOC ON ) @@ -117,27 +122,27 @@ IF( WIN32 ) set(WINDOWS_RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/resources.obj) IF( MSVC ) add_custom_command(OUTPUT ${WINDOWS_RES_FILE} - COMMAND rc.exe /fo ${WINDOWS_RES_FILE} playuver.rc + COMMAND rc.exe /fo ${WINDOWS_RES_FILE} ${PROJECT_NAME}.rc WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources ) ELSE() add_custom_command(OUTPUT ${WINDOWS_RES_FILE} - COMMAND windres.exe playuver.rc ${WINDOWS_RES_FILE} + COMMAND windres.exe ${PROJECT_NAME}.rc ${WINDOWS_RES_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources ) ENDIF() ENDIF() -ADD_EXECUTABLE( ${PROJECT_NAME} ${plaYUVer_App_SRCS} ${HEADERS_MOC_FILES} ${PlaYUVer_App_UI_Wrap} ${PlaYUVer_App_RCC} ${WINDOWS_RES_FILE} ) -TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PlaYUVerLib PlaYUVerModules ${APP_LINKER_LIBS} ${QT_LINKER_LIBS} QCustomPlotLib ) +ADD_EXECUTABLE( ${PROJECT_NAME} ${Calyp_App_SRCS} ${HEADERS_MOC_FILES} ${Calyp_App_UI_Wrap} ${Calyp_App_RCC} ${WINDOWS_RES_FILE} ) +TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${PROJECT_LIBRARY} CalypModules ${APP_LINKER_LIBS} ${QT_LINKER_LIBS} QCustomPlotLib ) # QT5_USE_MODULES( ${PROJECT_NAME} ${QT_MODULES} ) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin ) -INSTALL(FILES resources/playuver.desktop DESTINATION share/applications ) -INSTALL(FILES resources/playuver.png DESTINATION share/pixmaps ) -INSTALL(FILES resources/playuver.xml DESTINATION share/mime/packages ) +INSTALL(FILES resources/calyp.desktop DESTINATION share/applications ) +INSTALL(FILES resources/calyp.png DESTINATION share/pixmaps ) +INSTALL(FILES resources/calyp.xml DESTINATION share/mime/packages ) diff --git a/app/PlaYUVerAppModuleIf.cpp b/app/CalypAppModuleIf.cpp similarity index 74% rename from app/PlaYUVerAppModuleIf.cpp rename to app/CalypAppModuleIf.cpp index 890e067..c8abd5b 100644 --- a/app/PlaYUVerAppModuleIf.cpp +++ b/app/CalypAppModuleIf.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,11 +18,11 @@ */ /** - * \file PlaYUVerAppModuleIf.cpp - * \brief PlaYUVer modules interface + * \file CalypAppModuleIf.cpp + * \brief Calyp modules interface */ -#include "PlaYUVerAppModuleIf.h" +#include "CalypAppModuleIf.h" #include "VideoSubWindow.h" @@ -30,7 +30,7 @@ #include #include -PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaYUVerModuleIf* module ) +CalypAppModuleIf::CalypAppModuleIf( QObject* parent, QAction* action, CalypModuleIf* module ) : m_bIsRunning( false ) , m_pcModuleAction( action ) , m_pcModule( module ) @@ -42,13 +42,13 @@ PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaY , m_dMeasurementResult( 0 ) { setParent( parent ); - for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ ) + for( int i = 0; i < CLP_MODULE_MAX_NUM_FRAMES; i++ ) { m_pcSubWindow[i] = NULL; } } -Void PlaYUVerAppModuleIf::update() +void CalypAppModuleIf::update() { if( m_pcDisplaySubWindow ) { @@ -60,21 +60,21 @@ Void PlaYUVerAppModuleIf::update() } } -Bool PlaYUVerAppModuleIf::isRunning() +bool CalypAppModuleIf::isRunning() { -#ifdef PLAYUVER_THREADED_MODULES +#ifdef CALYP_THREADED_MODULES return QThread::isRunning(); #else return false; #endif } -Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads ) +bool CalypAppModuleIf::apply( bool isPlaying, bool disableThreads ) { - Bool bRet = false; + bool bRet = false; QApplication::setOverrideCursor( Qt::WaitCursor ); - if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE ) + if( m_pcModule->m_iModuleType == CLP_FRAME_PROCESSING_MODULE ) { if( m_pcDisplaySubWindow ) { @@ -85,9 +85,9 @@ Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads ) m_pcSubWindow[0]->setFillWindow( true ); } } - if( !( isPlaying && ( m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_SKIP_WHILE_PLAY ) ) ) + if( !( isPlaying && ( m_pcModule->m_uiModuleRequirements & CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY ) ) ) { -#ifdef PLAYUVER_THREADED_MODULES +#ifdef CALYP_THREADED_MODULES if( !disableThreads ) { wait(); @@ -100,7 +100,7 @@ Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads ) show(); } - if( m_pcDisplaySubWindow || m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE ) + if( m_pcDisplaySubWindow || m_pcModule->m_iModuleType == CLP_FRAME_MEASUREMENT_MODULE ) { bRet = true; } @@ -113,19 +113,19 @@ Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads ) return bRet; } -Void PlaYUVerAppModuleIf::run() +void CalypAppModuleIf::run() { m_bIsRunning = true; m_bSuccess = false; - std::vector apcFrameList; - for( UInt i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ ) + std::vector apcFrameList; + for( unsigned int i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ ) { apcFrameList.push_back( m_pcSubWindow[i]->getCurrFrame() ); } - if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE ) + if( m_pcModule->m_iModuleType == CLP_FRAME_PROCESSING_MODULE ) { - if( m_pcModule->m_iModuleAPI == MODULE_API_2 ) + if( m_pcModule->m_iModuleAPI == CLP_MODULE_API_2 ) { m_pcProcessedFrame = m_pcModule->process( apcFrameList ); } @@ -134,9 +134,9 @@ Void PlaYUVerAppModuleIf::run() m_pcProcessedFrame = m_pcModule->process( m_pcSubWindow[0]->getCurrFrame() ); } } - else if( m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE ) + else if( m_pcModule->m_iModuleType == CLP_FRAME_MEASUREMENT_MODULE ) { - if( m_pcModule->m_iModuleAPI == MODULE_API_2 ) + if( m_pcModule->m_iModuleAPI == CLP_MODULE_API_2 ) { m_dMeasurementResult = m_pcModule->measure( apcFrameList ); } @@ -151,7 +151,7 @@ Void PlaYUVerAppModuleIf::run() } m_bSuccess = true; m_bIsRunning = false; -#ifdef PLAYUVER_THREADED_MODULES +#ifdef CALYP_THREADED_MODULES EventData* eventData = new EventData( m_bSuccess, this ); if( parent() ) QCoreApplication::postEvent( parent(), eventData ); @@ -159,11 +159,11 @@ Void PlaYUVerAppModuleIf::run() return; } -Void PlaYUVerAppModuleIf::show() +void CalypAppModuleIf::show() { switch( m_pcModule->m_iModuleType ) { - case FRAME_PROCESSING_MODULE: + case CLP_FRAME_PROCESSING_MODULE: if( m_pcDisplaySubWindow ) { m_pcDisplaySubWindow->setCurrFrame( m_pcProcessedFrame ); @@ -177,13 +177,13 @@ Void PlaYUVerAppModuleIf::show() m_pcSubWindow[0]->clearWindowBusy(); } break; - case FRAME_MEASUREMENT_MODULE: + case CLP_FRAME_MEASUREMENT_MODULE: m_pcModuleDock->setModulueReturnValue( m_dMeasurementResult ); break; } } -Void PlaYUVerAppModuleIf::destroy() +void CalypAppModuleIf::destroy() { if( m_bIsRunning ) { @@ -207,7 +207,7 @@ Void PlaYUVerAppModuleIf::destroy() m_pcDisplaySubWindow->closeSubWindow(); m_pcDisplaySubWindow = NULL; - for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ ) + for( int i = 0; i < CLP_MODULE_MAX_NUM_FRAMES; i++ ) { if( m_pcSubWindow[i] ) { diff --git a/app/PlaYUVerAppModuleIf.h b/app/CalypAppModuleIf.h similarity index 59% rename from app/PlaYUVerAppModuleIf.h rename to app/CalypAppModuleIf.h index e4e8492..944b5cb 100644 --- a/app/PlaYUVerAppModuleIf.h +++ b/app/CalypAppModuleIf.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,19 +18,19 @@ */ /** - * \file PlaYUVerAppModuleIf.h - * \brief PlaYUVer App modules interface + * \file CalypAppModuleIf.h + * \brief Calyp App modules interface */ -#ifndef __PLAYUVERAPPMODULESIF_H__ -#define __PLAYUVERAPPMODULESIF_H__ +#ifndef __CALYPAPPMODULESIF_H__ +#define __CALYPAPPMODULESIF_H__ +#include "CommonDefs.h" #include "ModuleHandleDock.h" -#include "PlaYUVerAppDefs.h" #include "config.h" -#include "lib/PlaYUVerFrame.h" -#include "lib/PlaYUVerModuleIf.h" -#include "lib/PlaYUVerStream.h" +#include "lib/CalypFrame.h" +#include "lib/CalypModuleIf.h" +#include "lib/CalypStream.h" #include #include @@ -40,12 +40,12 @@ class QAction; class QDockWidget; -//#define PLAYUVER_THREADED_MODULES +#define CLP_MODULE_MAX_NUM_FRAMES 5 class VideoSubWindow; -class PlaYUVerAppModuleIf -#ifdef PLAYUVER_THREADED_MODULES +class CalypAppModuleIf +#ifdef CALYP_THREADED_MODULES : public QThread #else : public QObject @@ -56,58 +56,58 @@ class PlaYUVerAppModuleIf friend class ModulesHandleOptDialog; private: - Bool m_bIsRunning; - Bool m_bSuccess; + bool m_bIsRunning; + bool m_bSuccess; QAction* m_pcModuleAction; - PlaYUVerModuleIf* m_pcModule; + CalypModuleIf* m_pcModule; - VideoSubWindow* m_pcSubWindow[MODULE_REQUIRES_MAX_NUM_FRAMES]; + VideoSubWindow* m_pcSubWindow[CLP_MODULE_MAX_NUM_FRAMES]; VideoSubWindow* m_pcDisplaySubWindow; QDockWidget* m_pcDockWidget; ModuleHandleDock* m_pcModuleDock; - PlaYUVerStream* m_pcModuleStream; - PlaYUVerFrame* m_pcProcessedFrame; - Double m_dMeasurementResult; + CalypStream* m_pcModuleStream; + CalypFrame* m_pcProcessedFrame; + double m_dMeasurementResult; public: class EventData : public QEvent { public: - EventData( bool success, PlaYUVerAppModuleIf* module ) + EventData( bool success, CalypAppModuleIf* module ) : QEvent( QEvent::User ) { m_bSuccess = success; m_pcModule = module; } - Bool m_bSuccess; - PlaYUVerAppModuleIf* m_pcModule; + bool m_bSuccess; + CalypAppModuleIf* m_pcModule; }; - PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaYUVerModuleIf* module ); - virtual ~PlaYUVerAppModuleIf() {} + CalypAppModuleIf( QObject* parent, QAction* action, CalypModuleIf* module ); + virtual ~CalypAppModuleIf() {} QList getSubWindowList() { QList arraySubWindows; - for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ ) + for( int i = 0; i < CLP_MODULE_MAX_NUM_FRAMES; i++ ) if( m_pcSubWindow[i] ) arraySubWindows.append( m_pcSubWindow[i] ); return arraySubWindows; } - PlaYUVerModuleIf* getModule() { return m_pcModule; } - UInt getModuleRequirements() { return m_pcModule->m_uiModuleRequirements; } - Void update(); - Bool apply( Bool isPlaying = false, Bool disableThreads = false ); - Bool isRunning(); - Void show(); - Void destroy(); + CalypModuleIf* getModule() { return m_pcModule; } + unsigned int getModuleRequirements() { return m_pcModule->m_uiModuleRequirements; } + void update(); + bool apply( bool isPlaying = false, bool disableThreads = false ); + bool isRunning(); + void show(); + void destroy(); protected: virtual void run(); }; -#endif // __PLAYUVERAPPMODULESIF_H__ +#endif // __CALYPAPPMODULESIF_H__ diff --git a/app/PlaYUVerAppDefs.h b/app/CommonDefs.h similarity index 85% rename from app/PlaYUVerAppDefs.h rename to app/CommonDefs.h index 1d3e668..30e84a2 100644 --- a/app/PlaYUVerAppDefs.h +++ b/app/CommonDefs.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,14 +18,14 @@ */ /** - * \file PlaYUVerAppDefs.h - * \brief Define types for PlaYUVerApp + * \file CommonDefs.h + * \brief Define common types */ -#ifndef __PLAYUVERAPPDEFS_H__ -#define __PLAYUVERAPPDEFS_H__ +#ifndef __COMMONDEFS_H__ +#define __COMMONDEFS_H__ -#include "lib/PlaYUVerDefs.h" +#include "lib/CalypDefs.h" // ==================================================================================================================== // Qt compatibility redefinition @@ -38,4 +38,4 @@ #define QStringLiteral( str ) QString::fromUtf8( "" str "", sizeof( str ) - 1 ) #endif -#endif // __PLAYUVERAPPDEFS_H__ +#endif // __COMMONDEFS_H__ diff --git a/app/PlaYUVerAppAdaptor.cpp b/app/DBusAppAdaptor.cpp similarity index 70% rename from app/PlaYUVerAppAdaptor.cpp rename to app/DBusAppAdaptor.cpp index 65619cd..a6fd0f2 100644 --- a/app/PlaYUVerAppAdaptor.cpp +++ b/app/DBusAppAdaptor.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,32 +18,35 @@ */ /** - * \file PlaYUVerAppAdaptor.h + * \file DBusAppAdaptor.cpp * \brief Define function to manage the interface in DBus */ -#include "PlaYUVerAppAdaptor.h" +#include "DBusAppAdaptor.h" -#include "PlaYUVerApp.h" +#include "MainWindow.h" -#include +//#include +//#include +#include +#include -PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp* app ) +DBusAppAdaptor::DBusAppAdaptor( MainWindow* app ) : QDBusAbstractAdaptor( app ), m_app( app ) { // application dbus interface - Bool isRegistered = QDBusConnection::sessionBus().registerObject( QStringLiteral( PLAYUVER_DBUS_PATH ), this, + bool isRegistered = QDBusConnection::sessionBus().registerObject( QStringLiteral( CALYP_DBUS_PATH ), this, QDBusConnection::ExportAllSlots ); Q_ASSERT( isRegistered == true ); } -PlaYUVerAppAdaptor::~PlaYUVerAppAdaptor() +DBusAppAdaptor::~DBusAppAdaptor() { - QDBusConnection::sessionBus().unregisterObject( QStringLiteral( PLAYUVER_DBUS_PATH ) ); + QDBusConnection::sessionBus().unregisterObject( QStringLiteral( CALYP_DBUS_PATH ) ); } -void PlaYUVerAppAdaptor::activate() +void DBusAppAdaptor::activate() { if( !m_app ) { @@ -52,13 +55,13 @@ void PlaYUVerAppAdaptor::activate() m_app->raise(); } -QString PlaYUVerAppAdaptor::activeSession() +QString DBusAppAdaptor::activeSession() { // return m_app->sessionManager()->activeSession()->name(); - return QString( "PlaYUVer" ); + return QString( "Calyp" ); } -bool PlaYUVerAppAdaptor::loadFile( const QString& filename ) +bool DBusAppAdaptor::loadFile( const QString& filename ) { m_app->loadFile( filename ); return true; diff --git a/app/PlaYUVerAppAdaptor.h b/app/DBusAppAdaptor.h similarity index 76% rename from app/PlaYUVerAppAdaptor.h rename to app/DBusAppAdaptor.h index 6d435d3..666ae17 100644 --- a/app/PlaYUVerAppAdaptor.h +++ b/app/DBusAppAdaptor.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,33 +18,31 @@ */ /** - * \file PlaYUVerAppAdaptor.h + * \file DBusAppAdaptor.h * \brief Define function to manage the interface in DBus */ -#ifndef __PlaYUVerAppAdaptor_H__ -#define __PlaYUVerAppAdaptor_H__ +#ifndef __DBUSAPPADAPTOR_H__ +#define __DBUSAPPADAPTOR_H__ +#include #include -#include -#include -#include #include #include -#define PLAYUVER_DBUS_SESSION_NAME "org.pixlra.PlaYUVer.application" -#define PLAYUVER_DBUS_PATH "/" +#define CALYP_DBUS_SESSION_NAME "org.pixlra.Calyp.application" +#define CALYP_DBUS_PATH "/" -class PlaYUVerApp; +class MainWindow; -class PlaYUVerAppAdaptor : public QDBusAbstractAdaptor +class DBusAppAdaptor : public QDBusAbstractAdaptor { Q_OBJECT - Q_CLASSINFO( "D-Bus Interface", PLAYUVER_DBUS_SESSION_NAME ) + Q_CLASSINFO( "D-Bus interface", CALYP_DBUS_SESSION_NAME ) Q_PROPERTY( QString activeSession READ activeSession ) public: - PlaYUVerAppAdaptor( PlaYUVerApp* app ); - ~PlaYUVerAppAdaptor(); + DBusAppAdaptor( MainWindow* app ); + ~DBusAppAdaptor(); /** * emit the exiting signal */ @@ -77,7 +75,7 @@ public: QString activeSession(); private: - PlaYUVerApp* m_app; + MainWindow* m_app; }; -#endif // __PlaYUVerAppAdaptor_H__ +#endif // __DBUSAPPADAPTOR_H__ diff --git a/app/GridManager.cpp b/app/GridManager.cpp index 4e70942..2f67fbf 100644 --- a/app/GridManager.cpp +++ b/app/GridManager.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -65,8 +65,8 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter style = Solid; switch( style ) { - case IntersectionDot: - case IntersectionCross: + case intersectionDot: + case intersectionCross: { painter->setPen( mainPen ); // Draw crosses or dots on intersections @@ -82,7 +82,7 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter if( x >= area.x() && y >= area.y() ) { - if( style == IntersectionDot ) + if( style == intersectionDot ) painter->drawPoint( x, y ); // Dot else { // Crosses: diff --git a/app/GridManager.h b/app/GridManager.h index 1cf9e60..e967fea 100644 --- a/app/GridManager.h +++ b/app/GridManager.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -29,7 +29,7 @@ #include #include #include -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "config.h" class QPoint; @@ -44,8 +44,8 @@ class GridManager public: enum Style { - IntersectionDot = 0, - IntersectionCross, + intersectionDot = 0, + intersectionCross, Dashed, Solid }; @@ -93,8 +93,8 @@ public: QPoint nearPos( int x = -1, int y = -1 ); private: - UInt m_uiHSpace; - UInt m_uiVSpace; + unsigned int m_uiHSpace; + unsigned int m_uiVSpace; QColor m_cGridColor; Style m_eGridStyle; QPoint m_nearPos; diff --git a/app/PlaYUVerApp.cpp b/app/MainWindow.cpp similarity index 84% rename from app/PlaYUVerApp.cpp rename to app/MainWindow.cpp index 2cffd1d..4726dd1 100644 --- a/app/PlaYUVerApp.cpp +++ b/app/MainWindow.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * Joao Santos (joaompssantos@gmail.com) @@ -19,21 +19,21 @@ */ /** - * \file PlaYUVerApp.cpp - * \brief Main definition of the PlaYUVerApp app + * \file MainWindow.cpp + * \brief Definition of the main window */ -#include "PlaYUVerApp.h" +#include "MainWindow.h" #include "AboutDialog.h" -#include "DialogSubWindowSelector.h" #include "ModulesHandle.h" -#include "PlaYUVerSubWindowHandle.h" #include "QualityHandle.h" #include "SubWindowAbstract.h" +#include "SubWindowHandle.h" +#include "SubWindowSelectorDialog.h" #include "VideoHandle.h" #include "VideoSubWindow.h" -#include "lib/PlaYUVerOptions.h" +#include "lib/CalypOptions.h" #include #include @@ -47,9 +47,7 @@ #include "fvupdater.h" #endif -#define SYNCHRONISED_ZOON 1 - -PlaYUVerApp::PlaYUVerApp() +MainWindow::MainWindow() : m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), m_pcAboutDialog( NULL ) { setWindowModality( Qt::ApplicationModal ); @@ -57,10 +55,10 @@ PlaYUVerApp::PlaYUVerApp() // DBus #ifdef USE_QTDBUS - m_pDBusAdaptor = new PlaYUVerAppAdaptor( this ); + m_pDBusAdaptor = new DBusAppAdaptor( this ); #endif - m_pcWindowHandle = new PlaYUVerSubWindowHandle( this ); + m_pcWindowHandle = new SubWindowHandle( this ); m_appModuleVideo = new VideoHandle( this, m_pcWindowHandle ); m_appModuleQuality = new QualityHandle( this, m_pcWindowHandle ); @@ -76,7 +74,7 @@ PlaYUVerApp::PlaYUVerApp() readSettings(); setWindowTitle( QApplication::applicationName() ); - setWindowIcon( QIcon( ":/images/playuver.png" ) ); + setWindowIcon( QIcon( ":logos/calyp-icon.png" ) ); setUnifiedTitleAndToolBarOnMac( true ); setCentralWidget( m_pcWindowHandle ); setAcceptDrops( true ); @@ -89,14 +87,14 @@ PlaYUVerApp::PlaYUVerApp() connect( m_appModuleExtensions, SIGNAL( changed() ), this, SLOT( update() ) ); } -Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] ) +bool MainWindow::parseArgs( int argc, char* argv[] ) { - Bool bRet = false; - PlaYUVerOptions pcCmdParser; + bool bRet = false; + CalypOptions pcCmdParser; - std::vector m_apcInputs; - String strResolution( "" ); - String strPelFmt( "" ); + std::vector m_apcInputs; + ClpString strResolution( "" ); + ClpString strPelFmt( "" ); pcCmdParser.addOptions() /**/ ( "input,i", m_apcInputs, "input file" ) /**/ @@ -116,13 +114,13 @@ Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] ) } if( pcCmdParser.hasOpt( "input" ) ) { - for( UInt i = 1; i < m_apcInputs.size(); i++ ) + for( unsigned int i = 1; i < m_apcInputs.size(); i++ ) { loadFile( QString::fromStdString( m_apcInputs[i] ) ); } } - std::list& argv_unhandled = pcCmdParser.getUnhandledArgs(); - for( std::list::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ ) + std::list& argv_unhandled = pcCmdParser.getUnhandledArgs(); + for( std::list::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ ) { loadFile( QString::fromStdString( *it ) ); } @@ -131,22 +129,22 @@ Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] ) return bRet; } -Void PlaYUVerApp::about() +void MainWindow::about() { if( !m_pcAboutDialog ) m_pcAboutDialog = new AboutDialog( this ); m_pcAboutDialog->exec(); } -Void PlaYUVerApp::closeEvent( QCloseEvent* event ) +void MainWindow::closeEvent( QCloseEvent* event ) { - Int mayCloseAll = true; - Int msgBoxCloseRet = QMessageBox::Yes; + int mayCloseAll = true; + int msgBoxCloseRet = QMessageBox::Yes; QList subWindowList = m_pcWindowHandle->findSubWindow(); if( subWindowList.size() >= 1 ) { - QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!", + QMessageBox msgBoxClose( QMessageBox::Question, "Calyp", "There are open files!", QMessageBox::Yes | QMessageBox::No, this ); msgBoxClose.setDefaultButton( QMessageBox::No ); msgBoxClose.setInformativeText( "Close all?" ); @@ -156,7 +154,7 @@ Void PlaYUVerApp::closeEvent( QCloseEvent* event ) { case QMessageBox::Yes: mayCloseAll = true; - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { mayCloseAll &= subWindowList.at( i )->mayClose(); } @@ -179,19 +177,19 @@ Void PlaYUVerApp::closeEvent( QCloseEvent* event ) } } -Void PlaYUVerApp::closeAll() +void MainWindow::closeAll() { m_pcWindowHandle->removeAllSubWindow(); } -Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) +void MainWindow::loadFile( QString fileName, CalypFileInfo* pStreamInfo ) { if( !QFileInfo( fileName ).exists() ) { - printMessage( "File " + fileName + " do not exist!", LOG_ERROR ); + printMessage( "File " + fileName + " do not exist!", CLP_LOG_ERROR ); return; } - VideoSubWindow* videoSubWindow = PlaYUVerApp::findVideoStreamSubWindow( m_pcWindowHandle, fileName ); + VideoSubWindow* videoSubWindow = MainWindow::findVideoStreamSubWindow( m_pcWindowHandle, fileName ); if( videoSubWindow ) { m_pcWindowHandle->setActiveSubWindow( videoSubWindow ); @@ -200,13 +198,13 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) videoSubWindow = new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); // createSubWindow(); if( !pStreamInfo ) { - Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName ); - pStreamInfo = (PlaYUVerStreamInfo*)( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL ); + int idx = findCalypStreamInfo( m_aRecentFileStreamInfo, fileName ); + pStreamInfo = (CalypFileInfo*)( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL ); } try { - Bool opened = false; + bool opened = false; if( !pStreamInfo ) opened = videoSubWindow->loadFile( fileName ); @@ -215,7 +213,7 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) if( opened ) { - printMessage( "Loading file...", LOG_INFO ); + printMessage( "Loading file...", CLP_LOG_INFO ); m_pcWindowHandle->addSubWindow( videoSubWindow ); videoSubWindow->show(); @@ -225,7 +223,7 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) addStreamInfoToRecentList( videoSubWindow->getStreamInfo() ); - printMessage( "File loaded", LOG_INFO ); + printMessage( "File loaded", CLP_LOG_INFO ); m_cLastOpenPath = QFileInfo( fileName ).path(); } else @@ -233,37 +231,37 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) videoSubWindow->close(); } } - catch( PlaYUVerFailure& e ) + catch( CalypFailure& e ) { videoSubWindow->close(); QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what(); QMessageBox::warning( this, QApplication::applicationName(), warningMsg ); - printMessage( warningMsg, LOG_ERROR ); + printMessage( warningMsg, CLP_LOG_ERROR ); } } // ----------------------- File Functions ----------------------- -QStringList PlaYUVerApp::showFileDialog( Bool bRead ) +QStringList MainWindow::showFileDialog( bool bRead ) { QString supported = tr( "Supported Files (" ); QStringList formatsList; - std::vector supportedFmts; + std::vector supportedFmts; if( bRead ) - supportedFmts = PlaYUVerStream::supportedReadFormats(); + supportedFmts = CalypStream::supportedReadFormats(); else - supportedFmts = PlaYUVerStream::supportedWriteFormats(); + supportedFmts = CalypStream::supportedWriteFormats(); - for( UInt i = 0; i < supportedFmts.size(); i++ ) + for( unsigned int i = 0; i < supportedFmts.size(); i++ ) { - std::vector arrayExt = supportedFmts[i].getExts(); + std::vector arrayExt = supportedFmts[i].getExts(); if( arrayExt.size() > 0 ) { QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) ); currFmt.append( " (" ); - for( std::vector::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e ) + for( std::vector::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e ) { supported.append( " *." ); currFmt.append( "*." ); @@ -292,10 +290,10 @@ QStringList PlaYUVerApp::showFileDialog( Bool bRead ) return fileNameList; } -Void PlaYUVerApp::open() +void MainWindow::open() { QStringList fileNameList = showFileDialog( true ); - for( Int i = 0; i < fileNameList.size(); i++ ) + for( int i = 0; i < fileNameList.size(); i++ ) { if( !fileNameList.at( i ).isEmpty() ) { @@ -304,20 +302,20 @@ Void PlaYUVerApp::open() } } -// Void PlaYUVerApp::openDevice() +// void CalypApp::openDevice() //{ // loadFile( "/dev/video0", NULL ); //} -Void PlaYUVerApp::openRecent() +void MainWindow::openRecent() { QAction* action = qobject_cast( sender() ); - PlaYUVerStreamInfo recentFile = action->data().value(); + CalypFileInfo recentFile = action->data().value(); if( action ) loadFile( recentFile.m_cFilename, &recentFile ); } -Void PlaYUVerApp::saveFrame() +void MainWindow::saveFrame() { if( m_pcCurrentVideoSubWindow ) { @@ -332,20 +330,20 @@ Void PlaYUVerApp::saveFrame() { saveWindow->save( fileName ); } - catch( PlaYUVerFailure& e ) + catch( CalypFailure& e ) { QApplication::restoreOverrideCursor(); QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what(); QMessageBox::warning( this, QApplication::applicationName(), warningMsg ); - printMessage( warningMsg, LOG_ERROR ); + printMessage( warningMsg, CLP_LOG_ERROR ); return; } } } } -Void PlaYUVerApp::saveStream() +void MainWindow::saveStream() { if( m_pcCurrentVideoSubWindow ) { @@ -360,20 +358,20 @@ Void PlaYUVerApp::saveStream() { saveWindow->save( fileName ); } - catch( PlaYUVerFailure& e ) + catch( CalypFailure& e ) { QApplication::restoreOverrideCursor(); QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what(); QMessageBox::warning( this, QApplication::applicationName(), warningMsg ); - printMessage( warningMsg, LOG_ERROR ); + printMessage( warningMsg, CLP_LOG_ERROR ); return; } } } } -Void PlaYUVerApp::format() +void MainWindow::format() { if( m_pcCurrentVideoSubWindow ) { @@ -385,12 +383,12 @@ Void PlaYUVerApp::format() addStreamInfoToRecentList( pcVideoSubWindow->getStreamInfo() ); } } - catch( PlaYUVerFailure& e ) + catch( CalypFailure& e ) { QString warningMsg = "Cannot change format of " + QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n" + e.what(); QMessageBox::warning( this, QApplication::applicationName(), warningMsg ); - printMessage( warningMsg, LOG_ERROR ); + printMessage( warningMsg, CLP_LOG_ERROR ); qDebug() << warningMsg; m_pcCurrentSubWindow->close(); } @@ -399,7 +397,7 @@ Void PlaYUVerApp::format() } } -Void PlaYUVerApp::reload() +void MainWindow::reload() { if( m_pcCurrentSubWindow ) { @@ -409,18 +407,18 @@ Void PlaYUVerApp::reload() } } -Void PlaYUVerApp::reloadAll() +void MainWindow::reloadAll() { - UInt windowCategoryOrder[] = { + unsigned int windowCategoryOrder[] = { SubWindowAbstract::VIDEO_STREAM_SUBWINDOW, SubWindowAbstract::MODULE_SUBWINDOW, SubWindowAbstract::MODULE_SUBWINDOW, }; - for( UInt c = 0; c < 3; c++ ) + for( unsigned int c = 0; c < 3; c++ ) { QList subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { subWindowList.at( i )->refreshSubWindow(); } @@ -429,19 +427,19 @@ Void PlaYUVerApp::reloadAll() update(); } -Void PlaYUVerApp::loadAll() +void MainWindow::loadAll() { if( m_pcCurrentVideoSubWindow ) { - printMessage( "Loading file into memory...", LOG_INFO ); + printMessage( "Loading file into memory...", CLP_LOG_INFO ); m_pcCurrentVideoSubWindow->loadAll(); - printMessage( "File loaded", LOG_INFO ); + printMessage( "File loaded", CLP_LOG_INFO ); } } // ----------------------- Zoom Functions ----------------------- -Void PlaYUVerApp::normalSize() +void MainWindow::normalSize() { if( m_pcCurrentSubWindow ) { @@ -450,7 +448,7 @@ Void PlaYUVerApp::normalSize() } } -Void PlaYUVerApp::zoomToFit() +void MainWindow::zoomToFit() { if( m_pcCurrentSubWindow ) { @@ -459,11 +457,11 @@ Void PlaYUVerApp::zoomToFit() } } -Void PlaYUVerApp::zoomToFitAll() +void MainWindow::zoomToFitAll() { VideoSubWindow* videoSubWindow; QList subWindowList = m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { videoSubWindow = qobject_cast( subWindowList.at( i ) ); videoSubWindow->zoomToFit(); @@ -472,28 +470,28 @@ Void PlaYUVerApp::zoomToFitAll() updateZoomFactorSBox(); } -Void PlaYUVerApp::scaleFrame( int ratio ) +void MainWindow::scaleFrame( int ratio ) { if( m_pcCurrentSubWindow ) { - m_pcCurrentSubWindow->scaleView( ( Double )( ratio ) / 100.0 ); + m_pcCurrentSubWindow->scaleView( (double)( ratio ) / 100.0 ); updateZoomFactorSBox(); } } -Void PlaYUVerApp::zoomFromSBox( double zoom ) +void MainWindow::zoomFromSBox( double zoom ) { SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow(); - Double factor = zoom / 100; + double factor = zoom / 100; if( activeSubWindow ) { activeSubWindow->zoomToFactor( factor ); } } -Void PlaYUVerApp::updateZoomFactorSBox() +void MainWindow::updateZoomFactorSBox() { - Double factor; + double factor; if( m_pcCurrentSubWindow ) { factor = m_pcCurrentSubWindow->getScaleFactor(); @@ -503,14 +501,14 @@ Void PlaYUVerApp::updateZoomFactorSBox() // ----------------------- Drag and drop functions ---------------------- -Void PlaYUVerApp::dragEnterEvent( QDragEnterEvent* event ) +void MainWindow::dragEnterEvent( QDragEnterEvent* event ) { // setText(tr("")); // mdiArea->setBackgroundRole( QPalette::Highlight ); event->acceptProposedAction(); } -Void PlaYUVerApp::dropEvent( QDropEvent* event ) +void MainWindow::dropEvent( QDropEvent* event ) { const QMimeData* mimeData = event->mimeData(); QList urlList = mimeData->urls(); @@ -524,13 +522,13 @@ Void PlaYUVerApp::dropEvent( QDropEvent* event ) // ----------------------- Sub Window Functions ----------------------- -VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager, - const QString& fileName ) +VideoSubWindow* MainWindow::findVideoStreamSubWindow( const SubWindowHandle* windowManager, + const QString& fileName ) { QString canonicalFilePath = QFileInfo( fileName ).canonicalFilePath(); VideoSubWindow* pcSubWindow; QList subWindowList = windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { pcSubWindow = qobject_cast( subWindowList.at( i ) ); if( pcSubWindow->getCurrentFileName() == canonicalFilePath ) @@ -541,7 +539,7 @@ VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHa // ----------------------- Update Functions ----------------------- -Void PlaYUVerApp::update() +void MainWindow::update() { SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow(); QCoreApplication::processEvents(); @@ -574,28 +572,28 @@ Void PlaYUVerApp::update() updateMenus(); } -Void PlaYUVerApp::printMessage( const QString& msg ) +void MainWindow::printMessage( const QString& msg ) { printMessage( msg, 0 ); } -Void PlaYUVerApp::printMessage( const QString& msg, UInt logLevel ) +void MainWindow::printMessage( const QString& msg, unsigned int logLevel ) { if( !msg.isEmpty() ) { statusBar()->showMessage( msg, 10000 ); - if( logLevel >= LOG_INFO ) + if( logLevel >= CLP_LOG_INFO ) { m_pcWindowHandle->processLogMsg( msg ); } } } -Void PlaYUVerApp::updateMenus() +void MainWindow::updateMenus() { - Bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 ); + bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 ); - Bool hasVideoStreamSubWindow = false; + bool hasVideoStreamSubWindow = false; if( m_pcCurrentSubWindow ) if( m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ) hasVideoStreamSubWindow = true; @@ -625,7 +623,7 @@ Void PlaYUVerApp::updateMenus() // ----------------------- Create Functions ----------------------- -Void PlaYUVerApp::createActions() +void MainWindow::createActions() { m_arrayActions.resize( TOTAL_ACT ); @@ -642,7 +640,7 @@ Void PlaYUVerApp::createActions() // SIGNAL( triggered() ), this, SLOT( openDevice() ) ); m_arrayRecentFilesActions.resize( MAX_RECENT_FILES ); - for( Int i = 0; i < MAX_RECENT_FILES; i++ ) + for( int i = 0; i < MAX_RECENT_FILES; i++ ) { m_arrayRecentFilesActions[i] = new QAction( this ); m_arrayRecentFilesActions[i]->setVisible( false ); @@ -748,7 +746,7 @@ Void PlaYUVerApp::createActions() #endif m_arrayActions[ABOUT_ACT] = new QAction( tr( "&About" ), this ); - m_arrayActions[ABOUT_ACT]->setIcon( QIcon( ":images/playuver.png" ) ); + m_arrayActions[ABOUT_ACT]->setIcon( QIcon( ":logos/calyp-icon.png" ) ); m_arrayActions[ABOUT_ACT]->setStatusTip( tr( "Show the application's About box" ) ); connect( m_arrayActions[ABOUT_ACT], SIGNAL( triggered() ), this, SLOT( about() ) ); @@ -758,7 +756,7 @@ Void PlaYUVerApp::createActions() connect( m_arrayActions[ABOUTQT_ACT], SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) ); } -Void PlaYUVerApp::createMenus() +void MainWindow::createMenus() { m_arrayMenu.resize( TOTAL_MENUS ); @@ -766,7 +764,7 @@ Void PlaYUVerApp::createMenus() m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[OPEN_ACT] ); // m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[OPEN_DEVICE_ACT] ); m_arrayMenu[RECENT_MENU] = m_arrayMenu[FILE_MENU]->addMenu( tr( "Open Recent" ) ); - for( Int i = 0; i < MAX_RECENT_FILES; ++i ) + for( int i = 0; i < MAX_RECENT_FILES; ++i ) { m_arrayMenu[RECENT_MENU]->addAction( m_arrayRecentFilesActions[i] ); } @@ -820,7 +818,7 @@ Void PlaYUVerApp::createMenus() m_arrayMenu[ABOUT_MENU]->addAction( m_arrayActions[ABOUTQT_ACT] ); } -Void PlaYUVerApp::createToolBars() +void MainWindow::createToolBars() { m_arrayToolBars.resize( TOTAL_TOOLBAR ); @@ -854,7 +852,7 @@ Void PlaYUVerApp::createToolBars() addToolBar( Qt::TopToolBarArea, m_appModuleVideo->createToolBar() ); } -Void PlaYUVerApp::createDockWidgets() +void MainWindow::createDockWidgets() { // Properties Dock Window m_arraySideBars.resize( TOTAL_DOCK ); @@ -862,16 +860,16 @@ Void PlaYUVerApp::createDockWidgets() addDockWidget( Qt::RightDockWidgetArea, m_appModuleQuality->createDock() ); } -Void PlaYUVerApp::createStatusBar() +void MainWindow::createStatusBar() { //! Warning: the following widget cannot change size too much statusBar()->addPermanentWidget( m_appModuleVideo->createStatusBarMessage() ); - printMessage( "Ready!", LOG_INFO ); + printMessage( "Ready!", CLP_LOG_INFO ); } -Void PlaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo ) +void MainWindow::addStreamInfoToRecentList( CalypFileInfo streamInfo ) { - Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, streamInfo.m_cFilename ); + int idx = findCalypStreamInfo( m_aRecentFileStreamInfo, streamInfo.m_cFilename ); if( idx >= 0 ) m_aRecentFileStreamInfo.remove( idx ); m_aRecentFileStreamInfo.prepend( streamInfo ); @@ -880,11 +878,11 @@ Void PlaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo ) updateRecentFileActions(); } -Void PlaYUVerApp::updateRecentFileActions() +void MainWindow::updateRecentFileActions() { - Int numRecentFiles = m_aRecentFileStreamInfo.size(); + int numRecentFiles = m_aRecentFileStreamInfo.size(); numRecentFiles = qMin( numRecentFiles, MAX_RECENT_FILES ); - Int actionIdx = 0; + int actionIdx = 0; while( actionIdx < numRecentFiles ) { QString text = m_aRecentFileStreamInfo.at( actionIdx ).m_cFilename; @@ -904,9 +902,9 @@ Void PlaYUVerApp::updateRecentFileActions() m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false ); } -Void PlaYUVerApp::checkRecentFileActions() +void MainWindow::checkRecentFileActions() { - Int i = 0; + int i = 0; while( i < m_aRecentFileStreamInfo.size() ) { if( !QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).exists() ) @@ -916,7 +914,7 @@ Void PlaYUVerApp::checkRecentFileActions() } else { - UInt64 fileSize = QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).size(); + unsigned long long int fileSize = QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).size(); if( m_aRecentFileStreamInfo.at( i ).m_uiFileSize != fileSize ) { m_aRecentFileStreamInfo.remove( i ); @@ -927,7 +925,7 @@ Void PlaYUVerApp::checkRecentFileActions() } } -Void PlaYUVerApp::readSettings() +void MainWindow::readSettings() { QSettings appSettings; @@ -939,7 +937,7 @@ Void PlaYUVerApp::readSettings() m_cLastOpenPath = appSettings.value( "MainWindow/LastOpenPath", QDir::homePath() ).toString(); QVariant value = appSettings.value( "MainWindow/RecentFileList" ); - m_aRecentFileStreamInfo = value.value(); + m_aRecentFileStreamInfo = value.value(); checkRecentFileActions(); updateRecentFileActions(); @@ -949,7 +947,7 @@ Void PlaYUVerApp::readSettings() m_pcWindowHandle->readSettings(); } -Void PlaYUVerApp::writeSettings() +void MainWindow::writeSettings() { QSettings appSettings; @@ -958,7 +956,7 @@ Void PlaYUVerApp::writeSettings() appSettings.setValue( "MainWindow/LastOpenPath", m_cLastOpenPath ); QVariant var; - var.setValue( m_aRecentFileStreamInfo ); + var.setValue( m_aRecentFileStreamInfo ); appSettings.setValue( "MainWindow/RecentFileList", var ); m_appModuleVideo->writeSettings(); diff --git a/app/PlaYUVerApp.h b/app/MainWindow.h similarity index 74% rename from app/PlaYUVerApp.h rename to app/MainWindow.h index 8482851..2367240 100644 --- a/app/PlaYUVerApp.h +++ b/app/MainWindow.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,14 +18,14 @@ */ /** - * \file PlaYUVerApp.h - * \ingroup PlaYUVerApp - * \brief Main definition of the PlaYUVerApp app + * \file MainWindow.cpp + * \brief Definition of the main window + * \ingroup CalypApp * - * @defgroup PlaYUVerApp PlaYUVer App (GUI) + * @defgroup CalypApp Calyp App (GUI) * @{ * - * PlaYUVerApp is an high level interface providing a GUI + * CalypApp is an high level interface providing a GUI * based on the Qt libs in order to display provide important * information about video streams. * @@ -33,14 +33,14 @@ * */ -#ifndef __PLAYUVERAPP_H__ -#define __PLAYUVERAPP_H__ +#ifndef __MAINWINDOW_H__ +#define __MAINWINDOW_H__ -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "VideoSubWindow.h" #include "config.h" #ifdef USE_QTDBUS -#include "PlaYUVerAppAdaptor.h" +#include "DBusAppAdaptor.h" #endif #include @@ -55,32 +55,32 @@ class QActionGroup; class QAction; class QSignalMapper; -class PlaYUVerOptions; -class PlaYUVerStream; -class PlaYUVerSubWindowHandle; +class CalypOptions; +class CalypStream; +class SubWindowHandle; class VideoHandle; class QualityHandle; class ModulesHandle; -class PlaYUVerAppAdaptor; +class DBusAppAdaptor; class VideoSubWindow; class SubWindowAbstract; class AboutDialog; -class PlaYUVerApp : public QMainWindow +class MainWindow : public QMainWindow { Q_OBJECT public: - PlaYUVerApp(); - Bool parseArgs( Int argc, Char* argv[] ); - Void loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo = NULL ); + MainWindow(); + bool parseArgs( int argc, char* argv[] ); + void loadFile( QString fileName, CalypFileInfo* pStreamInfo = NULL ); public Q_SLOTS: void printMessage( const QString& msg ); - void printMessage( const QString& msg, UInt logLevel ); + void printMessage( const QString& msg, unsigned int logLevel ); protected: - Void closeEvent( QCloseEvent* event ); + void closeEvent( QCloseEvent* event ); private Q_SLOTS: @@ -118,8 +118,8 @@ private Q_SLOTS: void updateZoomFactorSBox(); private: - PlaYUVerAppAdaptor* m_pDBusAdaptor; - PlaYUVerOptions* m_pcCmdParser; + DBusAppAdaptor* m_pDBusAdaptor; + CalypOptions* m_pcCmdParser; /** * Save the current subwindow for every category */ @@ -127,25 +127,25 @@ private: VideoSubWindow* m_pcCurrentVideoSubWindow; QString m_cLastOpenPath; - QStringList showFileDialog( Bool bRead ); + QStringList showFileDialog( bool bRead ); - static VideoSubWindow* findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager, + static VideoSubWindow* findVideoStreamSubWindow( const SubWindowHandle* windowManager, const QString& fileName ); - Void updateMenus(); + void updateMenus(); - Void createActions(); - Void createMenus(); - Void createToolBars(); - Void createDockWidgets(); - Void createStatusBar(); + void createActions(); + void createMenus(); + void createToolBars(); + void createDockWidgets(); + void createStatusBar(); - Void addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo ); - Void updateRecentFileActions(); - Void checkRecentFileActions(); + void addStreamInfoToRecentList( CalypFileInfo streamInfo ); + void updateRecentFileActions(); + void checkRecentFileActions(); - Void readSettings(); - Void writeSettings(); + void readSettings(); + void writeSettings(); QDoubleSpinBox* m_pcZoomFactorSBox; @@ -161,7 +161,7 @@ private: VideoHandle* m_appModuleVideo; QualityHandle* m_appModuleQuality; ModulesHandle* m_appModuleExtensions; - PlaYUVerSubWindowHandle* m_pcWindowHandle; + SubWindowHandle* m_pcWindowHandle; /** * Array of menus for the main app @@ -235,9 +235,9 @@ private: #define MAX_RECENT_FILES 20 QVector m_arrayRecentFilesActions; - PlaYUVerStreamInfoVector m_aRecentFileStreamInfo; + CalypFileInfoVector m_aRecentFileStreamInfo; AboutDialog* m_pcAboutDialog; }; -#endif // __PLAYUVERAPP_H__ +#endif // __MAINWINDOW_H__ diff --git a/app/PlaYUVerMdiSubWindow.cpp b/app/MdiSubWindow.cpp similarity index 82% rename from app/PlaYUVerMdiSubWindow.cpp rename to app/MdiSubWindow.cpp index 1b31eeb..b761ea7 100644 --- a/app/PlaYUVerMdiSubWindow.cpp +++ b/app/MdiSubWindow.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,24 +18,24 @@ */ /** - * \file PlaYUVerMdiSubWindow.cpp + * \file MdiSubWindow.cpp * \brief Re-implementation QMdiSubWindow */ -#include "PlaYUVerMdiSubWindow.h" +#include "MdiSubWindow.h" #include "SubWindowAbstract.h" #include -PlaYUVerMdiSubWindow::PlaYUVerMdiSubWindow( QWidget* parent ) +MdiSubWindow::MdiSubWindow( QWidget* parent ) : QMdiSubWindow( parent ) { setAttribute( Qt::WA_DeleteOnClose ); setBackgroundRole( QPalette::Background ); } -QSize PlaYUVerMdiSubWindow::sizeHint() const +QSize MdiSubWindow::sizeHint() const { QSize maxSize; if( parent() ) @@ -44,7 +44,7 @@ QSize PlaYUVerMdiSubWindow::sizeHint() const return sizeHint; } -Void PlaYUVerMdiSubWindow::closeEvent( QCloseEvent* event ) +void MdiSubWindow::closeEvent( QCloseEvent* event ) { emit aboutToClose( this ); event->accept(); diff --git a/app/PlaYUVerMdiSubWindow.h b/app/MdiSubWindow.h similarity index 75% rename from app/PlaYUVerMdiSubWindow.h rename to app/MdiSubWindow.h index 0c4f7db..bae332e 100644 --- a/app/PlaYUVerMdiSubWindow.h +++ b/app/MdiSubWindow.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,30 +18,30 @@ */ /** - * \file PlaYUVerMdiSubWindow.h + * \file MdiSubWindow.h * \brief Re-implementation QMdiSubWindow */ -#ifndef __PLAYUVERMDISUBWINDOW_H__ -#define __PLAYUVERMDISUBWINDOW_H__ +#ifndef __MDISUBWINDOW_H_ +#define __MDISUBWINDOW_H_ #include -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "config.h" -class PlaYUVerMdiSubWindow : public QMdiSubWindow +class MdiSubWindow : public QMdiSubWindow { Q_OBJECT public: - PlaYUVerMdiSubWindow( QWidget* parent = 0 ); + MdiSubWindow( QWidget* parent = 0 ); Q_SIGNALS: - void aboutToClose( PlaYUVerMdiSubWindow* ); + void aboutToClose( MdiSubWindow* ); protected: QSize sizeHint() const; void closeEvent( QCloseEvent* event ); }; -#endif // __PLAYUVERMDISUBWINDOW_H__ +#endif // __MDISUBWINDOW_H_ diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 613c500..4af7f55 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -19,22 +19,22 @@ /** * \file ModulesHandle.cpp - * \brief PlaYUVer modules handle + * \brief Calyp modules handle */ #include "ModulesHandle.h" -#include "DialogSubWindowSelector.h" +#include "MainWindow.h" #include "ModulesHandleOptDialog.h" -#include "PlaYUVerApp.h" -#include "PlaYUVerSubWindowHandle.h" +#include "SubWindowHandle.h" +#include "SubWindowSelectorDialog.h" #include "VideoHandle.h" #include "VideoSubWindow.h" -#include "modules/PlaYUVerModuleFactory.h" +#include "modules/CalypModulesFactory.h" #include -ModulesHandle::ModulesHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager, VideoHandle* moduleVideo ) +ModulesHandle::ModulesHandle( QWidget* parent, SubWindowHandle* windowManager, VideoHandle* moduleVideo ) : QWidget( parent ), m_pcParent( parent ), m_pcMainWindowManager( windowManager ), m_appModuleVideo( moduleVideo ) { setParent( m_pcParent ); @@ -42,7 +42,7 @@ ModulesHandle::ModulesHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowMa ModulesHandle::~ModulesHandle() {} -Void ModulesHandle::createActions() +void ModulesHandle::createActions() { m_arrayActions.resize( MODULES_TOTAL_ACT ); @@ -89,14 +89,14 @@ QMenu* ModulesHandle::createMenu() return m_pcModulesMenu; } -Void ModulesHandle::buildMenu() +void ModulesHandle::buildMenu() { - PlaYUVerModuleIf* pcCurrModuleIf; - QString ModuleIfInternalName; + CalypModuleIf* pcCurrModuleIf; + QString ModuleIfinternalName; QAction* currAction; QMenu* currSubMenu; - for( Int i = 0; i < m_arrayModulesActions.size(); i++ ) + for( int i = 0; i < m_arrayModulesActions.size(); i++ ) { delete m_arrayModulesActions.at( i ); } @@ -104,17 +104,17 @@ Void ModulesHandle::buildMenu() m_pcModulesMenu->clear(); m_pcModulesSubMenuList.clear(); - PlaYUVerModuleFactoryMap& PlaYUVerModuleFactoryMap = PlaYUVerModuleFactory::Get()->getMap(); - PlaYUVerModuleFactoryMap::iterator it = PlaYUVerModuleFactoryMap.begin(); - for( ; it != PlaYUVerModuleFactoryMap.end(); ++it ) + CalypModulesFactoryMap& moduleFactoryMap = CalypModulesFactory::Get()->getMap(); + CalypModulesFactoryMap::iterator it = moduleFactoryMap.begin(); + for( ; it != moduleFactoryMap.end(); ++it ) { pcCurrModuleIf = it->second(); - ModuleIfInternalName = QString::fromLocal8Bit( it->first ); + ModuleIfinternalName = QString::fromLocal8Bit( it->first ); currSubMenu = NULL; if( pcCurrModuleIf->m_pchModuleCategory ) { - for( Int j = 0; j < m_pcModulesSubMenuList.size(); j++ ) + for( int j = 0; j < m_pcModulesSubMenuList.size(); j++ ) { if( m_pcModulesSubMenuList.at( j )->title() == QString( pcCurrModuleIf->m_pchModuleCategory ) ) { @@ -135,7 +135,7 @@ Void ModulesHandle::buildMenu() moduleTooltip += QString( " | Requires %1 frames" ).arg( pcCurrModuleIf->m_uiNumberOfFrames ); currAction->setStatusTip( moduleTooltip ); - currAction->setData( ModuleIfInternalName ); + currAction->setData( ModuleIfinternalName ); currAction->setCheckable( false ); connect( currAction, SIGNAL( triggered() ), this, SLOT( activateModule() ) ); m_arrayModulesActions.append( currAction ); @@ -157,41 +157,41 @@ Void ModulesHandle::buildMenu() m_pcModulesMenu->addAction( m_arrayActions[FORCE_NEW_WINDOW_ACT] ); } -Void ModulesHandle::updateMenus() +void ModulesHandle::updateMenus() { VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); - Bool hasSubWindow = pcSubWindow ? true : false; + bool hasSubWindow = pcSubWindow ? true : false; QAction* currModuleAction; - for( Int i = 0; i < m_arrayModulesActions.size(); i++ ) + for( int i = 0; i < m_arrayModulesActions.size(); i++ ) { currModuleAction = m_arrayModulesActions.at( i ); //currModuleAction->setEnabled( hasSubWindow ); currModuleAction->setChecked( false ); } - //for( Int i = 0; i < m_pcModulesSubMenuList.size(); i++ ) + //for( int i = 0; i < m_pcModulesSubMenuList.size(); i++ ) //{ // m_pcModulesSubMenuList.at( i )->setEnabled( hasSubWindow ); //} - for( Int i = 0; i < m_arrayActions.size(); i++ ) + for( int i = 0; i < m_arrayActions.size(); i++ ) { m_arrayActions.at( i )->setEnabled( false ); } m_arrayActions[LOAD_EXTERNAL_ACT]->setEnabled( true ); m_arrayActions[FORCE_NEW_WINDOW_ACT]->setEnabled( hasSubWindow ); - m_arrayActions[DISABLE_ALL_ACT]->setEnabled( m_pcPlaYUVerAppModuleIfList.size() > 0 ); + m_arrayActions[DISABLE_ALL_ACT]->setEnabled( m_pcCalypAppModuleIfList.size() > 0 ); if( pcSubWindow ) { - QList apcCurrentModule = pcSubWindow->getModuleArray(); + QList apcCurrentModule = pcSubWindow->getModuleArray(); m_arrayActions[DISABLE_ACT]->setEnabled( apcCurrentModule.size() > 0 ); if( pcSubWindow->getDisplayModule() ) { m_arrayActions[APPLY_ALL_ACT]->setEnabled( true ); m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true ); } - for( Int i = 0; i < apcCurrentModule.size(); i++ ) + for( int i = 0; i < apcCurrentModule.size(); i++ ) { currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction; currModuleAction->setChecked( true ); @@ -199,27 +199,27 @@ Void ModulesHandle::updateMenus() } } -Void ModulesHandle::readSettings() +void ModulesHandle::readSettings() { QSettings appSettings; m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked( appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() ); } -Void ModulesHandle::writeSettings() +void ModulesHandle::writeSettings() { QSettings appSettings; appSettings.setValue( "ModulesHandle/UseNewWindow", m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() ); } -Void ModulesHandle::processOpt( Int index ) +void ModulesHandle::processOpt( int index ) { VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( pcSubWindow ) { - PlaYUVerAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule(); + CalypAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule(); if( pcCurrentModule ) { - PlaYUVerAppModuleIf* pcCurrModule = pcCurrentModule; + CalypAppModuleIf* pcCurrModule = pcCurrentModule; switch( index ) { case INVALID_OPT: @@ -238,9 +238,9 @@ Void ModulesHandle::processOpt( Int index ) } } -Void ModulesHandle::loadExternalModule() +void ModulesHandle::loadExternalModule() { - Bool bUpdate = false; + bool bUpdate = false; QString supported = tr( "Supported Files (*.so)" ); QStringList formatsList; formatsList << "Shared Libraries (*.so)"; @@ -249,19 +249,19 @@ Void ModulesHandle::loadExternalModule() QStringList fileNames = QFileDialog::getOpenFileNames( m_pcParent, tr( "Open File" ), QString(), filter.join( ";;" ) ); - for( Int i = 0; i < fileNames.size(); i++ ) + for( int i = 0; i < fileNames.size(); i++ ) { - bUpdate |= PlaYUVerModuleFactory::Get()->RegisterDl( fileNames.at( i ).toStdString().data() ); + bUpdate |= CalypModulesFactory::Get()->RegisterDl( fileNames.at( i ).toStdString().data() ); } if( bUpdate ) buildMenu(); } -Void ModulesHandle::activateModule() +void ModulesHandle::activateModule() { QAction* pcAction = qobject_cast( sender() ); Qt::KeyboardModifiers keyModifiers = QApplication::keyboardModifiers(); - Bool bTmpForceNewWindow = false; + bool bTmpForceNewWindow = false; VideoSubWindow* pcVideoSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( !pcVideoSubWindow ) @@ -275,28 +275,28 @@ Void ModulesHandle::activateModule() } QString ModuleIfName = pcAction->data().toString(); - PlaYUVerModuleIf* pcCurrModuleIf = - PlaYUVerModuleFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() ); - PlaYUVerAppModuleIf* pcCurrAppModuleIf = new PlaYUVerAppModuleIf( this, pcAction, pcCurrModuleIf ); + CalypModuleIf* pcCurrModuleIf = + CalypModulesFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() ); + CalypAppModuleIf* pcCurrAppModuleIf = new CalypAppModuleIf( this, pcAction, pcCurrModuleIf ); QList videoSubWindowList; - Int numberOfFrames = pcCurrAppModuleIf->m_pcModule->m_uiNumberOfFrames; - if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME ) // Show dialog to select sub windows + int numberOfFrames = pcCurrAppModuleIf->m_pcModule->m_uiNumberOfFrames; + if( numberOfFrames > 1 ) // Show dialog to select sub windows { - Int minNumFrames = numberOfFrames; - Int maxNumFrames = numberOfFrames; - if( numberOfFrames == MODULE_REQUIRES_SEVERAL_FRAMES ) + int minNumFrames = numberOfFrames; + int maxNumFrames = numberOfFrames; + if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & CLP_MODULES_VARIABLE_NUM_FRAMES ) { - minNumFrames = 0; + minNumFrames = numberOfFrames; maxNumFrames = 255; } - DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMainWindowManager, + SubWindowSelectorDialog dialogWindowsSelection( m_pcParent, m_pcMainWindowManager, SubWindowAbstract::VIDEO_SUBWINDOW, minNumFrames, maxNumFrames ); QList windowsList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); if( windowsList.size() == minNumFrames && windowsList.size() == maxNumFrames ) { - for( Int i = 0; i < windowsList.size(); i++ ) + for( int i = 0; i < windowsList.size(); i++ ) { videoSubWindowList.append( qobject_cast( windowsList.at( i ) ) ); } @@ -305,7 +305,7 @@ Void ModulesHandle::activateModule() { if( windowsList.size() <= minNumFrames ) { - for( Int i = 0; i < windowsList.size(); i++ ) + for( int i = 0; i < windowsList.size(); i++ ) { dialogWindowsSelection.selectSubWindow( windowsList.at( i ) ); } @@ -318,22 +318,22 @@ Void ModulesHandle::activateModule() { VideoSubWindow* videoSubWindow; QList subWindowList = dialogWindowsSelection.getSelectedWindows(); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { videoSubWindow = qobject_cast( subWindowList.at( i ) ); videoSubWindowList.append( videoSubWindow ); } } } - if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_1 ) + if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == CLP_MODULE_API_1 ) { // Check for same fmt in more than one frame modules - for( Int i = 1; i < videoSubWindowList.size(); i++ ) + for( int i = 1; i < videoSubWindowList.size(); i++ ) { if( !videoSubWindowList.at( i )->getCurrFrame()->haveSameFmt( videoSubWindowList.at( 0 )->getCurrFrame() ) ) { videoSubWindowList.clear(); - qobject_cast( m_pcParent )->printMessage( "Error! Incompatible frames", LOG_ERROR ); + qobject_cast( m_pcParent )->printMessage( "Error! Incompatible frames", CLP_LOG_ERROR ); destroyModuleIf( pcCurrAppModuleIf ); return; } @@ -347,36 +347,36 @@ Void ModulesHandle::activateModule() if( videoSubWindowList.size() == 0 ) { - qobject_cast( m_pcParent ) - ->printMessage( "Error! There is no windows to apply the module", LOG_ERROR ); + qobject_cast( m_pcParent ) + ->printMessage( "Error! There is no windows to apply the module", CLP_LOG_ERROR ); destroyModuleIf( pcCurrAppModuleIf ); return; } - for( Int i = 0; i < videoSubWindowList.size(); i++ ) + for( int i = 0; i < videoSubWindowList.size(); i++ ) { pcCurrAppModuleIf->m_pcSubWindow[i] = videoSubWindowList.at( i ); } - if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_OPTIONS ) + if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & CLP_MODULE_REQUIRES_OPTIONS ) { ModulesHandleOptDialog moduleOptDialog( m_pcParent, pcCurrAppModuleIf ); if( moduleOptDialog.runConfiguration() == QDialog::Rejected ) { - qobject_cast( m_pcParent )->printMessage( "Module canceled by user!", LOG_WARNINGS ); + qobject_cast( m_pcParent )->printMessage( "Module canceled by user!", CLP_LOG_WARNINGS ); destroyModuleIf( pcCurrAppModuleIf ); return; } } - Bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow; + bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow; QString windowName; VideoSubWindow* pcModuleSubWindow = NULL; - if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE ) + if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == CLP_FRAME_PROCESSING_MODULE ) { - if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow ) + if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & CLP_MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow ) { pcModuleSubWindow = new VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW ); windowName.append( QStringLiteral( "Module " ) ); @@ -390,7 +390,7 @@ Void ModulesHandle::activateModule() // SLOT( moveAllScrollBars( const QPoint ) ) ); } } - else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE ) + else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == CLP_FRAME_MEASUREMENT_MODULE ) { pcCurrAppModuleIf->m_pcDisplaySubWindow = NULL; pcCurrAppModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent, pcCurrAppModuleIf ); @@ -414,24 +414,24 @@ Void ModulesHandle::activateModule() { if( pcCurrAppModuleIf->m_pcDisplaySubWindow ) pcCurrAppModuleIf->m_pcDisplaySubWindow->enableModule( pcCurrAppModuleIf ); - for( Int i = 0; i < videoSubWindowList.size(); i++ ) + for( int i = 0; i < videoSubWindowList.size(); i++ ) { pcCurrAppModuleIf->m_pcSubWindow[i]->associateModule( pcCurrAppModuleIf ); } } // Create Module - Bool moduleCreated = false; - if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_2 ) + bool moduleCreated = false; + if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == CLP_MODULE_API_2 ) { - std::vector apcFrameList; - for( Int i = 0; i < videoSubWindowList.size(); i++ ) + std::vector apcFrameList; + for( int i = 0; i < videoSubWindowList.size(); i++ ) { apcFrameList.push_back( pcCurrAppModuleIf->m_pcSubWindow[i]->getCurrFrame() ); } moduleCreated = pcCurrAppModuleIf->m_pcModule->create( apcFrameList ); } - else if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_1 ) + else if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == CLP_MODULE_API_1 ) { pcCurrAppModuleIf->m_pcModule->create( pcCurrAppModuleIf->m_pcSubWindow[0]->getCurrFrame() ); moduleCreated = true; @@ -439,7 +439,7 @@ Void ModulesHandle::activateModule() if( !moduleCreated ) { - qobject_cast( m_pcParent )->printMessage( "Error! Module cannot be created", LOG_ERROR ); + qobject_cast( m_pcParent )->printMessage( "Error! Module cannot be created", CLP_LOG_ERROR ); destroyModuleIf( pcCurrAppModuleIf ); return; } @@ -462,12 +462,12 @@ Void ModulesHandle::activateModule() videoSubWindowList.at( 0 )->setWindowName( windowName ); } - m_pcPlaYUVerAppModuleIfList.append( pcCurrAppModuleIf ); + m_pcCalypAppModuleIfList.append( pcCurrAppModuleIf ); emit changed(); } -Void ModulesHandle::destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) +void ModulesHandle::destroyModuleIf( CalypAppModuleIf* pcCurrModuleIf ) { if( pcCurrModuleIf ) { @@ -475,7 +475,7 @@ Void ModulesHandle::destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) } } -Void ModulesHandle::destroyWindowModules() +void ModulesHandle::destroyWindowModules() { VideoSubWindow* pcVideoSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( pcVideoSubWindow ) @@ -485,44 +485,44 @@ Void ModulesHandle::destroyWindowModules() } } -Void ModulesHandle::destroyAllModulesIf() +void ModulesHandle::destroyAllModulesIf() { - for( Int i = 0; i < m_pcPlaYUVerAppModuleIfList.size(); i++ ) + for( int i = 0; i < m_pcCalypAppModuleIfList.size(); i++ ) { - destroyModuleIf( m_pcPlaYUVerAppModuleIfList.at( i ) ); + destroyModuleIf( m_pcCalypAppModuleIfList.at( i ) ); } emit changed(); } -Void ModulesHandle::applyModuleIf( QList pcCurrModuleIfList, Bool isPlaying, Bool disableThreads ) +void ModulesHandle::applyModuleIf( QList pcCurrModuleIfList, bool isPlaying, bool disableThreads ) { - for( Int i = 0; i < pcCurrModuleIfList.size() && !isPlaying; i++ ) + for( int i = 0; i < pcCurrModuleIfList.size() && !isPlaying; i++ ) { pcCurrModuleIfList.at( i )->apply( isPlaying, disableThreads ); } } -Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) +void ModulesHandle::applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf ) { if( pcCurrModuleIf ) { if( !pcCurrModuleIf->m_pcModuleStream ) { - UInt Width = 0, Height = 0, FrameRate = 30; - Int BitsPixel, InputFormat = -1; + unsigned int Width = 0, Height = 0, FrameRate = 30; + int BitsPixel, InputFormat = -1; QString supported = tr( "Supported Files (" ); QStringList formatsList; - std::vector supportedFmts = PlaYUVerStream::supportedWriteFormats(); + std::vector supportedFmts = CalypStream::supportedWriteFormats(); - for( UInt i = 0; i < supportedFmts.size(); i++ ) + for( unsigned int i = 0; i < supportedFmts.size(); i++ ) { - std::vector arrayExt = supportedFmts[i].getExts(); + std::vector arrayExt = supportedFmts[i].getExts(); if( arrayExt.size() > 0 ) { QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) ); currFmt.append( " (" ); - for( std::vector::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e ) + for( std::vector::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e ) { supported.append( " *." ); currFmt.append( "*." ); @@ -549,9 +549,9 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) BitsPixel = pcCurrModuleIf->m_pcProcessedFrame->getBitsPel(); FrameRate = pcCurrModuleIf->m_pcSubWindow[0]->getInputStream()->getFrameRate(); - pcCurrModuleIf->m_pcModuleStream = new PlaYUVerStream; + pcCurrModuleIf->m_pcModuleStream = new CalypStream; if( !pcCurrModuleIf->m_pcModuleStream->open( fileName.toStdString(), Width, Height, InputFormat, BitsPixel, - PLAYUVER_LITTLE_ENDIAN, FrameRate, false ) ) + CLP_LITTLE_ENDIAN, FrameRate, false ) ) { delete pcCurrModuleIf->m_pcModuleStream; pcCurrModuleIf->m_pcModuleStream = NULL; @@ -561,10 +561,10 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) } if( pcCurrModuleIf->m_pcModuleStream ) { - UInt numberOfWindows = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames; - UInt64 currFrames = 0; - UInt64 numberOfFrames = INT_MAX; - for( UInt i = 0; i < numberOfWindows; i++ ) + unsigned int numberOfWindows = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames; + unsigned long long int currFrames = 0; + unsigned long long int numberOfFrames = INT_MAX; + for( unsigned int i = 0; i < numberOfWindows; i++ ) { currFrames = pcCurrModuleIf->m_pcSubWindow[i]->getInputStream()->getFrameNum(); if( currFrames < numberOfFrames ) @@ -572,18 +572,18 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) pcCurrModuleIf->m_pcSubWindow[i]->stop(); } QApplication::setOverrideCursor( Qt::WaitCursor ); - for( UInt f = 1; f < numberOfFrames; f++ ) + for( unsigned int f = 1; f < numberOfFrames; f++ ) { pcCurrModuleIf->apply( false, true ); QCoreApplication::processEvents(); pcCurrModuleIf->m_pcModuleStream->writeFrame( pcCurrModuleIf->m_pcProcessedFrame ); - for( UInt i = 0; i < numberOfWindows; i++ ) + for( unsigned int i = 0; i < numberOfWindows; i++ ) { pcCurrModuleIf->m_pcSubWindow[i]->play(); pcCurrModuleIf->m_pcSubWindow[i]->playEvent(); } } - for( UInt i = 0; i < numberOfWindows; i++ ) + for( unsigned int i = 0; i < numberOfWindows; i++ ) { pcCurrModuleIf->m_pcSubWindow[i]->stop(); } @@ -591,9 +591,9 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) } } -Void ModulesHandle::swapModulesWindowsIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) +void ModulesHandle::swapModulesWindowsIf( CalypAppModuleIf* pcCurrModuleIf ) { - if( pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames == MODULE_REQUIRES_TWO_FRAMES ) + if( pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames == 2 ) { VideoSubWindow* auxWindowHandle = pcCurrModuleIf->m_pcSubWindow[0]; pcCurrModuleIf->m_pcSubWindow[0] = pcCurrModuleIf->m_pcSubWindow[1]; @@ -602,13 +602,13 @@ Void ModulesHandle::swapModulesWindowsIf( PlaYUVerAppModuleIf* pcCurrModuleIf ) } } -Void ModulesHandle::customEvent( QEvent* event ) +void ModulesHandle::customEvent( QEvent* event ) { if( !event ) { return; } - PlaYUVerAppModuleIf::EventData* eventData = (PlaYUVerAppModuleIf::EventData*)event; + CalypAppModuleIf::EventData* eventData = (CalypAppModuleIf::EventData*)event; if( eventData->m_bSuccess ) { eventData->m_pcModule->show(); diff --git a/app/ModulesHandle.h b/app/ModulesHandle.h index 38717a0..5dfa51c 100644 --- a/app/ModulesHandle.h +++ b/app/ModulesHandle.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,7 +18,7 @@ */ /** * \file ModulesHandle.h - * \brief PlaYUVer modules handle + * \brief Calyp modules handle */ #ifndef __MODULESHANDLE_H__ @@ -31,38 +31,38 @@ #include #include -#include "PlaYUVerAppDefs.h" -#include "PlaYUVerAppModuleIf.h" -#include "lib/PlaYUVerFrame.h" +#include "CalypAppModuleIf.h" +#include "CommonDefs.h" +#include "lib/CalypFrame.h" class VideoHandle; -class PlaYUVerSubWindowHandle; -class PlaYUVerAppModuleIf; +class SubWindowHandle; +class CalypAppModuleIf; class SubWindowHandle; class ModulesHandle : public QWidget { Q_OBJECT public: - ModulesHandle( QWidget*, PlaYUVerSubWindowHandle*, VideoHandle* ); + ModulesHandle( QWidget*, SubWindowHandle*, VideoHandle* ); ~ModulesHandle(); - Void createActions(); + void createActions(); QMenu* createMenu(); // QDockWidget* createDock(); - Void buildMenu(); - Void updateMenus(); + void buildMenu(); + void updateMenus(); - Void readSettings(); - Void writeSettings(); + void readSettings(); + void writeSettings(); - static Void destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ); - static Void applyModuleIf( QList pcCurrModuleIfList, Bool isPlaying = false, - Bool disableThreads = false ); + static void destroyModuleIf( CalypAppModuleIf* pcCurrModuleIf ); + static void applyModuleIf( QList pcCurrModuleIfList, bool isPlaying = false, + bool disableThreads = false ); private: QWidget* m_pcParent; - PlaYUVerSubWindowHandle* m_pcMainWindowManager; + SubWindowHandle* m_pcMainWindowManager; VideoHandle* m_appModuleVideo; enum @@ -74,7 +74,7 @@ private: QMenu* m_pcModulesMenu; QList m_pcModulesSubMenuList; - QList m_pcPlaYUVerAppModuleIfList; + QList m_pcCalypAppModuleIfList; QVector m_arrayModulesActions; @@ -92,11 +92,11 @@ private: QVector m_arrayActions; QSignalMapper* m_pcActionMapper; - Void enableModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ); - Void applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf ); - Void swapModulesWindowsIf( PlaYUVerAppModuleIf* pcCurrModuleIf ); + void enableModuleIf( CalypAppModuleIf* pcCurrModuleIf ); + void applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf ); + void swapModulesWindowsIf( CalypAppModuleIf* pcCurrModuleIf ); - Void customEvent( QEvent* event ); + void customEvent( QEvent* event ); Q_SIGNALS: void changed(); diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index 07363d0..8af1e6b 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -27,7 +27,7 @@ #include "qcustomplot.h" //#include "external/qcustomplot/qcustomplot.h" -Void PlotSubWindow::definePlotColors() +void PlotSubWindow::definePlotColors() { m_arrayColorList.append( Qt::blue ); m_arrayColorList.append( Qt::red ); @@ -121,7 +121,7 @@ PlotSubWindow::~PlotSubWindow() delete m_cPlotArea; } -Void PlotSubWindow::normalSize() +void PlotSubWindow::normalSize() { m_cPlotArea->xAxis->setRange( m_aAxisRange[HORIZONTAL][0], m_aAxisRange[HORIZONTAL][1] ); m_cPlotArea->yAxis->setRange( m_aAxisRange[VERTICAL][0], m_aAxisRange[VERTICAL][1] ); @@ -129,14 +129,14 @@ Void PlotSubWindow::normalSize() m_dScaleFactor = 1; } -Void PlotSubWindow::zoomToFit() +void PlotSubWindow::zoomToFit() { normalSize(); } -Void PlotSubWindow::zoomToFactor( Double factor, QPoint center ) {} +void PlotSubWindow::zoomToFactor( double factor, QPoint center ) {} -Void PlotSubWindow::scaleView( Double scale, QPoint center ) +void PlotSubWindow::scaleView( double scale, QPoint center ) { scale -= 1; scale /= 10; @@ -144,9 +144,9 @@ Void PlotSubWindow::scaleView( Double scale, QPoint center ) m_dScaleFactor *= scale; // - // UInt aNewAxisRange[2][2]; - // for( UInt axis = 0; axis < 2; axis++ ) - // for( UInt dim = 0; dim < 2; dim++ ) + // unsigned int aNewAxisRange[2][2]; + // for( unsigned int axis = 0; axis < 2; axis++ ) + // for( unsigned int dim = 0; dim < 2; dim++ ) // aNewAxisRange[axis][dim] = m_aAxisRange[axis][dim] / m_dScaleFactor; // // m_cPlotArea->xAxis->setRange( aNewAxisRange[HORIZONTAL][0], @@ -179,19 +179,19 @@ QSize PlotSubWindow::sizeHint( const QSize& maxSize ) const return maxSize * 2 / 3; } -Void PlotSubWindow::setAxisName( const QString& nameAxisX, const QString& nameAxisY ) +void PlotSubWindow::setAxisName( const QString& nameAxisX, const QString& nameAxisY ) { m_cPlotArea->xAxis->setLabel( nameAxisX ); m_cPlotArea->yAxis->setLabel( nameAxisY ); } -Void PlotSubWindow::setAxisRange( const QLine& axisLimits ) +void PlotSubWindow::setAxisRange( const QLine& axisLimits ) { setAxisRange( HORIZONTAL, axisLimits.x1(), axisLimits.x2() ); setAxisRange( VERTICAL, axisLimits.y1(), axisLimits.y2() ); } -Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd ) +void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd ) { if( eAxis == HORIZONTAL ) { @@ -210,7 +210,7 @@ Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStar m_cPlotArea->replot(); } -Void PlotSubWindow::addPlot( const QVector& arrayX, const QVector& arrayY, const QString& key ) +void PlotSubWindow::addPlot( const QVector& arrayX, const QVector& arrayY, const QString& key ) { QCPGraph* newPlot = m_cPlotArea->addGraph(); QColor plotColor = m_arrayColorList.at( 0 ); diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index 5678575..52c9d2b 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -25,7 +25,7 @@ #ifndef __PLOTWINDOWHANDLE_H__ #define __PLOTWINDOWHANDLE_H__ -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "SubWindowAbstract.h" #include "config.h" @@ -48,40 +48,40 @@ private: HORIZONTAL, VERTICAL, }; - Double m_aAxisRange[2][2]; - Double m_dScaleFactor; - Int m_iNumberPlots; + double m_aAxisRange[2][2]; + double m_dScaleFactor; + int m_iNumberPlots; public: PlotSubWindow( const QString& windowTitle, QWidget* parent = NULL ); ~PlotSubWindow(); - Void definePlotColors(); + void definePlotColors(); - Void refreshSubWindow() {} + void refreshSubWindow() {} /** * Virtual functions from SubWindowAbstract */ - Void normalSize(); - Void zoomToFit(); - Void zoomToFactor( Double factor, QPoint center = QPoint() ); - Void scaleView( Double scale, QPoint center = QPoint() ); + void normalSize(); + void zoomToFit(); + void zoomToFactor( double factor, QPoint center = QPoint() ); + void scaleView( double scale, QPoint center = QPoint() ); - Double getScaleFactor() { return m_dScaleFactor; } + double getScaleFactor() { return m_dScaleFactor; } /** * Size related functions */ QSize sizeHint() const; QSize sizeHint( const QSize& ) const; - Void setAxisName( const QString& nameAxisX, const QString& nameAxisY ); + void setAxisName( const QString& nameAxisX, const QString& nameAxisY ); - Void setAxisRange( const QLine& axisLimits ); - Void setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd ); + void setAxisRange( const QLine& axisLimits ); + void setAxisRange( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd ); - Void setKey( const QString& key ); + void setKey( const QString& key ); - Void addPlot( const QVector& arrayX, const QVector& arrayY, const QString& key = QString() ); + void addPlot( const QVector& arrayX, const QVector& arrayY, const QString& key = QString() ); }; #endif // __PLOTWINDOWHANDLE_H__ diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index 39e64ac..d44a39c 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -24,24 +24,24 @@ #include "QualityHandle.h" -#include "DialogSubWindowSelector.h" -#include "PlaYUVerSubWindowHandle.h" #include "PlotSubWindow.h" #include "ProgressBar.h" +#include "SubWindowHandle.h" +#include "SubWindowSelectorDialog.h" #include "VideoSubWindow.h" #include "lib/LibMemory.h" #include #include "QtConcurrent/qtconcurrentrun.h" -QualityHandle::QualityHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager ) +QualityHandle::QualityHandle( QWidget* parent, SubWindowHandle* windowManager ) : m_pcParet( parent ), m_pcMainWindowManager( windowManager ) { } QualityHandle::~QualityHandle() {} -Void QualityHandle::createActions() +void QualityHandle::createActions() { m_actionGroupQualityMetric = new QActionGroup( this ); m_actionGroupQualityMetric->setExclusive( true ); @@ -49,9 +49,9 @@ Void QualityHandle::createActions() m_mapperQualityMetric = new QSignalMapper( this ); QAction* currAction; - for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ ) + for( unsigned int i = 0; i < CalypFrame::supportedQualityMetricsList().size(); i++ ) { - currAction = new QAction( PlaYUVerFrame::supportedQualityMetricsList()[i].c_str(), this ); + currAction = new QAction( CalypFrame::supportedQualityMetricsList()[i].c_str(), this ); currAction->setCheckable( true ); m_actionGroupQualityMetric->addAction( currAction ); connect( currAction, SIGNAL( triggered() ), m_mapperQualityMetric, SLOT( map() ) ); @@ -97,12 +97,12 @@ QDockWidget* QualityHandle::createDock() return m_pcQualityHandleDock; } -Void QualityHandle::updateMenus() +void QualityHandle::updateMenus() { VideoSubWindow* pcCurrentVideoSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); - Bool hasSubWindow = pcCurrentVideoSubWindow ? true : false; - Bool hasReference = false; - Bool isReference = false; + bool hasSubWindow = pcCurrentVideoSubWindow ? true : false; + bool hasReference = false; + bool isReference = false; if( hasSubWindow ) { @@ -112,7 +112,7 @@ Void QualityHandle::updateMenus() VideoSubWindow* pcVideoSubWindow; QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); if( pcVideoSubWindow->getRefSubWindow() == pcCurrentVideoSubWindow ) @@ -133,36 +133,36 @@ Void QualityHandle::updateMenus() m_pcQualityHandleSideBar->updateSideBar( hasSubWindow ); } -Void QualityHandle::readSettings() +void QualityHandle::readSettings() { QSettings appSettings; - Int metric = appSettings.value( "QualityHandle/Metric", 0 ).toInt(); + int metric = appSettings.value( "QualityHandle/Metric", 0 ).toInt(); slotQualityMetricChanged( metric ); if( !appSettings.value( "QualityHandle/QualitySideBar", true ).toBool() ) m_pcQualityHandleDock->close(); } -Void QualityHandle::writeSettings() +void QualityHandle::writeSettings() { QSettings appSettings; appSettings.setValue( "QualityHandle/Metric", m_iQualityMetricIdx ); appSettings.setValue( "QualityHandle/QualitySideBar", m_pcQualityHandleDock->isVisible() ); } -Void QualityHandle::update( VideoSubWindow* currSubWindow ) +void QualityHandle::update( VideoSubWindow* currSubWindow ) { m_pcQualityHandleSideBar->updateCurrentWindow( currSubWindow ); } -Void QualityHandle::measureQuality( QVector apcWindowList ) +void QualityHandle::measureQuality( QVector apcWindowList ) { - QVector* padQualityValues; - UInt numberOfWindows = apcWindowList.size(); - UInt64 currFrames = 0; - UInt64 numberOfFrames = INT_MAX; + QVector* padQualityValues; + unsigned int numberOfWindows = apcWindowList.size(); + unsigned long long int currFrames = 0; + unsigned long long int numberOfFrames = INT_MAX; //! Check reference window - for( UInt i = 0; i < numberOfWindows; i++ ) + for( unsigned int i = 0; i < numberOfWindows; i++ ) { if( !apcWindowList.at( i )->getRefSubWindow() ) { @@ -172,7 +172,7 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) VideoSubWindow* pcReferenceWindow = apcWindowList.at( 0 )->getRefSubWindow(); numberOfFrames = pcReferenceWindow->getInputStream()->getFrameNum(); - for( UInt i = 0; i < numberOfWindows; i++ ) + for( unsigned int i = 0; i < numberOfWindows; i++ ) { currFrames = apcWindowList.at( i )->getInputStream()->getFrameNum(); if( currFrames < numberOfFrames ) @@ -183,24 +183,24 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) ProgressBar* pcProgressBar = new ProgressBar( m_pcParet, numberOfFrames ); - padQualityValues = new QVector[numberOfWindows + 1]; + padQualityValues = new QVector[numberOfWindows + 1]; - PlaYUVerFrame* pcReferenceFrame; - PlaYUVerFrame* pcCurrFrame; - for( UInt f = 0; f < numberOfFrames; f++ ) + CalypFrame* pcReferenceFrame; + CalypFrame* pcCurrFrame; + for( unsigned int f = 0; f < numberOfFrames; f++ ) { padQualityValues[0].append( f ); pcReferenceFrame = pcReferenceWindow->getCurrFrame(); - for( UInt i = 0; i < numberOfWindows; i++ ) + for( unsigned int i = 0; i < numberOfWindows; i++ ) { pcCurrFrame = apcWindowList.at( i )->getCurrFrame(); - padQualityValues[i + 1].append( pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, LUMA ) ); + padQualityValues[i + 1].append( pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, CLP_LUMA ) ); apcWindowList.at( i )->seekRelativeEvent( true ); } pcReferenceWindow->seekRelativeEvent( true ); pcProgressBar->incrementProgress( 1 ); } - for( UInt i = 0; i < numberOfWindows; i++ ) + for( unsigned int i = 0; i < numberOfWindows; i++ ) { apcWindowList.at( i )->stop(); } @@ -213,12 +213,12 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) } PlotSubWindow* pcPlotWindow = new PlotSubWindow( plotWindowTitle ); pcPlotWindow->setAxisName( - "Frame Number", QString::fromStdString( PlaYUVerFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) ); + "Frame Number", QString::fromStdString( CalypFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) ); if( apcWindowList.size() > 1 ) { QString key; - for( UInt i = 0; i < numberOfWindows; i++ ) + for( unsigned int i = 0; i < numberOfWindows; i++ ) { key = apcWindowList.at( i )->getWindowName(); pcPlotWindow->addPlot( padQualityValues[0], padQualityValues[i + 1], key ); @@ -235,7 +235,7 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) pcProgressBar->close(); } -Void QualityHandle::slotQualityMetricChanged( Int idx ) +void QualityHandle::slotQualityMetricChanged( int idx ) { m_actionGroupQualityMetric->actions().at( idx )->setChecked( true ); m_pcQualityHandleSideBar->updateQualityMetric( idx ); @@ -243,7 +243,7 @@ Void QualityHandle::slotQualityMetricChanged( Int idx ) m_iQualityMetricIdx = idx; } -Void QualityHandle::slotSelectCurrentAsReference() +void QualityHandle::slotSelectCurrentAsReference() { VideoSubWindow* pcRefSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( pcRefSubWindow ) @@ -251,7 +251,7 @@ Void QualityHandle::slotSelectCurrentAsReference() VideoSubWindow* pcVideoSubWindow; QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); if( pcVideoSubWindow != pcRefSubWindow ) @@ -263,7 +263,7 @@ Void QualityHandle::slotSelectCurrentAsReference() } } -Void QualityHandle::slotPlotQualitySingle() +void QualityHandle::slotPlotQualitySingle() { VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( pcSubWindow ) @@ -287,7 +287,7 @@ Void QualityHandle::slotPlotQualitySingle() } } -Void QualityHandle::slotPlotQualitySeveral() +void QualityHandle::slotPlotQualitySeveral() { VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( pcSubWindow ) @@ -303,7 +303,7 @@ Void QualityHandle::slotPlotQualitySeveral() VideoSubWindow* pcVideoSubWindow; QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); if( pcVideoSubWindow->getRefSubWindow() == pcRefSubWindow ) diff --git a/app/QualityHandle.h b/app/QualityHandle.h index 92902b6..157db43 100644 --- a/app/QualityHandle.h +++ b/app/QualityHandle.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -27,34 +27,34 @@ #include #include -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "QFuture" #include "QualityMeasurementSidebar.h" #include "config.h" -class PlaYUVerSubWindowHandle; +class SubWindowHandle; class VideoSubWindow; class QualityHandle : public QWidget { Q_OBJECT public: - QualityHandle( QWidget*, PlaYUVerSubWindowHandle* ); + QualityHandle( QWidget*, SubWindowHandle* ); ~QualityHandle(); - Void createActions(); + void createActions(); QMenu* createMenu(); QDockWidget* createDock(); - Void updateMenus(); + void updateMenus(); - Void readSettings(); - Void writeSettings(); + void readSettings(); + void writeSettings(); - Void update( VideoSubWindow* currSubWindow ); + void update( VideoSubWindow* currSubWindow ); private: QWidget* m_pcParet; - PlaYUVerSubWindowHandle* m_pcMainWindowManager; + SubWindowHandle* m_pcMainWindowManager; enum { @@ -66,7 +66,7 @@ private: QVector m_arrayActions; QActionGroup* m_actionGroupQualityMetric; QSignalMapper* m_mapperQualityMetric; - Int m_iQualityMetricIdx; + int m_iQualityMetricIdx; QMenu* m_pcMenuQuality; QMenu* m_pcSubMenuQualityMetrics; @@ -74,8 +74,8 @@ private: QDockWidget* m_pcQualityHandleDock; QualityMeasurementSidebar* m_pcQualityHandleSideBar; - QFuture m_cMeasurementResult; - Void measureQuality( QVector apcWindowList ); + QFuture m_cMeasurementResult; + void measureQuality( QVector apcWindowList ); Q_SIGNALS: void changed(); diff --git a/app/SubWindowAbstract.cpp b/app/SubWindowAbstract.cpp index 0073b26..f44c90a 100644 --- a/app/SubWindowAbstract.cpp +++ b/app/SubWindowAbstract.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -24,7 +24,7 @@ #include "SubWindowAbstract.h" -#include "PlaYUVerMdiSubWindow.h" +#include "MdiSubWindow.h" #include #include @@ -32,7 +32,7 @@ #include #include -SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category ) +SubWindowAbstract::SubWindowAbstract( QWidget* parent, unsigned int category ) : QWidget( parent ), m_cSubWindow( NULL ) { setParent( parent ); @@ -42,7 +42,7 @@ SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category ) setAttribute( Qt::WA_DeleteOnClose ); setBackgroundRole( QPalette::Background ); - setWindowIcon( QIcon( ":/images/playuver.png" ) ); + setWindowIcon( QIcon( ":/logos/calyp-icon.png" ) ); // setWidgetResizable( true ); m_pcLayout = NULL; @@ -57,7 +57,7 @@ SubWindowAbstract::~SubWindowAbstract() return; } -Void SubWindowAbstract::setWidget( QWidget* widget ) +void SubWindowAbstract::setWidget( QWidget* widget ) { QGridLayout* layout = new QGridLayout( this ); layout->setContentsMargins( 0, 0, 0, 0 ); @@ -69,7 +69,7 @@ void SubWindowAbstract::onDestroyed() return; } -Void SubWindowAbstract::setWindowName( QString name ) +void SubWindowAbstract::setWindowName( QString name ) { m_cWindowName = name; setWindowTitle( m_cWindowName ); @@ -80,7 +80,7 @@ QString SubWindowAbstract::getWindowName() return m_cWindowName; } -Bool SubWindowAbstract::mayClose() +bool SubWindowAbstract::mayClose() { return true; } @@ -95,18 +95,18 @@ QSize SubWindowAbstract::sizeHint( const QSize& ) const return QSize(); } -Void SubWindowAbstract::focusInEvent( QFocusEvent* event ) +void SubWindowAbstract::focusInEvent( QFocusEvent* event ) { emit aboutToActivate( this ); } -Void SubWindowAbstract::closeEvent( QCloseEvent* event ) +void SubWindowAbstract::closeEvent( QCloseEvent* event ) { emit aboutToClose( this ); event->accept(); } -Void SubWindowAbstract::closeSubWindow() +void SubWindowAbstract::closeSubWindow() { close(); if( m_cSubWindow ) diff --git a/app/SubWindowAbstract.h b/app/SubWindowAbstract.h index 2baa016..c5aaa22 100644 --- a/app/SubWindowAbstract.h +++ b/app/SubWindowAbstract.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -19,14 +19,14 @@ /** * \file SubWindowAbstract.h - * \ingroup PlaYUVerApp PlaYUVerApp_Subwindow + * \ingroup CalypApp CalypApp_Subwindow * \brief Abstract class to handle subwindows * - * @defgroup PlaYUVerApp_Subwindow SubWindow definition + * @defgroup CalypApp_Subwindow SubWindow definition * @{ - * \ingroup PlaYUVerApp + * \ingroup CalypApp * - * Different SubWindow may be found in the PlaYUVerApp + * Different SubWindow may be found in the CalypApp * Each one provide different functionality and serve * different purposes, ( e.g., displaying a video stream * or displaying a quality plot) @@ -41,14 +41,14 @@ #include #include #include -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "config.h" class QHBoxLayout; class QFocusEvent; class QCloseEvent; -class PlaYUVerMdiSubWindow; +class MdiSubWindow; class SubWindowAbstract : public QWidget { @@ -56,10 +56,10 @@ class SubWindowAbstract : public QWidget private: QHBoxLayout* m_pcLayout; - UInt m_uiCategory; + unsigned int m_uiCategory; QString m_cWindowName; - PlaYUVerMdiSubWindow* m_cSubWindow; + MdiSubWindow* m_cSubWindow; public: enum SubWindowCategory @@ -72,35 +72,35 @@ public: }; Q_DECLARE_FLAGS( SubWindowCategories, SubWindowCategory ) - SubWindowAbstract( QWidget*, UInt ); + SubWindowAbstract( QWidget*, unsigned int ); ~SubWindowAbstract(); /** * Show the image at its original size */ - virtual Void refreshSubWindow() = 0; + virtual void refreshSubWindow() = 0; /** * Show the image at its original size */ - virtual Void normalSize() = 0; + virtual void normalSize() = 0; /** * Scale the image (zoomed in or out) to fit on the window. */ - virtual Void zoomToFit() = 0; + virtual void zoomToFit() = 0; /** * Scale the image (zoomed in or out) to speficied absolute zoom value (1.0 = * original size). */ - virtual Void zoomToFactor( Double factor, QPoint center = QPoint() ) = 0; + virtual void zoomToFactor( double factor, QPoint center = QPoint() ) = 0; /** * Scale the image by a given factor * @param factor factor of scale. Ex: 1.2 scale the image up by 20% and * 0.8 scale the image down by 25% */ - virtual Void scaleView( Double, QPoint center = QPoint() ) = 0; + virtual void scaleView( double, QPoint center = QPoint() ) = 0; - virtual Double getScaleFactor() = 0; + virtual double getScaleFactor() = 0; /** * Size related functions @@ -112,10 +112,10 @@ public: * Window name */ - Void setWindowName( QString ); + void setWindowName( QString ); QString getWindowName(); - virtual Bool mayClose(); + virtual bool mayClose(); /** * Get category of the SubWindow @@ -123,22 +123,22 @@ public: * @note This function should be used with enum SubWindowCategories * with an & operation and it may belong to several categories */ - UInt getCategory() { return m_uiCategory; } + unsigned int getCategory() { return m_uiCategory; } /** * Check category of the SubWindow * @param checkCateory SubWindow category to check against; * it should be enum SubWindowCategories type * @return true when SubWindow belong to checkCateory */ - Bool checkCategory( UInt checkCateory ) { return m_uiCategory & checkCateory; } - Void setSubWindow( PlaYUVerMdiSubWindow* subWindow ) { m_cSubWindow = subWindow; } - Void closeSubWindow(); + bool checkCategory( unsigned int checkCateory ) { return m_uiCategory & checkCateory; } + void setSubWindow( MdiSubWindow* subWindow ) { m_cSubWindow = subWindow; } + void closeSubWindow(); protected: void focusInEvent( QFocusEvent* event ); virtual void closeEvent( QCloseEvent* event ); - Void setWidget( QWidget* widget ); + void setWidget( QWidget* widget ); Q_SIGNALS: /** diff --git a/app/PlaYUVerSubWindowHandle.cpp b/app/SubWindowHandle.cpp similarity index 82% rename from app/PlaYUVerSubWindowHandle.cpp rename to app/SubWindowHandle.cpp index babfd04..6ec0be7 100644 --- a/app/PlaYUVerSubWindowHandle.cpp +++ b/app/SubWindowHandle.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * Joao Santos (joaompssantos@gmail.com) @@ -19,14 +19,14 @@ */ /** - * \file PlaYUVerSubWindowHandle.cpp + * \file SubWindowHandle.cpp * \brief Handle multiple sub-windows */ -#include "PlaYUVerSubWindowHandle.h" +#include "SubWindowHandle.h" -#include "PlaYUVerApp.h" -#include "PlaYUVerMdiSubWindow.h" +#include "MainWindow.h" +#include "MdiSubWindow.h" #include "SubWindowAbstract.h" #include @@ -41,16 +41,16 @@ #include #include -class PlaYUVerMdiArea : public QMdiArea +class MdiArea : public QMdiArea { public: - PlaYUVerMdiArea( QWidget* parent = 0 ) - : QMdiArea( parent ), m_pixmapLogo( ":/images/playuver-background-logo.png" ) + MdiArea( QWidget* parent = 0 ) + : QMdiArea( parent ), m_pixmapLogo( ":/logos/calyp-logo.png" ) { setBackgroundRole( QPalette::Background ); } - Void appendLogMessage( const QString& msg ) + void appendLogMessage( const QString& msg ) { m_acLogMessages.push_front( msg ); if( m_acLogMessages.size() > 5 ) @@ -63,13 +63,13 @@ protected: { QMdiArea::paintEvent( event ); QPainter painter( viewport() ); - QPixmap pixFinalLogo = m_pixmapLogo.scaled( 2 * size() / 3, Qt::KeepAspectRatio ); + QPixmap pixFinalLogo = m_pixmapLogo.scaled( 2 * size() / 5, Qt::KeepAspectRatio ); // Calculate the logo position - the bottom right corner of the mdi area. int x = width() / 2 - pixFinalLogo.width() / 2; int y = height() / 2 - pixFinalLogo.height() / 2; painter.drawPixmap( x, y, pixFinalLogo ); - // for( Int i = 0; i < m_acLogMessages.size(); i++ ) + // for( int i = 0; i < m_acLogMessages.size(); i++ ) // { // painter.drawText( 5, height() - 5 - i * 15, m_acLogMessages.at( i ) // ); @@ -82,7 +82,7 @@ private: QPixmap m_pixmapLogo; }; -PlaYUVerSubWindowHandle::PlaYUVerSubWindowHandle( QWidget* parent ) +SubWindowHandle::SubWindowHandle( QWidget* parent ) : QWidget( parent ) { m_iWindowMode = -1; @@ -92,12 +92,12 @@ PlaYUVerSubWindowHandle::PlaYUVerSubWindowHandle( QWidget* parent ) m_apcSubWindowList.clear(); m_apcMdiSubWindowList.clear(); - m_pcApp = qobject_cast( parentWidget() ); + m_pcApp = qobject_cast( parentWidget() ); // setWindowMode( DETACHEDSUBWINDOWMODE ); setWindowMode( MDISUBWINDOWMODE ); } -Void PlaYUVerSubWindowHandle::processLogMsg( const QString& msg ) +void SubWindowHandle::processLogMsg( const QString& msg ) { if( m_pcMdiArea ) { @@ -105,7 +105,7 @@ Void PlaYUVerSubWindowHandle::processLogMsg( const QString& msg ) } } -Void PlaYUVerSubWindowHandle::resetWindowMode() +void SubWindowHandle::resetWindowMode() { QList apcSubWindowList = m_apcSubWindowList; @@ -116,14 +116,14 @@ Void PlaYUVerSubWindowHandle::resetWindowMode() { m_cMdiModeWindowPosition = m_pcApp->pos(); m_cMdiModeWindowSize = m_pcApp->size(); - for( Int i = 0; i < m_apcSubWindowList.size(); i++ ) + for( int i = 0; i < m_apcSubWindowList.size(); i++ ) { m_apcSubWindowList.at( i )->setParent( NULL ); } - for( Int i = 0; i < m_apcMdiSubWindowList.size(); i++ ) + for( int i = 0; i < m_apcMdiSubWindowList.size(); i++ ) { - disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this, - SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) ); + disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( MdiSubWindow* ) ), this, + SLOT( removeMdiSubWindow( MdiSubWindow* ) ) ); m_apcMdiSubWindowList.at( i )->close(); } m_apcMdiSubWindowList.clear(); @@ -135,7 +135,7 @@ Void PlaYUVerSubWindowHandle::resetWindowMode() } } -Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode ) +void SubWindowHandle::setWindowMode( int iWindowMode ) { if( m_iWindowMode == iWindowMode ) return; @@ -144,7 +144,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode ) if( iWindowMode == DETACHEDSUBWINDOWMODE ) { - for( Int i = 0; i < m_apcSubWindowList.size(); i++ ) + for( int i = 0; i < m_apcSubWindowList.size(); i++ ) { m_apcSubWindowList.at( i )->setParent( NULL ); m_apcSubWindowList.at( i )->resize( m_apcSubWindowList.at( i )->sizeHint() ); @@ -163,13 +163,13 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode ) if( iWindowMode == MDISUBWINDOWMODE ) { setVisible( true ); - m_pcMdiArea = new PlaYUVerMdiArea; + m_pcMdiArea = new MdiArea; m_pcMdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder ); connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( updateActiveSubWindow() ) ); m_pcWindowManagerLayout = new QHBoxLayout( this ); m_pcWindowManagerLayout->addWidget( m_pcMdiArea ); setLayout( m_pcWindowManagerLayout ); - for( Int i = 0; i < m_apcSubWindowList.size(); i++ ) + for( int i = 0; i < m_apcSubWindowList.size(); i++ ) { addMdiSubWindow( m_apcSubWindowList.at( i ) ); m_apcSubWindowList.at( i )->resize( m_apcSubWindowList.at( i )->sizeHint() ); @@ -187,7 +187,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode ) // qApp->processEvents(); } -Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window ) +void SubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window ) { if( m_iWindowMode == DETACHEDSUBWINDOWMODE ) { @@ -205,7 +205,7 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window ) if( mdiSubWindow ) { QWidget* activeWidget = m_pcMdiArea->activeSubWindow()->widget(); - Int windowIdx = m_apcSubWindowList.indexOf( qobject_cast( activeWidget ) ); + int windowIdx = m_apcSubWindowList.indexOf( qobject_cast( activeWidget ) ); if( windowIdx >= 0 ) { m_pcActiveWindow = m_apcSubWindowList.at( windowIdx ); @@ -219,18 +219,18 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window ) } } -Void PlaYUVerSubWindowHandle::addMdiSubWindow( SubWindowAbstract* window ) +void SubWindowHandle::addMdiSubWindow( SubWindowAbstract* window ) { - PlaYUVerMdiSubWindow* mdiSubWindow = new PlaYUVerMdiSubWindow; + MdiSubWindow* mdiSubWindow = new MdiSubWindow; mdiSubWindow->setWidget( window ); m_pcMdiArea->addSubWindow( mdiSubWindow ); m_apcMdiSubWindowList.append( mdiSubWindow ); window->setSubWindow( mdiSubWindow ); - connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this, - SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) ); + connect( mdiSubWindow, SIGNAL( aboutToClose( MdiSubWindow* ) ), this, + SLOT( removeMdiSubWindow( MdiSubWindow* ) ) ); } -Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags ) +void SubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags ) { if( window ) { @@ -251,7 +251,7 @@ Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::Windo } } -Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx ) +void SubWindowHandle::removeSubWindow( int windowIdx ) { if( windowIdx >= 0 ) { @@ -263,7 +263,7 @@ Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx ) } if( m_iWindowMode == MDISUBWINDOWMODE ) { - PlaYUVerMdiSubWindow* mdiSubWindow = m_apcMdiSubWindowList.at( windowIdx ); + MdiSubWindow* mdiSubWindow = m_apcMdiSubWindowList.at( windowIdx ); m_apcMdiSubWindowList.removeAt( windowIdx ); m_pcMdiArea->removeSubWindow( m_apcSubWindowList.at( windowIdx ) ); m_apcSubWindowList.at( windowIdx )->close(); @@ -280,17 +280,17 @@ Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx ) } } -Void PlaYUVerSubWindowHandle::removeSubWindow( SubWindowAbstract* window ) +void SubWindowHandle::removeSubWindow( SubWindowAbstract* window ) { removeSubWindow( m_apcSubWindowList.indexOf( window ) ); } -Void PlaYUVerSubWindowHandle::removeMdiSubWindow( PlaYUVerMdiSubWindow* window ) +void SubWindowHandle::removeMdiSubWindow( MdiSubWindow* window ) { removeSubWindow( m_apcMdiSubWindowList.indexOf( window ) ); } -Void PlaYUVerSubWindowHandle::removeAllSubWindow() +void SubWindowHandle::removeAllSubWindow() { while( m_apcSubWindowList.size() > 0 ) { @@ -298,17 +298,17 @@ Void PlaYUVerSubWindowHandle::removeAllSubWindow() } } -Void PlaYUVerSubWindowHandle::removeActiveSubWindow() +void SubWindowHandle::removeActiveSubWindow() { removeSubWindow( m_pcActiveWindow ); } -SubWindowAbstract* PlaYUVerSubWindowHandle::activeSubWindow() const +SubWindowAbstract* SubWindowHandle::activeSubWindow() const { return m_pcActiveWindow; } -QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const +QList SubWindowHandle::findSubWindow( const unsigned int uiCategory ) const { QList apcSubWindowList; if( uiCategory == 0 ) @@ -317,7 +317,7 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiC } else { - for( Int i = 0; i < m_apcSubWindowList.size(); i++ ) + for( int i = 0; i < m_apcSubWindowList.size(); i++ ) { if( m_apcSubWindowList.at( i )->getCategory() & uiCategory ) apcSubWindowList.append( m_apcSubWindowList.at( i ) ); @@ -326,14 +326,14 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiC return apcSubWindowList; } -QList PlaYUVerSubWindowHandle::findSubWindow( const QString& windowName, - const UInt uiCategory ) const +QList SubWindowHandle::findSubWindow( const QString& windowName, + const unsigned int uiCategory ) const { QList subWindowList = findSubWindow( uiCategory ); QList apcSubWindowList; if( !windowName.isEmpty() ) { - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { if( subWindowList.at( i )->getWindowName() == windowName ) apcSubWindowList.append( subWindowList.at( i ) ); @@ -342,10 +342,10 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const QString& return apcSubWindowList; } -SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow( const SubWindowAbstract* subWindow ) const +SubWindowAbstract* SubWindowHandle::findSubWindow( const SubWindowAbstract* subWindow ) const { QList subWindowList = findSubWindow(); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { if( subWindow == subWindowList.at( i ) ) return subWindowList.at( i ); @@ -353,7 +353,7 @@ SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow( const SubWindowAbstra return 0; } -Void PlaYUVerSubWindowHandle::setActiveSubWindow( QWidget* window ) +void SubWindowHandle::setActiveSubWindow( QWidget* window ) { if( !window ) return; @@ -370,16 +370,16 @@ Void PlaYUVerSubWindowHandle::setActiveSubWindow( QWidget* window ) } } -Void PlaYUVerSubWindowHandle::tileSubWindows() +void SubWindowHandle::tileSubWindows() { - UInt numberOfWindows = m_apcSubWindowList.size(); + unsigned int numberOfWindows = m_apcSubWindowList.size(); if( numberOfWindows == 0 ) return; if( m_iWindowMode == DETACHEDSUBWINDOWMODE ) { QSize screenSize = QApplication::desktop()->availableGeometry().size(); - UInt minWindowsInRow = 1; + unsigned int minWindowsInRow = 1; while( ( screenSize.width() / minWindowsInRow ) > 500 ) { minWindowsInRow++; @@ -396,12 +396,12 @@ Void PlaYUVerSubWindowHandle::tileSubWindows() { numberOfWindows++; } - UInt numberTillingRows = 1; - UInt numberTillingColumns; + unsigned int numberTillingRows = 1; + unsigned int numberTillingColumns; if( numberOfWindows > minWindowsInRow ) { numberTillingColumns = minWindowsInRow; - for( Int i = numberOfWindows; i > 0; ) + for( int i = numberOfWindows; i > 0; ) { numberTillingRows = ( numberOfWindows + numberTillingColumns - 1 ) / numberTillingColumns; if( numberTillingColumns > numberTillingRows ) @@ -423,7 +423,7 @@ Void PlaYUVerSubWindowHandle::tileSubWindows() QSize totalWindowsSize( screenSize.width(), screenSize.height() - topLeftCornerWindow.y() ); QSize windowsSize( totalWindowsSize.width() / numberTillingColumns, totalWindowsSize.height() / numberTillingRows ); QPoint windowRelativePos; - for( Int i = 0; i < m_apcSubWindowList.size(); i++ ) + for( int i = 0; i < m_apcSubWindowList.size(); i++ ) { windowRelativePos.setY( ( i / numberTillingColumns ) * windowsSize.height() ); windowRelativePos.setX( ( i % numberTillingColumns ) * windowsSize.width() ); @@ -437,7 +437,7 @@ Void PlaYUVerSubWindowHandle::tileSubWindows() } } -Void PlaYUVerSubWindowHandle::cascadeSubWindows() +void SubWindowHandle::cascadeSubWindows() { if( m_iWindowMode == MDISUBWINDOWMODE ) { @@ -445,7 +445,7 @@ Void PlaYUVerSubWindowHandle::cascadeSubWindows() } } -Void PlaYUVerSubWindowHandle::createActions() +void SubWindowHandle::createActions() { m_mapperWindow = new QSignalMapper( this ); connect( m_mapperWindow, SIGNAL( mapped( QWidget* ) ), this, SLOT( setActiveSubWindow( QWidget* ) ) ); @@ -518,7 +518,7 @@ Void PlaYUVerSubWindowHandle::createActions() m_arrayActions[SEPARATOR_ACT]->setSeparator( true ); } -QMenu* PlaYUVerSubWindowHandle::createMenu() +QMenu* SubWindowHandle::createMenu() { m_pcMenuWindow = new QMenu( "&Window", this ); updateMenu(); @@ -526,7 +526,7 @@ QMenu* PlaYUVerSubWindowHandle::createMenu() return m_pcMenuWindow; } -Void PlaYUVerSubWindowHandle::updateMenu() +void SubWindowHandle::updateMenu() { m_pcMenuWindow->clear(); m_pcMenuWindow->addAction( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] ); @@ -542,7 +542,7 @@ Void PlaYUVerSubWindowHandle::updateMenu() // m_pcMenuWindow->addAction( m_arrayActions[PREVIOUS_WINDOWS_ACT] ); // m_pcMenuWindow->addSeparator(); - Int number_windows = m_apcSubWindowList.size(); + int number_windows = m_apcSubWindowList.size(); if( number_windows > 1 ) { m_arrayActions[NEXT_WINDOWS_ACT]->setEnabled( true ); @@ -556,7 +556,7 @@ Void PlaYUVerSubWindowHandle::updateMenu() m_arrayActions[SEPARATOR_ACT]->setVisible( number_windows > 0 ); - for( Int i = 0; i < number_windows; ++i ) + for( int i = 0; i < number_windows; ++i ) { SubWindowAbstract* subWindow = m_apcSubWindowList.at( i ); @@ -577,17 +577,17 @@ Void PlaYUVerSubWindowHandle::updateMenu() } } -Void PlaYUVerSubWindowHandle::readSettings() +void SubWindowHandle::readSettings() { QSettings appSettings; m_cMdiModeWindowPosition = appSettings.value( "SubWindowManager/LastMdiPosition", QPoint( 200, 200 ) ).toPoint(); m_cMdiModeWindowSize = appSettings.value( "SubWindowManager/LastMdiSize", QSize( 500, 400 ) ).toSize(); - Int iWindowMode = appSettings.value( "SubWindowManager/SubWindowMode", MDISUBWINDOWMODE ).toInt(); + int iWindowMode = appSettings.value( "SubWindowManager/SubWindowMode", MDISUBWINDOWMODE ).toInt(); setWindowMode( iWindowMode ); m_actionGroupWindowMode->actions().at( iWindowMode )->setChecked( true ); } -Void PlaYUVerSubWindowHandle::writeSettings() +void SubWindowHandle::writeSettings() { QSettings appSettings; appSettings.setValue( "SubWindowManager/LastMdiPosition", m_cMdiModeWindowPosition ); diff --git a/app/PlaYUVerSubWindowHandle.h b/app/SubWindowHandle.h similarity index 71% rename from app/PlaYUVerSubWindowHandle.h rename to app/SubWindowHandle.h index 6e9f0aa..35344e2 100644 --- a/app/PlaYUVerSubWindowHandle.h +++ b/app/SubWindowHandle.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -18,14 +18,14 @@ */ /** - * \file PlaYUVerSubWindowHandle.h + * \file SubWindowHandle.h * \brief Handle multiple sub-windows */ -#ifndef __PLAYUVERSUBWINDOWHANDLE_H__ -#define __PLAYUVERSUBWINDOWHANDLE_H__ +#ifndef __SUBWINDOWHANDLE_H__ +#define __SUBWINDOWHANDLE_H__ -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include #include @@ -37,33 +37,33 @@ class QHBoxLayout; class QMenu; class QSignalMapper; -class PlaYUVerApp; +class MainWindow; class SubWindowAbstract; -class PlaYUVerMdiArea; -class PlaYUVerMdiSubWindow; +class MdiArea; +class MdiSubWindow; -class PlaYUVerSubWindowHandle : public QWidget +class SubWindowHandle : public QWidget { Q_OBJECT public: - PlaYUVerSubWindowHandle( QWidget* parent ); + SubWindowHandle( QWidget* parent ); - Void processLogMsg( const QString& msg ); + void processLogMsg( const QString& msg ); - Void addSubWindow( SubWindowAbstract* widget, Qt::WindowFlags flags = 0 ); + void addSubWindow( SubWindowAbstract* widget, Qt::WindowFlags flags = 0 ); SubWindowAbstract* activeSubWindow() const; - QList findSubWindow( const UInt uiCategory = 0 ) const; - QList findSubWindow( const QString& aName, const UInt uiCategory = 0 ) const; + QList findSubWindow( const unsigned int uiCategory = 0 ) const; + QList findSubWindow( const QString& aName, const unsigned int uiCategory = 0 ) const; SubWindowAbstract* findSubWindow( const SubWindowAbstract* subWindow ) const; - Void createActions(); + void createActions(); QMenu* createMenu(); - Void readSettings(); - Void writeSettings(); + void readSettings(); + void writeSettings(); enum WindowMode { @@ -72,13 +72,13 @@ public: }; private: - PlaYUVerApp* m_pcApp; - Int m_iWindowMode; + MainWindow* m_pcApp; + int m_iWindowMode; QList m_apcSubWindowList; QHBoxLayout* m_pcWindowManagerLayout; - PlaYUVerMdiArea* m_pcMdiArea; - QList m_apcMdiSubWindowList; + MdiArea* m_pcMdiArea; + QList m_apcMdiSubWindowList; SubWindowAbstract* m_pcActiveWindow; @@ -105,18 +105,18 @@ private: QMenu* m_pcMenuWindow; /** - * Internal functions + * internal functions */ - Void addMdiSubWindow( SubWindowAbstract* window ); - Void resetWindowMode(); - Void removeSubWindow( Int windowIdx ); + void addMdiSubWindow( SubWindowAbstract* window ); + void resetWindowMode(); + void removeSubWindow( int windowIdx ); public Q_SLOTS: void setWindowMode( int iWindowMode ); void updateActiveSubWindow( SubWindowAbstract* window = 0 ); void setActiveSubWindow( QWidget* window ); void removeSubWindow( SubWindowAbstract* window ); - void removeMdiSubWindow( PlaYUVerMdiSubWindow* window ); + void removeMdiSubWindow( MdiSubWindow* window ); void removeActiveSubWindow(); void removeAllSubWindow(); void tileSubWindows(); @@ -128,4 +128,4 @@ Q_SIGNALS: void windowActivated(); }; -#endif // __PLAYUVERSUBWINDOWHANDLE_H__ +#endif // __SUBWINDOWHANDLE_H__ diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index dabd158..04dbe05 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -24,13 +24,13 @@ #include "VideoHandle.h" -#include "DialogSubWindowSelector.h" +#include "FrameNumberWidget.h" #include "FramePropertiesDock.h" -#include "PlaYUVerApp.h" -#include "PlaYUVerSubWindowHandle.h" +#include "MainWindow.h" #include "SeekStreamDialog.h" +#include "SubWindowHandle.h" +#include "SubWindowSelectorDialog.h" #include "VideoSubWindow.h" -#include "WidgetFrameNumber.h" #include #include @@ -43,7 +43,7 @@ #include #endif -VideoHandle::VideoHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager ) +VideoHandle::VideoHandle( QWidget* parent, SubWindowHandle* windowManager ) : m_pcParet( parent ), m_pcMainWindowManager( windowManager ) { m_pcCurrentVideoSubWindow = NULL; @@ -56,7 +56,7 @@ VideoHandle::VideoHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManage VideoHandle::~VideoHandle() {} -Void VideoHandle::createActions() +void VideoHandle::createActions() { m_arrayActions.resize( TOTAL_ACT ); m_arrayActions[PLAY_ACT] = new QAction( "Play", this ); @@ -201,7 +201,7 @@ QToolBar* VideoHandle::createToolBar() m_toolbarVideo->addWidget( m_pcFrameSlider ); m_toolbarVideo->addAction( m_arrayActions[VIDEO_FORWARD_ACT] ); m_toolbarVideo->addWidget( new QLabel ); - m_pcFrameNumInfo = new WidgetFrameNumber; + m_pcFrameNumInfo = new FrameNumberWidget; m_toolbarVideo->addWidget( m_pcFrameNumInfo ); return m_toolbarVideo; @@ -242,10 +242,10 @@ QWidget* VideoHandle::createStatusBarMessage() return pcStatusBarWidget; } -Void VideoHandle::updateMenus() +void VideoHandle::updateMenus() { VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); - Bool hasSubWindow = pcSubWindow ? true : false; + bool hasSubWindow = pcSubWindow ? true : false; m_arrayActions[PLAY_ACT]->setEnabled( hasSubWindow ); // m_arrayActions[PAUSE_ACT]->setEnabled( hasSubWindow ); @@ -272,7 +272,7 @@ Void VideoHandle::updateMenus() m_arrayActions[SHOW_GRID_ACT]->setEnabled( hasSubWindow ); } -Void VideoHandle::readSettings() +void VideoHandle::readSettings() { QSettings appSettings; m_arrayActions[VIDEO_REPEAT_ACT]->setChecked( appSettings.value( "VideoHandle/Repeat", false ).toBool() ); @@ -284,7 +284,7 @@ Void VideoHandle::readSettings() setTool( m_uiViewTool ); } -Void VideoHandle::writeSettings() +void VideoHandle::writeSettings() { QSettings appSettings; appSettings.setValue( "VideoHandle/Repeat", m_arrayActions[VIDEO_REPEAT_ACT]->isChecked() ); @@ -293,15 +293,15 @@ Void VideoHandle::writeSettings() appSettings.setValue( "VideoHandle/SelectedTool", m_uiViewTool ); } -Void VideoHandle::update() +void VideoHandle::update() { if( m_pcCurrentVideoSubWindow ) { - PlaYUVerStream* pcStream = m_pcCurrentVideoSubWindow->getInputStream(); - PlaYUVerFrame* pcFrame = m_pcCurrentVideoSubWindow->getCurrFrame(); + CalypStream* pcStream = m_pcCurrentVideoSubWindow->getInputStream(); + CalypFrame* pcFrame = m_pcCurrentVideoSubWindow->getCurrFrame(); - Int frame_num = 0; - UInt64 total_frame_num = 1; + int frame_num = 0; + unsigned long long int total_frame_num = 1; m_pcVideoFormatLabel->setText( m_pcCurrentVideoSubWindow->getStreamInformation() ); @@ -325,7 +325,7 @@ Void VideoHandle::update() } if( pcStream && pcFrame->getBitsPel() > 8 ) { - if( pcStream->getEndianess() == PLAYUVER_BIG_ENDIAN ) + if( pcStream->getEndianess() == CLP_BIG_ENDIAN ) { resolution.append( QStringLiteral( " (BE)" ) ); } @@ -367,13 +367,13 @@ Void VideoHandle::update() } } -Void VideoHandle::update( VideoSubWindow* currSubWindow ) +void VideoHandle::update( VideoSubWindow* currSubWindow ) { m_pcCurrentVideoSubWindow = currSubWindow; update(); } -Void VideoHandle::updateSelectionArea( QRect area ) +void VideoHandle::updateSelectionArea( QRect area ) { if( m_pcCurrentVideoSubWindow ) { @@ -381,7 +381,7 @@ Void VideoHandle::updateSelectionArea( QRect area ) } } -Void VideoHandle::addSubWindow( VideoSubWindow* window ) +void VideoHandle::addSubWindow( VideoSubWindow* window ) { window->zoomToFit(); window->getViewArea()->setTool( m_uiViewTool ); @@ -399,13 +399,13 @@ Void VideoHandle::addSubWindow( VideoSubWindow* window ) connect( window->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectionArea( QRect ) ) ); } -Void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow ) +void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow ) { VideoSubWindow* videoSubWindow = qobject_cast( subWindow ); if( m_acPlayingSubWindows.contains( videoSubWindow ) ) { - Int pos = m_acPlayingSubWindows.indexOf( videoSubWindow ); + int pos = m_acPlayingSubWindows.indexOf( videoSubWindow ); m_acPlayingSubWindows.at( pos )->stop(); m_acPlayingSubWindows.remove( pos ); if( m_acPlayingSubWindows.size() < 2 ) @@ -415,9 +415,9 @@ Void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow ) } } -Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center ) +void VideoHandle::zoomToFactorAll( const double scale, const QPoint center ) { - Double factor; + double factor; if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() ) { @@ -426,7 +426,7 @@ Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center ) SubWindowAbstract* subWindow; QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { subWindow = subWindowList.at( i ); if( m_pcCurrentVideoSubWindow == subWindow ) @@ -440,7 +440,7 @@ Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center ) } #if 0 -Void VideoHandle::moveAllScrollBars( const QPoint& offset ) +void VideoHandle::moveAllScrollBars( const QPoint& offset ) { QPoint newOffset = offset; if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() && m_pcCurrentVideoSubWindow ) @@ -465,7 +465,7 @@ Void VideoHandle::moveAllScrollBars( const QPoint& offset ) if( scrollBar->value() == scrollBar->minimum() && offset.y() < 0 ) newOffset.setY( 0 ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { videoSubWindow = qobject_cast( subWindowList.at( i ) ); if( m_pcCurrentVideoSubWindow == videoSubWindow ) @@ -478,14 +478,14 @@ Void VideoHandle::moveAllScrollBars( const QPoint& offset ) } } #else -Void VideoHandle::moveAllScrollBars( const double& horRatio, const double& verRatio ) +void VideoHandle::moveAllScrollBars( const double& horRatio, const double& verRatio ) { if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() && m_pcCurrentVideoSubWindow ) { VideoSubWindow* videoSubWindow; QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { videoSubWindow = qobject_cast( subWindowList.at( i ) ); if( m_pcCurrentVideoSubWindow == videoSubWindow ) @@ -499,15 +499,15 @@ Void VideoHandle::moveAllScrollBars( const double& horRatio, const double& verRa } #endif -UInt64 VideoHandle::getMaxFrameNumber() +unsigned long long int VideoHandle::getMaxFrameNumber() { - UInt currFrames; - UInt64 maxFrames = INT_MAX; + unsigned int currFrames; + unsigned long long int maxFrames = INT_MAX; if( m_pcCurrentVideoSubWindow ) { if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum(); if( currFrames < maxFrames ) @@ -522,10 +522,10 @@ UInt64 VideoHandle::getMaxFrameNumber() return maxFrames; } -Void VideoHandle::setTimerStatus() +void VideoHandle::setTimerStatus() { - Bool status = false; - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + bool status = false; + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { status |= m_acPlayingSubWindows.at( i )->isPlaying(); } @@ -563,7 +563,7 @@ Void VideoHandle::setTimerStatus() } } -Void VideoHandle::play() +void VideoHandle::play() { if( !m_pcCurrentVideoSubWindow ) return; @@ -573,11 +573,11 @@ Void VideoHandle::play() if( !m_pcCurrentVideoSubWindow->isPlaying() ) // Not playing { - Double frameRate; - UInt timeInterval; + double frameRate; + unsigned int timeinterval; if( m_acPlayingSubWindows.size() < 2 ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { m_acPlayingSubWindows.at( i )->pause(); } @@ -586,20 +586,20 @@ Void VideoHandle::play() } if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { m_acPlayingSubWindows.at( i )->play(); } frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate(); - timeInterval = ( UInt )( 1000.0 / frameRate + 0.5 ); - m_pcPlayingTimer->setInterval( timeInterval ); + timeinterval = (unsigned int)( 1000.0 / frameRate + 0.5 ); + m_pcPlayingTimer->setInterval( timeinterval ); } } else { if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { m_acPlayingSubWindows.at( i )->pause(); } @@ -614,11 +614,11 @@ Void VideoHandle::play() // update(); } -Void VideoHandle::stop() +void VideoHandle::stop() { if( m_acPlayingSubWindows.size() > 0 ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { m_acPlayingSubWindows.at( i )->stop(); } @@ -636,9 +636,9 @@ Void VideoHandle::stop() m_arrayActions[VIDEO_LOCK_ACT]->setVisible( false ); } -Void VideoHandle::playEvent() +void VideoHandle::playEvent() { - Bool bEndOfSequence = false; + bool bEndOfSequence = false; #if( _CONTROL_PLAYING_TIME_ == 1 ) m_dAverageFps = Double( m_dAverageFps * m_uiNumberPlayedFrames + m_pcPlayControlTimer->elapsed() ) / Double( m_uiNumberPlayedFrames + 1 ); @@ -647,7 +647,7 @@ Void VideoHandle::playEvent() #endif try { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { bEndOfSequence |= m_acPlayingSubWindows.at( i )->playEvent(); } @@ -656,7 +656,7 @@ Void VideoHandle::playEvent() if( !m_arrayActions[VIDEO_REPEAT_ACT]->isChecked() ) stop(); else - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( 0 ); } } @@ -673,16 +673,16 @@ Void VideoHandle::playEvent() emit changed(); } -Void VideoHandle::seekEvent( Int direction ) +void VideoHandle::seekEvent( int direction ) { if( m_pcCurrentVideoSubWindow ) { if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) ) { - if( !( ( UInt )( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >= getMaxFrameNumber() && + if( !( (unsigned int)( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >= getMaxFrameNumber() && direction > 0 ) ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { m_acPlayingSubWindows.at( i )->seekRelativeEvent( direction > 0 ? true : false ); } @@ -697,7 +697,7 @@ Void VideoHandle::seekEvent( Int direction ) } } -Void VideoHandle::seekVideo() +void VideoHandle::seekVideo() { if( m_pcCurrentVideoSubWindow ) { @@ -705,19 +705,19 @@ Void VideoHandle::seekVideo() { SeekStreamDialog* dialogSeekVideo = new SeekStreamDialog( m_pcCurrentVideoSubWindow->getInputStream(), m_pcParet ); - Int newFrameNum = dialogSeekVideo->runDialog(); + int newFrameNum = dialogSeekVideo->runDialog(); if( newFrameNum >= 0 ) { if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { - m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (UInt)newFrameNum ); + m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (unsigned int)newFrameNum ); } } else { - m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (UInt)newFrameNum ); + m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (unsigned int)newFrameNum ); } emit changed(); } @@ -725,26 +725,26 @@ Void VideoHandle::seekVideo() } } -Void VideoHandle::seekSliderEvent( Int new_frame_num ) +void VideoHandle::seekSliderEvent( int new_frame_num ) { if( m_pcCurrentVideoSubWindow && !m_bIsPlaying ) // TODO: Fix this slot { if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { - m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (UInt)new_frame_num ); + m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (unsigned int)new_frame_num ); } } else { - m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (UInt)new_frame_num ); + m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (unsigned int)new_frame_num ); } emit changed(); } } -Void VideoHandle::videoSelectionButtonEvent() +void VideoHandle::videoSelectionButtonEvent() { VideoSubWindow* videoSubWindow; @@ -753,7 +753,7 @@ Void VideoHandle::videoSelectionButtonEvent() { QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { videoSubWindow = qobject_cast( subWindowList.at( i ) ); m_acPlayingSubWindows.append( videoSubWindow ); @@ -761,10 +761,10 @@ Void VideoHandle::videoSelectionButtonEvent() } else { - DialogSubWindowSelector dialogWindowsSelection( m_pcParet, m_pcMainWindowManager, + SubWindowSelectorDialog dialogWindowsSelection( m_pcParet, m_pcMainWindowManager, SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ); QStringList cWindowListNames; - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { dialogWindowsSelection.selectSubWindow( m_acPlayingSubWindows.at( i ) ); } @@ -773,7 +773,7 @@ Void VideoHandle::videoSelectionButtonEvent() m_acPlayingSubWindows.clear(); QList selectedSubWindowList = dialogWindowsSelection.getSelectedWindows(); - for( Int i = 0; i < selectedSubWindowList.size(); i++ ) + for( int i = 0; i < selectedSubWindowList.size(); i++ ) { videoSubWindow = qobject_cast( selectedSubWindowList.at( i ) ); m_acPlayingSubWindows.append( videoSubWindow ); @@ -794,7 +794,7 @@ Void VideoHandle::videoSelectionButtonEvent() } if( m_bIsPlaying ) { - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + for( int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { m_acPlayingSubWindows.at( i )->play(); } @@ -806,21 +806,21 @@ Void VideoHandle::videoSelectionButtonEvent() } } -Void VideoHandle::setTool( Int tool ) +void VideoHandle::setTool( int tool ) { m_uiViewTool = tool; actionGroupTools->actions().at( m_uiViewTool )->setChecked( true ); QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { qobject_cast( subWindowList.at( i ) )->getViewArea()->setTool( m_uiViewTool ); } } -Void VideoHandle::toggleGrid( Bool checked ) +void VideoHandle::toggleGrid( bool checked ) { QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + for( int i = 0; i < subWindowList.size(); i++ ) { qobject_cast( subWindowList.at( i ) )->getViewArea()->setGridVisible( checked ); } diff --git a/app/VideoHandle.h b/app/VideoHandle.h index f7b9472..bb607e2 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -25,7 +25,7 @@ #ifndef __VIDEOHANDLE_H__ #define __VIDEOHANDLE_H__ -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "config.h" #include @@ -43,37 +43,37 @@ class QLabel; class QSlider; class QElapsedTimer; -class PlaYUVerSubWindowHandle; +class SubWindowHandle; class SubWindowAbstract; class VideoSubWindow; class FramePropertiesDock; -class WidgetFrameNumber; +class FrameNumberWidget; class VideoHandle : public QObject { Q_OBJECT public: - VideoHandle( QWidget*, PlaYUVerSubWindowHandle* ); + VideoHandle( QWidget*, SubWindowHandle* ); ~VideoHandle(); - Void createActions(); + void createActions(); QMenu* createVideoMenu(); QMenu* createImageMenu(); QToolBar* createToolBar(); QDockWidget* createDock(); QWidget* createStatusBarMessage(); - Void updateMenus(); + void updateMenus(); - Void readSettings(); - Void writeSettings(); + void readSettings(); + void writeSettings(); - Void update( VideoSubWindow* currSubWindow ); + void update( VideoSubWindow* currSubWindow ); - Void addSubWindow( VideoSubWindow* subWindow ); + void addSubWindow( VideoSubWindow* subWindow ); private: QWidget* m_pcParet; - PlaYUVerSubWindowHandle* m_pcMainWindowManager; + SubWindowHandle* m_pcMainWindowManager; enum { PLAY_ACT, @@ -95,12 +95,12 @@ private: QSignalMapper* m_mapperVideoSeek; QSlider* m_pcFrameSlider; - WidgetFrameNumber* m_pcFrameNumInfo; + FrameNumberWidget* m_pcFrameNumInfo; // Tools Actions; QActionGroup* actionGroupTools; QSignalMapper* m_mapperTools; - UInt m_uiViewTool; + unsigned int m_uiViewTool; QMenu* m_pcMenuVideo; QMenu* m_pcMenuImage; @@ -116,16 +116,16 @@ private: QVector m_acPlayingSubWindows; QTimer* m_pcPlayingTimer; - Bool m_bIsPlaying; + bool m_bIsPlaying; #if( _CONTROL_PLAYING_TIME_ == 1 ) - UInt m_uiNumberPlayedFrames; + unsigned int m_uiNumberPlayedFrames; Double m_dAverageFps; QElapsedTimer* m_pcPlayControlTimer; #endif - UInt64 getMaxFrameNumber(); - Void setTimerStatus(); + unsigned long long int getMaxFrameNumber(); + void setTimerStatus(); Q_SIGNALS: void changed(); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index b4b3bb5..c6e41c4 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -36,11 +36,11 @@ * \brief Functions to control data stream from stream information */ -QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& array ) +QDataStream& operator<<( QDataStream& out, const CalypFileInfoVector& array ) { - PlaYUVerStreamInfo d; + CalypFileInfo d; out << array.size(); - for( Int i = 0; i < array.size(); i++ ) + for( int i = 0; i < array.size(); i++ ) { d = array.at( i ); out << d.m_cFilename << d.m_uiWidth << d.m_uiHeight << d.m_iPelFormat << d.m_uiBitsPelPixel << d.m_iEndianness @@ -49,12 +49,12 @@ QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& array return out; } -QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& array ) +QDataStream& operator>>( QDataStream& in, CalypFileInfoVector& array ) { - PlaYUVerStreamInfo d; - Int array_size; + CalypFileInfo d; + int array_size; in >> array_size; - for( Int i = 0; i < array_size; i++ ) + for( int i = 0; i < array_size; i++ ) { in >> d.m_cFilename; in >> d.m_uiWidth; @@ -69,9 +69,9 @@ QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& array ) return in; } -Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename ) +int findCalypStreamInfo( CalypFileInfoVector array, QString filename ) { - for( Int i = 0; i < array.size(); i++ ) + for( int i = 0; i < array.size(); i++ ) if( array.at( i ).m_cFilename == filename ) return i; return -1; @@ -88,7 +88,7 @@ private: QList m_cTopLeftTextList; QFont m_cTopLeftTextFont; QFont m_cCenterTextFont; - Bool m_bBusyWindow; + bool m_bBusyWindow; public: VideoInformation( QWidget* parent ) @@ -99,15 +99,15 @@ public: m_cTopLeftTextFont.setPointSize( 8 ); m_cCenterTextFont.setPointSize( 12 ); } - Void setInformationTopLeft( const QStringList& textLines ) + void setInformationTopLeft( const QStringList& textLines ) { m_cTopLeftTextList.clear(); - for( Int i = 0; i < textLines.size(); i++ ) + for( int i = 0; i < textLines.size(); i++ ) { m_cTopLeftTextList.append( QStaticText( textLines.at( i ) ) ); } } - Void setBusyWindow( Bool bFlag ) { m_bBusyWindow = bFlag; } + void setBusyWindow( bool bFlag ) { m_bBusyWindow = bFlag; } protected: void paintEvent( QPaintEvent* event ) @@ -117,7 +117,7 @@ protected: if( !m_cTopLeftTextList.isEmpty() && size().width() > 300 ) { QPoint topLeftCorner( 10, 10 ); - for( Int i = 0; i < m_cTopLeftTextList.size(); i++ ) + for( int i = 0; i < m_cTopLeftTextList.size(); i++ ) { painter.drawStaticText( topLeftCorner, m_cTopLeftTextList.at( i ) ); topLeftCorner += QPoint( 0, 15 ); @@ -196,19 +196,19 @@ VideoSubWindow::~VideoSubWindow() * Events handlers */ -Void VideoSubWindow::closeEvent( QCloseEvent* event ) +void VideoSubWindow::closeEvent( QCloseEvent* event ) { stop(); SubWindowAbstract::closeEvent( event ); } -Void VideoSubWindow::keyPressEvent( QKeyEvent* event ) +void VideoSubWindow::keyPressEvent( QKeyEvent* event ) { if( m_pcCurrentDisplayModule ) { - if( m_pcCurrentDisplayModule->getModuleRequirements() & MODULE_USES_KEYS ) + if( m_pcCurrentDisplayModule->getModuleRequirements() & CLP_MODULE_USES_KEYS ) { - Bool bRet = false; + bool bRet = false; switch( event->key() ) { case Qt::Key_A: @@ -234,7 +234,7 @@ Void VideoSubWindow::keyPressEvent( QKeyEvent* event ) QWidget::keyPressEvent( event ); } -Void VideoSubWindow::resizeEvent( QResizeEvent* event ) +void VideoSubWindow::resizeEvent( QResizeEvent* event ) { m_pcVideoInfo->resize( event->size() ); } @@ -276,12 +276,12 @@ QSize VideoSubWindow::sizeHint( const QSize& maxSize ) const return isize; } -Void VideoSubWindow::updateWindowOnTimeout() +void VideoSubWindow::updateWindowOnTimeout() { m_pcVideoInfo->update(); } -Void VideoSubWindow::loadAll() +void VideoSubWindow::loadAll() { QApplication::setOverrideCursor( Qt::WaitCursor ); m_pCurrStream->loadAll(); @@ -289,7 +289,7 @@ Void VideoSubWindow::loadAll() QApplication::restoreOverrideCursor(); } -Void VideoSubWindow::refreshSubWindow() +void VideoSubWindow::refreshSubWindow() { if( getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW ) { @@ -304,24 +304,24 @@ Void VideoSubWindow::refreshSubWindow() refreshFrame(); } -Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) +bool VideoSubWindow::loadFile( QString cFilename, bool bForceDialog ) { ConfigureFormatDialog formatDialog( this ); - UInt Width = 0, Height = 0, BitsPel = 8, FrameRate = 30; - Int Endianness = PLAYUVER_BIG_ENDIAN; - Int InputFormat = PlaYUVerFrame::YUV420p; + unsigned int Width = 0, Height = 0, BitsPel = 8, FrameRate = 30; + int Endianness = CLP_BIG_ENDIAN; + int InputFormat = CLP_YUV420P; if( m_pCurrStream ) m_pCurrStream->getFormat( Width, Height, InputFormat, BitsPel, Endianness, FrameRate ); if( !m_pCurrStream ) { - m_pCurrStream = new PlaYUVerStream; + m_pCurrStream = new CalypStream; } - Bool bConfig = guessFormat( cFilename, Width, Height, InputFormat, BitsPel, Endianness ) || bForceDialog; - Bool bRet = false; - for( Int iPass = 0; iPass < 2 && !bRet; iPass++ ) + bool bConfig = guessFormat( cFilename, Width, Height, InputFormat, BitsPel, Endianness ) || bForceDialog; + bool bRet = false; + for( int iPass = 0; iPass < 2 && !bRet; iPass++ ) { if( iPass || bConfig ) { @@ -355,11 +355,11 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) return true; } -Bool VideoSubWindow::loadFile( PlaYUVerStreamInfo* streamInfo ) +bool VideoSubWindow::loadFile( CalypFileInfo* streamInfo ) { if( !m_pCurrStream ) { - m_pCurrStream = new PlaYUVerStream; + m_pCurrStream = new CalypStream; } if( !m_pCurrStream->open( streamInfo->m_cFilename.toStdString(), streamInfo->m_uiWidth, streamInfo->m_uiHeight, @@ -381,7 +381,7 @@ Bool VideoSubWindow::loadFile( PlaYUVerStreamInfo* streamInfo ) return true; } -Void VideoSubWindow::updateVideoWindowInfo() +void VideoSubWindow::updateVideoWindowInfo() { m_cStreamInformation = ""; if( m_pcCurrentDisplayModule ) @@ -391,7 +391,7 @@ Void VideoSubWindow::updateVideoWindowInfo() QStringList sourceWindowList; if( arraySubWindows.size() > 0 ) { - for( Int i = 0; i < arraySubWindows.size(); i++ ) + for( int i = 0; i < arraySubWindows.size(); i++ ) { if( arraySubWindows.at( i )->getWindowName() != getWindowName() ) { @@ -427,12 +427,12 @@ Void VideoSubWindow::updateVideoWindowInfo() } } -Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPixel, - Int& rEndianness ) +bool VideoSubWindow::guessFormat( QString filename, unsigned int& rWidth, unsigned int& rHeight, int& rInputFormat, unsigned int& rBitsPerPixel, + int& rEndianness ) { - std::vector stdResList = PlaYUVerStream::stdResolutionSizes(); - Bool bGuessed = true; - Bool bGuessedByFilesize = false; + std::vector stdResList = CalypStream::stdResolutionSizes(); + bool bGuessed = true; + bool bGuessedByFilesize = false; QString FilenameShort = QFileInfo( filename ).fileName(); QString fileExtension = QFileInfo( filename ).suffix(); @@ -445,8 +445,8 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, { bGuessed = false; // Guess pixel format - QVector formats_list = QVector::fromStdVector( PlaYUVerFrame::supportedPixelFormatListNames() ); - for( Int i = 0; i < formats_list.size(); i++ ) + QVector formats_list = QVector::fromStdVector( CalypFrame::supportedPixelFormatListNames() ); + for( int i = 0; i < formats_list.size(); i++ ) { if( FilenameShort.contains( formats_list.at( i ).c_str(), Qt::CaseInsensitive ) ) { @@ -458,8 +458,8 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, if( rWidth == 0 || rHeight == 0 ) { // Guess resolution - match resolution name - Int iMatch = -1; - for( UInt i = 0; i < stdResList.size(); i++ ) + int iMatch = -1; + for( unsigned int i = 0; i < stdResList.size(); i++ ) { if( FilenameShort.contains( QString::fromStdString( stdResList[i].shortName ) ) ) { @@ -497,14 +497,14 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, if( pF ) { fseek( pF, 0, SEEK_END ); - UInt64 uiFileSize = ftell( pF ); + unsigned long long int uiFileSize = ftell( pF ); fclose( pF ); - Int count = 0, module, frame_bytes, match; - for( UInt i = 0; i < stdResList.size(); i++ ) + int count = 0, module, frame_bytes, match; + for( unsigned int i = 0; i < stdResList.size(); i++ ) { frame_bytes = - PlaYUVerFrame::getBytesPerFrame( stdResList[i].uiWidth, stdResList[i].uiHeight, rInputFormat, 8 ); + CalypFrame::getBytesPerFrame( stdResList[i].uiWidth, stdResList[i].uiHeight, rInputFormat, 8 ); module = uiFileSize % frame_bytes; if( module == 0 ) { @@ -538,11 +538,11 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, // Guess Endianness if( FilenameShort.contains( QStringLiteral( "be" ), Qt::CaseInsensitive ) ) { - rEndianness = PLAYUVER_BIG_ENDIAN; + rEndianness = CLP_BIG_ENDIAN; } if( FilenameShort.contains( QStringLiteral( "le" ), Qt::CaseInsensitive ) ) { - rEndianness = PLAYUVER_LITTLE_ENDIAN; + rEndianness = CLP_LITTLE_ENDIAN; } if( rWidth > 0 && rHeight > 0 && rInputFormat >= 0 ) @@ -551,7 +551,7 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, return !bGuessed; } -Void VideoSubWindow::updateSelectedArea( QRect area ) +void VideoSubWindow::updateSelectedArea( QRect area ) { m_cSelectedArea = area; } @@ -560,7 +560,7 @@ Void VideoSubWindow::updateSelectedArea( QRect area ) * Functions to enable a module in the * current SubWindow */ -Void VideoSubWindow::enableModule( PlaYUVerAppModuleIf* pcModule ) +void VideoSubWindow::enableModule( CalypAppModuleIf* pcModule ) { if( m_pcCurrentDisplayModule ) { @@ -570,12 +570,12 @@ Void VideoSubWindow::enableModule( PlaYUVerAppModuleIf* pcModule ) updateVideoWindowInfo(); } -Void VideoSubWindow::disableModule( PlaYUVerAppModuleIf* pcModule ) +void VideoSubWindow::disableModule( CalypAppModuleIf* pcModule ) { - Bool bRefresh = false; + bool bRefresh = false; if( pcModule ) { - Int modIdx = m_apcCurrentModule.indexOf( pcModule ); + int modIdx = m_apcCurrentModule.indexOf( pcModule ); if( modIdx != -1 ) { m_apcCurrentModule.removeAt( modIdx ); @@ -593,8 +593,8 @@ Void VideoSubWindow::disableModule( PlaYUVerAppModuleIf* pcModule ) } else { - QList apcCurrentModule = m_apcCurrentModule; - for( Int i = 0; i < apcCurrentModule.size(); i++ ) + QList apcCurrentModule = m_apcCurrentModule; + for( int i = 0; i < apcCurrentModule.size(); i++ ) { m_apcCurrentModule.removeOne( apcCurrentModule.at( i ) ); ModulesHandle::destroyModuleIf( apcCurrentModule.at( i ) ); @@ -617,39 +617,39 @@ Void VideoSubWindow::disableModule( PlaYUVerAppModuleIf* pcModule ) } } -Void VideoSubWindow::associateModule( PlaYUVerAppModuleIf* pcModule ) +void VideoSubWindow::associateModule( CalypAppModuleIf* pcModule ) { m_apcCurrentModule.append( pcModule ); } -Bool VideoSubWindow::hasRunningModule() +bool VideoSubWindow::hasRunningModule() { - Bool bRet = false; + bool bRet = false; if( m_pcCurrentDisplayModule ) { bRet |= m_pcCurrentDisplayModule->isRunning(); } - for( Int i = 0; i < m_apcCurrentModule.size() && !bRet; i++ ) + for( int i = 0; i < m_apcCurrentModule.size() && !bRet; i++ ) { bRet |= m_apcCurrentModule.at( i )->isRunning(); } return bRet; } -Void VideoSubWindow::setFillWindow( Bool bFlag ) +void VideoSubWindow::setFillWindow( bool bFlag ) { m_pcVideoInfo->setBusyWindow( bFlag ); } -Void VideoSubWindow::setCurrFrame( PlaYUVerFrame* pcCurrFrame ) +void VideoSubWindow::setCurrFrame( CalypFrame* pcCurrFrame ) { m_pcCurrFrame = pcCurrFrame; m_cViewArea->setImage( m_pcCurrFrame ); } -Void VideoSubWindow::refreshFrameOperation() +void VideoSubWindow::refreshFrameOperation() { - Bool bSetFrame = false; + bool bSetFrame = false; if( m_pCurrStream ) { m_pcCurrFrame = m_pCurrStream->getCurrFrame(); @@ -665,13 +665,13 @@ Void VideoSubWindow::refreshFrameOperation() { m_cViewArea->setImage( m_pcCurrFrame ); } - for( Int i = 0; i < m_apcCurrentModule.size(); i++ ) + for( int i = 0; i < m_apcCurrentModule.size(); i++ ) { m_apcCurrentModule.at( i )->update(); } } -Void VideoSubWindow::refreshFrame( Bool bThreaded ) +void VideoSubWindow::refreshFrame( bool bThreaded ) { #ifndef QT_NO_CONCURRENT m_cRefreshResult.waitForFinished(); @@ -686,13 +686,13 @@ Void VideoSubWindow::refreshFrame( Bool bThreaded ) } } -Bool VideoSubWindow::goToNextFrame( Bool bThreaded ) +bool VideoSubWindow::goToNextFrame( bool bThreaded ) { #ifndef QT_NO_CONCURRENT m_cRefreshResult.waitForFinished(); m_cReadResult.waitForFinished(); #endif - Bool bEndOfSeq = m_pCurrStream->setNextFrame(); + bool bEndOfSeq = m_pCurrStream->setNextFrame(); if( !bEndOfSeq ) { #ifndef QT_NO_CONCURRENT @@ -700,7 +700,7 @@ Bool VideoSubWindow::goToNextFrame( Bool bThreaded ) if( bThreaded ) { refreshFrame(); - m_cReadResult = QtConcurrent::run( m_pCurrStream, &PlaYUVerStream::readNextFrameFillRGBBuffer ); + m_cReadResult = QtConcurrent::run( m_pCurrStream, &CalypStream::readNextFrameFillRGBBuffer ); } else #endif @@ -712,29 +712,29 @@ Bool VideoSubWindow::goToNextFrame( Bool bThreaded ) return bEndOfSeq; } -Bool VideoSubWindow::save( QString filename ) +bool VideoSubWindow::save( QString filename ) { - Bool iRet = false; + bool iRet = false; QApplication::setOverrideCursor( Qt::WaitCursor ); - PlaYUVerFrame* saveFrame = m_pcCurrFrame; + CalypFrame* saveFrame = m_pcCurrFrame; if( m_cSelectedArea.isValid() ) { - saveFrame = new PlaYUVerFrame( m_pcCurrFrame, m_cSelectedArea.x(), m_cSelectedArea.y(), m_cSelectedArea.width(), - m_cSelectedArea.height() ); + saveFrame = new CalypFrame( m_pcCurrFrame, m_cSelectedArea.x(), m_cSelectedArea.y(), m_cSelectedArea.width(), + m_cSelectedArea.height() ); } if( !saveFrame ) { return false; } - iRet = PlaYUVerStream::saveFrame( filename.toStdString(), saveFrame ); + iRet = CalypStream::saveFrame( filename.toStdString(), saveFrame ); QApplication::restoreOverrideCursor(); return iRet; } -Bool VideoSubWindow::saveStream( QString filename ) +bool VideoSubWindow::saveStream( QString filename ) { - Bool iRet = false; + bool iRet = false; QApplication::setOverrideCursor( Qt::WaitCursor ); // TODO: implement this @@ -742,7 +742,7 @@ Bool VideoSubWindow::saveStream( QString filename ) return iRet; } -Bool VideoSubWindow::play() +bool VideoSubWindow::play() { if( m_pCurrStream && m_pCurrStream->getFrameNum() > 1 ) { @@ -755,9 +755,9 @@ Bool VideoSubWindow::play() return m_bIsPlaying; } -Bool VideoSubWindow::playEvent() +bool VideoSubWindow::playEvent() { - Bool bEndOfSeq = false; + bool bEndOfSeq = false; if( m_pCurrStream && m_bIsPlaying ) { bEndOfSeq = goToNextFrame( true ); @@ -765,22 +765,22 @@ Bool VideoSubWindow::playEvent() return bEndOfSeq; } -Void VideoSubWindow::pause() +void VideoSubWindow::pause() { m_bIsPlaying = false; refreshFrame(); } -Void VideoSubWindow::seekAbsoluteEvent( UInt new_frame_num ) +void VideoSubWindow::seekAbsoluteEvent( unsigned int new_frame_num ) { if( m_pCurrStream ) if( m_pCurrStream->seekInput( new_frame_num ) ) refreshFrame(); } -Void VideoSubWindow::seekRelativeEvent( Bool bIsFoward ) +void VideoSubWindow::seekRelativeEvent( bool bIsFoward ) { - Bool bRefresh = false; + bool bRefresh = false; if( m_pCurrStream ) { if( bIsFoward ) @@ -798,7 +798,7 @@ Void VideoSubWindow::seekRelativeEvent( Bool bIsFoward ) } } -Void VideoSubWindow::stop() +void VideoSubWindow::stop() { #ifndef QT_NO_CONCURRENT m_cRefreshResult.waitForFinished(); @@ -814,7 +814,7 @@ QSize VideoSubWindow::getScrollSize() return QSize( m_pcScrollArea->viewport()->size().width() - 5, m_pcScrollArea->viewport()->size().height() - 5 ); } -Void VideoSubWindow::adjustScrollBarToRatio( const Double& horRatio, const Double& verRatio ) +void VideoSubWindow::adjustScrollBarToRatio( const double& horRatio, const double& verRatio ) { QScrollBar* scrollBarH = m_pcScrollArea->horizontalScrollBar(); QScrollBar* scrollBarV = m_pcScrollArea->verticalScrollBar(); @@ -823,14 +823,14 @@ Void VideoSubWindow::adjustScrollBarToRatio( const Double& horRatio, const Doubl updateScrollValues(); } -Void VideoSubWindow::adjustScrollBarByOffset( QPoint Offset ) +void VideoSubWindow::adjustScrollBarByOffset( QPoint Offset ) { QPoint cLastScroll = m_cCurrScroll; QScrollBar* scrollBarH = m_pcScrollArea->horizontalScrollBar(); QScrollBar* scrollBarV = m_pcScrollArea->verticalScrollBar(); - Int valueX = int( cLastScroll.x() + Offset.x() ); - Int valueY = int( cLastScroll.y() + Offset.y() ); + int valueX = int( cLastScroll.x() + Offset.x() ); + int valueY = int( cLastScroll.y() + Offset.y() ); scrollBarH->setValue( valueX ); scrollBarV->setValue( valueY ); @@ -842,7 +842,7 @@ Void VideoSubWindow::adjustScrollBarByOffset( QPoint Offset ) // This function was developed with help of the schematics presented in // http://stackoverflow.com/questions/13155382/jscrollpane-zoom-relative-to-mouse-position -Void VideoSubWindow::adjustScrollBarByScale( Double scale, QPoint center ) +void VideoSubWindow::adjustScrollBarByScale( double scale, QPoint center ) { QPoint cLastScroll = m_cCurrScroll; QScrollBar* scrollBarH = m_pcScrollArea->horizontalScrollBar(); @@ -855,13 +855,13 @@ Void VideoSubWindow::adjustScrollBarByScale( Double scale, QPoint center ) } else { - Int value; + int value; - Int x = center.x() - cLastScroll.x(); + int x = center.x() - cLastScroll.x(); value = int( scale * cLastScroll.x() + ( ( scale - 1 ) * x ) ); m_cCurrScroll.setX( value ); - Int y = center.y() - cLastScroll.y(); + int y = center.y() - cLastScroll.y(); value = int( scale * cLastScroll.y() + ( ( scale - 1 ) * y ) ); m_cCurrScroll.setY( value ); } @@ -875,10 +875,10 @@ Void VideoSubWindow::adjustScrollBarByScale( Double scale, QPoint center ) scrollBarMoved( m_dHorScroll, m_dVerScroll ); } -Void VideoSubWindow::updateScrollValues() +void VideoSubWindow::updateScrollValues() { - Double xPos = m_pcScrollArea->horizontalScrollBar()->value(); - Double yPos = m_pcScrollArea->verticalScrollBar()->value(); + double xPos = m_pcScrollArea->horizontalScrollBar()->value(); + double yPos = m_pcScrollArea->verticalScrollBar()->value(); m_cCurrScroll.setX( xPos ); m_cCurrScroll.setY( yPos ); @@ -886,13 +886,13 @@ Void VideoSubWindow::updateScrollValues() m_dHorScroll = m_dVerScroll = 0; if( xPos ) - m_dHorScroll = xPos / Double( m_pcScrollArea->horizontalScrollBar()->maximum() ); + m_dHorScroll = xPos / double( m_pcScrollArea->horizontalScrollBar()->maximum() ); if( yPos ) - m_dVerScroll = yPos / Double( m_pcScrollArea->verticalScrollBar()->maximum() ); + m_dVerScroll = yPos / double( m_pcScrollArea->verticalScrollBar()->maximum() ); } -//Void VideoSubWindow::setCurScrollValues() +//void VideoSubWindow::setCurScrollValues() //{ // QScrollBar* scrollBar = m_pcScrollArea->horizontalScrollBar(); // scrollBar->setValue( m_cCurrScroll.x() ); @@ -900,48 +900,48 @@ Void VideoSubWindow::updateScrollValues() // scrollBar->setValue( m_cCurrScroll.y() ); //} -Void VideoSubWindow::normalSize() +void VideoSubWindow::normalSize() { - Double factor = 1.0; - Double curFactor = getScaleFactor(); + double factor = 1.0; + double curFactor = getScaleFactor(); if( factor != curFactor ) { - Double usedScale; + double usedScale; usedScale = m_cViewArea->scaleZoomFactor( factor / curFactor, QPoint(), QSize() ); adjustScrollBarByScale( usedScale, QPoint() ); } } -Void VideoSubWindow::zoomToFit() +void VideoSubWindow::zoomToFit() { // Scale to a smaller size that the real to a nicer look scaleView( getScrollSize() ); } -Void VideoSubWindow::zoomToFactor( Double factor, QPoint center ) +void VideoSubWindow::zoomToFactor( double factor, QPoint center ) { - Double curFactor; + double curFactor; curFactor = getScaleFactor(); if( factor != curFactor ) { - Double usedScale; + double usedScale; usedScale = m_cViewArea->scaleZoomFactor( factor / curFactor, center, QSize() ); adjustScrollBarByScale( usedScale, center ); } } -Void VideoSubWindow::scaleView( Double scale, QPoint center ) +void VideoSubWindow::scaleView( double scale, QPoint center ) { Q_ASSERT( !m_cViewArea->image().isNull() ); if( scale != 1.0 ) { - Double usedScale; + double usedScale; usedScale = m_cViewArea->scaleZoomFactor( scale, center, getScrollSize() ); adjustScrollBarByScale( usedScale, center ); } } -Void VideoSubWindow::scaleView( const QSize& size, QPoint center ) +void VideoSubWindow::scaleView( const QSize& size, QPoint center ) { QSize imgViewSize; if( m_pcCurrFrame ) @@ -952,34 +952,34 @@ Void VideoSubWindow::scaleView( const QSize& size, QPoint center ) newSize.scale( size, Qt::KeepAspectRatio ); // Calc the zoom factor - Double wfactor = 1; - Double hfactor = 1; - Double factor; + double wfactor = 1; + double hfactor = 1; + double factor; - wfactor = (Double)newSize.width() / imgViewSize.width(); - hfactor = (Double)newSize.height() / imgViewSize.height(); + wfactor = (double)newSize.width() / imgViewSize.width(); + hfactor = (double)newSize.height() / imgViewSize.height(); if( wfactor < hfactor ) factor = wfactor; else factor = hfactor; - Double curFactor = getScaleFactor(); + double curFactor = getScaleFactor(); if( factor != curFactor ) { - Double usedScale; + double usedScale; usedScale = m_cViewArea->scaleZoomFactor( factor / curFactor, center, getScrollSize() ); adjustScrollBarByScale( usedScale, center ); } } -Void VideoSubWindow::updatePixelValueStatusBar( const QPoint& pos ) +void VideoSubWindow::updatePixelValueStatusBar( const QPoint& pos ) { if( m_pcCurrFrame ) { - Int iWidth, iHeight; - Int posX = pos.x(); - Int posY = pos.y(); + int iWidth, iHeight; + int posX = pos.x(); + int posY = pos.y(); QString strStatus; iWidth = m_pcCurrFrame->getWidth(); @@ -989,31 +989,31 @@ Void VideoSubWindow::updatePixelValueStatusBar( const QPoint& pos ) { strStatus = QString( "(%1,%2) " ).arg( posX ).arg( posY ); - Int colorSpace = m_pcCurrFrame->getColorSpace(); - PlaYUVerPixel pixelValue = m_pcCurrFrame->getPixel( pos.x(), pos.y() ); + int colorSpace = m_pcCurrFrame->getColorSpace(); + CalypPixel pixelValue = m_pcCurrFrame->getPixel( pos.x(), pos.y() ); switch( colorSpace ) { - case PlaYUVerPixel::COLOR_GRAY: - strStatus.append( QString( "Y: %1" ).arg( pixelValue.Y() ) ); + case CLP_COLOR_GRAY: + strStatus.append( QString( "Y: %1" ).arg( pixelValue[0] ) ); break; - case PlaYUVerPixel::COLOR_YUV: + case CLP_COLOR_YUV: strStatus.append( QString( "Y: %1 U: %2 V: %3" ) - .arg( pixelValue.Y() ) - .arg( pixelValue.Cb() ) - .arg( pixelValue.Cr() ) ); + .arg( pixelValue[0] ) + .arg( pixelValue[1] ) + .arg( pixelValue[2] ) ); break; - case PlaYUVerPixel::COLOR_RGB: + case CLP_COLOR_RGB: strStatus.append( QString( "R: %1 G: %2 B: %3" ) - .arg( pixelValue.R() ) - .arg( pixelValue.G() ) - .arg( pixelValue.B() ) ); + .arg( pixelValue[0] ) + .arg( pixelValue[1] ) + .arg( pixelValue[2] ) ); break; - case PlaYUVerPixel::COLOR_RGBA: + case CLP_COLOR_RGBA: strStatus.append( QString( "R: %1 G: %2 B: %3 A: %4" ) - .arg( pixelValue.R() ) - .arg( pixelValue.G() ) - .arg( pixelValue.B() ) - .arg( pixelValue.A() ) ); + .arg( pixelValue[0] ) + .arg( pixelValue[1] ) + .arg( pixelValue[2] ) + .arg( pixelValue[3] ) ); break; } diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 177185a..9ff722b 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -30,46 +30,46 @@ #include #include #include -#include "PlaYUVerAppDefs.h" +#include "CommonDefs.h" #include "SubWindowAbstract.h" #include "ViewArea.h" #include "config.h" -#include "lib/PlaYUVerStream.h" +#include "lib/CalypStream.h" class QScrollArea; class VideoInformation; class VideoSubWindow; -class PlaYUVerAppModuleIf; +class CalypAppModuleIf; typedef struct { QString m_cFilename; - UInt m_uiWidth; - UInt m_uiHeight; - Int m_iPelFormat; - UInt m_uiBitsPelPixel; - UInt m_iEndianness; - UInt m_uiFrameRate; - UInt64 m_uiFileSize; -} PlaYUVerStreamInfo; -typedef QVector PlaYUVerStreamInfoVector; + unsigned int m_uiWidth; + unsigned int m_uiHeight; + int m_iPelFormat; + unsigned int m_uiBitsPelPixel; + unsigned int m_iEndianness; + unsigned int m_uiFrameRate; + unsigned long long int m_uiFileSize; +} CalypFileInfo; +typedef QVector CalypFileInfoVector; -QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& d ); -QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& d ); -Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename ); +QDataStream& operator<<( QDataStream& out, const CalypFileInfoVector& d ); +QDataStream& operator>>( QDataStream& in, CalypFileInfoVector& d ); +int findCalypStreamInfo( CalypFileInfoVector array, QString filename ); class VideoSubWindow : public SubWindowAbstract { Q_OBJECT private: - Bool m_bWindowBusy; + bool m_bWindowBusy; QScrollArea* m_pcScrollArea; QPoint m_cCurrScroll; - Double m_dHorScroll; - Double m_dVerScroll; + double m_dHorScroll; + double m_dVerScroll; ViewArea* m_cViewArea; @@ -77,29 +77,29 @@ private: QString m_cFilename; QString m_cStreamInformation; - PlaYUVerStreamInfo m_sStreamInfo; - PlaYUVerStream* m_pCurrStream; + CalypFileInfo m_sStreamInfo; + CalypStream* m_pCurrStream; - PlaYUVerFrame* m_pcCurrFrame; + CalypFrame* m_pcCurrFrame; QRect m_cSelectedArea; - PlaYUVerAppModuleIf* m_pcCurrentDisplayModule; - QList m_apcCurrentModule; + CalypAppModuleIf* m_pcCurrentDisplayModule; + QList m_apcCurrentModule; VideoSubWindow* m_pcReferenceSubWindow; // QString m_cWindowShortName; QString m_cCurrFileName; - Bool m_bIsPlaying; + bool m_bIsPlaying; QTimer* m_pcUpdateTimer; /** * Threads variables * QtConcurrent */ - QFuture m_cRefreshResult; - QFuture m_cReadResult; + QFuture m_cRefreshResult; + QFuture m_cReadResult; public: enum VideoSubWindowCategories @@ -110,34 +110,34 @@ public: VideoSubWindow( enum VideoSubWindowCategories category, QWidget* parent = 0 ); ~VideoSubWindow(); - Bool loadFile( QString cFilename, Bool bForceDialog = false ); - Bool loadFile( PlaYUVerStreamInfo* streamInfo ); - Void loadAll(); - Bool save( QString filename ); - Bool saveStream( QString filename ); + bool loadFile( QString cFilename, bool bForceDialog = false ); + bool loadFile( CalypFileInfo* streamInfo ); + void loadAll(); + bool save( QString filename ); + bool saveStream( QString filename ); - Void refreshSubWindow(); - Void refreshFrame( Bool bThreaded = false ); + void refreshSubWindow(); + void refreshFrame( bool bThreaded = false ); - Bool play(); - Void pause(); - Bool playEvent(); - Void stop(); + bool play(); + void pause(); + bool playEvent(); + void stop(); - Bool isPlaying() { return m_bIsPlaying; } - Void seekAbsoluteEvent( UInt new_frame_num ); - Void seekRelativeEvent( Bool bIsFoward ); + bool isPlaying() { return m_bIsPlaying; } + void seekAbsoluteEvent( unsigned int new_frame_num ); + void seekRelativeEvent( bool bIsFoward ); - Void setCurrFrame( PlaYUVerFrame* pcCurrFrame ); + void setCurrFrame( CalypFrame* pcCurrFrame ); QScrollArea* getScroll() { return m_pcScrollArea; } - PlaYUVerStreamInfo getStreamInfo() { return m_sStreamInfo; } + CalypFileInfo getStreamInfo() { return m_sStreamInfo; } QString getStreamInformation() { return m_cStreamInformation; } - PlaYUVerStream* getInputStream() { return m_pCurrStream; } - PlaYUVerStream* getCurrStream() { return m_pCurrStream; } - PlaYUVerFrame* getCurrFrame() { return m_pcCurrFrame; } + CalypStream* getInputStream() { return m_pCurrStream; } + CalypStream* getCurrStream() { return m_pCurrStream; } + CalypFrame* getCurrFrame() { return m_pcCurrFrame; } ViewArea* getViewArea() { return m_cViewArea; } - Void setRefSubWindow( VideoSubWindow* subWindow ) + void setRefSubWindow( VideoSubWindow* subWindow ) { m_pcReferenceSubWindow = NULL; if( subWindow ) @@ -150,14 +150,14 @@ public: * Functions to enable a module in the * current SubWindow */ - Void enableModule( PlaYUVerAppModuleIf* pcModule ); - Void disableModule( PlaYUVerAppModuleIf* pcModule = NULL ); - Void associateModule( PlaYUVerAppModuleIf* pcModule ); + void enableModule( CalypAppModuleIf* pcModule ); + void disableModule( CalypAppModuleIf* pcModule = NULL ); + void associateModule( CalypAppModuleIf* pcModule ); - PlaYUVerAppModuleIf* getDisplayModule() { return m_pcCurrentDisplayModule; } - QList getModuleArray() + CalypAppModuleIf* getDisplayModule() { return m_pcCurrentDisplayModule; } + QList getModuleArray() { - QList apcModulesArray; + QList apcModulesArray; if( m_pcCurrentDisplayModule ) apcModulesArray.append( m_pcCurrentDisplayModule ); apcModulesArray.append( m_apcCurrentModule ); @@ -167,12 +167,12 @@ public: /** * Virtual functions from SubWindowAbstract */ - Void normalSize(); - Void zoomToFit(); - Void scaleView( Double scale, QPoint center = QPoint() ); - Void zoomToFactor( Double factor, QPoint center = QPoint() ); + void normalSize(); + void zoomToFit(); + void scaleView( double scale, QPoint center = QPoint() ); + void zoomToFactor( double factor, QPoint center = QPoint() ); - Double getScaleFactor() { return m_cViewArea->getZoomFactor(); } + double getScaleFactor() { return m_cViewArea->getZoomFactor(); } /** * Size related functions */ @@ -180,34 +180,34 @@ public: QSize sizeHint( const QSize& ) const; QString getCurrentFileName() { return m_cFilename; } - Bool getIsModule() { return getCategory() | SubWindowAbstract::MODULE_SUBWINDOW; } - Void clearWindowBusy() { m_bWindowBusy = false; } - Void setFillWindow( Bool bFlag ); + bool getIsModule() { return getCategory() | SubWindowAbstract::MODULE_SUBWINDOW; } + void clearWindowBusy() { m_bWindowBusy = false; } + void setFillWindow( bool bFlag ); - Void adjustScrollBarToRatio( const Double& horRatio, const Double& verRatio ); + void adjustScrollBarToRatio( const double& horRatio, const double& verRatio ); private: - Void refreshFrameOperation(); - Bool goToNextFrame( Bool bThreaded = false ); + void refreshFrameOperation(); + bool goToNextFrame( bool bThreaded = false ); - static Bool guessFormat( QString filename, UInt& rWidth, UInt& rHeight, Int& rInputFormat, UInt& rBitsPerPixel, - Int& rEndianness ); + static bool guessFormat( QString filename, unsigned int& rWidth, unsigned int& rHeight, int& rInputFormat, unsigned int& rBitsPerPixel, + int& rEndianness ); - Bool hasRunningModule(); + bool hasRunningModule(); /** * Private zoom function to handle * zoom to fit */ - Void scaleView( const QSize& size, QPoint center = QPoint() ); - Void updateVideoWindowInfo(); + void scaleView( const QSize& size, QPoint center = QPoint() ); + void updateVideoWindowInfo(); QSize getScrollSize(); protected: - Void keyPressEvent( QKeyEvent* event ); - Void resizeEvent( QResizeEvent* event ); - Void closeEvent( QCloseEvent* event ); + void keyPressEvent( QKeyEvent* event ); + void resizeEvent( QResizeEvent* event ); + void closeEvent( QCloseEvent* event ); public Q_SLOTS: void updateWindowOnTimeout(); @@ -218,7 +218,7 @@ public Q_SLOTS: void updatePixelValueStatusBar( const QPoint& pos ); }; -Q_DECLARE_METATYPE( PlaYUVerStreamInfo ); -Q_DECLARE_METATYPE( PlaYUVerStreamInfoVector ); +Q_DECLARE_METATYPE( CalypFileInfo ); +Q_DECLARE_METATYPE( CalypFileInfoVector ); #endif // __VIDEOSUBWINDOW_H__ diff --git a/app/ViewArea.cpp b/app/ViewArea.cpp index ee8a78c..ee06297 100644 --- a/app/ViewArea.cpp +++ b/app/ViewArea.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -70,7 +70,7 @@ ViewArea::ViewArea( QWidget* parent ) connect( &m_zoomWinTimer, SIGNAL( timeout() ), this, SLOT( update() ) ); } -Void ViewArea::setImage( PlaYUVerFrame* pcFrame ) +void ViewArea::setImage( CalypFrame* pcFrame ) { m_pcCurrFrame = pcFrame; m_uiPixelHalfScale = 1 << ( m_pcCurrFrame->getBitsPel() - 1 ); @@ -80,7 +80,7 @@ Void ViewArea::setImage( PlaYUVerFrame* pcFrame ) setImage( QPixmap::fromImage( qimg ) ); } -Void ViewArea::setImage( const QPixmap& pixmap ) +void ViewArea::setImage( const QPixmap& pixmap ) { m_pixmap = pixmap; m_mask = QBitmap( pixmap.width(), pixmap.height() ); @@ -92,7 +92,7 @@ Void ViewArea::setImage( const QPixmap& pixmap ) initZoomWinRect(); } -Void ViewArea::clear() +void ViewArea::clear() { m_pixmap = QPixmap(); m_mask = QBitmap(); @@ -102,7 +102,7 @@ Void ViewArea::clear() updateGeometry(); } -Void ViewArea::setTool( UInt view ) +void ViewArea::setTool( unsigned int view ) { switch( view ) { @@ -131,13 +131,13 @@ Void ViewArea::setTool( UInt view ) update(); } -Void ViewArea::setGridVisible( Bool enable ) +void ViewArea::setGridVisible( bool enable ) { m_bGridVisible = enable; update(); } -Void ViewArea::clearMask() +void ViewArea::clearMask() { m_mask.clear(); } @@ -145,12 +145,12 @@ Void ViewArea::clearMask() /** * Zoom related function */ -Void ViewArea::startZoomWinTimer() +void ViewArea::startZoomWinTimer() { m_zoomWinTimer.start(); } -Void ViewArea::setZoomFactor( Double f ) +void ViewArea::setZoomFactor( double f ) { m_dZoomFactor = f; @@ -159,11 +159,11 @@ Void ViewArea::setZoomFactor( Double f ) update(); } -Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize ) +double ViewArea::scaleZoomFactor( double scale, QPoint center, QSize minimumSize ) { - Double maxZoom = 100.0; - Double minZoom = 0.01; //( 1.0 / m_pixmap.width() ); - Double new_scale = 1.0; + double maxZoom = 100.0; + double minZoom = 0.01; //( 1.0 / m_pixmap.width() ); + double new_scale = 1.0; if( ( m_dZoomFactor == minZoom ) && ( scale < 1 ) ) return new_scale; @@ -171,19 +171,19 @@ Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize if( ( m_dZoomFactor == maxZoom ) && ( scale > 1 ) ) return new_scale; - Double zoomFactor = m_dZoomFactor * scale * 100.0; + double zoomFactor = m_dZoomFactor * scale * 100.0; zoomFactor = round( zoomFactor ); zoomFactor = zoomFactor / 100.0; scale = zoomFactor / m_dZoomFactor; if( !minimumSize.isNull() ) { - Double cw = m_pixmap.width() * m_dZoomFactor; - Double ch = m_pixmap.height() * m_dZoomFactor; - Double fw = m_pixmap.width() * zoomFactor; - Double fh = m_pixmap.height() * zoomFactor; - Double mw = minimumSize.width(); - Double mh = minimumSize.height(); + double cw = m_pixmap.width() * m_dZoomFactor; + double ch = m_pixmap.height() * m_dZoomFactor; + double fw = m_pixmap.width() * zoomFactor; + double fh = m_pixmap.height() * zoomFactor; + double mw = minimumSize.width(); + double mh = minimumSize.height(); if( ( cw < mw ) && ( ch < mh ) && ( scale < 1 ) ) { @@ -192,8 +192,8 @@ Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize if( ( fw < mw ) && ( fh < mh ) && ( scale < 1 ) ) { - Double wfactor = mw / fw; - Double hfactor = mh / fh; + double wfactor = mw / fw; + double hfactor = mh / fh; if( wfactor < hfactor ) scale = wfactor; @@ -228,7 +228,7 @@ Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize return new_scale; } -// Void ViewArea::setMode( Int mode ) +// void ViewArea::setMode( int mode ) //{ // if( m_mode == mode ) // return; @@ -237,56 +237,56 @@ Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize // update(); //} // -// Void ViewArea::setNormalMode() +// void ViewArea::setNormalMode() //{ // setMode( NormalMode ); //} // -// Void ViewArea::setMaskMode() +// void ViewArea::setMaskMode() //{ // setMode( MaskMode ); //} // -// Void ViewArea::setMaskColor( const QColor &color ) +// void ViewArea::setMaskColor( const QColor &color ) //{ // m_maskColor = color; // update(); //} // -// Void ViewArea::setMaskTool() +// void ViewArea::setMaskTool() //{ // setMode( MaskMode ); // setTool( MaskTool ); // m_blockTrackEnable = true; //} // -// Void ViewArea::setEraserTool() +// void ViewArea::setEraserTool() //{ // setMode( MaskMode ); // setTool( EraserTool ); // m_blockTrackEnable = true; //} // -// Void ViewArea::setSelectionTool() +// void ViewArea::setSelectionTool() //{ // setMode( NormalMode ); // setTool( SelectionTool ); // m_blockTrackEnable = false; //} // -// Void ViewArea::setBlockSelectionTool() +// void ViewArea::setBlockSelectionTool() //{ // setMode( NormalMode ); // setTool( BlockSelectionTool ); // m_blockTrackEnable = true; //} -Void ViewArea::setSnapToGrid( Bool enable ) +void ViewArea::setSnapToGrid( bool enable ) { m_snapToGrid = enable; } -// Void ViewArea::setSelectedArea( QRect &rect ) +// void ViewArea::setSelectedArea( QRect &rect ) //{ // if( rect.isNull() ) // { @@ -312,17 +312,17 @@ Void ViewArea::setSnapToGrid( Bool enable ) // update( updateRect.normalized() ); //} -Void ViewArea::initZoomWinRect() +void ViewArea::initZoomWinRect() { - Int iMinX = 80; - Int iMinY = 80; + int iMinX = 80; + int iMinY = 80; - Int iMaxX = iMinX * 5; - Int iMaxY = iMinY * 5; + int iMaxX = iMinX * 5; + int iMaxY = iMinY * 5; double dSizeRatio, dWinZoomRatio; - Int iHorizontalImg = ( m_pixmap.width() > m_pixmap.height() ) ? 1 : 0; + int iHorizontalImg = ( m_pixmap.width() > m_pixmap.height() ) ? 1 : 0; if( iHorizontalImg ) { @@ -362,10 +362,10 @@ Void ViewArea::initZoomWinRect() //////////////////////////////////////////////////////////////////////////////// // Geometry Updates //////////////////////////////////////////////////////////////////////////////// -Void ViewArea::updateSize() +void ViewArea::updateSize() { - Int w = m_pixmap.width() * m_dZoomFactor; - Int h = m_pixmap.height() * m_dZoomFactor; + int w = m_pixmap.width() * m_dZoomFactor; + int h = m_pixmap.height() * m_dZoomFactor; setMinimumSize( w, h ); QWidget* p = parentWidget(); @@ -381,7 +381,7 @@ Void ViewArea::updateSize() updateOffset(); } -Void ViewArea::updateOffset() +void ViewArea::updateOffset() { if( width() > m_pixmap.width() * m_dZoomFactor ) { @@ -404,7 +404,7 @@ Void ViewArea::updateOffset() //////////////////////////////////////////////////////////////////////////////// // Resize Event //////////////////////////////////////////////////////////////////////////////// -Void ViewArea::resizeEvent( QResizeEvent* event ) +void ViewArea::resizeEvent( QResizeEvent* event ) { if( size().isEmpty() || m_pixmap.isNull() ) return; @@ -414,10 +414,10 @@ Void ViewArea::resizeEvent( QResizeEvent* event ) update(); } //////////////////////////////////////////////////////////////////////////////// -// PaInt Event +// Paint Event //////////////////////////////////////////////////////////////////////////////// -Void ViewArea::paintEvent( QPaintEvent* event ) +void ViewArea::paintEvent( QPaintEvent* event ) { QRect winRect = event->rect(); @@ -427,31 +427,31 @@ Void ViewArea::paintEvent( QPaintEvent* event ) if( size().isEmpty() || m_pixmap.isNull() ) return; - QPainter paInter( this ); + QPainter painter( this ); - // Save the actual paInter properties and scales the coordinate system. - paInter.save(); - paInter.translate( m_xOffset, m_yOffset ); - paInter.scale( m_dZoomFactor, m_dZoomFactor ); + // Save the actual painter properties and scales the coordinate system. + painter.save(); + painter.translate( m_xOffset, m_yOffset ); + painter.scale( m_dZoomFactor, m_dZoomFactor ); - // This line is for fast paiting. Only visible area of the image is paInted. + // This line is for fast paiting. Only visible area of the image is painted. // We take the exposed rect from the event (that gives us scroll/expose // optimizations for free – no need // to draw the whole pixmap if your widget is only partially exposed), and - // reverse map it with the paInter matrix. + // reverse map it with the painter matrix. // That gives us the part of the pixmap that has actually been exposed. // See: // http://blog.qt.digia.com/blog/2006/05/13/fast-transformed-pixmapimage-drawing/ - QRect exposedRect = paInter.worldTransform().inverted().mapRect( event->rect() ).adjusted( -1, -1, 1, 1 ); + QRect exposedRect = painter.worldTransform().inverted().mapRect( event->rect() ).adjusted( -1, -1, 1, 1 ); // Draw the pixmap. - paInter.drawPixmap( exposedRect, m_pixmap, exposedRect ); + painter.drawPixmap( exposedRect, m_pixmap, exposedRect ); // Draw the Grid if it's visible. if( m_bGridVisible ) { // Do we need to draw the whole grid? // To know that, we need to perform a transformation of the rectangle - // area that the paInter needs to update - transform the windows + // area that the painter needs to update - transform the windows // coordinates (origin at the top-left corner of the widget), to the // relatives coordinates of the image at it's original size (origin at // the top-left corner of the image). @@ -460,174 +460,145 @@ Void ViewArea::paintEvent( QPaintEvent* event ) // Now we have the (to update) rectangle area on a coordinates system // that has it's origin at the top-left corner of the image. That // is, is referenced to the not scaled image. - // To know what image area we need to update, just Intersects the + // To know what image area we need to update, just intersects the // rectangle area with the image area. vr &= QRect( 0, 0, m_pixmap.width(), m_pixmap.height() ); // Set up for the grid drawer. - paInter.setRenderHint( QPainter::Antialiasing ); + painter.setRenderHint( QPainter::Antialiasing ); // Draw grid. - m_grid.drawGrid( m_pixmap, vr, &paInter ); + m_grid.drawGrid( m_pixmap, vr, &painter ); } - paInter.restore(); + painter.restore(); // Draw a border around the image. /* if( m_xOffset || m_yOffset ) - { - paInter.setPen( Qt::black ); - paInter.drawRect( m_xOffset - 1, m_yOffset - 1, m_pixmap.width() * - m_dZoomFactor + 1, m_pixmap.height() * - m_dZoomFactor + 1 ); - }*/ + { + painter.setPen( Qt::black ); + painter.drawRect( m_xOffset - 1, m_yOffset - 1, m_pixmap.width() * + m_dZoomFactor + 1, m_pixmap.height() * + m_dZoomFactor + 1 ); + }*/ + + int frFormat = m_pcCurrFrame->getColorSpace(); // Draw pixel values in grid - if( m_dZoomFactor >= 50.0 ) + if( m_dZoomFactor >= 60.0 || ( frFormat != CLP_COLOR_RGBA && m_dZoomFactor >= 50.0 ) ) { - Int imageWidth = m_pixmap.width(); - Int imageHeight = m_pixmap.height(); - PlaYUVerPixel pixelValue; + int imageWidth = m_pixmap.width(); + int imageHeight = m_pixmap.height(); + ; QFont font( "Helvetica" ); font.setPixelSize( 12 ); - paInter.setFont( font ); + painter.setFont( font ); QRect vr = windowToView( winRect ); vr &= QRect( 0, 0, imageWidth, imageHeight ); - for( Int i = vr.x(); i <= vr.right(); i++ ) + for( int i = vr.x(); i <= vr.right(); i++ ) { - for( Int j = vr.y(); j <= vr.bottom(); j++ ) + for( int j = vr.y(); j <= vr.bottom(); j++ ) { QPoint pixelTopLeft( i, j ); QRect pixelRect( viewToWindow( pixelTopLeft ), QSize( m_dZoomFactor, m_dZoomFactor ) ); + QString pixelValue; + CalypPixel pixel = m_pcCurrFrame->getPixel( pixelTopLeft.x(), pixelTopLeft.y() ); - Int frFormat = m_pcCurrFrame->getColorSpace(); - - if( frFormat == PlaYUVerPixel::COLOR_YUV ) + if( frFormat == CLP_COLOR_YUV || frFormat == CLP_COLOR_GRAY ) { - pixelValue = m_pcCurrFrame->getPixel( pixelTopLeft.x(), pixelTopLeft.y() ); - - if( pixelValue.Y() < m_uiPixelHalfScale ) - paInter.setPen( QColor( Qt::white ) ); + if( pixel[0] < m_uiPixelHalfScale ) + painter.setPen( QColor( Qt::white ) ); else - paInter.setPen( QColor( Qt::black ) ); + painter.setPen( QColor( Qt::black ) ); - paInter.drawText( pixelRect, Qt::AlignCenter, - "Y: " + QString::number( pixelValue.Y() ) + "\n" + - "U: " + QString::number( pixelValue.Cb() ) + "\n" + - "V: " + QString::number( pixelValue.Cr() ) ); - } - if( frFormat == PlaYUVerPixel::COLOR_GRAY ) - { - pixelValue = m_pcCurrFrame->getPixel( pixelTopLeft.x(), pixelTopLeft.y() ); - - if( pixelValue.Y() < m_uiPixelHalfScale ) - paInter.setPen( QColor( Qt::white ) ); - else - paInter.setPen( QColor( Qt::black ) ); - - paInter.drawText( pixelRect, Qt::AlignCenter, "Y: " + QString::number( pixelValue.Y() ) ); + pixelValue = QString( "Y: %1" ).arg( pixel[0] ); + if( frFormat == CLP_COLOR_YUV ) + pixelValue += QString( "\nU: %1\nV: %2" ).arg( pixel[1] ).arg( pixel[2] ); } - if( ( frFormat == PlaYUVerPixel::COLOR_RGB ) ) + if( frFormat == CLP_COLOR_RGB || frFormat == CLP_COLOR_RGBA ) { - pixelValue = m_pcCurrFrame->getPixel( pixelTopLeft.x(), pixelTopLeft.y() ); - - if( ( pixelValue.R() + pixelValue.G() + pixelValue.B() ) < ( m_uiPixelHalfScale * 3 ) ) - paInter.setPen( QColor( Qt::white ) ); + if( ( pixel[0] + pixel[1] + pixel[2] ) < ( m_uiPixelHalfScale * 3 ) ) + painter.setPen( QColor( Qt::white ) ); else - paInter.setPen( QColor( Qt::black ) ); + painter.setPen( QColor( Qt::black ) ); - paInter.drawText( pixelRect, Qt::AlignCenter, - "R: " + QString::number( pixelValue.R() ) + - "\nG: " + QString::number( pixelValue.G() ) + - "\nB: " + QString::number( pixelValue.B() ) ); - } - if( ( frFormat == PlaYUVerPixel::COLOR_RGBA ) ) - { - pixelValue = m_pcCurrFrame->getPixel( pixelTopLeft.x(), pixelTopLeft.y() ); - - if( ( pixelValue.R() + pixelValue.G() + pixelValue.B() ) < ( m_uiPixelHalfScale * 3 ) ) - paInter.setPen( QColor( Qt::white ) ); - else - paInter.setPen( QColor( Qt::black ) ); - - paInter.drawText( pixelRect, Qt::AlignCenter, - "R: " + QString::number( pixelValue.R() ) + - "\nG: " + QString::number( pixelValue.G() ) + - "\nB: " + QString::number( pixelValue.B() ) + - "\nA: " + QString::number( pixelValue.A() ) ); + pixelValue = QString( "R: %1\nG: %2\nB: %3" ).arg( pixel[0] ).arg( pixel[1] ).arg( pixel[2] ); + if( frFormat == CLP_COLOR_RGBA ) + pixelValue += QString( "\nA: %1" ).arg( pixel[3] ); } + painter.drawText( pixelRect, Qt::AlignCenter, pixelValue ); } } QColor color( Qt::white ); QPen mainPen = QPen( color, 1, Qt::SolidLine ); - paInter.setPen( mainPen ); + painter.setPen( mainPen ); // Draw vertical line - for( Int x = vr.x(); x <= ( vr.right() + 1 ); x++ ) + for( int x = vr.x(); x <= ( vr.right() + 1 ); x++ ) { // Always draw the full line otherwise the line stippling // varies with the location of view area and we get glitchy // patterns. - paInter.drawLine( viewToWindow( QPoint( x, 0 ) ), viewToWindow( QPoint( x, imageHeight ) ) ); + painter.drawLine( viewToWindow( QPoint( x, 0 ) ), viewToWindow( QPoint( x, imageHeight ) ) ); } // Draw horizontal line - for( Int y = vr.y(); y <= ( vr.bottom() + 1 ); y++ ) + for( int y = vr.y(); y <= ( vr.bottom() + 1 ); y++ ) { - paInter.drawLine( viewToWindow( QPoint( 0, y ) ), viewToWindow( QPoint( imageWidth, y ) ) ); + painter.drawLine( viewToWindow( QPoint( 0, y ) ), viewToWindow( QPoint( imageWidth, y ) ) ); } } -// VISIBLE ZOOM RECT + // VISIBLE ZOOM RECT #if 0 - if( m_visibleZoomRect && m_zoomWinTimer.isActive() ) - { - double dRatio = m_dZoomWinRatio; + if( m_visibleZoomRect && m_zoomWinTimer.isActive() ) + { + double dRatio = m_dZoomWinRatio; - QRect cImg = QRect(0, 0, m_pixmap.width(), m_pixmap.height() ); - QPoint cZWinRBpos = QPoint(winRect.bottomRight()) - QPoint(15,15); - QRect cImgWinRect(0, 0, round((double)cImg.width()/dRatio), round((double)cImg.height()/dRatio) ); - cImgWinRect.moveBottomRight(cZWinRBpos); + QRect cImg = QRect(0, 0, m_pixmap.width(), m_pixmap.height() ); + QPoint cZWinRBpos = QPoint(winRect.bottomRight()) - QPoint(15,15); + QRect cImgWinRect(0, 0, round((double)cImg.width()/dRatio), round((double)cImg.height()/dRatio) ); + cImgWinRect.moveBottomRight(cZWinRBpos); - QRect vr = windowToView( winRect ); - QRect cVisibleImg = vr & cImg; - //cVisibleImg.moveTopLeft(vr.topLeft()); - QRect cVisibleWinRect; - cVisibleWinRect.setLeft(floor((double)cVisibleImg.x()/dRatio)); - cVisibleWinRect.setTop(floor((double)cVisibleImg.y()/dRatio)); - cVisibleWinRect.setRight(round((double)cVisibleImg.right()/dRatio)); - cVisibleWinRect.setBottom(round((double)cVisibleImg.bottom()/dRatio)); + QRect vr = windowToView( winRect ); + QRect cVisibleImg = vr & cImg; + //cVisibleImg.moveTopLeft(vr.topLeft()); + QRect cVisibleWinRect; + cVisibleWinRect.setLeft(floor((double)cVisibleImg.x()/dRatio)); + cVisibleWinRect.setTop(floor((double)cVisibleImg.y()/dRatio)); + cVisibleWinRect.setRight(round((double)cVisibleImg.right()/dRatio)); + cVisibleWinRect.setBottom(round((double)cVisibleImg.bottom()/dRatio)); - paInter.fillRect(cImgWinRect, QBrush(QColor(128, 128, 128, 128))); - paInter.setPen(QColor(50, 50, 50, 128)); - paInter.drawRect(cImgWinRect); + painter.fillRect(cImgWinRect, QBrush(QColor(128, 128, 128, 128))); + painter.setPen(QColor(50, 50, 50, 128)); + painter.drawRect(cImgWinRect); - cVisibleWinRect.moveTopLeft( cImgWinRect.topLeft() + cVisibleWinRect.topLeft() ); + cVisibleWinRect.moveTopLeft( cImgWinRect.topLeft() + cVisibleWinRect.topLeft() ); - cVisibleWinRect = cVisibleWinRect & cImgWinRect; + cVisibleWinRect = cVisibleWinRect & cImgWinRect; - if(cVisibleWinRect.left()<0) - cVisibleWinRect.moveLeft(0); - if(cVisibleWinRect.top()<0) - cVisibleWinRect.moveTop(0); + if(cVisibleWinRect.left()<0) + cVisibleWinRect.moveLeft(0); + if(cVisibleWinRect.top()<0) + cVisibleWinRect.moveTop(0); - if(cVisibleWinRect.width()<=0) - cVisibleWinRect.setWidth(1); - if(cVisibleWinRect.height()<=0) - cVisibleWinRect.setHeight(1); + if(cVisibleWinRect.width()<=0) + cVisibleWinRect.setWidth(1); + if(cVisibleWinRect.height()<=0) + cVisibleWinRect.setHeight(1); - paInter.fillRect(cVisibleWinRect, QBrush(QColor(200, 200, 200, 128))); - paInter.setPen(QColor(255, 255, 255, 128)); - paInter.drawRect(cVisibleWinRect); + painter.fillRect(cVisibleWinRect, QBrush(QColor(200, 200, 200, 128))); + painter.setPen(QColor(255, 255, 255, 128)); + painter.drawRect(cVisibleWinRect); - //qDebug() << "Debug VisibleZoomRect: " << winRect << vr << cImgWinRect << cVisibleWinRect << cVisibleImg << dRatio; + //qDebug() << "Debug VisibleZoomRect: " << winRect << vr << cImgWinRect << cVisibleWinRect << cVisibleImg << dRatio; - } + } #endif QRect sr = viewToWindow( m_selectedArea ); @@ -645,13 +616,13 @@ Void ViewArea::paintEvent( QPaintEvent* event ) QBrush brush( selectColor ); if( m_blockTrackEnable ) - paInter.setBrush( Qt::NoBrush ); + painter.setBrush( Qt::NoBrush ); else - paInter.setBrush( brush ); + painter.setBrush( brush ); - paInter.setPen( Qt::darkCyan ); + painter.setPen( Qt::darkCyan ); - // paInter.drawRect( sr/*m_selectedArea*/ ); + // painter.drawRect( sr/*m_selectedArea*/ ); } else { @@ -660,23 +631,23 @@ Void ViewArea::paintEvent( QPaintEvent* event ) fill.setAlpha( 150 ); QBrush brush( fill ); - paInter.setBrush( fill ); - paInter.setPen( Qt::NoPen ); + painter.setBrush( fill ); + painter.setPen( Qt::NoPen ); QPainterPath myPath; QRect imgr = viewToWindow( QRect( 0, 0, m_pixmap.width(), m_pixmap.height() ) ); myPath.addRect( imgr ); myPath.addRect( sr ); // m_selectedArea - paInter.drawPath( myPath ); + painter.drawPath( myPath ); // 2) Draw the selection rectangle - paInter.setBrush( Qt::NoBrush ); - paInter.setPen( Qt::darkCyan ); - // paInter.drawRect( sr/*m_selectedArea*/ ); + painter.setBrush( Qt::NoBrush ); + painter.setPen( Qt::darkCyan ); + // painter.drawRect( sr/*m_selectedArea*/ ); } if( !ir.isNull() ) - paInter.drawRect( sr /*m_selectedArea*/ ); + painter.drawRect( sr /*m_selectedArea*/ ); } // Mask Mode ---------------------------------------------------------- @@ -695,12 +666,12 @@ Void ViewArea::paintEvent( QPaintEvent* event ) color = imageMaskColor; color.setAlpha( 120 ); - paInter.setPen( color ); - paInter.save(); - paInter.translate( m_xOffset, m_yOffset ); - paInter.scale( m_dZoomFactor, m_dZoomFactor ); - paInter.drawPixmap( QPoint( 0, 0 ), m_mask ); - paInter.restore(); + painter.setPen( color ); + painter.save(); + painter.translate( m_xOffset, m_yOffset ); + painter.scale( m_dZoomFactor, m_dZoomFactor ); + painter.drawPixmap( QPoint( 0, 0 ), m_mask ); + painter.restore(); if( !m_selectedArea.isNull() ) { @@ -730,13 +701,13 @@ Void ViewArea::paintEvent( QPaintEvent* event ) brush = QBrush( color ); if( m_blockTrackEnable ) - paInter.setBrush( Qt::NoBrush ); + painter.setBrush( Qt::NoBrush ); else - paInter.setBrush( brush ); + painter.setBrush( brush ); - paInter.setPen( color ); + painter.setPen( color ); if( !ir.isNull() ) - paInter.drawRect( sr ); + painter.drawRect( sr ); } } } @@ -744,10 +715,10 @@ Void ViewArea::paintEvent( QPaintEvent* event ) //////////////////////////////////////////////////////////////////////////////// // Mouse Events //////////////////////////////////////////////////////////////////////////////// -Void ViewArea::wheelEvent( QWheelEvent* event ) +void ViewArea::wheelEvent( QWheelEvent* event ) { - Double scale; - Double usedScale; + double scale; + double usedScale; if( event->modifiers() & Qt::ControlModifier ) { @@ -767,7 +738,7 @@ Void ViewArea::wheelEvent( QWheelEvent* event ) } } -Void ViewArea::mousePressEvent( QMouseEvent* event ) +void ViewArea::mousePressEvent( QMouseEvent* event ) { event->accept(); @@ -800,12 +771,12 @@ Void ViewArea::mousePressEvent( QMouseEvent* event ) // If grid tracking if( m_snapToGrid ) { - // Find if the cursor is near a grid Intersection - Bool isNear = m_grid.isNear( m_lastPos ); + // Find if the cursor is near a grid intersection + bool isNear = m_grid.isNear( m_lastPos ); isNear = true; if( isNear ) { - // The grid 'near Intersection' found when used isNear() + // The grid 'near intersection' found when used isNear() m_lastPos = m_grid.nearPos(); } } @@ -833,12 +804,12 @@ Void ViewArea::mousePressEvent( QMouseEvent* event ) } } -Void ViewArea::mouseMoveEvent( QMouseEvent* event ) +void ViewArea::mouseMoveEvent( QMouseEvent* event ) { event->accept(); #ifndef _MSC_VER - // Add this code line to aVoid slow navigation with some specific mouses + // Add this code line to avoid slow navigation with some specific mouses // This seems to always appear on windows if( qApp->hasPendingEvents() ) return; @@ -855,12 +826,12 @@ Void ViewArea::mouseMoveEvent( QMouseEvent* event ) // Grid tracking if( m_snapToGrid ) { - // Find if the cursor is near a grid Intersection - Bool isNear = m_grid.isNear( actualPos ); + // Find if the cursor is near a grid intersection + bool isNear = m_grid.isNear( actualPos ); if( isNear ) { - // Return the last grid near Intersection found + // Return the last grid near intersection found actualPos = m_grid.nearPos(); } } @@ -920,21 +891,21 @@ Void ViewArea::mouseMoveEvent( QMouseEvent* event ) } } /* else // if tool() == BlockSelectionTool || MaskTool || EraserTool - { - m_blockTrackEnable = false; - // If cursor is inside the selected area, we most redraw - // the selection rect because it may be smaller. - if( m_selectedArea.contains( actualPos ) ) - { - m_selectedArea = m_grid.rectContains( m_lastPos ); - } + { + m_blockTrackEnable = false; + // If cursor is inside the selected area, we most redraw + // the selection rect because it may be smaller. + if( m_selectedArea.contains( actualPos ) ) + { + m_selectedArea = m_grid.rectContains( m_lastPos ); + } - m_selectedArea = m_selectedArea.united( m_grid.rectContains( actualPos ) ); - } - */ + m_selectedArea = m_selectedArea.united( m_grid.rectContains( actualPos ) ); + } + */ if( tool() == SelectionTool ) { - // Intercept the selected area with the image area to limit the + // intercept the selected area with the image area to limit the // selection only to the image area, preventing it to come outside // the image. m_selectedArea &= QRect( 0, 0, m_pixmap.width(), m_pixmap.height() ); @@ -975,7 +946,7 @@ Void ViewArea::mouseMoveEvent( QMouseEvent* event ) } } -Void ViewArea::mouseReleaseEvent( QMouseEvent* event ) +void ViewArea::mouseReleaseEvent( QMouseEvent* event ) { event->accept(); @@ -1019,7 +990,7 @@ Void ViewArea::mouseReleaseEvent( QMouseEvent* event ) //////////////////////////////////////////////////////////////////////////////// -Bool ViewArea::isPosValid( const QPoint& pos ) const +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; @@ -1032,8 +1003,8 @@ 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 ) ); + p.setX( static_cast( ( pt.x() - m_xOffset ) / m_dZoomFactor ) ); + p.setY( static_cast( ( pt.y() - m_yOffset ) / m_dZoomFactor ) ); return p; } @@ -1043,11 +1014,11 @@ QRect ViewArea::windowToView( const QRect& rc ) const QRect r; r.setTopLeft( windowToView( rc.topLeft() ) ); - // r.setRight ( (Int)( ceil(( rc.right() - m_xOffset)/m_dZoomFactor ))); - // r.setBottom( (Int)( ceil(( rc.bottom()- m_yOffset)/m_dZoomFactor ))); - // r.setRight ( static_cast(( rc.right() - m_xOffset ) / + // r.setRight ( (int)( ceil(( rc.right() - m_xOffset)/m_dZoomFactor ))); + // r.setBottom( (int)( ceil(( rc.bottom()- m_yOffset)/m_dZoomFactor ))); + // r.setRight ( static_cast(( rc.right() - m_xOffset ) / // m_dZoomFactor +1)); - // r.setBottom( static_cast(( rc.bottom() - m_xOffset ) / + // r.setBottom( static_cast(( rc.bottom() - m_xOffset ) / // m_dZoomFactor+1)); r.setBottomRight( windowToView( rc.bottomRight() ) ); return r; @@ -1057,8 +1028,8 @@ QPoint ViewArea::viewToWindow( const QPoint& pt ) const { QPoint p; - p.setX( static_cast( pt.x() * m_dZoomFactor + m_xOffset ) ); - p.setY( static_cast( pt.y() * m_dZoomFactor + m_yOffset ) ); + p.setX( static_cast( pt.x() * m_dZoomFactor + m_xOffset ) ); + p.setY( static_cast( pt.y() * m_dZoomFactor + m_yOffset ) ); return p; } @@ -1068,18 +1039,18 @@ QRect ViewArea::viewToWindow( const QRect& rc ) const QRect r; r.setTopLeft( viewToWindow( rc.topLeft() ) ); - // r.setRight ( (Int)( ceil(( rc.right() +1+m_xOffset )*m_dZoomFactor ) - + // r.setRight ( (int)( ceil(( rc.right() +1+m_xOffset )*m_dZoomFactor ) - // 1 )); - // r.setBottom( (Int)( ceil(( rc.bottom()+1+m_yOffset )*m_dZoomFactor ) - + // r.setBottom( (int)( ceil(( rc.bottom()+1+m_yOffset )*m_dZoomFactor ) - // 1 )); - // r.setRight ( (Int)( ceil(( rc.right()+0.5)*m_dZoomFactor )+ m_xOffset + // r.setRight ( (int)( ceil(( rc.right()+0.5)*m_dZoomFactor )+ m_xOffset // )-1); - // r.setBottom( (Int)( ceil(( rc.bottom()+0.5)*m_dZoomFactor ) +m_yOffset + // r.setBottom( (int)( ceil(( rc.bottom()+0.5)*m_dZoomFactor ) +m_yOffset // )-1); // qDebug()<<"Right = "<< r.right(); - // r.setRight ( static_cast(( rc.right()+1) * m_dZoomFactor + + // r.setRight ( static_cast(( rc.right()+1) * m_dZoomFactor + // m_xOffset -1) ); - // r.setBottom( static_cast(( rc.bottom()+1) * m_dZoomFactor + + // r.setBottom( static_cast(( rc.bottom()+1) * m_dZoomFactor + // m_yOffset -1)); r.setBottomRight( viewToWindow( rc.bottomRight() ) ); @@ -1089,28 +1060,28 @@ QRect ViewArea::viewToWindow( const QRect& rc ) const //////////////////////////////////////////////////////////////////////////////// // Masks Management //////////////////////////////////////////////////////////////////////////////// -Void ViewArea::updateMask( const QRect& rect ) +void ViewArea::updateMask( const QRect& rect ) { switch( tool() ) { case MaskTool: { // Add rect to the mask - QPainter paInter( &m_mask ); - paInter.setBrush( Qt::color1 ); - paInter.setPen( Qt::NoPen ); - paInter.drawRect( rect ); - paInter.end(); + QPainter painter( &m_mask ); + painter.setBrush( Qt::color1 ); + painter.setPen( Qt::NoPen ); + painter.drawRect( rect ); + painter.end(); break; } case EraserTool: { // Clears rect area in the mask - QPainter paInter( &m_mask ); - paInter.setBrush( Qt::color0 ); - paInter.setPen( Qt::NoPen ); - paInter.drawRect( rect ); - paInter.end(); + QPainter painter( &m_mask ); + painter.setBrush( Qt::color0 ); + painter.setPen( Qt::NoPen ); + painter.drawRect( rect ); + painter.end(); break; } default: /* Do Nothing */ diff --git a/app/ViewArea.h b/app/ViewArea.h index 4a319f0..405a1d9 100644 --- a/app/ViewArea.h +++ b/app/ViewArea.h @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * @@ -26,10 +26,10 @@ #ifndef __VIEWAREA_H__ #define __VIEWAREA_H__ +#include "CommonDefs.h" #include "GridManager.h" -#include "PlaYUVerAppDefs.h" #include "config.h" -#include "lib/PlaYUVerFrame.h" +#include "lib/CalypFrame.h" #include #include @@ -37,7 +37,7 @@ #include #include -class PlaYUVerStream; +class CalypStream; /** * @@ -56,38 +56,38 @@ public: ViewArea( QWidget* parent = 0 ); - Void setImage( PlaYUVerFrame* pcFrame ); - Void setImage( const QPixmap& pixmap ); + void setImage( CalypFrame* pcFrame ); + void setImage( const QPixmap& pixmap ); - Void setMode( Int mode ); - Void setMaskColor( const QColor& color = QColor() ); + void setMode( int mode ); + void setMaskColor( const QColor& color = QColor() ); /** * Clears any contents. */ - Void clear(); + void clear(); /** * Select tool from the menu */ - Void setTool( UInt view ); + void setTool( unsigned int view ); - Void setGridVisible( Bool enable ); + void setGridVisible( bool enable ); /** * Clears any mask content. */ - Void clearMask(); + void clearMask(); QPixmap image() const { return m_pixmap; } QBitmap mask() const { return m_mask; } QRect selectedArea() const { return m_selectedArea; } GridManager gridManager() const { return m_grid; } QColor maskColor() const { return m_maskColor; } - Double getZoomFactor() { return m_dZoomFactor; } + double getZoomFactor() { return m_dZoomFactor; } // Scale function. Return used scale value (it may change when it touches the // min or max zoom value) - Double scaleZoomFactor( Double scale, QPoint center, QSize minimumSize ); + double scaleZoomFactor( double scale, QPoint center, QSize minimumSize ); Q_SIGNALS: void selectionChanged( const QRect& rect ); @@ -96,25 +96,25 @@ Q_SIGNALS: void zoomFactorChanged_byWheel( const double factor, const QPoint center ); public Q_SLOTS: - // Void setNormalMode(); - // Void setMaskMode(); - // Void setMaskTool(); - // Void setEraserTool(); - // Void setNormalSelectionTool(); - // Void setBlockSelectionTool(); + // void setNormalMode(); + // void setMaskMode(); + // void setMaskTool(); + // void setEraserTool(); + // void setNormalSelectionTool(); + // void setBlockSelectionTool(); void setSnapToGrid( bool enable ); // void setSelectedArea( QRect &rect ); protected: - Void paintEvent( QPaintEvent* event ); - Void resizeEvent( QResizeEvent* event ); - Void mousePressEvent( QMouseEvent* event ); - Void mouseMoveEvent( QMouseEvent* event ); - Void mouseReleaseEvent( QMouseEvent* event ); - Void wheelEvent( QWheelEvent* event ); + void paintEvent( QPaintEvent* event ); + void resizeEvent( QResizeEvent* event ); + void mousePressEvent( QMouseEvent* event ); + void mouseMoveEvent( QMouseEvent* event ); + void mouseReleaseEvent( QMouseEvent* event ); + void wheelEvent( QWheelEvent* event ); - Void updateSize(); - Void updateOffset(); + void updateSize(); + void updateOffset(); private: enum ViewMode @@ -133,12 +133,12 @@ private: ViewMode mode() const { return m_mode; } Tool tool() const { return m_eTool; } - Void initZoomWinRect(); - Void startZoomWinTimer(); - Void setZoomFactor( Double ); + void initZoomWinRect(); + void startZoomWinTimer(); + void setZoomFactor( double ); - Bool isPosValid( const QPoint& pos ) const; - Void updateMask( const QRect& rect ); + bool isPosValid( const QPoint& pos ) const; + void updateMask( const QRect& rect ); QPoint windowToView( const QPoint& pt ) const; QRect windowToView( const QRect& rc ) const; @@ -146,16 +146,16 @@ private: QPoint viewToWindow( const QPoint& pt ) const; QRect viewToWindow( const QRect& rc ) const; - PlaYUVerFrame* m_pcCurrFrame; + CalypFrame* m_pcCurrFrame; - Pel m_uiPixelHalfScale; + ClpPel m_uiPixelHalfScale; Tool m_eTool; - Bool m_bGridVisible; + bool m_bGridVisible; QTimer m_zoomWinTimer; - Double m_dZoomWinRatio; - Double m_dZoomFactor; + double m_dZoomWinRatio; + double m_dZoomFactor; QPixmap m_pixmap; QBitmap m_mask; @@ -166,13 +166,13 @@ private: ViewMode m_mode; QColor m_maskColor; - Int m_xOffset; - Int m_yOffset; - Bool m_blockTrackEnable; - Bool m_newShape; - Bool m_snapToGrid; - Bool m_cursorInGrid; - Bool m_visibleZoomRect; + int m_xOffset; + int m_yOffset; + bool m_blockTrackEnable; + bool m_newShape; + bool m_snapToGrid; + bool m_cursorInGrid; + bool m_visibleZoomRect; }; #endif // __VIEWAREA_H__ diff --git a/app/AboutDialog.cpp b/app/dialog/AboutDialog.cpp similarity index 84% rename from app/AboutDialog.cpp rename to app/dialog/AboutDialog.cpp index 07205a1..40d7e9f 100644 --- a/app/AboutDialog.cpp +++ b/app/dialog/AboutDialog.cpp @@ -1,4 +1,4 @@ -/* This file is a part of PlaYUVer project +/* This file is a part of Calyp project * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) * Luis Lucas (luisfrlucas@gmail.com) * Joao Santos (joaompssantos@gmail.com) @@ -40,17 +40,16 @@ AboutDialog::AboutDialog( QWidget* parent ) : QDialog( parent ) { - QPixmap logo = QPixmap( ":/images/playuver-background-logo.png" ).scaled( QSize( 500, 350 ), Qt::KeepAspectRatio ); + QPixmap logo = QPixmap( ":logos/calyp-logo.png" ).scaledToWidth( 200, Qt::SmoothTransformation ); QLabel* pixmapLabel = new QLabel; pixmapLabel->setPixmap( logo ); - QLabel* label = new QLabel( QString( "

%1 Version %2

%3

" ) - .arg( QApplication::applicationName() ) - .arg( QApplication::applicationVersion() ) - .arg( tr( "Enhanced open-source Qt-based raw video player" ) ) ); - label->setWordWrap( true ); + QLabel* label = new QLabel( QString( "

%1

Version %2

" ) + .arg( tr( "Enhanced open-source video player" ) ) + .arg( QApplication::applicationVersion() ) ); + label->setWordWrap( false ); - QString featuresList = QStringLiteral( "

Features: