Author SHA1 Message Date
jfmcarreira c854e76fd8 Add GitHub action to build code using cmake 2021-04-06 22:27:40 +01:00
jfmcarreira 8f290d6351 Remove unused file and update .gitignore 2021-04-06 21:47:06 +01:00
jfmcarreira fc038eb62f Tests: Add general tests for modules
The idea of these tests is to check whether the modules will work
with different kinds of inputs. The modules should be able to initialize
or return an error indication. But in all cases they should be able to handle
default arguments all different inputs
2021-02-17 02:30:13 +00:00
19 changed files with 37 additions and 122 deletions

No files matched your search

+1 -2
View File
@@ -25,14 +25,13 @@ install:
- 7z x ffmpeg.7z -y -offmpeg - 7z x ffmpeg.7z -y -offmpeg
- git clone https://github.com/pixlra/calyp-deployment.git - git clone https://github.com/pixlra/calyp-deployment.git
- CALL calyp-deployment/scripts/extract_ffmpeg.bat - CALL calyp-deployment/scripts/extract_ffmpeg.bat
- ps: rm C:\Projects\ffmpeg_libraries\bin\*.exe
build_script: build_script:
- mv C:\Projects\calyp C:\Projects\calyp-deployment\cmake-helper\ - mv C:\Projects\calyp C:\Projects\calyp-deployment\cmake-helper\
- mkdir C:\Projects\calyp-build - mkdir C:\Projects\calyp-build
- cd C:\Projects\calyp-build - cd C:\Projects\calyp-build
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DUSE_DYNLOAD=OFF -DOpenCV_DIR="C:/Tools/opencv/build" -DOpenCV_DLL_DIR="C:/Tools/opencv/build/x64/vc15/bin" -DOpenCV_INSTALL_MODULES="world" -DQT_DIR="C:\Qt\latest\msvc2017_64" -DQt5_DIR="C:\Qt\latest\msvc2017_64\lib\cmake\Qt5" -DUSE_QTDBUS=OFF -DAVFORMAT_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avformat.lib -DAVFORMAT_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVCODEC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avcodec.lib -DAVCODEC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVUTIL_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avutil.lib -DAVUTIL_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DSWSCALE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swscale.lib -DSWSCALE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVDEVICE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avdevice.lib -DAVDEVICE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DPOSTPROC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/postproc.lib -DPOSTPROC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DFFMPEG_DIR=C:\Projects\ffmpeg_libraries -DSWRESAMPLE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swresample.lib -DSWRESAMPLE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -G "Visual Studio 15 2017 Win64" C:\Projects\calyp-deployment\cmake-helper - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DUSE_DYNLOAD=OFF -DOpenCV_DIR="C:/Tools/opencv/build" -DOpenCV_DLL_DIR="C:/Tools/opencv/build/x64/vc15/bin" -DOpenCV_INSTALL_MODULES="world" -DQT_DIR="C:\Qt\latest\msvc2017_64" -DQt5_DIR="C:\Qt\latest\msvc2017_64\lib\cmake\Qt5" -DUSE_QTDBUS=OFF -DAVFORMAT_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avformat.lib -DAVFORMAT_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVCODEC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avcodec.lib -DAVCODEC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVUTIL_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avutil.lib -DAVUTIL_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DSWSCALE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swscale.lib -DSWSCALE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -G "Visual Studio 15 2017 Win64" C:\Projects\calyp-deployment\cmake-helper
- cmake --build . --target ALL_BUILD -- /p:Configuration=Release > log_build - cmake --build . --target ALL_BUILD -- /p:Configuration=Release > log_build
- cmake --build . --target INSTALL -- /p:Configuration=Release > log_install - cmake --build . --target INSTALL -- /p:Configuration=Release > log_install
- cmake --build . --target PACKAGE -- /p:Configuration=Release > log_pkg - cmake --build . --target PACKAGE -- /p:Configuration=Release > log_pkg
-1
View File
@@ -76,7 +76,6 @@
# CMake # CMake
bin/ bin/
build/ build/
build-*
cmake-build-*/ cmake-build-*/
# Mongo Explorer plugin # Mongo Explorer plugin
+1 -1
View File
@@ -2,6 +2,6 @@ language: cpp
dist: xenial dist: xenial
before_install: before_install:
- sudo apt-get -qq update - sudo apt-get -qq update
- sudo apt-get install build-essential cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev libgtest-dev - sudo apt-get install build-essential cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev
script: script:
- mkdir -p build && cd build && cmake .. && make && cd .. - mkdir -p build && cd build && cmake .. && make && cd ..
+15 -28
View File
@@ -2,7 +2,15 @@
# CMakeLists for calyp # CMakeLists for calyp
# #
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0) CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
# ####################################################################################################################################################
# CMake functions
# ####################################################################################################################################################
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
INCLUDE(cmake/ModulesFct.cmake)
INCLUDE(FeatureSummary)
INCLUDE(GNUInstallDirs)
# #################################################################################################################################################### # ####################################################################################################################################################
# Project Definition # Project Definition
@@ -17,28 +25,15 @@ SET(PROJECT_LIBRARY
CACHE INTERNAL "" FORCE CACHE INTERNAL "" FORCE
) )
PROJECT(${PROJECT_NAME})
SET(CALYP_VERSION_MAJOR "1") SET(CALYP_VERSION_MAJOR "1")
SET(CALYP_VERSION_MINOR "2") SET(CALYP_VERSION_MINOR "1")
SET(CALYP_VERSION_PATCH "0") SET(CALYP_VERSION_PATCH "0")
SET(CALYP_VERSION SET(CALYP_VERSION
"${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}" "${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}"
CACHE INTERNAL "" FORCE CACHE INTERNAL "" FORCE
) )
PROJECT(
${PROJECT_NAME}
VERSION ${CALYP_VERSION}
LANGUAGES "CXX"
)
# ####################################################################################################################################################
# CMake functions
# ####################################################################################################################################################
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
INCLUDE(cmake/ModulesFct.cmake)
INCLUDE(FeatureSummary)
INCLUDE(GNUInstallDirs)
# #################################################################################################################################################### # ####################################################################################################################################################
# Variables # Variables
# #################################################################################################################################################### # ####################################################################################################################################################
@@ -48,7 +43,6 @@ OPTION(BUILD_TOOLS "Build Command Line Application" ON)
OPTION(BUILD_EXAMPLES "Build Examples" OFF) OPTION(BUILD_EXAMPLES "Build Examples" OFF)
OPTION(BUILD_DOC "Build Documentation" OFF) OPTION(BUILD_DOC "Build Documentation" OFF)
OPTION(BUILD_TESTS "Build Google Tests" OFF) OPTION(BUILD_TESTS "Build Google Tests" OFF)
OPTION(BUILD_TESTS_CATCH2 "Build Catch2 Tests" OFF)
OPTION(USE_FERVOR "Add Fervor support" OFF) OPTION(USE_FERVOR "Add Fervor support" OFF)
@@ -125,17 +119,6 @@ IF(BUILD_TESTS)
) )
ENDIF() ENDIF()
IF(BUILD_TESTS_CATCH2)
FIND_PACKAGE(Catch2 REQUIRED)
ENABLE_TESTING()
SET_PACKAGE_PROPERTIES(
Catch2 PROPERTIES
URL "https://github.com/catchorg/Catch2"
DESCRIPTION "Catch2 unit tests"
TYPE OPTIONAL
)
ENDIF()
OPTION(USE_OPENCV "Add OpenCV support" ON) OPTION(USE_OPENCV "Add OpenCV support" ON)
IF(USE_OPENCV) IF(USE_OPENCV)
@@ -164,6 +147,10 @@ SET_PACKAGE_PROPERTIES(
OPTION(USE_FFMPEG "Add FFMPEG support" ON) OPTION(USE_FFMPEG "Add FFMPEG support" ON)
IF(USE_FFMPEG) IF(USE_FFMPEG)
FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE) 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}) SET(USE_FFMPEG ${FFMPEG_FOUND})
ENDIF() ENDIF()
SET_PACKAGE_PROPERTIES( SET_PACKAGE_PROPERTIES(
+1 -5
View File
@@ -24,10 +24,6 @@
#include "PlotSubWindow.h" #include "PlotSubWindow.h"
#include <QGuiApplication>
#include <QScreen>
#include <QSize>
#include "qcustomplot.h" #include "qcustomplot.h"
//#include "external/qcustomplot/qcustomplot.h" //#include "external/qcustomplot/qcustomplot.h"
@@ -178,7 +174,7 @@ QSize PlotSubWindow::sizeHint() const
} }
else else
{ {
maxSize = QGuiApplication::screens()[0]->availableGeometry().size(); maxSize = QApplication::desktop()->availableGeometry().size();
} }
return sizeHint( maxSize ); return sizeHint( maxSize );
} }
+5 -9
View File
@@ -29,12 +29,10 @@
#include <QActionGroup> #include <QActionGroup>
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QGuiApplication>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QMdiArea> #include <QMdiArea>
#include <QMenu> #include <QMenu>
#include <QPainter> #include <QPainter>
#include <QScreen>
#include <QSettings> #include <QSettings>
#include <QSignalMapper> #include <QSignalMapper>
#include <QStyle> #include <QStyle>
@@ -156,7 +154,7 @@ void SubWindowHandle::setWindowMode( int iWindowMode )
parentWidget()->update(); parentWidget()->update();
m_pcApp->showNormal(); m_pcApp->showNormal();
qApp->processEvents(); qApp->processEvents();
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size(); QSize screenSize = QApplication::desktop()->availableGeometry().size();
m_pcApp->move( 0, 0 ); m_pcApp->move( 0, 0 );
m_pcApp->resize( screenSize.width(), 5 ); m_pcApp->resize( screenSize.width(), 5 );
m_pcApp->setWindowTitle( QApplication::applicationName() ); m_pcApp->setWindowTitle( QApplication::applicationName() );
@@ -232,14 +230,12 @@ void SubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
SLOT( removeMdiSubWindow( MdiSubWindow* ) ) ); SLOT( removeMdiSubWindow( MdiSubWindow* ) ) );
} }
void SubWindowHandle::addSubWindow( SubWindowAbstract* window ) void SubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags )
{ {
if( window ) if( window )
{ {
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp, connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp, SLOT( printMessage( const QString& ) ) );
SLOT( printMessage( const QString& ) ) ); connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp, SLOT( updateZoomFactorSBox() ) );
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp,
SLOT( updateZoomFactorSBox() ) );
if( m_iWindowMode == DETACHEDSUBWINDOWMODE ) if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
{ {
connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this, connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this,
@@ -382,7 +378,7 @@ void SubWindowHandle::tileSubWindows()
if( m_iWindowMode == DETACHEDSUBWINDOWMODE ) if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
{ {
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size(); QSize screenSize = QApplication::desktop()->availableGeometry().size();
unsigned int minWindowsInRow = 1; unsigned int minWindowsInRow = 1;
while( ( screenSize.width() / minWindowsInRow ) > 500 ) while( ( screenSize.width() / minWindowsInRow ) > 500 )
{ {
+1 -1
View File
@@ -51,7 +51,7 @@ public:
void processLogMsg( const QString& msg ); void processLogMsg( const QString& msg );
void addSubWindow( SubWindowAbstract* widget ); void addSubWindow( SubWindowAbstract* widget, Qt::WindowFlags flags = 0 );
SubWindowAbstract* activeSubWindow() const; SubWindowAbstract* activeSubWindow() const;
+1 -1
View File
@@ -259,7 +259,7 @@ QSize VideoSubWindow::sizeHint() const
} }
else else
{ {
maxSize = QGuiApplication::screens()[0]->availableGeometry().size(); maxSize = QApplication::desktop()->availableGeometry().size();
} }
return sizeHint( maxSize ); return sizeHint( maxSize );
} }
+1
View File
@@ -182,6 +182,7 @@ public:
QSize sizeHint( const QSize& ) const; QSize sizeHint( const QSize& ) const;
QString getCurrentFileName() { return m_cFilename; } QString getCurrentFileName() { return m_cFilename; }
bool getIsModule() { return getCategory() | SubWindowAbstract::MODULE_SUBWINDOW; }
void clearWindowBusy() { m_bWindowBusy = false; } void clearWindowBusy() { m_bWindowBusy = false; }
void setFillWindow( bool bFlag ); void setFillWindow( bool bFlag );
+1 -1
View File
@@ -730,7 +730,7 @@ void ViewArea::wheelEvent( QWheelEvent* event )
if( event->modifiers() & Qt::ControlModifier ) if( event->modifiers() & Qt::ControlModifier )
{ {
scale = 0.001 * event->angleDelta().y(); scale = 0.001 * event->delta();
if( scale > 0 ) if( scale > 0 )
scale = 1.25; scale = 1.25;
else else
+3 -10
View File
@@ -49,7 +49,7 @@ AboutDialog::AboutDialog( QWidget* parent )
.arg( QApplication::applicationVersion() ) ); .arg( QApplication::applicationVersion() ) );
label->setWordWrap( false ); label->setWordWrap( false );
QString featuresList = QStringLiteral( "<p><h4><b>Features:</b></h4><ul>" ); QString featuresList = QStringLiteral( "<p><h3><b>Features:</b></h3><ul>" );
#ifdef USE_QTDBUS #ifdef USE_QTDBUS
featuresList.append( QStringLiteral( "<li>Support for Qt DBus messages" ) ); featuresList.append( QStringLiteral( "<li>Support for Qt DBus messages" ) );
@@ -63,21 +63,14 @@ AboutDialog::AboutDialog( QWidget* parent )
featuresList.append( QStringLiteral( "</ul></p>" ) ); featuresList.append( QStringLiteral( "</ul></p>" ) );
QLabel* labelFeatures = new QLabel( featuresList ); QLabel* labelFeatures = new QLabel( featuresList );
QString thanksList = QStringLiteral( "<p><h4><b>Thanks to:</b></h4><ul>" ); QLabel* labelCopyright = new QLabel( QStringLiteral( "Copyright © 2014–2018 Joao Carreira and Luis Lucas" ) );
thanksList.append( QStringLiteral( "<li>Joao Santos" ) );
thanksList.append( QStringLiteral( "<li>Jose Filipe" ) );
thanksList.append( QStringLiteral( "</ul></p>" ) );
QLabel* labelContributors = new QLabel( thanksList );
QLabel* labelCopyright = new QLabel( QStringLiteral( "Copyright 2014–2021 Joao Carreira and Luis Lucas" ) );
QWidget* topWidget = new QWidget; QWidget* topWidget = new QWidget;
QVBoxLayout* topLayout = new QVBoxLayout; QVBoxLayout* topLayout = new QVBoxLayout;
topLayout->addWidget( pixmapLabel, 0, Qt::AlignHCenter ); topLayout->addWidget( pixmapLabel, 0, Qt::AlignHCenter );
topLayout->addWidget( label ); topLayout->addWidget( label );
topLayout->addWidget( labelCopyright );
topLayout->addWidget( labelFeatures ); topLayout->addWidget( labelFeatures );
topLayout->addWidget( labelContributors ); topLayout->addWidget( labelCopyright );
topWidget->setLayout( topLayout ); topWidget->setLayout( topLayout );
// QTextEdit *textEdit = new QTextEdit(tr("<p>This program is free " // QTextEdit *textEdit = new QTextEdit(tr("<p>This program is free "
-4
View File
@@ -51,10 +51,6 @@ int main( int argc, char* argv[] )
QApplication::setApplicationVersion( QStringLiteral( CALYP_VERSION_STRING ) ); QApplication::setApplicationVersion( QStringLiteral( CALYP_VERSION_STRING ) );
QApplication::setOrganizationName( QStringLiteral( "PixLRA" ) ); QApplication::setOrganizationName( QStringLiteral( "PixLRA" ) );
#if _WIN32
application.setStyle( QStyleFactory::create( "Fusion" ) );
#endif
#ifdef USE_QTDBUS #ifdef USE_QTDBUS
/** /**
* use dbus, if available * use dbus, if available
-1
View File
@@ -86,7 +86,6 @@ IF(NOT FFMPEG_LIBRARIES)
FIND_COMPONENT(AVDEVICE libavdevice avdevice libavdevice/avdevice.h) FIND_COMPONENT(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
FIND_COMPONENT(AVUTIL libavutil avutil libavutil/avutil.h) FIND_COMPONENT(AVUTIL libavutil avutil libavutil/avutil.h)
FIND_COMPONENT(SWSCALE libswscale swscale libswscale/swscale.h) FIND_COMPONENT(SWSCALE libswscale swscale libswscale/swscale.h)
FIND_COMPONENT(SWRESAMPLE libswresample swresample libswresample/swresample.h)
FIND_COMPONENT(POSTPROC libpostproc postproc libpostproc/postprocess.h) FIND_COMPONENT(POSTPROC libpostproc postproc libpostproc/postprocess.h)
# Check if the required components were found and add their stuff to the FFMPEG_* vars. # Check if the required components were found and add their stuff to the FFMPEG_* vars.
+1 -1
View File
@@ -4,7 +4,7 @@ MACRO(ADD_MODULE name file)
OPTION(MODULE_${name} "Use module ${name}" ON) OPTION(MODULE_${name} "Use module ${name}" ON)
ADD_FEATURE_INFO(${name} MODULE_${name} "Module ${name}") ADD_FEATURE_INFO(${name} MODULE_${name} "Module ${name}")
IF(MODULE_${name}) IF(MODULE_${name})
LIST(APPEND Calyp_Mod_SRCS ${MODULE_LOCATION}${file}.cpp) LIST(APPEND Calyp_Mod_SRCS ${MODULE_LOCATION}${file})
LIST(APPEND MODULES_LIST_NAME ${name}) LIST(APPEND MODULES_LIST_NAME ${name})
LIST(APPEND MODULES_LIST_FILES ${file}) LIST(APPEND MODULES_LIST_FILES ${file})
SET(Calyp_Mod_SRCS SET(Calyp_Mod_SRCS
+5 -1
View File
@@ -77,5 +77,9 @@ IF(USE_FFMPEG)
"FFmpeg-Dir" "FFmpeg-Dir"
CACHE PATH "Where to find FFmpeg Lib on Windows" CACHE PATH "Where to find FFmpeg Lib on Windows"
) )
INSTALL(DIRECTORY ${FFMPEG_DIR}/bin/ DESTINATION bin) INSTALL(FILES ${FFMPEG_DIR}/bin/avcodec-${AVCODEC_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/avformat-${AVFORMAT_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/avutil-${AVUTIL_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/swscale-${SWSCALE_VERSION}.dll DESTINATION bin)
INSTALL(FILES ${FFMPEG_DIR}/bin/swresample-${SWRESAMPLE_VERSION}.dll DESTINATION bin)
ENDIF() ENDIF()
-4
View File
@@ -85,7 +85,3 @@ ENDIF()
IF(BUILD_TESTS) IF(BUILD_TESTS)
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)
ENDIF() ENDIF()
IF(BUILD_TESTS_CATCH2)
ADD_SUBDIRECTORY(catch2)
ENDIF()
+1 -1
View File
@@ -91,7 +91,7 @@ bool StreamHandlerLibav::openHandler( ClpString strFilename, bool bInput )
// } // }
// Register all components of FFmpeg // Register all components of FFmpeg
//av_register_all(); av_register_all();
/* open input file, and allocate format context */ /* open input file, and allocate format context */
if( avformat_open_input( &m_cFmtCtx, filename, NULL, NULL ) < 0 ) if( avformat_open_input( &m_cFmtCtx, filename, NULL, NULL ) < 0 )
-12
View File
@@ -1,12 +0,0 @@
#
# CMakeLists for Calyp lis tests using catch2
#
# ADD_DEFINITIONS(-DCALYP_TEST_DATA_DIR=\"${CALYP_TEST_DATA_DIR}\")
SET(Calyp_Lib_Catch2_Tests_SRCS CalypFrameTests.cpp)
ADD_EXECUTABLE(CalypLibCatch2Tests ${Calyp_Lib_Catch2_Tests_SRCS})
TARGET_LINK_LIBRARIES(CalypLibCatch2Tests ${PROJECT_LIBRARY} Catch2::Catch2)
INCLUDE(CTest)
-39
View File
@@ -1,39 +0,0 @@
/* This file is a part of plaYUVer project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file CalypFrameTests.cpp
* \brief CalypFrame general tests
*/
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include "CalypFrame.h"
TEST_CASE( "create a 256x128 frame in YUV420 format", "CalypFrame" )
{
// Constructor: CalypFrame( unsigned int width, unsigned int height, int pelFormat, unsigned bitsPixel = 8 );
CalypFrame testFrame( 256, 128, CLP_YUV420P, 8 );
REQUIRE( testFrame.getWidth() == 256 );
REQUIRE( testFrame.getHeight() == 128 );
REQUIRE( testFrame.getPelFormat() == CLP_YUV420P );
REQUIRE( testFrame.getBitsPel() == 8 );
}