Compare commits
10
Commits
a5e0554286
...
2.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b4cdddde4 | ||
|
|
c43cb2bd0a | ||
|
|
e6970fb953 | ||
|
|
aac02a9959 | ||
|
|
500e0e85ba | ||
|
|
d4886a7fee | ||
|
|
f3919ac8e8 | ||
|
|
562fd915fe | ||
|
|
f3df40cdf7 | ||
|
|
1bb2773abc |
No files matched your search
+3
-1
@@ -1,5 +1,5 @@
|
||||
---
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-non-private-member-variables-in-classes, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-constant-array-index'
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-non-private-member-variables-in-classes, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-constant-array-index, -readability-magic-numbers,-cppcoreguidelines-avoid-magic-numbers'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
AnalyzeTemporaryDtors: false
|
||||
@@ -41,3 +41,5 @@ CheckOptions:
|
||||
value: '0'
|
||||
- key: google-readability-function-size.StatementThreshold
|
||||
value: '800'
|
||||
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
|
||||
value: '1'
|
||||
@@ -26,14 +26,13 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Configure CMake
|
||||
- name: Build with default options
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_WERROR=ON
|
||||
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_WERROR=ON; cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
- name: Build without threads
|
||||
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_WERROR=ON -DCALYP_MANAGED_RESOURCES=OFF -DCALYP_THREADED_MODULES=OFF; cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
check-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# Created by https://www.gitignore.io/api/c++,clion,linux
|
||||
# Edit at https://www.gitignore.io/?templates=c++,clion,linux
|
||||
|
||||
deps/**
|
||||
### C++ ###
|
||||
# Prerequisites
|
||||
*.d
|
||||
@@ -146,4 +146,4 @@ doc/
|
||||
compile_commands.json
|
||||
|
||||
# Build dirs
|
||||
build*
|
||||
build*
|
||||
+32
-30
@@ -18,8 +18,8 @@ SET(PROJECT_LIBRARY
|
||||
)
|
||||
|
||||
SET(CALYP_VERSION_MAJOR "2")
|
||||
SET(CALYP_VERSION_MINOR "0")
|
||||
SET(CALYP_VERSION_PATCH "1")
|
||||
SET(CALYP_VERSION_MINOR "1")
|
||||
SET(CALYP_VERSION_PATCH "0")
|
||||
SET(CALYP_VERSION
|
||||
"${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}"
|
||||
CACHE INTERNAL "" FORCE
|
||||
@@ -104,7 +104,8 @@ SET(UPDATE_CHANNEL
|
||||
# ####################################################################################################################################################
|
||||
INCLUDE(FetchContent)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
SET(FETCHCONTENT_BASE_DIR "${CMAKE_BINARY_DIR}/deps")
|
||||
|
||||
# Doxygen
|
||||
IF(BUILD_DOC)
|
||||
FIND_PACKAGE(Doxygen)
|
||||
@@ -117,7 +118,24 @@ SET_PACKAGE_PROPERTIES(
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Type safe
|
||||
FETCHCONTENT_DECLARE(
|
||||
type_safe
|
||||
GIT_REPOSITORY https://github.com/foonathan/type_safe
|
||||
GIT_TAG v0.2.2
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/deps/type_safe"
|
||||
)
|
||||
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
type_safe PROPERTIES
|
||||
URL "https://github.com/foonathan/type_safe"
|
||||
DESCRIPTION "Zero overhead abstractions that use the C++ type system to prevent bugs."
|
||||
TYPE REQUIRED
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(type_safe)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/deps/type_safe/include/ ${CMAKE_BINARY_DIR}/deps/type_safe/external/debug_assert/)
|
||||
ADD_DEFINITIONS(-DTYPE_SAFE_ENABLE_ASSERTIONS=0 -DTYPE_SAFE_ENABLE_PRECONDITION_CHECKS=0 -DDEBUG_ASSERT_DISABLE)
|
||||
|
||||
# Catch2 and Google Tests
|
||||
IF(BUILD_TESTS)
|
||||
FETCHCONTENT_DECLARE(googletest URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip)
|
||||
@@ -126,7 +144,12 @@ IF(BUILD_TESTS)
|
||||
ON
|
||||
CACHE BOOL "" FORCE
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(googletest)
|
||||
FETCHCONTENT_DECLARE(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v2.13.1
|
||||
)
|
||||
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
googletest PROPERTIES
|
||||
URL "https://github.com/google/googletest"
|
||||
@@ -134,19 +157,15 @@ IF(BUILD_TESTS)
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
FETCHCONTENT_DECLARE(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v2.13.1
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(Catch2)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
Catch2 PROPERTIES
|
||||
URL "https://github.com/catchorg/Catch2"
|
||||
DESCRIPTION "Catch2 unit tests"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/_deps/catch2-src/contrib/Catch.cmake)
|
||||
FETCHCONTENT_MAKEAVAILABLE(googletest Catch2)
|
||||
|
||||
INCLUDE(${CMAKE_BINARY_DIR}/deps/catch2-src/contrib/Catch.cmake)
|
||||
INCLUDE(CTest)
|
||||
ENABLE_TESTING()
|
||||
|
||||
@@ -156,23 +175,7 @@ IF(BUILD_TESTS)
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Type safe
|
||||
FETCHCONTENT_DECLARE(
|
||||
type_safe
|
||||
GIT_REPOSITORY https://github.com/foonathan/type_safe
|
||||
GIT_TAG v0.2.2
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(type_safe)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
type_safe PROPERTIES
|
||||
URL "https://github.com/foonathan/type_safe"
|
||||
DESCRIPTION "Zero overhead abstractions that use the C++ type system to prevent bugs."
|
||||
TYPE REQUIRED
|
||||
)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/_deps/type_safe-src/include/ ${CMAKE_CURRENT_BINARY_DIR}/_deps/type_safe-src/external/debug_assert/)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# OpenCV
|
||||
OPTION(USE_OPENCV "Add OpenCV support" ON)
|
||||
IF(USE_OPENCV)
|
||||
@@ -199,7 +202,6 @@ SET_PACKAGE_PROPERTIES(
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# FFmpeg
|
||||
OPTION(USE_FFMPEG "Add FFMPEG support" ON)
|
||||
IF(USE_FFMPEG)
|
||||
@@ -266,7 +268,7 @@ IF(USE_WERROR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 -DCLP_DEBUG")
|
||||
IF(BUILD_WITH_SANITIZERS)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fsanitize=leak -fsanitize=undefined")
|
||||
ENDIF()
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoStreamSubWindow.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
VideoHandle::VideoHandle( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: m_pcParent( parent ), m_pcMainWindowManager( windowManager )
|
||||
@@ -123,6 +124,24 @@ void VideoHandle::createActions()
|
||||
connect( m_pcFrameSlider, SIGNAL( valueChanged( int ) ), this, SLOT( seekSliderEvent( int ) ) );
|
||||
|
||||
// ------------ Image ------------
|
||||
m_mapperComponent = new QSignalMapper( this );
|
||||
m_actionGroupComponent = new QActionGroup( this );
|
||||
m_actionGroupComponent->setExclusive( true );
|
||||
m_mapperComponent->setMapping( m_actionGroupComponent->addAction( "All" ), -1 );
|
||||
m_mapperComponent->setMapping( m_actionGroupComponent->addAction( "Red" ), 0 );
|
||||
m_mapperComponent->setMapping( m_actionGroupComponent->addAction( "Green" ), 1 );
|
||||
m_mapperComponent->setMapping( m_actionGroupComponent->addAction( "Blue" ), 2 );
|
||||
m_mapperComponent->setMapping( m_actionGroupComponent->addAction( "Alpha" ), 3 );
|
||||
for( int i = 0; i < m_actionGroupComponent->actions().size(); i++ )
|
||||
{
|
||||
m_actionGroupComponent->actions().at( i )->setCheckable( true );
|
||||
m_actionGroupComponent->actions().at( i )->setVisible( false );
|
||||
connect( m_actionGroupComponent->actions().at( i ), SIGNAL( triggered() ), m_mapperComponent, SLOT( map() ) );
|
||||
}
|
||||
m_actionGroupComponent->actions().at( 0 )->setChecked( true );
|
||||
m_actionGroupComponent->actions().at( 0 )->setVisible( true );
|
||||
connect( m_mapperComponent, SIGNAL( mapped( int ) ), this, SLOT( setComponent( int ) ) );
|
||||
|
||||
m_actionGroupTools = new QActionGroup( this );
|
||||
m_actionGroupTools->setExclusive( true );
|
||||
|
||||
@@ -158,9 +177,11 @@ void VideoHandle::createActions()
|
||||
m_mapperGrid = new QSignalMapper( this );
|
||||
m_actionGroupGrid = new QActionGroup( this );
|
||||
m_actionGroupGrid->setExclusive( true );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "4x4" ), 4 );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "8x8" ), 8 );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "16x16" ), 16 );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "64x64" ), 64 );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "128x128" ), 128 );
|
||||
|
||||
for( int i = 0; i < m_actionGroupGrid->actions().size(); i++ )
|
||||
{
|
||||
@@ -194,6 +215,8 @@ QMenu* VideoHandle::createVideoMenu()
|
||||
QMenu* VideoHandle::createImageMenu()
|
||||
{
|
||||
m_pcMenuImage = new QMenu( "Image", m_pcParent );
|
||||
m_menuComponent = m_pcMenuImage->addMenu( "Component" );
|
||||
m_menuComponent->addActions( m_actionGroupComponent->actions() );
|
||||
m_pcMenuImage->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
|
||||
m_pcMenuImage->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
|
||||
m_pcMenuImage->addAction( m_arrayActions[BLOCK_SELECTION_TOOL_ACT] );
|
||||
@@ -268,6 +291,62 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
return pcStatusBarWidget;
|
||||
}
|
||||
|
||||
void VideoHandle::updateComponentMenu()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
if( pcSubWindow == nullptr )
|
||||
{
|
||||
m_menuComponent->setEnabled( false );
|
||||
return;
|
||||
}
|
||||
|
||||
const auto* frame = pcSubWindow->getCurrFrame();
|
||||
if( frame == nullptr )
|
||||
{
|
||||
m_menuComponent->setEnabled( false );
|
||||
return;
|
||||
}
|
||||
|
||||
m_menuComponent->setEnabled( true );
|
||||
for( int i = 1; i < m_actionGroupComponent->actions().size(); i++ )
|
||||
{
|
||||
m_actionGroupComponent->actions()[i]->setChecked( false );
|
||||
m_actionGroupComponent->actions()[i]->setVisible( false );
|
||||
}
|
||||
switch( frame->getColorSpace() )
|
||||
{
|
||||
case CLP_COLOR_GRAY:
|
||||
m_actionGroupComponent->actions().at( 1 )->setText( QStringLiteral( "Gray" ) );
|
||||
m_actionGroupComponent->actions().at( 1 )->setVisible( true );
|
||||
break;
|
||||
case CLP_COLOR_YUV:
|
||||
m_actionGroupComponent->actions().at( 1 )->setText( QStringLiteral( "Luminance" ) );
|
||||
m_actionGroupComponent->actions().at( 1 )->setVisible( true );
|
||||
m_actionGroupComponent->actions().at( 2 )->setText( QStringLiteral( "Chrominance U (Cb)" ) );
|
||||
m_actionGroupComponent->actions().at( 2 )->setVisible( true );
|
||||
m_actionGroupComponent->actions().at( 3 )->setText( QStringLiteral( "Chrominance V (Cr)" ) );
|
||||
m_actionGroupComponent->actions().at( 3 )->setVisible( true );
|
||||
break;
|
||||
case CLP_COLOR_RGBA:
|
||||
m_actionGroupComponent->actions().at( 4 )->setText( QStringLiteral( "Alpha" ) );
|
||||
m_actionGroupComponent->actions().at( 4 )->setVisible( true );
|
||||
[[fallthrough]];
|
||||
case CLP_COLOR_RGB:
|
||||
m_actionGroupComponent->actions().at( 1 )->setText( QStringLiteral( "Red" ) );
|
||||
m_actionGroupComponent->actions().at( 1 )->setVisible( true );
|
||||
m_actionGroupComponent->actions().at( 2 )->setText( QStringLiteral( "Green" ) );
|
||||
m_actionGroupComponent->actions().at( 2 )->setVisible( true );
|
||||
m_actionGroupComponent->actions().at( 3 )->setText( QStringLiteral( "Blue" ) );
|
||||
m_actionGroupComponent->actions().at( 3 )->setVisible( true );
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT( false );
|
||||
}
|
||||
auto component = pcSubWindow->getViewArea()->getFilteredChannel();
|
||||
int idx = component.has_value() ? *component : 0;
|
||||
m_actionGroupComponent->actions().at( idx )->setChecked( true );
|
||||
}
|
||||
|
||||
void VideoHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
@@ -296,6 +375,8 @@ void VideoHandle::updateMenus()
|
||||
m_arrayActions[SELECTION_TOOL_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[SHOW_GRID_ACT]->setEnabled( hasSubWindow );
|
||||
|
||||
updateComponentMenu();
|
||||
}
|
||||
|
||||
void VideoHandle::readSettings()
|
||||
@@ -860,6 +941,20 @@ void VideoHandle::videoSelectionButtonEvent()
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::setComponent( int component )
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow == nullptr )
|
||||
return;
|
||||
if( component < 0 )
|
||||
{
|
||||
m_pcCurrentVideoSubWindow->getViewArea()->clearFilteredChannel();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcCurrentVideoSubWindow->getViewArea()->setFilteredChannel( static_cast<std::size_t>( component ) );
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::setTool( int tool )
|
||||
{
|
||||
m_uiViewTool = tool;
|
||||
|
||||
@@ -97,6 +97,11 @@ private:
|
||||
QSlider* m_pcFrameSlider;
|
||||
FrameNumberWidget* m_pcFrameNumInfo;
|
||||
|
||||
// Filter component actions
|
||||
QMenu* m_menuComponent;
|
||||
QActionGroup* m_actionGroupComponent;
|
||||
QSignalMapper* m_mapperComponent;
|
||||
|
||||
// Tools Actions
|
||||
QActionGroup* m_actionGroupTools;
|
||||
QSignalMapper* m_mapperTools;
|
||||
@@ -131,6 +136,7 @@ private:
|
||||
void calculateRealFrameRate();
|
||||
unsigned long getMaxFrameNumber();
|
||||
void setTimerStatus();
|
||||
void updateComponentMenu();
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
@@ -150,6 +156,7 @@ private Q_SLOTS:
|
||||
void seekEvent( int direction );
|
||||
void seekVideo();
|
||||
void videoSelectionButtonEvent();
|
||||
void setComponent( int component );
|
||||
void setTool( int tool );
|
||||
void toggleGrid( bool checked );
|
||||
void setGridSize( int size );
|
||||
|
||||
+7
-13
@@ -396,7 +396,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();
|
||||
@@ -500,12 +500,11 @@ void VideoSubWindow::zoomToFactor( double factor, QPoint center )
|
||||
|
||||
void VideoSubWindow::scaleView( double scale, QPoint center )
|
||||
{
|
||||
Q_ASSERT( !m_cViewArea->image().isNull() );
|
||||
if( scale != 1.0 )
|
||||
{
|
||||
double usedScale = m_cViewArea->scaleZoomFactor( scale, center, getScrollSize() );
|
||||
adjustScrollBarByScale( usedScale, center );
|
||||
}
|
||||
if( scale == 1.0 )
|
||||
return;
|
||||
|
||||
double usedScale = m_cViewArea->scaleZoomFactor( scale, center, getScrollSize() );
|
||||
adjustScrollBarByScale( usedScale, center );
|
||||
}
|
||||
|
||||
void VideoSubWindow::scaleView( const QSize& size, QPoint center )
|
||||
@@ -521,12 +520,7 @@ void VideoSubWindow::scaleView( const QSize& size, QPoint center )
|
||||
// Calc the zoom factor
|
||||
double wfactor = (double)newSize.width() / imgViewSize.width();
|
||||
double hfactor = (double)newSize.height() / imgViewSize.height();
|
||||
double factor{ wfactor };
|
||||
|
||||
if( wfactor < hfactor )
|
||||
factor = wfactor;
|
||||
else
|
||||
factor = hfactor;
|
||||
auto factor = std::min( wfactor, hfactor );
|
||||
|
||||
double curFactor = getScaleFactor();
|
||||
if( factor != curFactor )
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
void setFillWindow( bool bFlag );
|
||||
|
||||
void adjustScrollBarToRatio( const double& horRatio, const double& verRatio );
|
||||
void adjustScrollBarToRatio( const double horRatio, const double verRatio );
|
||||
|
||||
private:
|
||||
bool hasRunningModule();
|
||||
@@ -177,8 +177,8 @@ protected:
|
||||
private:
|
||||
QScrollArea* m_pcScrollArea;
|
||||
QPoint m_cCurrScroll;
|
||||
double m_dHorScroll;
|
||||
double m_dVerScroll;
|
||||
double m_dHorScroll{ 0 };
|
||||
double m_dVerScroll{ 0 };
|
||||
ViewArea* m_cViewArea;
|
||||
QRect m_cSelectedArea;
|
||||
VideoSubWindow* m_pcReferenceSubWindow;
|
||||
|
||||
+94
-53
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "ViewArea.h"
|
||||
|
||||
#include <qcolor.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
#include <QColor>
|
||||
@@ -42,9 +43,17 @@
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
static const QColor selectionColor = Qt::cyan;
|
||||
static const QColor imageMaskColor = Qt::green;
|
||||
static const QColor eraserColor = Qt::red;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||
constexpr auto kSelectionColor = QColorConstants::Cyan;
|
||||
constexpr auto kImageMaskColor = QColorConstants::Green;
|
||||
constexpr auto kEraserColor = QColorConstants::Red;
|
||||
#else
|
||||
static const QColor kSelectionColor = Qt::cyan;
|
||||
static const QColor kImageMaskColor = Qt::green;
|
||||
static const QColor kEraserColor = Qt::red;
|
||||
#endif
|
||||
constexpr double kMaxZoom = 100.0;
|
||||
constexpr double kMinZoom = 0.01;
|
||||
|
||||
ViewArea::ViewArea( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
@@ -53,15 +62,6 @@ ViewArea::ViewArea( QWidget* parent )
|
||||
m_grid = GridManager();
|
||||
m_mask = QBitmap();
|
||||
m_selectedArea = QRect();
|
||||
m_dZoomFactor = 1;
|
||||
m_xOffset = 0;
|
||||
m_yOffset = 0;
|
||||
m_mode = NormalMode;
|
||||
m_eTool = NavigationTool;
|
||||
m_bGridVisible = false;
|
||||
m_snapToGrid = false;
|
||||
m_blockTrackEnable = false;
|
||||
m_visibleZoomRect = true;
|
||||
|
||||
m_zoomWinTimer.setSingleShot( true );
|
||||
m_zoomWinTimer.setInterval( 2000 );
|
||||
@@ -72,7 +72,15 @@ void ViewArea::setImage( std::shared_ptr<CalypFrame> frame )
|
||||
{
|
||||
m_nextFrame = frame;
|
||||
m_uiPixelHalfScale = 1 << ( m_nextFrame->getBitsPel() - 1 );
|
||||
m_nextFrame->fillRGBBuffer();
|
||||
if( m_filterSingleChannel.has_value() )
|
||||
{
|
||||
m_nextFrame->fillRGBBuffer( m_filterSingleChannel );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nextFrame->fillRGBBuffer();
|
||||
}
|
||||
|
||||
m_image = QImage( m_nextFrame->getRGBBuffer(),
|
||||
m_nextFrame->getWidth(),
|
||||
m_nextFrame->getHeight(),
|
||||
@@ -86,14 +94,47 @@ void ViewArea::setImage( std::shared_ptr<CalypFrame> frame )
|
||||
initZoomWinRect();
|
||||
}
|
||||
|
||||
void ViewArea::clear()
|
||||
// void ViewArea::clear()
|
||||
// {
|
||||
// m_image = QImage();
|
||||
// m_mask = QBitmap();
|
||||
// m_mode = NormalMode;
|
||||
// updateSize();
|
||||
// update();
|
||||
// updateGeometry();
|
||||
// }
|
||||
|
||||
auto ViewArea::getFilteredChannel() -> std::optional<std::size_t>
|
||||
{
|
||||
m_image = QImage();
|
||||
m_mask = QBitmap();
|
||||
m_mode = NormalMode;
|
||||
updateSize();
|
||||
return m_filterSingleChannel;
|
||||
}
|
||||
|
||||
void ViewArea::setFilteredChannel( std::size_t channel )
|
||||
{
|
||||
m_filterSingleChannel = channel;
|
||||
if( m_nextFrame != nullptr )
|
||||
{
|
||||
m_nextFrame->fillRGBBuffer( m_filterSingleChannel );
|
||||
m_image = QImage( m_nextFrame->getRGBBuffer(),
|
||||
m_nextFrame->getWidth(),
|
||||
m_nextFrame->getHeight(),
|
||||
QImage::Format_ARGB32 );
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void ViewArea::clearFilteredChannel()
|
||||
{
|
||||
m_filterSingleChannel = {};
|
||||
if( m_nextFrame != nullptr )
|
||||
{
|
||||
m_nextFrame->fillRGBBuffer( m_filterSingleChannel );
|
||||
m_image = QImage( m_nextFrame->getRGBBuffer(),
|
||||
m_nextFrame->getWidth(),
|
||||
m_nextFrame->getHeight(),
|
||||
QImage::Format_ARGB32 );
|
||||
}
|
||||
update();
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
void ViewArea::setTool( unsigned int view )
|
||||
@@ -161,14 +202,14 @@ void ViewArea::setZoomFactor( double f )
|
||||
|
||||
double ViewArea::scaleZoomFactor( double scale, QPoint center, QSize minimumSize )
|
||||
{
|
||||
double maxZoom = 100.0;
|
||||
double minZoom = 0.01; //( 1.0 / m_image.width() );
|
||||
Q_ASSERT( !m_image.isNull() );
|
||||
|
||||
double new_scale = 1.0;
|
||||
|
||||
if( ( m_dZoomFactor == minZoom ) && ( scale < 1 ) )
|
||||
if( ( m_dZoomFactor == kMinZoom ) && ( scale < 1 ) )
|
||||
return new_scale;
|
||||
|
||||
if( ( m_dZoomFactor == maxZoom ) && ( scale > 1 ) )
|
||||
if( ( m_dZoomFactor == kMaxZoom ) && ( scale > 1 ) )
|
||||
return new_scale;
|
||||
|
||||
double newZoomFactor = m_dZoomFactor * scale * 100.0;
|
||||
@@ -209,16 +250,16 @@ double ViewArea::scaleZoomFactor( double scale, QPoint center, QSize minimumSize
|
||||
|
||||
new_scale = scale;
|
||||
|
||||
if( newZoomFactor < minZoom )
|
||||
if( newZoomFactor < kMinZoom )
|
||||
{
|
||||
newZoomFactor = minZoom;
|
||||
newZoomFactor = kMinZoom;
|
||||
new_scale = newZoomFactor / m_dZoomFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( newZoomFactor > maxZoom )
|
||||
if( newZoomFactor > kMaxZoom )
|
||||
{
|
||||
newZoomFactor = maxZoom;
|
||||
newZoomFactor = kMaxZoom;
|
||||
new_scale = newZoomFactor / m_dZoomFactor;
|
||||
}
|
||||
}
|
||||
@@ -474,12 +515,12 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
|
||||
// Draw a border around the image.
|
||||
/* if( m_xOffset || m_yOffset )
|
||||
{
|
||||
painter.setPen( Qt::black );
|
||||
painter.drawRect( m_xOffset - 1, m_yOffset - 1, m_image.width() *
|
||||
m_dZoomFactor + 1, m_image.height() *
|
||||
m_dZoomFactor + 1 );
|
||||
}*/
|
||||
{
|
||||
painter.setPen( Qt::black );
|
||||
painter.drawRect( m_xOffset - 1, m_yOffset - 1, m_image.width() *
|
||||
m_dZoomFactor + 1, m_image.height() *
|
||||
m_dZoomFactor + 1 );
|
||||
}*/
|
||||
|
||||
int frFormat = m_currFrame->getColorSpace();
|
||||
|
||||
@@ -567,16 +608,16 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
|
||||
QRect vr = windowToView( winRect );
|
||||
QRect cVisibleImg = vr & cImg;
|
||||
//cVisibleImg.moveTopLeft(vr.topLeft());
|
||||
// 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.fillRect( cImgWinRect, QBrush( QColor( 128, 128, 128, 128 ) ) );
|
||||
painter.setPen( QColor( 50, 50, 50, 128 ) );
|
||||
//painter.drawRect( cImgWinRect );
|
||||
// painter.drawRect( cImgWinRect );
|
||||
painter.setOpacity( 0.7 );
|
||||
painter.drawImage( cImgWinRect, m_image );
|
||||
painter.setOpacity( 1 );
|
||||
@@ -599,7 +640,7 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
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;
|
||||
}
|
||||
|
||||
QRect sr = viewToWindow( m_selectedArea );
|
||||
@@ -610,7 +651,7 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
if( m_newShape || m_blockTrackEnable )
|
||||
{
|
||||
// Set the tool color
|
||||
QColor selectColor = selectionColor;
|
||||
QColor selectColor = kSelectionColor;
|
||||
|
||||
selectColor.setAlpha( 120 );
|
||||
|
||||
@@ -664,7 +705,7 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
if( m_maskColor.isValid() )
|
||||
color = m_maskColor;
|
||||
else
|
||||
color = imageMaskColor;
|
||||
color = kImageMaskColor;
|
||||
|
||||
color.setAlpha( 120 );
|
||||
painter.setPen( color );
|
||||
@@ -684,16 +725,16 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
if( m_maskColor.isValid() )
|
||||
color = m_maskColor;
|
||||
else
|
||||
color = imageMaskColor;
|
||||
color = kImageMaskColor;
|
||||
|
||||
break;
|
||||
}
|
||||
case EraserTool: {
|
||||
color = eraserColor;
|
||||
color = kEraserColor;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
color = selectionColor; // ?Problems!
|
||||
color = kSelectionColor; // ?Problems!
|
||||
}
|
||||
|
||||
color.setAlpha( 120 );
|
||||
@@ -898,18 +939,18 @@ 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
|
||||
|
||||
+22
-23
@@ -56,17 +56,15 @@ public:
|
||||
|
||||
ViewArea( QWidget* parent = 0 );
|
||||
|
||||
QImage& image() { return m_image; };
|
||||
void setImage( std::shared_ptr<CalypFrame> frame );
|
||||
|
||||
auto getFilteredChannel() -> std::optional<std::size_t>;
|
||||
void setFilteredChannel( std::size_t channel );
|
||||
void clearFilteredChannel();
|
||||
|
||||
void setMode( int mode );
|
||||
void setMaskColor( const QColor& color = QColor() );
|
||||
|
||||
/**
|
||||
* Clears any contents.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* Select tool from the menu
|
||||
*/
|
||||
@@ -108,12 +106,12 @@ public Q_SLOTS:
|
||||
// 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 ) override;
|
||||
void resizeEvent( QResizeEvent* event ) override;
|
||||
void mousePressEvent( QMouseEvent* event ) override;
|
||||
void mouseMoveEvent( QMouseEvent* event ) override;
|
||||
void mouseReleaseEvent( QMouseEvent* event ) override;
|
||||
void wheelEvent( QWheelEvent* event ) override;
|
||||
|
||||
void updateSize();
|
||||
void updateOffset();
|
||||
@@ -149,34 +147,35 @@ private:
|
||||
QRect viewToWindow( const QRect& rc ) const;
|
||||
|
||||
std::shared_ptr<CalypFrame> m_currFrame;
|
||||
QImage m_image;
|
||||
std::shared_ptr<CalypFrame> m_nextFrame;
|
||||
|
||||
std::optional<std::size_t> m_filterSingleChannel;
|
||||
ClpPel m_uiPixelHalfScale;
|
||||
|
||||
Tool m_eTool;
|
||||
bool m_bGridVisible;
|
||||
Tool m_eTool{ NavigationTool };
|
||||
bool m_bGridVisible{ false };
|
||||
|
||||
QTimer m_zoomWinTimer;
|
||||
double m_dZoomWinRatio;
|
||||
double m_dZoomFactor;
|
||||
double m_dZoomFactor{ 1.0 };
|
||||
|
||||
QImage m_image;
|
||||
//QPixmap m_pixmap;
|
||||
// QPixmap m_pixmap;
|
||||
QBitmap m_mask;
|
||||
QRect m_selectedArea;
|
||||
QPoint m_lastPos;
|
||||
QPoint m_lastWindowPos;
|
||||
GridManager m_grid;
|
||||
ViewMode m_mode;
|
||||
ViewMode m_mode{ NormalMode };
|
||||
|
||||
QColor m_maskColor;
|
||||
int m_xOffset;
|
||||
int m_yOffset;
|
||||
bool m_blockTrackEnable;
|
||||
int m_xOffset{ 0 };
|
||||
int m_yOffset{ 0 };
|
||||
bool m_blockTrackEnable{ false };
|
||||
bool m_newShape;
|
||||
bool m_snapToGrid;
|
||||
bool m_snapToGrid{ false };
|
||||
bool m_cursorInGrid;
|
||||
bool m_visibleZoomRect;
|
||||
bool m_visibleZoomRect{ true };
|
||||
};
|
||||
|
||||
#endif // __VIEWAREA_H__
|
||||
+44
-16
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "CalypFrame.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
@@ -782,18 +783,20 @@ inline constexpr auto convert_to_pel_argb( const T r, const T g, const T b ) ->
|
||||
template <typename T>
|
||||
inline constexpr void convert_yuv_to_rgb( const T iY, const T iU, const T iV, T& iR, T& iG, T& iB )
|
||||
{
|
||||
auto clamp_pel_value = []( auto X ) {if( X < 0 )
|
||||
return 0;
|
||||
if( X > 255 )
|
||||
return 255;
|
||||
return X; };
|
||||
auto clamp_pel_value = []( auto X ) {
|
||||
if( X < 0 )
|
||||
return 0;
|
||||
if( X > 255 )
|
||||
return 255;
|
||||
return X;
|
||||
};
|
||||
|
||||
iR = iY + ( ( 1436 * ( iV - 128 ) ) >> 10 );
|
||||
iG = iY - ( ( 352 * ( iU - 128 ) + 731 * ( iV - 128 ) ) >> 10 );
|
||||
iB = iY + ( ( 1812 * ( iU - 128 ) ) >> 10 );
|
||||
clamp_pel_value( iR );
|
||||
clamp_pel_value( iG );
|
||||
clamp_pel_value( iB );
|
||||
iR = clamp_pel_value( iR );
|
||||
iG = clamp_pel_value( iG );
|
||||
iB = clamp_pel_value( iB );
|
||||
}
|
||||
|
||||
void fillRGBBufferYUV420p( ClpPel*** pppInputPel, uint32_t* pARGB, unsigned uiWidth, unsigned uiHeight, int shiftBits )
|
||||
@@ -828,25 +831,42 @@ void fillRGBBufferYUV420p( ClpPel*** pppInputPel, uint32_t* pARGB, unsigned uiWi
|
||||
}
|
||||
}
|
||||
|
||||
void CalypFrame::fillRGBBuffer() const
|
||||
void CalypFrame::fillRGBBuffer( std::optional<std::size_t> channel ) const
|
||||
{
|
||||
if( d->m_bHasRGBPel )
|
||||
return;
|
||||
int shiftBits = d->m_uiBitsPel - 8;
|
||||
auto shiftBits = static_cast<int>( d->m_uiBitsPel ) - 8;
|
||||
|
||||
d->m_bHasRGBPel = true;
|
||||
// 4 bytes for A, R, G and B
|
||||
uint32_t* pARGB = (uint32_t*)d->m_pcARGB32.data();
|
||||
if( d->m_pcPelFormat->colorSpace == CLP_COLOR_GRAY )
|
||||
if( d->m_pcPelFormat->colorSpace == CLP_COLOR_GRAY || ( channel.has_value() && *channel == 0 ) )
|
||||
{
|
||||
ClpPel* pY = d->m_pppcInputPel[CLP_LUMA][0];
|
||||
unsigned char finalPel{ 0 };
|
||||
ClpPel* pY = d->m_pppcInputPel[0][0];
|
||||
for( unsigned int i = 0; i < d->m_uiHeight * d->m_uiWidth; i++ )
|
||||
{
|
||||
finalPel = ( *pY++ ) >> shiftBits;
|
||||
unsigned char finalPel = ( *pY++ ) >> shiftBits;
|
||||
*pARGB++ = convert_to_pel_argb( finalPel, finalPel, finalPel );
|
||||
}
|
||||
}
|
||||
else if( channel.has_value() && *channel > 0 )
|
||||
{
|
||||
ClpPel* pLine = d->m_pppcInputPel[*channel][0];
|
||||
for( unsigned y = 0; y < CHROMASHIFT( d->m_uiHeight, d->m_pcPelFormat->log2ChromaHeight ); y++ )
|
||||
{
|
||||
for( int i = 0; i < 1 << d->m_pcPelFormat->log2ChromaHeight; i++ )
|
||||
{
|
||||
ClpPel* pPel = pLine;
|
||||
for( unsigned x = 0; x < CHROMASHIFT( d->m_uiWidth, d->m_pcPelFormat->log2ChromaWidth ); x++ )
|
||||
{
|
||||
unsigned char finalPel = ( *pPel++ ) >> shiftBits;
|
||||
for( int j = 0; j < ( 1 << d->m_pcPelFormat->log2ChromaWidth ); j++ )
|
||||
{
|
||||
*pARGB++ = convert_to_pel_argb( finalPel, finalPel, finalPel );
|
||||
}
|
||||
}
|
||||
}
|
||||
pLine += CHROMASHIFT( d->m_uiWidth, d->m_pcPelFormat->log2ChromaWidth );
|
||||
}
|
||||
}
|
||||
else if( d->m_pcPelFormat->colorSpace == CLP_COLOR_RGB )
|
||||
{
|
||||
ClpPel* pR = d->m_pppcInputPel[CLP_COLOR_R][0];
|
||||
@@ -910,6 +930,14 @@ void CalypFrame::fillRGBBuffer() const
|
||||
}
|
||||
}
|
||||
|
||||
void CalypFrame::fillRGBBuffer() const
|
||||
{
|
||||
if( d->m_bHasRGBPel )
|
||||
return;
|
||||
|
||||
fillRGBBuffer( {} );
|
||||
}
|
||||
|
||||
/**
|
||||
* Histogram
|
||||
*/
|
||||
|
||||
+2
-1
@@ -26,7 +26,7 @@
|
||||
#ifndef __CALYPFRAME_H__
|
||||
#define __CALYPFRAME_H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
@@ -492,6 +492,7 @@ public:
|
||||
void frameFromBuffer( const std::vector<ClpByte>&, int );
|
||||
void frameToBuffer( std::vector<ClpByte>&, int ) const;
|
||||
|
||||
void fillRGBBuffer( std::optional<std::size_t> channel ) const;
|
||||
void fillRGBBuffer() const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -149,6 +149,7 @@ auto CalypPixel::operator==( const CalypPixel& other ) const -> bool
|
||||
|
||||
std::ostream& operator<<( std::ostream& os, const CalypPixel& p )
|
||||
{
|
||||
#ifdef CLP_DEBUG
|
||||
if( p.colorSpace() == CLP_COLOR_RGB || p.colorSpace() == CLP_COLOR_YUV )
|
||||
{
|
||||
os << "(" << p[0] << ", " << p[1] << ", " << p[2] << ")";
|
||||
@@ -157,6 +158,7 @@ std::ostream& operator<<( std::ostream& os, const CalypPixel& p )
|
||||
{
|
||||
os << "(" << p[0] << ", " << p[1] << ", " << p[2] << ", " << p[3] << ")";
|
||||
}
|
||||
#endif
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ bool StreamHandlerRaw::openHandler( std::string strFilename, bool bInput )
|
||||
return false;
|
||||
}
|
||||
calculateFrameNumber();
|
||||
std::string fileExtension = std::filesystem::path{ strFilename }.extension();
|
||||
std::string fileExtension = std::filesystem::path{ strFilename }.extension().string();
|
||||
fileExtension.erase( fileExtension.begin() );
|
||||
m_strFormatName = clpUppercase( fileExtension );
|
||||
m_strCodecName = "Raw Video";
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
# CMakeLists for Calyp lis tests using catch2
|
||||
#
|
||||
|
||||
FETCHCONTENT_MAKEAVAILABLE(Catch2)
|
||||
|
||||
|
||||
SET(Calyp_Lib_Catch2_Tests_SRCS
|
||||
CalypLibTests.cpp
|
||||
CalypStreamTests.cpp
|
||||
|
||||
@@ -24,12 +24,10 @@
|
||||
#include "ShapeDetection.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
//#include <opencv2/video/video.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
|
||||
using cv::Mat;
|
||||
using cv::Ptr;
|
||||
using namespace cv::saliency;
|
||||
|
||||
ShapeDetection::ShapeDetection()
|
||||
: m_rng( 12345 )
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
// OpenCV
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/saliency.hpp>
|
||||
|
||||
class ShapeDetection : public CalypOpenCVModuleIf,
|
||||
public CalypModuleInstace<ShapeDetection>
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#
|
||||
OPTION(BUILD_MODULES_TESTS "Build unit tests of modules" ON)
|
||||
IF(BUILD_MODULES_TESTS)
|
||||
|
||||
FETCHCONTENT_MAKEAVAILABLE(googletest Catch2)
|
||||
|
||||
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
|
||||
|
||||
ADD_DEFINITIONS(-DCALYP_TEST_DATA_DIR=\"${CALYP_TEST_DATA_DIR}\")
|
||||
|
||||
Reference in new issue
Block a user