Compare commits
106
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaa9987314 | ||
|
|
2a1b0abb2f | ||
|
|
cad1f6d7a6 | ||
|
|
d330ecfd0d | ||
|
|
7b5e5d5694 | ||
|
|
f2a636baa1 | ||
|
|
9e3fb9c0a0 | ||
|
|
420aeb89a6 | ||
|
|
a1b44895b8 | ||
|
|
e1e5c4eb3c | ||
|
|
206613d08a | ||
|
|
b7e8087163 | ||
|
|
f4cf81b63c | ||
|
|
47504ff46f | ||
|
|
bdc5317ccc | ||
|
|
1dfddcf7fb | ||
|
|
cea720f8e9 | ||
|
|
48907ef614 | ||
|
|
cdff468904 | ||
|
|
dea3dd93d5 | ||
|
|
3745a687cb | ||
|
|
a1ebf62e21 | ||
|
|
3c85c96769 | ||
|
|
e7e1a8534b | ||
|
|
8807c14b59 | ||
|
|
039887f2e6 | ||
|
|
4c6a4aba65 | ||
|
|
910ab8024e | ||
|
|
6b0f7f6de3 | ||
|
|
6b8b4cbb6a | ||
|
|
0a70267ab7 | ||
|
|
4a4f985ac1 | ||
|
|
58424b8f4e | ||
|
|
3bbbf81ca2 | ||
|
|
7ea1db3202 | ||
|
|
0e26fd8964 | ||
|
|
27ecd818e8 | ||
|
|
d5d21a458f | ||
|
|
1066aaa73c | ||
|
|
ddd5eeb6b9 | ||
|
|
876e1ba9e3 | ||
|
|
47dd2ad3f9 | ||
|
|
e77e0a82fa | ||
|
|
2181fd6add | ||
|
|
eda28d1380 | ||
|
|
1599a80d46 | ||
|
|
42c4e3b388 | ||
|
|
d86ed3508b | ||
|
|
cd18227b8b | ||
|
|
fc913fdc08 | ||
|
|
f90c681788 | ||
|
|
44f7a9b02e | ||
|
|
624612d49b | ||
|
|
70db70a7cf | ||
|
|
33bf02ba0f | ||
|
|
864c3253f1 | ||
|
|
a2d452fd64 | ||
|
|
3732810f9e | ||
|
|
56fc2e45bb | ||
|
|
7ff939c33a | ||
|
|
fa23256955 | ||
|
|
ffe0c38427 | ||
|
|
12bd1a4c2c | ||
|
|
b830b700ca | ||
|
|
3109250471 | ||
|
|
c6b43ac7fa | ||
|
|
beed955e3f | ||
|
|
1f003ec2ac | ||
|
|
c718d01700 | ||
|
|
847f4f06b9 | ||
|
|
344188234b | ||
|
|
5439fd1af5 | ||
|
|
2f434d269b | ||
|
|
a72208f0e6 | ||
|
|
c3c4e229d8 | ||
|
|
fedcb2e03a | ||
|
|
e755608b02 | ||
|
|
2debe78ed8 | ||
|
|
4d1730f928 | ||
|
|
521e56202c | ||
|
|
d0933f43c9 | ||
|
|
1674ec4061 | ||
|
|
ab58ca44f2 | ||
|
|
11bf3f6bfd | ||
|
|
669f3db250 | ||
|
|
3c6e0555bc | ||
|
|
fca79a7992 | ||
|
|
b507b61ce4 | ||
|
|
72bfaf6796 | ||
|
|
0998d98375 | ||
|
|
3afa6eeb6f | ||
|
|
41c65dcac4 | ||
|
|
25d40cadbe | ||
|
|
ca68f5a78f | ||
|
|
f2e1e4bfc7 | ||
|
|
b5edc60794 | ||
|
|
6b084c1a7e | ||
|
|
7b712bb232 | ||
|
|
684cecd632 | ||
|
|
f6cc0ffd29 | ||
|
|
c1cef58de1 | ||
|
|
f9e62c73ac | ||
|
|
6486104db2 | ||
|
|
31f7e46e94 | ||
|
|
aaa5a0fde4 | ||
|
|
f2c8697ace |
No files matched your search
+12
-11
@@ -4,34 +4,35 @@ platform:
|
||||
- x64
|
||||
environment:
|
||||
access_token:
|
||||
secure: WAV5LfCSAtwE1JuZh4HrDlxOOClimLoslYAJlf5KRgc3f7WIkX591PrSSua/Zo2C
|
||||
|
||||
secure: SMxOWNKN0RkPvICWhIet2FJM5g/zx5mguM/XAPjM2OrC3U2/LAqcBZw0veS9peS4
|
||||
|
||||
clone_folder: C:\Projects\calyp
|
||||
|
||||
init:
|
||||
- ps: Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
|
||||
- git config --global credential.helper store
|
||||
- git config --global user.email "jfmcarreira@gmail.com"
|
||||
- git config --global user.name "AppVeyor"
|
||||
- git config --global user.name "AppVeyor"
|
||||
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
|
||||
install:
|
||||
- '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64'
|
||||
#- '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64'
|
||||
- choco install nsis
|
||||
- choco install opencv
|
||||
- 'C:\Tools\opencv\build\setup_vars_opencv4.cmd'
|
||||
- cd C:\Projects
|
||||
- ps: Start-FileDownload 'https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.1.1-win64-dev.zip'
|
||||
- 7z x ffmpeg-4.1.1-win64-dev.zip -y
|
||||
- ps: Start-FileDownload 'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z' ffmpeg.7z
|
||||
- 7z x ffmpeg.7z -y -offmpeg
|
||||
- git clone https://github.com/pixlra/calyp-deployment.git
|
||||
|
||||
|
||||
- CALL calyp-deployment/scripts/extract_ffmpeg.bat
|
||||
- ps: rm C:\Projects\ffmpeg_libraries\bin\*.exe
|
||||
|
||||
|
||||
build_script:
|
||||
- mv C:\Projects\calyp C:\Projects\calyp-deployment\cmake-helper\
|
||||
- mkdir 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-4.1.1-win64-dev/lib/avformat.lib -DAVFORMAT_INCLUDE_DIRS=C:/Projects/ffmpeg-4.1.1-win64-dev/include -DAVCODEC_LIBRARIES=C:/Projects/ffmpeg-4.1.1-win64-dev/lib/avcodec.lib -DAVCODEC_INCLUDE_DIRS=C:/Projects/ffmpeg-4.1.1-win64-dev/include -DAVUTIL_LIBRARIES=C:/Projects/ffmpeg-4.1.1-win64-dev/lib/avutil.lib -DAVUTIL_INCLUDE_DIRS=C:/Projects/ffmpeg-4.1.1-win64-dev/include -DSWSCALE_LIBRARIES=C:/Projects/ffmpeg-4.1.1-win64-dev/lib/swscale.lib -DSWSCALE_INCLUDE_DIRS=C:/Projects/ffmpeg-4.1.1-win64-dev/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 -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 --build . --target ALL_BUILD -- /p:Configuration=Release > log_build
|
||||
- cmake --build . --target INSTALL -- /p:Configuration=Release > log_install
|
||||
- cmake --build . --target PACKAGE -- /p:Configuration=Release > log_pkg
|
||||
@@ -39,7 +40,7 @@ build_script:
|
||||
after_build:
|
||||
- IF "%APPVEYOR_REPO_BRANCH%" == "master" (CALL ..\calyp-deployment\scripts\deploy-to-github.bat)
|
||||
|
||||
|
||||
|
||||
on_failure:
|
||||
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# ----------------------------------
|
||||
# Options affecting listfile parsing
|
||||
# ----------------------------------
|
||||
with section("parse"):
|
||||
|
||||
# Specify structure for custom cmake functions
|
||||
additional_commands = { 'foo': { 'flags': ['BAR', 'BAZ'],
|
||||
'kwargs': {'DEPENDS': '*', 'HEADERS': '*', 'SOURCES': '*'}}}
|
||||
|
||||
## Override configurations per-command where available
|
||||
#override_spec = {}
|
||||
|
||||
# Specify variable tags.
|
||||
vartags = []
|
||||
|
||||
# Specify property tags.
|
||||
proptags = []
|
||||
|
||||
# -----------------------------
|
||||
# Options affecting formatting.
|
||||
# -----------------------------
|
||||
with section("format"):
|
||||
|
||||
# How wide to allow formatted cmake files
|
||||
line_width = 150
|
||||
|
||||
# How many spaces to tab for indent
|
||||
tab_size = 2
|
||||
|
||||
# If an argument group contains more than this many sub-groups (parg or kwarg
|
||||
# groups) then force it to a vertical layout.
|
||||
max_subgroups_hwrap = 2
|
||||
|
||||
# If a positional argument group contains more than this many arguments, then
|
||||
# force it to a vertical layout.
|
||||
max_pargs_hwrap = 6
|
||||
|
||||
dangle_parens = True
|
||||
|
||||
# Format command names consistently as 'lower' or 'upper' case
|
||||
command_case = 'upper'
|
||||
|
||||
# Format keywords consistently as 'lower' or 'upper' case
|
||||
keyword_case = 'upper'
|
||||
|
||||
|
||||
# ----------------------------
|
||||
# Options affecting the linter
|
||||
# ----------------------------
|
||||
with section("lint"):
|
||||
|
||||
# a list of lint codes to disable
|
||||
disabled_codes = ["C0103"]
|
||||
|
||||
# regular expression pattern describing valid function names
|
||||
function_pattern = '[0-9a-z_]+'
|
||||
|
||||
# regular expression pattern describing valid macro names
|
||||
macro_pattern = '[0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for variables with global
|
||||
# (cache) scope
|
||||
global_var_pattern = '[A-Z][0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for variables with global
|
||||
# scope (but internal semantic)
|
||||
internal_var_pattern = '_[A-Z][0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for variables with local
|
||||
# scope
|
||||
local_var_pattern = '[a-z][a-z0-9_]+'
|
||||
|
||||
# regular expression pattern describing valid names for privatedirectory
|
||||
# variables
|
||||
private_var_pattern = '_[0-9a-z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for public directory
|
||||
# variables
|
||||
public_var_pattern = '[A-Z][0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for function/macro
|
||||
# arguments and loop variables.
|
||||
argument_var_pattern = '[a-z][a-z0-9_]+'
|
||||
|
||||
# regular expression pattern describing valid names for keywords used in
|
||||
# functions or macros
|
||||
keyword_pattern = '[A-Z][0-9A-Z_]+'
|
||||
|
||||
# In the heuristic for C0201, how many conditionals to match within a loop in
|
||||
# before considering the loop a parser.
|
||||
max_conditionals_custom_parser = 2
|
||||
|
||||
# Require at least this many newlines between statements
|
||||
min_statement_spacing = 1
|
||||
|
||||
# Require no more than this many newlines between statements
|
||||
max_statement_spacing = 2
|
||||
max_returns = 6
|
||||
max_branches = 12
|
||||
max_arguments = 5
|
||||
max_localvars = 15
|
||||
max_statements = 50
|
||||
|
||||
# -------------------------------
|
||||
# Options affecting file encoding
|
||||
# -------------------------------
|
||||
with section("encode"):
|
||||
|
||||
# If true, emit the unicode byte-order mark (BOM) at the start of the file
|
||||
emit_byteorder_mark = False
|
||||
|
||||
# Specify the encoding of the input file. Defaults to utf-8
|
||||
input_encoding = 'utf-8'
|
||||
|
||||
# Specify the encoding of the output file. Defaults to utf-8. Note that cmake
|
||||
# only claims to support utf-8 so be careful when using anything else
|
||||
output_encoding = 'utf-8'
|
||||
@@ -0,0 +1,31 @@
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- devel
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
run: sudo apt-get install cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev
|
||||
|
||||
- name: Build CMake
|
||||
uses: ashutoshvarma/action-cmake-build@v1
|
||||
with:
|
||||
build-dir: ${{ runner.workspace }}/build
|
||||
# will set the CC & CXX for cmake
|
||||
cc: gcc
|
||||
cxx: g++
|
||||
build-type: Release
|
||||
# Extra options pass to cmake while configuring project
|
||||
configure-options: -DBUILD_TESTS=ON -DUSE_WERROR=ON
|
||||
run-test: true
|
||||
#ctest-options: -R mytest
|
||||
# install the build using cmake --install
|
||||
install-build: true
|
||||
# run build using '-j [parallel]' to use multiple threads to build
|
||||
parallel: 14
|
||||
+12
-1
@@ -4,6 +4,8 @@
|
||||
### C++ ###
|
||||
# Prerequisites
|
||||
*.d
|
||||
# Clang
|
||||
.cache/
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
@@ -74,6 +76,7 @@
|
||||
# CMake
|
||||
bin/
|
||||
build/
|
||||
build-*
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
@@ -132,4 +135,12 @@ fabric.properties
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# End of https://www.gitignore.io/api/c++,clion,linux
|
||||
### vscode ###
|
||||
.vscode/*
|
||||
*.code-workspace
|
||||
|
||||
# Documentation
|
||||
doc/
|
||||
|
||||
# CLang
|
||||
compile_commands.json
|
||||
Generated
-2
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
Generated
-4
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||
</project>
|
||||
Generated
-7
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/calyp.iml" filepath="$PROJECT_DIR$/.idea/calyp.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-6
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,29 @@
|
||||
fail_fast: false
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
||||
rev: v0.6.10
|
||||
hooks:
|
||||
- id: cmake-format
|
||||
- id: cmake-lint
|
||||
|
||||
- repo: https://github.com/pocc/pre-commit-hooks
|
||||
rev: v1.1.1
|
||||
hooks:
|
||||
- id: clang-format
|
||||
args: [--style=file, -i]
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: cmake-configure
|
||||
name: Cmake Configure
|
||||
entry: cmake -B build
|
||||
pass_filenames: false
|
||||
language: system
|
||||
- id: cmake-build
|
||||
name: Cmake Build
|
||||
entry: cmake --build build
|
||||
pass_filenames: false
|
||||
language: system
|
||||
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@ language: cpp
|
||||
dist: xenial
|
||||
before_install:
|
||||
- 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
|
||||
- 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
|
||||
script:
|
||||
- mkdir -p build && cd build && cmake .. && make && cd ..
|
||||
+206
-154
@@ -1,240 +1,292 @@
|
||||
###
|
||||
### CMakeLists for calyp
|
||||
###
|
||||
#
|
||||
# CMakeLists for calyp
|
||||
#
|
||||
|
||||
cmake_minimum_required( VERSION 3.2.0 )
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Project Definition
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(PROJECT_NAME
|
||||
"calyp"
|
||||
CACHE INTERNAL "" FORCE
|
||||
)
|
||||
SET(PROJECT_LIBRARY
|
||||
"Calyp"
|
||||
CACHE INTERNAL "" FORCE
|
||||
)
|
||||
|
||||
SET(CALYP_VERSION_MAJOR "1")
|
||||
SET(CALYP_VERSION_MINOR "2")
|
||||
SET(CALYP_VERSION_PATCH "1")
|
||||
SET(CALYP_VERSION
|
||||
"${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}"
|
||||
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 )
|
||||
# ####################################################################################################################################################
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
INCLUDE(cmake/ModulesFct.cmake)
|
||||
INCLUDE(FeatureSummary)
|
||||
INCLUDE(GNUInstallDirs)
|
||||
|
||||
######################################################################################
|
||||
# Project Definition
|
||||
######################################################################################
|
||||
|
||||
SET( PROJECT_NAME "calyp" CACHE INTERNAL "" FORCE )
|
||||
SET( PROJECT_LIBRARY "Calyp" CACHE INTERNAL "" FORCE )
|
||||
|
||||
|
||||
PROJECT( ${PROJECT_NAME} )
|
||||
SET( CALYP_VERSION_MAJOR "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 )
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Variables
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
OPTION( BUILD_APP "Build GUI Application" ON )
|
||||
OPTION( BUILD_TOOLS "Build Command Line Application" ON )
|
||||
OPTION( BUILD_EXAMPLES "Build Examples" OFF )
|
||||
OPTION( BUILD_DOC "Build Documentation" OFF )
|
||||
OPTION( BUILD_TESTS "Build Google Tests" OFF )
|
||||
OPTION(BUILD_APP "Build GUI Application" ON)
|
||||
OPTION(BUILD_TOOLS "Build Command Line Application" ON)
|
||||
OPTION(BUILD_EXAMPLES "Build Examples" OFF)
|
||||
OPTION(BUILD_DOC "Build Documentation" 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)
|
||||
|
||||
OPTION( USE_DYNLOAD "Use dynamic load of modules" ON )
|
||||
OPTION( USE_SSE "Build with SSE support" OFF )
|
||||
OPTION( USE_WERROR "Warnings as errors" OFF )
|
||||
OPTION( USE_STATIC "Use static libs" OFF )
|
||||
OPTION(USE_DYNLOAD "Use dynamic load of modules" ON)
|
||||
OPTION(USE_SSE "Build with SSE support" OFF)
|
||||
OPTION(USE_WERROR "Warnings as errors" OFF)
|
||||
OPTION(USE_STATIC "Use static libs" OFF)
|
||||
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Release configuration
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
# To be switched on when releasing.
|
||||
OPTION(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON)
|
||||
|
||||
# Get current version.
|
||||
set(CALYP_VERSION_STRING "${CALYP_VERSION}")
|
||||
if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
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)
|
||||
if(GIT_FOUND)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
IF(GIT_FOUND)
|
||||
EXEC_PROGRAM(
|
||||
${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ARGS "describe --tags"
|
||||
OUTPUT_VARIABLE CALYP_GIT_REVISION
|
||||
RETURN_VALUE TAG_RESULT
|
||||
)
|
||||
# git describe --tags failed; maybe the repository was checked with depth=1.
|
||||
if(NOT ${TAG_RESULT} EQUAL 0)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
IF(NOT ${TAG_RESULT} EQUAL 0)
|
||||
EXEC_PROGRAM(
|
||||
${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ARGS "describe --always"
|
||||
OUTPUT_VARIABLE CALYP_GIT_REVISION
|
||||
)
|
||||
endif()
|
||||
message(STATUS "Calyp Git revision: ${CALYP_GIT_REVISION}")
|
||||
set(CALYP_VERSION_STRING "${CALYP_VERSION} (rev. ${CALYP_GIT_REVISION})")
|
||||
else()
|
||||
message(STATUS "Calyp Git revision could not be determined")
|
||||
endif()
|
||||
endif()
|
||||
ENDIF()
|
||||
MESSAGE(STATUS "Calyp Git revision: ${CALYP_GIT_REVISION}")
|
||||
SET(CALYP_VERSION_STRING "${CALYP_VERSION} (rev. ${CALYP_GIT_REVISION})")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Calyp Git revision could not be determined")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(UPDATE_CHANNEL "stable" CACHE STRING "Update channel" )
|
||||
SET(UPDATE_CHANNEL
|
||||
"stable"
|
||||
CACHE STRING "Update channel"
|
||||
)
|
||||
# CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/CalypUpdate.xml.in ${CMAKE_CURRENT_BINARY_DIR}/CalypUpdate-${UPDATE_CHANNEL}.xml )
|
||||
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Dependencies
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
IF( BUILD_DOC )
|
||||
IF(BUILD_DOC)
|
||||
FIND_PACKAGE(Doxygen)
|
||||
SET( BUILD_DOC ${Doxygen_FOUND} )
|
||||
SET(BUILD_DOC ${Doxygen_FOUND})
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(Doxygen PROPERTIES URL "http://www.doxygen.org/" DESCRIPTION "Doxygen" TYPE OPTIONAL)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
Doxygen PROPERTIES
|
||||
URL "http://www.doxygen.org/"
|
||||
DESCRIPTION "Doxygen"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
INCLUDE(FetchContent)
|
||||
|
||||
IF( BUILD_TESTS )
|
||||
FIND_PACKAGE(GTest)
|
||||
SET( BUILD_DOC ${GTEST_FOUND} )
|
||||
IF( GTEST_FOUND )
|
||||
ENABLE_TESTING()
|
||||
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
IF(BUILD_TESTS)
|
||||
FETCHCONTENT_DECLARE(googletest URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip)
|
||||
# For Windows: Prevent overriding the parent project's compiler/linker settings
|
||||
SET(gtest_force_shared_crt
|
||||
ON
|
||||
CACHE BOOL "" FORCE
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(googletest)
|
||||
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
googletest PROPERTIES
|
||||
URL "https://github.com/google/googletest"
|
||||
DESCRIPTION "Google unit tests"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
SET(CALYP_TEST_DATA_DIR
|
||||
"CALYP_TEST_DATA_DIR"
|
||||
CACHE PATH "Location of video information for testing"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
OPTION( USE_OPENCV "Add OpenCV support" ON )
|
||||
IF( USE_OPENCV )
|
||||
IF(BUILD_TESTS_CATCH2)
|
||||
|
||||
FIND_PACKAGE( OpenCV COMPONENTS core highgui imgproc video )
|
||||
IF( ${OpenCV_FOUND} )
|
||||
SET(USE_OPENCV TRUE )
|
||||
LIST(APPEND OPENCV_MODULES core highgui imgproc video )
|
||||
FIND_PACKAGE( OpenCV COMPONENTS videoio photo )
|
||||
IF( ${OPENCV_VIDEOIO_FOUND} )
|
||||
LIST(APPEND OPENCV_MODULES videoio )
|
||||
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)
|
||||
ENABLE_TESTING()
|
||||
ENDIF()
|
||||
|
||||
OPTION(USE_OPENCV "Add OpenCV support" ON)
|
||||
IF(USE_OPENCV)
|
||||
|
||||
FIND_PACKAGE(OpenCV COMPONENTS core highgui imgproc video)
|
||||
IF(${OpenCV_FOUND})
|
||||
SET(USE_OPENCV TRUE)
|
||||
LIST(APPEND OPENCV_MODULES core highgui imgproc video)
|
||||
FIND_PACKAGE(OpenCV COMPONENTS videoio photo)
|
||||
IF(${OPENCV_VIDEOIO_FOUND})
|
||||
LIST(APPEND OPENCV_MODULES videoio)
|
||||
ENDIF()
|
||||
IF( ${OPENCV_PHOTO_FOUND} )
|
||||
LIST(APPEND OPENCV_MODULES photo )
|
||||
IF(${OPENCV_PHOTO_FOUND})
|
||||
LIST(APPEND OPENCV_MODULES photo)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(USE_OPENCV FALSE )
|
||||
SET(USE_OPENCV FALSE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(OpenCV PROPERTIES URL "http://opencv.willowgarage.com" DESCRIPTION "OpenCV library support in CalypFrame" 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 COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE )
|
||||
IF( "${AVCODEC_VERSION}" VERSION_LESS "56.0.0" )
|
||||
SET(FFMPEG_FOUND FALSE )
|
||||
SET(FFmpeg_FOUND FALSE )
|
||||
ENDIF()
|
||||
OPTION(USE_FFMPEG "Add FFMPEG support" ON)
|
||||
IF(USE_FFMPEG)
|
||||
FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
|
||||
SET(USE_FFMPEG ${FFMPEG_FOUND})
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(FFmpeg PROPERTIES URL "http://ffmpeg.org/" DESCRIPTION "Libav library support in CalypStream" TYPE OPTIONAL)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
FFmpeg PROPERTIES
|
||||
URL "http://ffmpeg.org/"
|
||||
DESCRIPTION "Libav library support in CalypStream"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( USE_STATIC ON )
|
||||
INCLUDE( cmake/Win32.cmake )
|
||||
IF(WIN32)
|
||||
SET(USE_STATIC ON)
|
||||
INCLUDE(cmake/Win32.cmake)
|
||||
ENDIF()
|
||||
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# CMake Defin1itions
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
INCLUDE(FeatureSummary)
|
||||
|
||||
# must go before the project command
|
||||
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
||||
SET(CMAKE_CONFIGURATION_TYPES
|
||||
"Debug;Release"
|
||||
CACHE STRING "Configs" FORCE
|
||||
)
|
||||
IF(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
|
||||
SET_PROPERTY( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
|
||||
ENDIF()
|
||||
SET( CMAKE_CXX_FLAGS "" )
|
||||
SET(CMAKE_CXX_FLAGS "")
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Compiler options
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 14)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ADD_DEFINITIONS(-std=gnu++0x)
|
||||
endif()
|
||||
SET(CMAKE_CXX_STANDARD 20)
|
||||
ADD_DEFINITIONS(-std=gnu++20)
|
||||
|
||||
IF (NOT CMAKE_BUILD_TYPE )
|
||||
MESSAGE(STATUS "No build type selected, default to Release")
|
||||
SET(CMAKE_BUILD_TYPE "Release")
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
MESSAGE(STATUS "No build type selected, default to Release")
|
||||
SET(CMAKE_BUILD_TYPE "Release")
|
||||
ENDIF()
|
||||
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -ftree-vectorizer-verbose")
|
||||
|
||||
ADD_DEFINITIONS(-DQT_NO_CAST_TO_ASCII
|
||||
#-DQT_NO_CAST_FROM_ASCII
|
||||
-DQT_NO_URL_CAST_FROM_STRING
|
||||
-DQT_NO_CAST_FROM_BYTEARRAY
|
||||
#-DQT_NO_SIGNALS_SLOTS_KEYWORDS
|
||||
#-DQT_USE_QSTRINGBUILDER
|
||||
)
|
||||
ADD_DEFINITIONS(
|
||||
-DQT_NO_CAST_TO_ASCII
|
||||
# -DQT_NO_CAST_FROM_ASCII
|
||||
-DQT_NO_URL_CAST_FROM_STRING
|
||||
-DQT_NO_CAST_FROM_BYTEARRAY
|
||||
# -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_USE_QSTRINGBUILDER
|
||||
)
|
||||
|
||||
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
||||
# endif()
|
||||
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op" )
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations" )
|
||||
endif()
|
||||
|
||||
IF( USE_WERROR )
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
|
||||
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op")
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
||||
ENDIF()
|
||||
|
||||
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0" )
|
||||
SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
|
||||
IF(USE_WERROR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Configure targets
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
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_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 )
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
ADD_SUBDIRECTORY(modules)
|
||||
|
||||
IF( ${BUILD_TOOLS} )
|
||||
ADD_SUBDIRECTORY( tools )
|
||||
IF(${BUILD_TOOLS})
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
ENDIF()
|
||||
|
||||
IF( ${BUILD_APP} )
|
||||
ADD_SUBDIRECTORY( app )
|
||||
IF(${BUILD_APP})
|
||||
ADD_SUBDIRECTORY(app)
|
||||
ENDIF()
|
||||
|
||||
IF( ${BUILD_EXAMPLES} )
|
||||
ADD_SUBDIRECTORY( examples )
|
||||
IF(${BUILD_EXAMPLES})
|
||||
ADD_SUBDIRECTORY(examples)
|
||||
ENDIF()
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h )
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Final information dump
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
MESSAGE("")
|
||||
MESSAGE( STATUS "${PROJECT_NAME} INFORMATION" )
|
||||
MESSAGE( STATUS "Version: " "${CALYP_VERSION_STRING}" )
|
||||
MESSAGE( STATUS "Configuration:" )
|
||||
MESSAGE( STATUS " Static libs: " "${USE_STATIC}" )
|
||||
MESSAGE( STATUS " Build type: " "${CMAKE_BUILD_TYPE}" )
|
||||
MESSAGE( STATUS " Build flags: " "${CMAKE_CXX_FLAGS}" )
|
||||
MESSAGE(STATUS "${PROJECT_NAME} INFORMATION")
|
||||
MESSAGE(STATUS "Version: " "${CALYP_VERSION_STRING}")
|
||||
MESSAGE(STATUS "Configuration:")
|
||||
MESSAGE(STATUS " Static libs: " "${USE_STATIC}")
|
||||
MESSAGE(STATUS " Build type: " "${CMAKE_BUILD_TYPE}")
|
||||
MESSAGE(STATUS " Build flags: " "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
FEATURE_SUMMARY(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
+12
-36
@@ -27,19 +27,21 @@ Modules
|
||||
|
||||
Supported Quality Metrics
|
||||
----------------------------------------------------------------
|
||||
- PSNR
|
||||
- SSIM
|
||||
- MSE
|
||||
- Peak Signal-to-Noise Ratio (PSNR)
|
||||
- Structural SIMilarity (SSIM)
|
||||
- Mean Square Error (MSE)
|
||||
- Weighted Spherical PSNR (WS-PSNR)
|
||||
|
||||
|
||||
Frame Processing Modules
|
||||
----------------------------------------------------------------
|
||||
- Component filtering
|
||||
- Frame difference, crop, shift, binarization
|
||||
- Frame difference, crop, shift, binarization and rotation
|
||||
- Sub-sampling operations
|
||||
- Measuring modules
|
||||
- Modules based on opencv:
|
||||
* Disparity estimation
|
||||
* Motion estimation
|
||||
- Disparity estimation
|
||||
- Motion estimation
|
||||
|
||||
Supported Formats
|
||||
----------------------------------------------------------------
|
||||
@@ -62,35 +64,9 @@ Supported Formats
|
||||
Developers
|
||||
----------------------------------------------------------------
|
||||
|
||||
- Joao Carreira (jfmcarreira@gmail.com)
|
||||
- Luis Lucas (luisfrlucas@gmail.com)
|
||||
|
||||
Builds
|
||||
----------------------------------------------------------------
|
||||
Download update build for windows and linux from our <a href="https://sourceforge.net/projects/playuver/">SourceForge project page</a>
|
||||
|
||||
|
||||
Build/Install using cmake
|
||||
----------------------------------------------------------------
|
||||
|
||||
1. The following are required for compilation:
|
||||
- an ordinary C++ development environment (g++, make, C++ libraries and headers, ...)
|
||||
- cmake
|
||||
- a Qt development environment (libraries, headers, qmake, ...): only QtCore, QtGui and QtWidgets are required, at least in version 4
|
||||
|
||||
2. Optional Dependencies:
|
||||
- QtDBus
|
||||
- OpenCv
|
||||
- FFmpeg
|
||||
|
||||
3. Run the following commands: (this will create an executable named calyp)
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DUSE_QT4=OFF -DUSE_FFMPEG=ON -DUSE_OPENCV=ON .. (for FFmpeg and OpenCV support)
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
- [**Joao Carreira**](https://github.com/jfmcarreira) (Founder, Main Developer)
|
||||
- [**Luis Lucas** ](https://github.com/lfrlucas) (Founder, Developer)
|
||||
- [**Joao Santos** ](https://github.com/jpataias) (Contributor)
|
||||
- [**JNSFilipe** ](https://github.com/JNSFilipe) (Contributor)
|
||||
|
||||
*/
|
||||
+90
-74
@@ -1,148 +1,164 @@
|
||||
###
|
||||
### CMakeLists for calyp app component
|
||||
###
|
||||
#
|
||||
# CMakeLists for calyp app component
|
||||
#
|
||||
|
||||
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 )
|
||||
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 )
|
||||
OPTION(USE_QTDBUS "Build with QtDBus" ON)
|
||||
OPTION(USE_FERVOR "Add Fervor support" OFF)
|
||||
|
||||
ADD_SUBDIRECTORY( external )
|
||||
ADD_SUBDIRECTORY(external)
|
||||
|
||||
FIND_PACKAGE( Qt5 REQUIRED COMPONENTS Core Gui Widgets Concurrent )
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent )
|
||||
LIST(APPEND QT_MODULES Core Gui Widgets Concurrent )
|
||||
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Gui Widgets Concurrent)
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent)
|
||||
LIST(APPEND QT_MODULES Core Gui Widgets Concurrent)
|
||||
|
||||
IF( USE_QTDBUS )
|
||||
FIND_PACKAGE( Qt5DBus )
|
||||
SET_PACKAGE_PROPERTIES(Qt5DBus PROPERTIES DESCRIPTION "Support for Qt5 DBus messages between instances" TYPE OPTIONAL )
|
||||
IF( ${Qt5DBus_FOUND} )
|
||||
SET( USE_QTDBUS ${Qt5DBus_FOUND} ) # TODO: fix this stupid variable
|
||||
SET( USE_QTDBUS ${Qt5DBus_FOUND} PARENT_SCOPE)
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::DBus )
|
||||
LIST(APPEND QT_MODULES DBus )
|
||||
IF(USE_QTDBUS)
|
||||
FIND_PACKAGE(Qt5DBus)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
Qt5DBus PROPERTIES
|
||||
DESCRIPTION "Support for Qt5 DBus messages between instances"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
IF(${Qt5DBus_FOUND})
|
||||
SET(USE_QTDBUS ${Qt5DBus_FOUND}) # TODO: fix this stupid variable
|
||||
SET(USE_QTDBUS
|
||||
${Qt5DBus_FOUND}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::DBus)
|
||||
LIST(APPEND QT_MODULES DBus)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
set(Calyp_App_SRCS
|
||||
# Main
|
||||
SET(Calyp_App_SRCS
|
||||
# Main
|
||||
main.cpp
|
||||
MainWindow.cpp
|
||||
# Module SubWindow
|
||||
# Module SubWindow
|
||||
SubWindowHandle.cpp
|
||||
MdiSubWindow.cpp
|
||||
SubWindowAbstract.cpp
|
||||
# Module Video
|
||||
# Module Video
|
||||
VideoHandle.cpp
|
||||
VideoSubWindow.cpp
|
||||
ViewArea.cpp
|
||||
GridManager.cpp
|
||||
# Module Quality
|
||||
# Module Quality
|
||||
QualityHandle.cpp
|
||||
PlotSubWindow.cpp
|
||||
external/qcustomplot/qcustomplot.cpp
|
||||
# Module Plugins
|
||||
# Module Plugins
|
||||
ModulesHandle.cpp
|
||||
CalypAppModuleIf.cpp
|
||||
# Dialogs
|
||||
# Dialogs
|
||||
dialog/AboutDialog.cpp
|
||||
dialog/ConfigureFormatDialog.cpp
|
||||
dialog/SubWindowSelectorDialog.cpp
|
||||
dialog/ProgressBar.cpp
|
||||
dialog/SeekStreamDialog.cpp
|
||||
dialog/ModulesHandleOptDialog.cpp
|
||||
# Widgets
|
||||
# Widgets
|
||||
widgets/HistogramWidget.cpp
|
||||
widgets/FrameNumberWidget.cpp
|
||||
# Docks
|
||||
# Docks
|
||||
docks/FramePropertiesDock.cpp
|
||||
docks/ModuleHandleDock.cpp
|
||||
docks/QualityMeasurementSidebar.cpp
|
||||
)
|
||||
|
||||
IF( USE_QTDBUS )
|
||||
LIST( APPEND Calyp_App_SRCS DBusAppAdaptor.cpp )
|
||||
IF(USE_QTDBUS)
|
||||
LIST(APPEND Calyp_App_SRCS DBusAppAdaptor.cpp)
|
||||
ENDIF()
|
||||
|
||||
SET(Calyp_App_UI "")
|
||||
|
||||
set(Calyp_App_UI "" )
|
||||
SET(Calyp_App_RCC resources/${PROJECT_NAME}.qrc)
|
||||
|
||||
set(Calyp_App_RCC
|
||||
resources/${PROJECT_NAME}.qrc
|
||||
)
|
||||
IF(USE_FERVOR)
|
||||
|
||||
SET(FERVOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/fervor)
|
||||
|
||||
IF( USE_FERVOR )
|
||||
IF(EXISTS ${FERVOR_DIR})
|
||||
|
||||
SET( FERVOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/fervor )
|
||||
SET(FERVOR_APP_NAME ${PROJECT_NAME})
|
||||
SET(FERVOR_APP_VERSION ${CALYP_VERSION_STRING})
|
||||
|
||||
IF(EXISTS ${FERVOR_DIR} )
|
||||
ADD_SUBDIRECTORY(${FERVOR_DIR})
|
||||
|
||||
SET( FERVOR_APP_NAME ${PROJECT_NAME} )
|
||||
SET( FERVOR_APP_VERSION ${CALYP_VERSION_STRING} )
|
||||
INCLUDE_DIRECTORIES(${FERVOR_DIR})
|
||||
|
||||
ADD_SUBDIRECTORY( ${FERVOR_DIR} )
|
||||
LIST(APPEND APP_LINKER_LIBS Fervor)
|
||||
|
||||
INCLUDE_DIRECTORIES( ${FERVOR_DIR} )
|
||||
FIND_PACKAGE(Qt5 REQUIRED Network WebKit WebKitWidgets)
|
||||
|
||||
LIST(APPEND APP_LINKER_LIBS Fervor )
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Network Qt5::WebKit Qt5::WebKitWidgets)
|
||||
LIST(APPEND QT_MODULES Network WebKit WebKitWidgets)
|
||||
|
||||
FIND_PACKAGE( Qt5 REQUIRED Network WebKit WebKitWidgets )
|
||||
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Network Qt5::WebKit Qt5::WebKitWidgets )
|
||||
LIST(APPEND QT_MODULES Network WebKit WebKitWidgets )
|
||||
|
||||
# LIST(APPEND APP_LINKER_LIBS ${FERVOR_DEPENDENCIES} )
|
||||
INCLUDE_DIRECTORIES( ${FERVOR_INCLUDE_DIRS} )
|
||||
# LIST(APPEND APP_LINKER_LIBS ${FERVOR_DEPENDENCIES} )
|
||||
INCLUDE_DIRECTORIES(${FERVOR_INCLUDE_DIRS})
|
||||
|
||||
SET(QT_USE_QTNETWORK true)
|
||||
SET(QT_USE_QTWEBKIT true)
|
||||
|
||||
ELSE()
|
||||
MESSAGE( "Fervor lib source code is not find in ${FERVOR_DIR}... Disabling it!" )
|
||||
SET( USE_FERVOR False )
|
||||
MESSAGE("Fervor lib source code is not find in ${FERVOR_DIR}... Disabling it!")
|
||||
SET(USE_FERVOR False)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET_PACKAGE_PROPERTIES(Fervor PROPERTIES URL "https://github.com/pypt/fervor" DESCRIPTION "Fervor lib includes check for updates feature" TYPE OPTIONAL )
|
||||
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( Calyp_App_UI_Wrap ${Calyp_App_UI} )
|
||||
QT5_ADD_RESOURCES( Calyp_App_RCC ${Calyp_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 )
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
|
||||
# Windows application icon
|
||||
IF( WIN32 )
|
||||
set(WINDOWS_RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/resources.obj)
|
||||
IF( MSVC )
|
||||
add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
|
||||
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} ${PROJECT_NAME}.rc
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources
|
||||
COMMENT "Add icon on windows platform"
|
||||
)
|
||||
ELSE()
|
||||
add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${WINDOWS_RES_FILE}
|
||||
COMMAND windres.exe ${PROJECT_NAME}.rc ${WINDOWS_RES_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources
|
||||
COMMENT "Add icon on windows platform"
|
||||
)
|
||||
ENDIF()
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} ${Calyp_App_SRCS} ${HEADERS_MOC_FILES} ${Calyp_App_UI_Wrap} ${Calyp_App_RCC} ${WINDOWS_RES_FILE})
|
||||
ELSEIF(CMAKE_HOST_APPLE)
|
||||
SET(CMAKE_MACOSX_BUNDLE ON)
|
||||
SET(MACOSX_BUNDLE_EXECUTABLE_NAME ${PROJECT_NAME})
|
||||
SET(MACOSX_BUNDLE_ICON_FILE Contents/Resources/calyp.icns)
|
||||
SET(MACOSX_BUNDLE_BUNDLE_NAME Calyp)
|
||||
SET(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/resources/calyp.icns)
|
||||
SET_SOURCE_FILES_PROPERTIES(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} MACOSX_BUNDLE ${Calyp_App_SRCS} ${HEADERS_MOC_FILES} ${Calyp_App_UI_Wrap} ${Calyp_App_RCC} ${APP_ICON_MACOSX})
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} ${Calyp_App_SRCS} ${HEADERS_MOC_FILES} ${Calyp_App_UI_Wrap} ${Calyp_App_RCC})
|
||||
ENDIF()
|
||||
|
||||
|
||||
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 )
|
||||
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/calyp.desktop DESTINATION share/applications )
|
||||
INSTALL(FILES resources/calyp.png DESTINATION share/pixmaps )
|
||||
INSTALL(FILES resources/calyp.xml DESTINATION share/mime/packages )
|
||||
|
||||
|
||||
|
||||
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
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)
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,12 +24,12 @@
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
CalypAppModuleIf::CalypAppModuleIf( QObject* parent, QAction* action, CalypModuleIf* module )
|
||||
: m_bIsRunning( false )
|
||||
, m_pcModuleAction( action )
|
||||
@@ -48,7 +48,7 @@ CalypAppModuleIf::CalypAppModuleIf( QObject* parent, QAction* action, CalypModul
|
||||
}
|
||||
}
|
||||
|
||||
void CalypAppModuleIf::update()
|
||||
void CalypAppModuleIf::update( bool isPlaying )
|
||||
{
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
@@ -56,7 +56,7 @@ void CalypAppModuleIf::update()
|
||||
}
|
||||
else
|
||||
{
|
||||
apply();
|
||||
apply( isPlaying );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,14 +167,12 @@ void CalypAppModuleIf::show()
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
m_pcDisplaySubWindow->setCurrFrame( m_pcProcessedFrame );
|
||||
m_pcDisplaySubWindow->setFillWindow( false );
|
||||
m_pcDisplaySubWindow->clearWindowBusy();
|
||||
m_pcDisplaySubWindow->setFillWindow( isRunning() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcSubWindow[0]->setCurrFrame( m_pcProcessedFrame );
|
||||
m_pcSubWindow[0]->setFillWindow( false );
|
||||
m_pcSubWindow[0]->clearWindowBusy();
|
||||
m_pcSubWindow[0]->setFillWindow( isRunning() );
|
||||
}
|
||||
break;
|
||||
case CLP_FRAME_MEASUREMENT_MODULE:
|
||||
|
||||
+14
-9
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,18 +25,23 @@
|
||||
#ifndef __CALYPAPPMODULESIF_H__
|
||||
#define __CALYPAPPMODULESIF_H__
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "ModuleHandleDock.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypModuleIf.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QVector>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
#include <QThread>
|
||||
#endif
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "ModuleHandleDock.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypModuleIf.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class QAction;
|
||||
class QDockWidget;
|
||||
|
||||
@@ -101,7 +106,7 @@ public:
|
||||
CalypModuleIf* getModule() { return m_pcModule; }
|
||||
unsigned int getModuleRequirements() { return m_pcModule->m_uiModuleRequirements; }
|
||||
ClpString moduleInfo() { return m_pcModule->moduleInfo(); }
|
||||
void update();
|
||||
void update( bool isPlaying );
|
||||
bool apply( bool isPlaying = false, bool disableThreads = false );
|
||||
bool isRunning();
|
||||
void show();
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
+3
-5
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -71,8 +71,7 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter
|
||||
switch( style )
|
||||
{
|
||||
case intersectionDot:
|
||||
case intersectionCross:
|
||||
{
|
||||
case intersectionCross: {
|
||||
painter->setPen( mainPen );
|
||||
// Draw crosses or dots on intersections
|
||||
for( int x = offsetx; x <= area.right(); x += hSpacing )
|
||||
@@ -99,8 +98,7 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Dashed:
|
||||
{
|
||||
case Dashed: {
|
||||
// Change pen to the dashed line
|
||||
mainPen.setStyle( Qt::DashLine );
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QColor>
|
||||
#include <QPen>
|
||||
#include <QRect>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Santos (joaompssantos@gmail.com)
|
||||
*
|
||||
@@ -25,6 +25,15 @@
|
||||
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QCloseEvent>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QDropEvent>
|
||||
#include <QSignalMapper>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "AboutDialog.h"
|
||||
#include "ModulesHandle.h"
|
||||
#include "QualityHandle.h"
|
||||
@@ -34,15 +43,6 @@
|
||||
#include "VideoHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "lib/CalypOptions.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QCloseEvent>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QDropEvent>
|
||||
#include <QSignalMapper>
|
||||
#include <QtDebug>
|
||||
#ifdef USE_FERVOR
|
||||
#include "fvupdater.h"
|
||||
#endif
|
||||
@@ -101,7 +101,7 @@ bool MainWindow::parseArgs( int argc, char* argv[] )
|
||||
( "size,s", strResolution, "size (WxH)" ) /**/
|
||||
( "pel_fmt", strPelFmt, "pixel format" );
|
||||
|
||||
if( !pcCmdParser.parse( argc, argv ) )
|
||||
if( pcCmdParser.parse( argc, argv ) < 0 )
|
||||
{
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,10 +24,10 @@
|
||||
|
||||
#include "MdiSubWindow.h"
|
||||
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
MdiSubWindow::MdiSubWindow( QWidget* parent )
|
||||
: QMdiSubWindow( parent )
|
||||
{
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __MDISUBWINDOW_H_
|
||||
|
||||
#include <QMdiSubWindow>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
+4
-5
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,15 +24,14 @@
|
||||
#ifndef __MODULESHANDLE_H__
|
||||
#define __MODULESHANDLE_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
class VideoHandle;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
#include "PlotSubWindow.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QSize>
|
||||
|
||||
#include "qcustomplot.h"
|
||||
//#include "external/qcustomplot/qcustomplot.h"
|
||||
|
||||
@@ -174,7 +178,7 @@ QSize PlotSubWindow::sizeHint() const
|
||||
}
|
||||
else
|
||||
{
|
||||
maxSize = QApplication::desktop()->availableGeometry().size();
|
||||
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
}
|
||||
return sizeHint( maxSize );
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,12 +25,12 @@
|
||||
#ifndef __PLOTWINDOWHANDLE_H__
|
||||
#define __PLOTWINDOWHANDLE_H__
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class QCustomPlot;
|
||||
|
||||
class PlotSubWindow : public SubWindowAbstract
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,16 +24,16 @@
|
||||
|
||||
#include "QualityHandle.h"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include "PlotSubWindow.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "lib/LibMemory.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
|
||||
QualityHandle::QualityHandle( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "QFuture"
|
||||
#include "QualityMeasurementSidebar.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,14 +24,14 @@
|
||||
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
#include "MdiSubWindow.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QFocusEvent>
|
||||
#include <QHBoxLayout>
|
||||
#include <QIcon>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "MdiSubWindow.h"
|
||||
|
||||
SubWindowAbstract::SubWindowAbstract( QWidget* parent, unsigned int category )
|
||||
: QWidget( parent ), m_cSubWindow( NULL )
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
+14
-10
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Santos (joaompssantos@gmail.com)
|
||||
*
|
||||
@@ -25,22 +25,24 @@
|
||||
|
||||
#include "SubWindowHandle.h"
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "MdiSubWindow.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QGuiApplication>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMdiArea>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QScreen>
|
||||
#include <QSettings>
|
||||
#include <QSignalMapper>
|
||||
#include <QStyle>
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "MdiSubWindow.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
class MdiArea : public QMdiArea
|
||||
{
|
||||
public:
|
||||
@@ -154,7 +156,7 @@ void SubWindowHandle::setWindowMode( int iWindowMode )
|
||||
parentWidget()->update();
|
||||
m_pcApp->showNormal();
|
||||
qApp->processEvents();
|
||||
QSize screenSize = QApplication::desktop()->availableGeometry().size();
|
||||
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
m_pcApp->move( 0, 0 );
|
||||
m_pcApp->resize( screenSize.width(), 5 );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() );
|
||||
@@ -230,12 +232,14 @@ void SubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
|
||||
SLOT( removeMdiSubWindow( MdiSubWindow* ) ) );
|
||||
}
|
||||
|
||||
void SubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags )
|
||||
void SubWindowHandle::addSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
if( window )
|
||||
{
|
||||
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp, SLOT( printMessage( const QString& ) ) );
|
||||
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp, SLOT( updateZoomFactorSBox() ) );
|
||||
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp,
|
||||
SLOT( printMessage( const QString& ) ) );
|
||||
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp,
|
||||
SLOT( updateZoomFactorSBox() ) );
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this,
|
||||
@@ -378,7 +382,7 @@ void SubWindowHandle::tileSubWindows()
|
||||
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
QSize screenSize = QApplication::desktop()->availableGeometry().size();
|
||||
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
unsigned int minWindowsInRow = 1;
|
||||
while( ( screenSize.width() / minWindowsInRow ) > 500 )
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,12 +25,12 @@
|
||||
#ifndef __SUBWINDOWHANDLE_H__
|
||||
#define __SUBWINDOWHANDLE_H__
|
||||
|
||||
#include "CommonDefs.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
|
||||
class QAction;
|
||||
class QActionGroup;
|
||||
class QHBoxLayout;
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
void processLogMsg( const QString& msg );
|
||||
|
||||
void addSubWindow( SubWindowAbstract* widget, Qt::WindowFlags flags = 0 );
|
||||
void addSubWindow( SubWindowAbstract* widget );
|
||||
|
||||
SubWindowAbstract* activeSubWindow() const;
|
||||
|
||||
|
||||
+89
-64
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,6 +24,14 @@
|
||||
|
||||
#include "VideoHandle.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QElapsedTimer>
|
||||
#include <QLabel>
|
||||
#include <QSignalMapper>
|
||||
#include <QSlider>
|
||||
#include <QToolBar>
|
||||
#include <QtGui>
|
||||
|
||||
#include "FrameNumberWidget.h"
|
||||
#include "FramePropertiesDock.h"
|
||||
#include "MainWindow.h"
|
||||
@@ -32,29 +40,23 @@
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QElapsedTimer>
|
||||
#include <QLabel>
|
||||
#include <QSignalMapper>
|
||||
#include <QSlider>
|
||||
#include <QToolBar>
|
||||
#include <QtGui>
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
#include <QElapsedTimer>
|
||||
#endif
|
||||
|
||||
VideoHandle::VideoHandle( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
m_pcCurrentVideoSubWindow = NULL;
|
||||
m_bIsPlaying = false;
|
||||
m_pcPlayingTimer = new QTimer;
|
||||
m_pcFrameRateFeedbackTimer = new QElapsedTimer;
|
||||
m_pcPlayingTimer->setTimerType( Qt::PreciseTimer );
|
||||
connect( m_pcPlayingTimer, SIGNAL( timeout() ), this, SLOT( playEvent() ) );
|
||||
m_acPlayingSubWindows.clear();
|
||||
}
|
||||
|
||||
VideoHandle::~VideoHandle() {}
|
||||
VideoHandle::~VideoHandle()
|
||||
{
|
||||
delete m_pcPlayingTimer;
|
||||
delete m_pcFrameRateFeedbackTimer;
|
||||
}
|
||||
|
||||
void VideoHandle::createActions()
|
||||
{
|
||||
@@ -240,6 +242,12 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
QWidget* pcStatusBarWidget = new QWidget;
|
||||
QHBoxLayout* mainlayout = new QHBoxLayout;
|
||||
|
||||
m_pcPlayingFPSLabel = new QLabel;
|
||||
m_pcPlayingFPSLabel->setText( " " );
|
||||
m_pcPlayingFPSLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
|
||||
m_pcPlayingFPSLabel->setMinimumWidth( 150 );
|
||||
m_pcPlayingFPSLabel->setAlignment( Qt::AlignCenter );
|
||||
|
||||
m_pcVideoFormatLabel = new QLabel;
|
||||
m_pcVideoFormatLabel->setText( " " );
|
||||
m_pcVideoFormatLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
|
||||
@@ -252,6 +260,7 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
m_pcResolutionLabel->setMinimumWidth( 90 );
|
||||
m_pcResolutionLabel->setAlignment( Qt::AlignCenter );
|
||||
|
||||
mainlayout->addWidget( m_pcPlayingFPSLabel );
|
||||
mainlayout->addWidget( m_pcVideoFormatLabel );
|
||||
mainlayout->addWidget( m_pcResolutionLabel );
|
||||
pcStatusBarWidget->setLayout( mainlayout );
|
||||
@@ -320,9 +329,6 @@ void VideoHandle::update()
|
||||
CalypStream* pcStream = m_pcCurrentVideoSubWindow->getInputStream();
|
||||
CalypFrame* pcFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
|
||||
unsigned long frame_num = 0;
|
||||
unsigned long total_frame_num = 1;
|
||||
|
||||
m_pcVideoFormatLabel->setText( m_pcCurrentVideoSubWindow->getStreamInformation() );
|
||||
|
||||
QString resolution;
|
||||
@@ -331,6 +337,8 @@ void VideoHandle::update()
|
||||
resolution.append( QString( "%1x%2" ).arg( pcFrame->getWidth() ).arg( pcFrame->getHeight() ) );
|
||||
}
|
||||
|
||||
unsigned long frame_num = 0;
|
||||
unsigned long total_frame_num = 1;
|
||||
if( pcStream )
|
||||
{
|
||||
frame_num = pcStream->getCurrFrameNum();
|
||||
@@ -356,7 +364,7 @@ void VideoHandle::update()
|
||||
}
|
||||
m_pcResolutionLabel->setText( resolution );
|
||||
|
||||
m_pcFramePropertiesSideBar->setFrame( pcFrame );
|
||||
m_pcFramePropertiesSideBar->setFrame( pcFrame, m_pcCurrentVideoSubWindow->isPlaying() );
|
||||
|
||||
m_pcFrameNumInfo->setTotalFrameNum( total_frame_num );
|
||||
m_pcFrameNumInfo->setCurrFrameNum( frame_num );
|
||||
@@ -366,6 +374,11 @@ void VideoHandle::update()
|
||||
m_pcFrameSlider->setValue( frame_num );
|
||||
m_pcFrameSlider->blockSignals( false );
|
||||
|
||||
if( m_uiRealAverageFrameRate > 0 )
|
||||
{
|
||||
m_pcPlayingFPSLabel->setText( QString( "%1 fps" ).arg( m_uiRealAverageFrameRate ) );
|
||||
}
|
||||
|
||||
if( m_pcCurrentVideoSubWindow->isPlaying() )
|
||||
{
|
||||
m_arrayActions[PLAY_ACT]->setText( "Pause" );
|
||||
@@ -379,6 +392,7 @@ void VideoHandle::update()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcPlayingFPSLabel->setText( "" );
|
||||
m_pcVideoFormatLabel->setText( "" );
|
||||
m_pcResolutionLabel->setText( "" );
|
||||
m_pcFramePropertiesSideBar->reset();
|
||||
@@ -559,30 +573,25 @@ void VideoHandle::setTimerStatus()
|
||||
{
|
||||
m_pcPlayingTimer->start();
|
||||
m_bIsPlaying = true;
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
m_uiNumberPlayedFrames = 0;
|
||||
m_pcPlayControlTimer = new QElapsedTimer;
|
||||
m_pcPlayControlTimer->start();
|
||||
m_dAverageFps = 0;
|
||||
#endif
|
||||
m_pcFrameRateFeedbackTimer->start();
|
||||
m_uiRealAverageFrameRate = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
if( m_pcPlayControlTimer && m_pcPlayingTimer->interval() > 0 )
|
||||
{
|
||||
qDebug() << "Desired Fps: " << 1000 / m_pcPlayingTimer->interval() << "Real Fps: " << 1000 / m_dAverageFps;
|
||||
|
||||
delete m_pcPlayControlTimer;
|
||||
m_pcPlayControlTimer = NULL;
|
||||
}
|
||||
#endif
|
||||
m_pcPlayingTimer->stop();
|
||||
m_bIsPlaying = false;
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::configureFrameRateTimer()
|
||||
{
|
||||
double frame_rate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate();
|
||||
unsigned int time_ms = (unsigned int)( 1000.0 / frame_rate + 0.5 );
|
||||
m_pcPlayingTimer->setInterval( time_ms );
|
||||
}
|
||||
|
||||
void VideoHandle::play()
|
||||
{
|
||||
if( !m_pcCurrentVideoSubWindow )
|
||||
@@ -593,8 +602,6 @@ void VideoHandle::play()
|
||||
|
||||
if( !m_pcCurrentVideoSubWindow->isPlaying() ) // Not playing
|
||||
{
|
||||
double frameRate;
|
||||
unsigned int timeinterval;
|
||||
if( m_acPlayingSubWindows.size() < 2 )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
@@ -610,9 +617,7 @@ void VideoHandle::play()
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->play();
|
||||
}
|
||||
frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate();
|
||||
timeinterval = (unsigned int)( 1000.0 / frameRate + 0.5 );
|
||||
m_pcPlayingTimer->setInterval( timeinterval );
|
||||
configureFrameRateTimer();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -638,9 +643,9 @@ void VideoHandle::stop()
|
||||
{
|
||||
if( m_acPlayingSubWindows.size() > 0 )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->stop();
|
||||
playingSubWindow->stop();
|
||||
}
|
||||
m_acPlayingSubWindows.clear();
|
||||
setTimerStatus();
|
||||
@@ -656,28 +661,48 @@ void VideoHandle::stop()
|
||||
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( false );
|
||||
}
|
||||
|
||||
void VideoHandle::calculateRealFrameRate()
|
||||
{
|
||||
double average_time_between_frames_ms = m_uiNumberPlayedFrames > 0 ? 1000.0 / m_uiRealAverageFrameRate : 0;
|
||||
double time_elapsed_since_last_frame_ms = m_pcFrameRateFeedbackTimer->elapsed();
|
||||
average_time_between_frames_ms = double( average_time_between_frames_ms * m_uiNumberPlayedFrames + time_elapsed_since_last_frame_ms ) / double( m_uiNumberPlayedFrames + 1 );
|
||||
m_uiRealAverageFrameRate = 1000.0 / average_time_between_frames_ms;
|
||||
m_uiNumberPlayedFrames++;
|
||||
m_pcFrameRateFeedbackTimer->restart();
|
||||
}
|
||||
|
||||
void VideoHandle::playEvent()
|
||||
{
|
||||
bool bEndOfSequence = false;
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
m_dAverageFps = double( m_dAverageFps * m_uiNumberPlayedFrames + m_pcPlayControlTimer->elapsed() ) /
|
||||
double( m_uiNumberPlayedFrames + 1 );
|
||||
m_uiNumberPlayedFrames++;
|
||||
m_pcPlayControlTimer->restart();
|
||||
#endif
|
||||
// This value should only be true if it is really needed to refresh the UI after this play event
|
||||
// Lets assum the current window is not playing. Nothing changes in the UI expect the playing windows
|
||||
// So no changed is emmited
|
||||
bool bShouldRefreshUI = false;
|
||||
calculateRealFrameRate();
|
||||
try
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
bool bEndOfSequence = false;
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
bEndOfSequence |= m_acPlayingSubWindows.at( i )->playEvent();
|
||||
bEndOfSequence |= playingSubWindow->playEvent();
|
||||
// If the current selected windows is playing then we need to refresh the UI
|
||||
if( playingSubWindow == m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
bShouldRefreshUI = true;
|
||||
}
|
||||
}
|
||||
if( bEndOfSequence )
|
||||
{
|
||||
if( !m_arrayActions[VIDEO_REPEAT_ACT]->isChecked() )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
else
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( 0 );
|
||||
{
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
playingSubWindow->seekAbsoluteEvent( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( const char* msg )
|
||||
@@ -690,7 +715,8 @@ void VideoHandle::playEvent()
|
||||
stop();
|
||||
m_pcCurrentVideoSubWindow->close();
|
||||
}
|
||||
emit changed();
|
||||
if( bShouldRefreshUI )
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void VideoHandle::seekEvent( int direction )
|
||||
@@ -702,9 +728,9 @@ void VideoHandle::seekEvent( int direction )
|
||||
if( !( (unsigned int)( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >= getMaxFrameNumber() &&
|
||||
direction > 0 ) )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->seekRelativeEvent( direction > 0 ? true : false );
|
||||
playingSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -713,7 +739,6 @@ void VideoHandle::seekEvent( int direction )
|
||||
m_pcCurrentVideoSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
}
|
||||
emit changed();
|
||||
// update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -730,9 +755,9 @@ void VideoHandle::seekVideo()
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (unsigned int)newFrameNum );
|
||||
playingSubWindow->seekAbsoluteEvent( (unsigned int)newFrameNum );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -751,9 +776,9 @@ void VideoHandle::seekSliderEvent( int new_frame_num )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (unsigned int)new_frame_num );
|
||||
playingSubWindow->seekAbsoluteEvent( (unsigned int)new_frame_num );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -773,9 +798,9 @@ void VideoHandle::videoSelectionButtonEvent()
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( auto subWindow : subWindowList )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindow );
|
||||
m_acPlayingSubWindows.append( videoSubWindow );
|
||||
}
|
||||
}
|
||||
@@ -784,18 +809,18 @@ void VideoHandle::videoSelectionButtonEvent()
|
||||
SubWindowSelectorDialog dialogWindowsSelection( m_pcParet, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QStringList cWindowListNames;
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
dialogWindowsSelection.selectSubWindow( m_acPlayingSubWindows.at( i ) );
|
||||
dialogWindowsSelection.selectSubWindow( playingSubWindow );
|
||||
}
|
||||
if( dialogWindowsSelection.exec() == QDialog::Accepted )
|
||||
{
|
||||
m_acPlayingSubWindows.clear();
|
||||
|
||||
QList<SubWindowAbstract*> selectedSubWindowList = dialogWindowsSelection.getSelectedWindows();
|
||||
for( int i = 0; i < selectedSubWindowList.size(); i++ )
|
||||
for( auto window : selectedSubWindowList )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( selectedSubWindowList.at( i ) );
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( window );
|
||||
m_acPlayingSubWindows.append( videoSubWindow );
|
||||
}
|
||||
}
|
||||
@@ -807,7 +832,7 @@ void VideoHandle::videoSelectionButtonEvent()
|
||||
|
||||
if( m_acPlayingSubWindows.size() > 0 )
|
||||
{
|
||||
m_acPlayingSubWindows.at( 0 )->activateWindow();
|
||||
m_acPlayingSubWindows.front()->activateWindow();
|
||||
if( m_acPlayingSubWindows.size() > 1 )
|
||||
{
|
||||
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( true );
|
||||
|
||||
+10
-9
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,16 +25,14 @@
|
||||
#ifndef __VIDEOHANDLE_H__
|
||||
#define __VIDEOHANDLE_H__
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QPoint>
|
||||
#include <QThread>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
//#define _CONTROL_PLAYING_TIME_ 1
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QToolBar;
|
||||
class QDockWidget;
|
||||
@@ -113,6 +111,7 @@ private:
|
||||
QDockWidget* m_pcFramePropertiesDock;
|
||||
FramePropertiesDock* m_pcFramePropertiesSideBar;
|
||||
|
||||
QLabel* m_pcPlayingFPSLabel;
|
||||
QLabel* m_pcVideoFormatLabel;
|
||||
QLabel* m_pcResolutionLabel;
|
||||
|
||||
@@ -122,12 +121,12 @@ private:
|
||||
QTimer* m_pcPlayingTimer;
|
||||
bool m_bIsPlaying;
|
||||
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
unsigned int m_uiNumberPlayedFrames;
|
||||
double m_dAverageFps;
|
||||
QElapsedTimer* m_pcPlayControlTimer;
|
||||
#endif
|
||||
unsigned int m_uiRealAverageFrameRate;
|
||||
QElapsedTimer* m_pcFrameRateFeedbackTimer;
|
||||
|
||||
void configureFrameRateTimer();
|
||||
void calculateRealFrameRate();
|
||||
unsigned long getMaxFrameNumber();
|
||||
void setTimerStatus();
|
||||
|
||||
@@ -140,8 +139,10 @@ private Q_SLOTS:
|
||||
void closeSubWindow( SubWindowAbstract* subWindow );
|
||||
void zoomToFactorAll( const double factor, const QPoint center = QPoint() );
|
||||
void moveAllScrollBars( const double&, const double& );
|
||||
|
||||
void play();
|
||||
void stop();
|
||||
|
||||
void playEvent();
|
||||
void seekSliderEvent( int new_frame_num );
|
||||
void seekEvent( int direction );
|
||||
|
||||
+51
-8
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -23,16 +23,18 @@
|
||||
*/
|
||||
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QSettings>
|
||||
#include <QStaticText>
|
||||
#include <cassert>
|
||||
|
||||
#include "ConfigureFormatDialog.h"
|
||||
#include "ModulesHandle.h"
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#define QT_NO_CONCURRENT
|
||||
//#define QT_NO_CONCURRENT
|
||||
|
||||
/**
|
||||
* \brief Functions to control data stream from stream information
|
||||
@@ -87,6 +89,7 @@ int findCalypStreamInfo( CalypFileInfoVector array, QString filename )
|
||||
class VideoInformation : public QWidget
|
||||
{
|
||||
private:
|
||||
QTimer* m_pcRefreshTimer;
|
||||
QList<QStaticText> m_cTopLeftTextList;
|
||||
QFont m_cTopLeftTextFont;
|
||||
QFont m_cCenterTextFont;
|
||||
@@ -100,6 +103,9 @@ public:
|
||||
setAttribute( Qt::WA_TransparentForMouseEvents );
|
||||
m_cTopLeftTextFont.setPointSize( 8 );
|
||||
m_cCenterTextFont.setPointSize( 12 );
|
||||
m_pcRefreshTimer = new QTimer;
|
||||
m_pcRefreshTimer->setSingleShot( true );
|
||||
connect( m_pcRefreshTimer, SIGNAL( timeout() ), this, SLOT( update() ) );
|
||||
}
|
||||
void setInformationTopLeft( const QStringList& textLines )
|
||||
{
|
||||
@@ -109,7 +115,11 @@ public:
|
||||
m_cTopLeftTextList.append( QStaticText( textLines.at( i ) ) );
|
||||
}
|
||||
}
|
||||
void setBusyWindow( bool bFlag ) { m_bBusyWindow = bFlag; }
|
||||
void setBusyWindow( bool bFlag )
|
||||
{
|
||||
m_bBusyWindow = bFlag;
|
||||
m_pcRefreshTimer->start( 500 );
|
||||
}
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent* event )
|
||||
@@ -257,7 +267,7 @@ QSize VideoSubWindow::sizeHint() const
|
||||
}
|
||||
else
|
||||
{
|
||||
maxSize = QApplication::desktop()->availableGeometry().size();
|
||||
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
}
|
||||
return sizeHint( maxSize );
|
||||
}
|
||||
@@ -313,6 +323,7 @@ bool VideoSubWindow::loadFile( QString cFilename, bool bForceDialog )
|
||||
unsigned int Width = 0, Height = 0, BitsPel = 8, FrameRate = 30;
|
||||
int Endianness = CLP_LITTLE_ENDIAN;
|
||||
int InputFormat = CLP_YUV420P;
|
||||
QSettings appSettings;
|
||||
|
||||
if( m_pCurrStream )
|
||||
m_pCurrStream->getFormat( Width, Height, InputFormat, BitsPel, Endianness, FrameRate );
|
||||
@@ -323,7 +334,16 @@ bool VideoSubWindow::loadFile( QString cFilename, bool bForceDialog )
|
||||
}
|
||||
bool bConfig = true;
|
||||
if( !bForceDialog )
|
||||
{
|
||||
bConfig = guessFormat( cFilename, Width, Height, InputFormat, BitsPel, Endianness, FrameRate );
|
||||
if( bConfig )
|
||||
{
|
||||
// Pre-load values with last opened file
|
||||
Width = appSettings.value( "VideoSubWindow/LastWidth" ).value<unsigned int>();
|
||||
Height = appSettings.value( "VideoSubWindow/LastHeight" ).value<unsigned int>();
|
||||
BitsPel = appSettings.value( "VideoSubWindow/LastBitsPerPixel" ).value<unsigned int>();
|
||||
}
|
||||
}
|
||||
bool bRet = false;
|
||||
for( int iPass = 0; iPass < 2 && !bRet; iPass++ )
|
||||
{
|
||||
@@ -355,6 +375,14 @@ bool VideoSubWindow::loadFile( QString cFilename, bool bForceDialog )
|
||||
m_sStreamInfo.m_uiFrameRate = FrameRate;
|
||||
m_sStreamInfo.m_uiFileSize = QFileInfo( cFilename ).size();
|
||||
|
||||
QVariant var;
|
||||
var.setValue<unsigned int>( Width );
|
||||
appSettings.setValue( "VideoSubWindow/LastWidth", var );
|
||||
var.setValue<unsigned int>( Height );
|
||||
appSettings.setValue( "VideoSubWindow/LastHeight", var );
|
||||
var.setValue<unsigned int>( BitsPel );
|
||||
appSettings.setValue( "VideoSubWindow/LastBitsPerPixel", var );
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
refreshFrame();
|
||||
@@ -363,6 +391,7 @@ bool VideoSubWindow::loadFile( QString cFilename, bool bForceDialog )
|
||||
|
||||
updateVideoWindowInfo();
|
||||
setWindowName( QFileInfo( m_cFilename ).fileName() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -711,7 +740,7 @@ void VideoSubWindow::refreshFrameOperation()
|
||||
}
|
||||
for( int i = 0; i < m_apcCurrentModule.size(); i++ )
|
||||
{
|
||||
m_apcCurrentModule.at( i )->update();
|
||||
m_apcCurrentModule.at( i )->update( m_bIsPlaying );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -743,8 +772,8 @@ bool VideoSubWindow::goToNextFrame( bool bThreaded )
|
||||
m_cRefreshResult.waitForFinished();
|
||||
if( bThreaded )
|
||||
{
|
||||
refreshFrame();
|
||||
m_cReadResult = QtConcurrent::run( m_pCurrStream, &CalypStream::readNextFrameFillRGBBuffer );
|
||||
refreshFrame();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -786,6 +815,20 @@ bool VideoSubWindow::saveStream( QString filename )
|
||||
return iRet;
|
||||
}
|
||||
|
||||
bool VideoSubWindow::isPlaying()
|
||||
{
|
||||
if( getCategory() & SubWindowCategory::MODULE_SUBWINDOW )
|
||||
{
|
||||
for( auto window : m_pcCurrentDisplayModule->getSubWindowList() )
|
||||
{
|
||||
if( window->isPlaying() )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return m_bIsPlaying;
|
||||
}
|
||||
|
||||
bool VideoSubWindow::play()
|
||||
{
|
||||
if( m_pCurrStream && m_pCurrStream->getFrameNum() > 1 )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QRect>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "ViewArea.h"
|
||||
@@ -126,7 +127,7 @@ public:
|
||||
bool playEvent();
|
||||
void stop();
|
||||
|
||||
bool isPlaying() { return m_bIsPlaying; }
|
||||
bool isPlaying();
|
||||
void seekAbsoluteEvent( unsigned int new_frame_num );
|
||||
void seekRelativeEvent( bool bIsFoward );
|
||||
|
||||
@@ -181,7 +182,6 @@ 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 );
|
||||
|
||||
|
||||
+8
-13
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,8 +25,6 @@
|
||||
|
||||
#include "ViewArea.h"
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
@@ -38,9 +36,10 @@
|
||||
#include <QRectF>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
static const QColor selectionColor = Qt::cyan;
|
||||
static const QColor imageMaskColor = Qt::green;
|
||||
static const QColor eraserColor = Qt::red;
|
||||
@@ -688,8 +687,7 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
switch( tool() )
|
||||
{
|
||||
case MaskTool:
|
||||
{
|
||||
case MaskTool: {
|
||||
if( m_maskColor.isValid() )
|
||||
color = m_maskColor;
|
||||
else
|
||||
@@ -697,8 +695,7 @@ void ViewArea::paintEvent( QPaintEvent* event )
|
||||
|
||||
break;
|
||||
}
|
||||
case EraserTool:
|
||||
{
|
||||
case EraserTool: {
|
||||
color = eraserColor;
|
||||
break;
|
||||
}
|
||||
@@ -733,7 +730,7 @@ void ViewArea::wheelEvent( QWheelEvent* event )
|
||||
|
||||
if( event->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
scale = 0.001 * event->delta();
|
||||
scale = 0.001 * event->angleDelta().y();
|
||||
if( scale > 0 )
|
||||
scale = 1.25;
|
||||
else
|
||||
@@ -1075,8 +1072,7 @@ void ViewArea::updateMask( const QRect& rect )
|
||||
{
|
||||
switch( tool() )
|
||||
{
|
||||
case MaskTool:
|
||||
{
|
||||
case MaskTool: {
|
||||
// Add rect to the mask
|
||||
QPainter painter( &m_mask );
|
||||
painter.setBrush( Qt::color1 );
|
||||
@@ -1085,8 +1081,7 @@ void ViewArea::updateMask( const QRect& rect )
|
||||
painter.end();
|
||||
break;
|
||||
}
|
||||
case EraserTool:
|
||||
{
|
||||
case EraserTool: {
|
||||
// Clears rect area in the mask
|
||||
QPainter painter( &m_mask );
|
||||
painter.setBrush( Qt::color0 );
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -26,17 +26,17 @@
|
||||
#ifndef __VIEWAREA_H__
|
||||
#define __VIEWAREA_H__
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "GridManager.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
#include <QBitmap>
|
||||
#include <QColor>
|
||||
#include <QPixmap>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "GridManager.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
class CalypStream;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Santos (joaompssantos@gmail.com)
|
||||
*
|
||||
@@ -27,14 +27,14 @@
|
||||
|
||||
#include "AboutDialog.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define TAB_FROM_SPACES " "
|
||||
|
||||
AboutDialog::AboutDialog( QWidget* parent )
|
||||
@@ -49,7 +49,7 @@ AboutDialog::AboutDialog( QWidget* parent )
|
||||
.arg( QApplication::applicationVersion() ) );
|
||||
label->setWordWrap( false );
|
||||
|
||||
QString featuresList = QStringLiteral( "<p><h3><b>Features:</b></h3><ul>" );
|
||||
QString featuresList = QStringLiteral( "<p><h4><b>Features:</b></h4><ul>" );
|
||||
|
||||
#ifdef USE_QTDBUS
|
||||
featuresList.append( QStringLiteral( "<li>Support for Qt DBus messages" ) );
|
||||
@@ -63,14 +63,21 @@ AboutDialog::AboutDialog( QWidget* parent )
|
||||
featuresList.append( QStringLiteral( "</ul></p>" ) );
|
||||
QLabel* labelFeatures = new QLabel( featuresList );
|
||||
|
||||
QLabel* labelCopyright = new QLabel( QStringLiteral( "Copyright © 2014–2018 Joao Carreira and Luis Lucas" ) );
|
||||
QString thanksList = QStringLiteral( "<p><h4><b>Thanks to:</b></h4><ul>" );
|
||||
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;
|
||||
QVBoxLayout* topLayout = new QVBoxLayout;
|
||||
topLayout->addWidget( pixmapLabel, 0, Qt::AlignHCenter );
|
||||
topLayout->addWidget( label );
|
||||
topLayout->addWidget( labelFeatures );
|
||||
topLayout->addWidget( labelCopyright );
|
||||
topLayout->addWidget( labelFeatures );
|
||||
topLayout->addWidget( labelContributors );
|
||||
topWidget->setLayout( topLayout );
|
||||
|
||||
// QTextEdit *textEdit = new QTextEdit(tr("<p>This program is free "
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include "ConfigureFormatDialog.h"
|
||||
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -39,6 +37,8 @@
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
#define MAX_SUPPORTED_RESOLUTION 99999
|
||||
|
||||
QDataStream& operator<<( QDataStream& out, const CalypStandardResolutionVector& array )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include "ModulesHandleOptDialog.h"
|
||||
|
||||
#include "lib/CalypOptions.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
@@ -34,6 +32,8 @@
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/CalypOptions.h"
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
class OpionConfiguration : public QWidget
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,13 +25,13 @@
|
||||
#ifndef __MODULEHANDLEOPTDIALOG_H__
|
||||
#define __MODULEHANDLEOPTDIALOG_H__
|
||||
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
class OpionConfiguration;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,11 +25,11 @@
|
||||
#ifndef __PROGRESSBAR_H__
|
||||
#define __PROGRESSBAR_H__
|
||||
|
||||
#include "CommonDefs.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
|
||||
class QProgressBar;
|
||||
|
||||
class ProgressBar : public QWidget
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include "SeekStreamDialog.h"
|
||||
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
@@ -33,6 +31,8 @@
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
SeekStreamDialog::SeekStreamDialog( CalypStream* pcCurrStream, QWidget* parent )
|
||||
: QDialog( parent, Qt::Dialog | Qt::WindowTitleHint ), m_iSelectedFrameNum()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,13 +25,13 @@
|
||||
#ifndef __SEEKSTREAMDIALOG_H__
|
||||
#define __SEEKSTREAMDIALOG_H__
|
||||
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
class QSpinBox;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,12 +24,12 @@
|
||||
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
|
||||
#include "SubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QGroupBox>
|
||||
|
||||
#include "SubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
SubWindowSelectorDialog::SubWindowSelectorDialog( QWidget* parent, SubWindowHandle* windowManager,
|
||||
unsigned int uiCategory, int minWindowsSelected, int maxWindowsSelected )
|
||||
: QDialog( parent )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,13 +25,12 @@
|
||||
#ifndef __DIALOGSUBWINDOWSELECTOR_H__
|
||||
#define __DIALOGSUBWINDOWSELECTOR_H__
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QVector>
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include <QVector>
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QPixmap;
|
||||
class QColor;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -28,12 +28,12 @@
|
||||
#include <QtGui>
|
||||
#include <cmath>
|
||||
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitch )
|
||||
: QWidget( parent ), m_pbIsPlaying( pbMainPlaySwitch )
|
||||
: QWidget( parent ), m_bIsPlaying( false ), m_bHasFrame( false )
|
||||
{
|
||||
// -------------- Variables definition --------------
|
||||
m_pcFrame = NULL;
|
||||
m_pcSelectedFrame = NULL;
|
||||
m_iLastFrameType = -1;
|
||||
|
||||
// Histogram area -----------------------------------------------------
|
||||
@@ -204,6 +204,11 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
labelMedianValue = new QLabel;
|
||||
labelMedianValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QLabel* entropyLabel = new QLabel( tr( "Entropy:" ) );
|
||||
entropyLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
labelEntropyValue = new QLabel;
|
||||
labelEntropyValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QLabel* percentileLabel = new QLabel( tr( "Percentile:" ) );
|
||||
percentileLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
labelPercentileValue = new QLabel;
|
||||
@@ -225,6 +230,8 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
statisticsLayout->addWidget( labelStdDevValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( medianLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelMedianValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( entropyLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelEntropyValue, gridRow++, 1 );
|
||||
|
||||
QGroupBox* statisticsGroup = new QGroupBox( tr( "Statistics" ) );
|
||||
statisticsGroup->setLayout( statisticsLayout );
|
||||
@@ -271,13 +278,8 @@ QSize FramePropertiesDock::sizeHint() const
|
||||
|
||||
void FramePropertiesDock::reset()
|
||||
{
|
||||
m_pcFrame = NULL;
|
||||
m_bHasFrame = false;
|
||||
m_cSelectionArea = QRect();
|
||||
if( m_pcSelectedFrame )
|
||||
{
|
||||
delete m_pcSelectedFrame;
|
||||
m_pcSelectedFrame = NULL;
|
||||
}
|
||||
|
||||
m_iLastFrameType = -1;
|
||||
|
||||
@@ -295,7 +297,7 @@ void FramePropertiesDock::reset()
|
||||
setEnabled( false );
|
||||
}
|
||||
|
||||
void FramePropertiesDock::setFrame( CalypFrame* pcFrame )
|
||||
void FramePropertiesDock::setFrame( CalypFrame* pcFrame, bool isPlaying )
|
||||
{
|
||||
int colorSpace = pcFrame->getColorSpace();
|
||||
if( m_iLastFrameType != colorSpace )
|
||||
@@ -357,35 +359,38 @@ void FramePropertiesDock::setFrame( CalypFrame* pcFrame )
|
||||
}
|
||||
}
|
||||
setEnabled( true );
|
||||
if( m_pcFrame || !( *m_pbIsPlaying ) )
|
||||
m_bIsPlaying = isPlaying;
|
||||
if( !m_bIsPlaying )
|
||||
{
|
||||
m_pcFrame = pcFrame;
|
||||
updateDataHistogram();
|
||||
if( pcFrame )
|
||||
{
|
||||
m_bHasFrame = true;
|
||||
m_cFrame = CalypFrame( pcFrame );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bHasFrame = false;
|
||||
}
|
||||
}
|
||||
updateDataHistogram();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
{
|
||||
if( m_pcFrame )
|
||||
if( m_bHasFrame )
|
||||
{
|
||||
bool bSelectionChanged = !( selectionArea.size() == m_cSelectionArea.size() );
|
||||
m_cSelectionArea = selectionArea;
|
||||
if( selectionArea.isValid() )
|
||||
{
|
||||
m_cSelectionArea = selectionArea;
|
||||
histogramWidget->stopHistogramComputation();
|
||||
|
||||
/*
|
||||
* Allocate a new image for the selection
|
||||
* or just copy information
|
||||
* Crop selection from frame
|
||||
*/
|
||||
if( bSelectionChanged )
|
||||
{
|
||||
if( m_pcSelectedFrame )
|
||||
{
|
||||
delete m_pcSelectedFrame;
|
||||
}
|
||||
m_pcSelectedFrame = new CalypFrame( m_pcFrame, selectionArea.x(), selectionArea.y(), selectionArea.width(),
|
||||
selectionArea.height() );
|
||||
m_cSelectedFrame = CalypFrame( m_cFrame, selectionArea.x(), selectionArea.y(), selectionArea.width(),
|
||||
selectionArea.height() );
|
||||
}
|
||||
updateDataHistogram();
|
||||
selectionImageButton->click();
|
||||
@@ -402,13 +407,13 @@ void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
|
||||
void FramePropertiesDock::updateDataHistogram()
|
||||
{
|
||||
if( m_pcFrame && isVisible() )
|
||||
if( m_bHasFrame && isVisible() )
|
||||
{
|
||||
if( !*m_pbIsPlaying )
|
||||
if( !m_bIsPlaying )
|
||||
{
|
||||
if( m_pcSelectedFrame )
|
||||
if( m_cSelectionArea.isValid() )
|
||||
{
|
||||
m_pcSelectedFrame->copyFrom( m_pcFrame, m_cSelectionArea.x(), m_cSelectionArea.y() );
|
||||
m_cSelectedFrame = CalypFrame( m_cFrame, m_cSelectionArea.x(), m_cSelectionArea.y(), m_cSelectionArea.width(), m_cSelectionArea.height() );
|
||||
fullImageButton->show();
|
||||
selectionImageButton->show();
|
||||
}
|
||||
@@ -417,7 +422,7 @@ void FramePropertiesDock::updateDataHistogram()
|
||||
fullImageButton->hide();
|
||||
selectionImageButton->hide();
|
||||
}
|
||||
histogramWidget->updateData( m_pcFrame, m_pcSelectedFrame );
|
||||
histogramWidget->updateData( &m_cFrame, m_cSelectionArea.isValid() ? &m_cSelectedFrame : nullptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -472,7 +477,10 @@ void FramePropertiesDock::updateStatistiques()
|
||||
labelCountValue->setText( value.setNum( (float)counts, 'f', 0 ) );
|
||||
|
||||
double median = frame->getMedian( channel, min, max );
|
||||
labelMedianValue->setText( value.setNum( median, 'f', 1 ) );
|
||||
labelMedianValue->setText( value.setNum( median, 'f', 0 ) );
|
||||
|
||||
double entropy = frame->getEntropy( channel, min, max );
|
||||
labelEntropyValue->setText( value.setNum( entropy, 'f', 2 ) );
|
||||
|
||||
double percentile = ( pixels > 0 ? ( 100.0 * counts / pixels ) : 0.0 );
|
||||
labelPercentileValue->setText( value.setNum( percentile, 'f', 1 ) );
|
||||
@@ -513,7 +521,7 @@ void FramePropertiesDock::slotRefreshOptions( int range )
|
||||
|
||||
void FramePropertiesDock::slotHistogramComputationFailed()
|
||||
{
|
||||
m_pcFrame = NULL;
|
||||
m_bHasFrame = false;
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotChannelChanged( int index )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,13 +25,14 @@
|
||||
#ifndef __FRAMEPROPERTIESDOCK_H__
|
||||
#define __FRAMEPROPERTIESDOCK_H__
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "HistogramWidget.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
#include <QtWidgets>
|
||||
class CalypStream;
|
||||
|
||||
class FramePropertiesDock : public QWidget
|
||||
{
|
||||
@@ -42,17 +43,17 @@ public:
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
void setFrame( CalypFrame* m_pcFrame );
|
||||
void setFrame( CalypFrame* m_pcFrame, bool isPlaying );
|
||||
void setSelection( const QRect& selectionArea );
|
||||
void reset();
|
||||
void stopHistogram();
|
||||
|
||||
private:
|
||||
CalypFrame* m_pcFrame;
|
||||
CalypFrame* m_pcSelectedFrame;
|
||||
CalypFrame m_cFrame;
|
||||
CalypFrame m_cSelectedFrame;
|
||||
int m_iLastFrameType;
|
||||
|
||||
bool* m_pbIsPlaying;
|
||||
bool m_bIsPlaying;
|
||||
bool m_bHasFrame;
|
||||
|
||||
QComboBox* channelCB;
|
||||
QComboBox* colorsCB;
|
||||
@@ -76,6 +77,7 @@ private:
|
||||
QLabel* labelMeanValue;
|
||||
QLabel* labelStdDevValue;
|
||||
QLabel* labelMedianValue;
|
||||
QLabel* labelEntropyValue;
|
||||
QLabel* labelPercentileValue;
|
||||
|
||||
QLabel* colorsLabel;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,14 +24,14 @@
|
||||
|
||||
#include "ModuleHandleDock.h"
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QtGui>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
ModuleHandleDock::ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf )
|
||||
: QWidget( parent ), m_pcCurrModuleIf( moduleIf )
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,12 +25,12 @@
|
||||
#ifndef __MODULEHANDLEDOCK_H__
|
||||
#define __MODULEHANDLEDOCK_H__
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QSize>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QLabel;
|
||||
|
||||
class CalypAppModuleIf;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
#include "QualityMeasurementSidebar.h"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include "SubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: QWidget( parent ), m_pcMainWindowManager( windowManager ), m_pcCurrentVideoSubWindow( NULL )
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,14 +25,14 @@
|
||||
#ifndef __QUALITYMEASUREMENTSIDEBAR_H__
|
||||
#define __QUALITYMEASUREMENTSIDEBAR_H__
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "HistogramWidget.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class SubWindowHandle;
|
||||
class VideoSubWindow;
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -1,5 +1,5 @@
|
||||
###
|
||||
### CMakeLists for calyp external components
|
||||
###
|
||||
#
|
||||
# CMakeLists for calyp external components
|
||||
#
|
||||
|
||||
ADD_SUBDIRECTORY( qcustomplot )
|
||||
ADD_SUBDIRECTORY(qcustomplot)
|
||||
+8
-16
@@ -1,20 +1,12 @@
|
||||
###
|
||||
### CMakeLists for qcustomplot
|
||||
###
|
||||
#
|
||||
# CMakeLists for qcustomplot
|
||||
#
|
||||
|
||||
FIND_PACKAGE( Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport )
|
||||
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport)
|
||||
|
||||
set(qcustomplot_SRCS
|
||||
qcustomplot.cpp
|
||||
qcustomplot.h
|
||||
)
|
||||
SET(qcustomplot_SRCS qcustomplot.cpp qcustomplot.h)
|
||||
|
||||
ADD_LIBRARY( QCustomPlotLib STATIC ${qcustomplot_SRCS} )
|
||||
TARGET_LINK_LIBRARIES( QCustomPlotLib
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Widgets
|
||||
Qt5::PrintSupport
|
||||
)
|
||||
ADD_LIBRARY(QCustomPlotLib STATIC ${qcustomplot_SRCS})
|
||||
TARGET_LINK_LIBRARIES(QCustomPlotLib Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport)
|
||||
|
||||
TARGET_INCLUDE_DIRECTORIES(QCustomPlotLib PUBLIC . )
|
||||
TARGET_INCLUDE_DIRECTORIES(QCustomPlotLib PUBLIC .)
|
||||
+674
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
+34
@@ -1,3 +1,37 @@
|
||||
#### Version 2.1.0 released on 29.03.21 ####
|
||||
|
||||
Added features:
|
||||
- Compatibility up to Qt 6.0
|
||||
- Tech Preview: Radial Plots (see setupPolarPlotDemo in examples project)
|
||||
- QCPAxisTickerDateTime can now be configured with a QTimeZone for adjusting the label display to arbitrary time zones
|
||||
- QCPColorGradient (and thus also QCPColorMap) now has explicit configurable NaN handling (see QCPColorGradient::setNanHandling)
|
||||
- added timing/benchmarking method QCustomPlot::replotTime(bool average) which returns the milliseconds per replot
|
||||
- QCustomPlot::plottableAt has an optional output parameter dataIndex, providing the index of the data point at the probed position
|
||||
- QCustomPlot::plottableAt<T> template method allows limiting the search to the specified QCPAbstractPlottable subclass T
|
||||
- QCustomPlot::itemAt<T> template method allows limiting the search to the specified QCPAbstractItem subclass T
|
||||
- Added Interaction flag QCP::iSelectPlottablesBeyondAxisRect, allows selection of data points very close to (and beyond of) the axes
|
||||
- QCPAxisTickerDateTime::dateTimeToKey(QDate &) now also takes a TimeSpec to specify the interpretation of the start-of-day
|
||||
- QCPAxisTickerLog now switches to linear ticks if zoomed in beyond where logarithmic ticks are reasonable
|
||||
- Added QCustomPlot::afterLayout signal, for user code that crucially depends on layout sizes/positions, right before the draw step during a replot
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bug where QCPLayer::replot wouldn't issue full replot even though invalidated buffers existed
|
||||
- Fixed QCPCurve bug causing rendering artifacts when using keys/values smaller than about 1e-12 in some constellations
|
||||
- Fixed getValueRange when used with explicit keyRange, now doesn't use key range expanded by one point to each side anymore
|
||||
- Fixed bug of QCPAxis tick label font size change only propagating to the layout after second call to replot
|
||||
- Fixed bug of QCPTextElement not respecting the configured text alignment flag (setTextFlags)
|
||||
- Various documentation typos and improvements
|
||||
|
||||
Other:
|
||||
- QCP Now requires C++11. However, Qt4.6 compatibility is maintained in the QCP 2.x release series
|
||||
- QCPColorScale is now initialized with gpCold gradient preset, which prevents color maps turning black when linking them to a default-created color scale without explicitly setting a gradient
|
||||
- QCPLegend::clearItems is now faster in case of many legend items (>1000)
|
||||
- Modernized expressions and thereby avoided some warnings (e.g. nullptr and casts)
|
||||
- Switched to foreach (Qt macro) where possible (in preparation for switch to range-based for (C++11), soonest at next major release)
|
||||
- Work around Qt bug, drawing lines with pen width 1 as slow as with pen widths > 1 (polyfill instead of line algorithm, also on Normal-DPI), by using pen width 0 in such cases.
|
||||
- Added QCP::Interaction flag iNone=0x000 to allow explicitly specifying no interaction (Avoids QFlags::zero, which was deprecated in Qt5.14)
|
||||
- QCP is now compatible with defines QT_USE_QSTRINGBUILDER, QT_USE_FAST_CONCATENATION (Qt<4.8), QT_USE_FAST_OPERATOR_PLUS (Qt<4.8)
|
||||
|
||||
#### Version 2.0.1 released on 25.06.18 ####
|
||||
|
||||
Bugfixes:
|
||||
|
||||
+15144
-9240
File diff suppressed because it is too large.
Load diff
+4361
-3007
File diff suppressed because it is too large.
Load diff
+6
-1
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "DBusAppAdaptor.h"
|
||||
#endif
|
||||
#include <QApplication>
|
||||
#include <QStyleFactory>
|
||||
#ifdef USE_FERVOR
|
||||
#include "fvupdater.h"
|
||||
#endif
|
||||
@@ -51,6 +52,10 @@ int main( int argc, char* argv[] )
|
||||
QApplication::setApplicationVersion( QStringLiteral( CALYP_VERSION_STRING ) );
|
||||
QApplication::setOrganizationName( QStringLiteral( "PixLRA" ) );
|
||||
|
||||
#if _WIN32
|
||||
application.setStyle( QStyleFactory::create( "Fusion" ) );
|
||||
#endif
|
||||
|
||||
#ifdef USE_QTDBUS
|
||||
/**
|
||||
* use dbus, if available
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,11 +25,11 @@
|
||||
#ifndef __WIDGETFRAMENUMBER_H__
|
||||
#define __WIDGETFRAMENUMBER_H__
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QLabel;
|
||||
|
||||
class FrameNumberWidget : public QWidget
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
void setup( CalypFrame* frame )
|
||||
{
|
||||
m_pcFrame = frame;
|
||||
// run();
|
||||
//run();
|
||||
start();
|
||||
}
|
||||
void run()
|
||||
@@ -61,17 +61,9 @@ public:
|
||||
if( m_pcFrame && m_parent )
|
||||
{
|
||||
EventData* eventData = new EventData();
|
||||
// eventDm_imageHistogramata->starting = true;
|
||||
// eventData->success = false;
|
||||
// eventData->histogram = m_histogram;
|
||||
// QCoreApplication::postEvent( m_parent, eventData );
|
||||
|
||||
eventData->starting = true;
|
||||
|
||||
m_pcFrame->calcHistogram();
|
||||
|
||||
eventData->starting = false;
|
||||
// eventData->success = m_pcFrame->getHasHistogram();
|
||||
eventData->success = true;
|
||||
eventData->frame = m_pcFrame;
|
||||
QCoreApplication::postEvent( m_parent, eventData );
|
||||
@@ -938,7 +930,11 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
tipText += cellBeg + tr( "Median:" ) + cellMid;
|
||||
double median = frame->getMedian( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
tipText += value.setNum( median, 'f', 1 ) + cellEnd;
|
||||
tipText += value.setNum( median, 'f', 0 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Entropy:" ) + cellMid;
|
||||
double entropy = frame->getEntropy( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
tipText += value.setNum( entropy, 'f', 2 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Percent:" ) + cellMid;
|
||||
double percentile = ( pixels > 0 ? ( 100.0 * counts / pixels ) : 0.0 );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -26,13 +26,13 @@
|
||||
#ifndef __HISTOGRAMWIDGET_H__
|
||||
#define __HISTOGRAMWIDGET_H__
|
||||
|
||||
#include <QColor>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QWidget>
|
||||
|
||||
class QEvent;
|
||||
|
||||
class HistogramWorker;
|
||||
|
||||
+94
-102
@@ -1,147 +1,139 @@
|
||||
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
|
||||
# * Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
|
||||
#
|
||||
# Once done this will define
|
||||
# FFMPEG_FOUND - System has the all required components.
|
||||
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
|
||||
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
|
||||
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
|
||||
# Once done this will define FFMPEG_FOUND - System has the all required components. FFMPEG_INCLUDE_DIRS - Include directory necessary for
|
||||
# using the required components headers. FFMPEG_LIBRARIES - Link these to use the required ffmpeg components. FFMPEG_DEFINITIONS - Compiler
|
||||
# switches required for using the required ffmpeg components.
|
||||
#
|
||||
# For each of the components it will additionally set.
|
||||
# - AVCODEC
|
||||
# - AVDEVICE
|
||||
# - AVFORMAT
|
||||
# - AVUTIL
|
||||
# - POSTPROCESS
|
||||
# - SWSCALE
|
||||
# the following variables will be defined
|
||||
# <component>_FOUND - System has <component>
|
||||
# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
|
||||
# <component>_LIBRARIES - Link these to use <component>
|
||||
# <component>_DEFINITIONS - Compiler switches required for using <component>
|
||||
# <component>_VERSION - The components version
|
||||
# For each of the components it will additionally set. - AVCODEC - AVDEVICE - AVFORMAT - AVUTIL - POSTPROCESS - SWSCALE the following variables will
|
||||
# be defined <component>_FOUND - System has <component> <component>_INCLUDE_DIRS - Include directory necessary for using the <component>
|
||||
# headers <component>_LIBRARIES - Link these to use <component> <component>_DEFINITIONS - Compiler switches required for using <component>
|
||||
# <component>_VERSION - The components version
|
||||
#
|
||||
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
|
||||
# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
|
||||
# Copyright (c) 2011, Michael Jansen, <kde@michael-jansen.biz>
|
||||
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org> Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org> Copyright (c) 2011, Michael Jansen,
|
||||
# <kde@michael-jansen.biz>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license. For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
# The default components were taken from a survey over other FindFFMPEG.cmake files
|
||||
if (NOT FFmpeg_FIND_COMPONENTS)
|
||||
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
|
||||
endif ()
|
||||
IF(NOT FFmpeg_FIND_COMPONENTS)
|
||||
SET(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
|
||||
ENDIF()
|
||||
|
||||
#
|
||||
### Macro: set_component_found
|
||||
# Macro: set_component_found
|
||||
#
|
||||
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
|
||||
#
|
||||
macro(set_component_found _component )
|
||||
if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
|
||||
MACRO(set_component_found _component)
|
||||
IF(${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
|
||||
# message(STATUS " - ${_component} found.")
|
||||
set(${_component}_FOUND TRUE)
|
||||
else ()
|
||||
SET(${_component}_FOUND TRUE)
|
||||
ELSE()
|
||||
# message(STATUS " - ${_component} not found.")
|
||||
endif ()
|
||||
endmacro()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
#
|
||||
### Macro: find_component
|
||||
# Macro: find_component
|
||||
#
|
||||
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
|
||||
# include directories.
|
||||
# Checks for the given component by invoking pkgconfig and then looking up the libraries and include directories.
|
||||
#
|
||||
macro(find_component _component _pkgconfig _library _header)
|
||||
MACRO(find_component _component _pkgconfig _library _header)
|
||||
|
||||
if (NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_${_component} ${_pkgconfig})
|
||||
endif ()
|
||||
endif (NOT WIN32)
|
||||
IF(NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(PC_${_component} ${_pkgconfig})
|
||||
ENDIF()
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
find_path(${_component}_INCLUDE_DIRS ${_header}
|
||||
HINTS
|
||||
${PC_LIB${_component}_INCLUDEDIR}
|
||||
${PC_LIB${_component}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
ffmpeg
|
||||
FIND_PATH(
|
||||
${_component}_INCLUDE_DIRS ${_header}
|
||||
HINTS ${PC_LIB${_component}_INCLUDEDIR} ${PC_LIB${_component}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ffmpeg
|
||||
)
|
||||
|
||||
find_library(${_component}_LIBRARIES NAMES ${_library}
|
||||
HINTS
|
||||
${PC_LIB${_component}_LIBDIR}
|
||||
${PC_LIB${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
|
||||
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
|
||||
|
||||
set_component_found(${_component})
|
||||
|
||||
mark_as_advanced(
|
||||
${_component}_INCLUDE_DIRS
|
||||
FIND_LIBRARY(
|
||||
${_component}_LIBRARIES
|
||||
${_component}_DEFINITIONS
|
||||
${_component}_VERSION)
|
||||
NAMES ${_library}
|
||||
HINTS ${PC_LIB${_component}_LIBDIR} ${PC_LIB${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
endmacro()
|
||||
SET(${_component}_DEFINITIONS
|
||||
${PC_${_component}_CFLAGS_OTHER}
|
||||
CACHE STRING "The ${_component} CFLAGS."
|
||||
)
|
||||
SET(${_component}_VERSION
|
||||
${PC_${_component}_VERSION}
|
||||
CACHE STRING "The ${_component} version number."
|
||||
)
|
||||
|
||||
SET_COMPONENT_FOUND(${_component})
|
||||
|
||||
MARK_AS_ADVANCED(${_component}_INCLUDE_DIRS ${_component}_LIBRARIES ${_component}_DEFINITIONS ${_component}_VERSION)
|
||||
|
||||
ENDMACRO()
|
||||
|
||||
# Check for cached results. If there are skip the costly part.
|
||||
if (NOT FFMPEG_LIBRARIES)
|
||||
IF(NOT FFMPEG_LIBRARIES)
|
||||
|
||||
# Check for all possible component.
|
||||
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
|
||||
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
|
||||
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
|
||||
find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
|
||||
FIND_COMPONENT(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||
FIND_COMPONENT(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||
FIND_COMPONENT(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
|
||||
FIND_COMPONENT(AVUTIL libavutil avutil libavutil/avutil.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)
|
||||
|
||||
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
|
||||
foreach (_component ${FFmpeg_FIND_COMPONENTS})
|
||||
if (${_component}_FOUND)
|
||||
FOREACH(_component ${FFmpeg_FIND_COMPONENTS})
|
||||
IF(${_component}_FOUND)
|
||||
# message(STATUS "Required component ${_component} present.")
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
|
||||
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
|
||||
else ()
|
||||
SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
|
||||
SET(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
|
||||
LIST(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
|
||||
ELSE()
|
||||
# message(STATUS "Required component ${_component} missing.")
|
||||
endif ()
|
||||
endforeach ()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
# Build the include path with duplicates removed.
|
||||
if (FFMPEG_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
endif ()
|
||||
IF(FFMPEG_INCLUDE_DIRS)
|
||||
LIST(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
ENDIF()
|
||||
|
||||
# cache the vars.
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
|
||||
SET(FFMPEG_INCLUDE_DIRS
|
||||
${FFMPEG_INCLUDE_DIRS}
|
||||
CACHE STRING "The FFmpeg include directories." FORCE
|
||||
)
|
||||
SET(FFMPEG_LIBRARIES
|
||||
${FFMPEG_LIBRARIES}
|
||||
CACHE STRING "The FFmpeg libraries." FORCE
|
||||
)
|
||||
SET(FFMPEG_DEFINITIONS
|
||||
${FFMPEG_DEFINITIONS}
|
||||
CACHE STRING "The FFmpeg cflags." FORCE
|
||||
)
|
||||
|
||||
mark_as_advanced(FFMPEG_INCLUDE_DIRS
|
||||
FFMPEG_LIBRARIES
|
||||
FFMPEG_DEFINITIONS)
|
||||
MARK_AS_ADVANCED(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS)
|
||||
|
||||
endif ()
|
||||
ENDIF()
|
||||
|
||||
# Now set the noncached _FOUND vars for the components.
|
||||
foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
|
||||
set_component_found(${_component})
|
||||
endforeach ()
|
||||
FOREACH(_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
|
||||
SET_COMPONENT_FOUND(${_component})
|
||||
ENDFOREACH()
|
||||
|
||||
# Compile the list of required vars
|
||||
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
|
||||
foreach (_component ${FFmpeg_FIND_COMPONENTS})
|
||||
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
|
||||
endforeach ()
|
||||
SET(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
|
||||
FOREACH(_component ${FFmpeg_FIND_COMPONENTS})
|
||||
LIST(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
|
||||
ENDFOREACH()
|
||||
|
||||
# Give a nice error message if some of the required vars are missing.
|
||||
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
|
||||
+51
-50
@@ -1,67 +1,68 @@
|
||||
|
||||
MACRO(ADD_EXTRA_MODULES dir)
|
||||
SET( MODULE_LOCATION "${dir}/" )
|
||||
ADD_SUBDIRECTORY( ${dir} ${CMAKE_CURRENT_BINARY_DIR}/extra-modules )
|
||||
INCLUDE_DIRECTORIES( ${dir} )
|
||||
SET( MODULE_LOCATION "${dir}/" PARENT_SCOPE )
|
||||
ENDMACRO()
|
||||
|
||||
MACRO(ADD_MODULE name file )
|
||||
# General function to add a module It receives the name of the module and the filename where it is defined. Used in modules/CMakeLists.txt
|
||||
MACRO(ADD_MODULE name file)
|
||||
SET(__modulename "Module${name}")
|
||||
OPTION(MODULE_${name} "Use module ${name}" ON )
|
||||
ADD_FEATURE_INFO(${name} MODULE_${name} "Module ${name}" )
|
||||
IF( MODULE_${name} )
|
||||
list(APPEND Calyp_Mod_SRCS ${MODULE_LOCATION}${file} )
|
||||
LIST(APPEND MODULES_LIST_NAME ${name} )
|
||||
LIST(APPEND MODULES_LIST_FILES ${file} )
|
||||
SET( Calyp_Mod_SRCS "${Calyp_Mod_SRCS}" PARENT_SCOPE )
|
||||
SET( MODULES_LIST_NAME "${MODULES_LIST_NAME}" PARENT_SCOPE )
|
||||
SET( MODULES_LIST_FILES "${MODULES_LIST_FILES}" PARENT_SCOPE )
|
||||
OPTION(MODULE_${name} "Use module ${name}" ON)
|
||||
ADD_FEATURE_INFO(${name} MODULE_${name} "Module ${name}")
|
||||
IF(MODULE_${name})
|
||||
LIST(APPEND Calyp_Mod_SRCS ${MODULE_LOCATION}${file}.cpp)
|
||||
LIST(APPEND MODULES_LIST_NAME ${name})
|
||||
LIST(APPEND MODULES_LIST_FILES ${file})
|
||||
SET(Calyp_Mod_SRCS
|
||||
"${Calyp_Mod_SRCS}"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
SET(MODULES_LIST_NAME
|
||||
"${MODULES_LIST_NAME}"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
SET(MODULES_LIST_FILES
|
||||
"${MODULES_LIST_FILES}"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
ENDIF()
|
||||
UNSET(__modulename)
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
MACRO(ADD_MODULE_USE_OPENCV name file )
|
||||
IF( USE_OPENCV )
|
||||
SET( ADD_MODULE_USE_OPENCV_VERSION "2.4" )
|
||||
CMAKE_PARSE_ARGUMENTS(ADD_MODULE_USE_OPENCV "" "VERSION" "MODULES" ${ARGN} )
|
||||
IF( NOT ( ${OpenCV_VERSION} VERSION_LESS ${ADD_MODULE_USE_OPENCV_VERSION} ) )
|
||||
SET( _HAS_MODULES TRUE )
|
||||
FOREACH(opencv_module IN LISTS ADD_MODULE_USE_OPENCV_MODULES )
|
||||
string(TOUPPER "${opencv_module}" opencv_moduleUP)
|
||||
FIND_PACKAGE( OpenCV QUIET COMPONENTS ${opencv_module} )
|
||||
IF( NOT ${OPENCV_${opencv_moduleUP}_FOUND} EQUAL "1" )
|
||||
SET( _HAS_MODULES FALSE )
|
||||
# General function to add a module It receives the name of the module and the filename where it is defined. Moreover it receives a VERSION and MODULES
|
||||
# (OpenCV modules required) Used in modules/CMakeLists.txt
|
||||
MACRO(ADD_MODULE_USE_OPENCV name file)
|
||||
IF(USE_OPENCV)
|
||||
SET(ADD_MODULE_USE_OPENCV_VERSION "2.4")
|
||||
CMAKE_PARSE_ARGUMENTS(ADD_MODULE_USE_OPENCV "" "VERSION" "MODULES" ${ARGN})
|
||||
IF(NOT (${OpenCV_VERSION} VERSION_LESS ${ADD_MODULE_USE_OPENCV_VERSION}))
|
||||
SET(_HAS_MODULES TRUE)
|
||||
FOREACH(opencv_module IN LISTS ADD_MODULE_USE_OPENCV_MODULES)
|
||||
STRING(TOUPPER "${opencv_module}" opencv_moduleUP)
|
||||
FIND_PACKAGE(OpenCV QUIET COMPONENTS ${opencv_module})
|
||||
IF(NOT ${OPENCV_${opencv_moduleUP}_FOUND} EQUAL "1")
|
||||
SET(_HAS_MODULES FALSE)
|
||||
ELSE()
|
||||
LIST(APPEND OPENCV_MODULES ${opencv_module} )
|
||||
LIST(APPEND OPENCV_MODULES ${opencv_module})
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
IF( _HAS_MODULES )
|
||||
ADD_MODULE( ${name} ${file} )
|
||||
IF(_HAS_MODULES)
|
||||
ADD_MODULE(${name} ${file})
|
||||
ENDIF()
|
||||
UNSET( OPENCV_${opencv_moduleUP}_FOUND )
|
||||
UNSET( _HAS_MODULES )
|
||||
UNSET(OPENCV_${opencv_moduleUP}_FOUND)
|
||||
UNSET(_HAS_MODULES)
|
||||
ENDIF()
|
||||
UNSET( ADD_MODULE_USE_OPENCV_VERSION )
|
||||
UNSET(ADD_MODULE_USE_OPENCV_VERSION)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
#
|
||||
# Create header
|
||||
#
|
||||
MACRO(CREATE_MODULE_MACROS )
|
||||
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "// This files add the header files of each module\n"
|
||||
"#ifndef __MODULESLISTHEADER_H__\n#define __MODULESLISTHEADER_H__\n" )
|
||||
foreach(module ${MODULES_LIST_FILES})
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${module}.h\"\n")
|
||||
endforeach(module ${MODULES_LIST_FILES})
|
||||
MACRO(CREATE_MODULE_MACROS)
|
||||
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "// This files add the header files of each module\n"
|
||||
"#ifndef __MODULESLISTHEADER_H__\n#define __MODULESLISTHEADER_H__\n"
|
||||
)
|
||||
FOREACH(module ${MODULES_LIST_FILES})
|
||||
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${module}.h\"\n")
|
||||
ENDFOREACH(module ${MODULES_LIST_FILES})
|
||||
|
||||
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#define REGISTER_ALL_MODULES \\\n" )
|
||||
foreach(module ${MODULES_LIST_NAME})
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "Register( \"${module}\", &(${module}::Create) ); \\\n")
|
||||
endforeach(module ${MODULES_LIST_NAME})
|
||||
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#define REGISTER_ALL_MODULES \\\n")
|
||||
FOREACH(module ${MODULES_LIST_NAME})
|
||||
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "Register( \"${module}\", &(${module}::Create) ); \\\n")
|
||||
ENDFOREACH(module ${MODULES_LIST_NAME})
|
||||
|
||||
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "\n#endif // __MODULESLISTHEADER_H__\n" )
|
||||
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "\n#endif // __MODULESLISTHEADER_H__\n")
|
||||
ENDMACRO()
|
||||
+67
-49
@@ -1,63 +1,81 @@
|
||||
#####################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# DLLs and Win32 specific code
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
|
||||
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
|
||||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "." )
|
||||
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "." )
|
||||
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "." )
|
||||
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
|
||||
FOREACH(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
STRING(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ".")
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ".")
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ".")
|
||||
ENDFOREACH(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
|
||||
|
||||
SET(MSVC_DLL_DIR "MSVC_DLL_DIR" CACHE PATH "Where to find MSVC dlls")
|
||||
#INSTALL(FILES ${MSVC_DLL_DIR}/msvcr120.dll DESTINATION bin )
|
||||
#INSTALL(FILES ${MSVC_DLL_DIR}/msvcp120.dll DESTINATION bin )
|
||||
SET(MSVC_DLL_DIR
|
||||
"MSVC_DLL_DIR"
|
||||
CACHE PATH "Where to find MSVC dlls"
|
||||
)
|
||||
# INSTALL(FILES ${MSVC_DLL_DIR}/msvcr120.dll DESTINATION bin ) INSTALL(FILES ${MSVC_DLL_DIR}/msvcp120.dll DESTINATION bin )
|
||||
|
||||
SET(QT_DIR "QT-Dir" CACHE PATH "Where to find QT Lib on Windows")
|
||||
SET(QT_ICU_VERSION "" CACHE STRING "Qt ICU version of dll's" )
|
||||
SET(QT_DLL_POSTFIX "" CACHE STRING "Postfix to dll's name for debug" )
|
||||
SET(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} ${QT_DIR}" )
|
||||
SET(QT_DIR
|
||||
"QT-Dir"
|
||||
CACHE PATH "Where to find QT Lib on Windows"
|
||||
)
|
||||
SET(QT_ICU_VERSION
|
||||
""
|
||||
CACHE STRING "Qt ICU version of dll's"
|
||||
)
|
||||
SET(QT_DLL_POSTFIX
|
||||
""
|
||||
CACHE STRING "Postfix to dll's name for debug"
|
||||
)
|
||||
SET(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} ${QT_DIR}")
|
||||
|
||||
SET(WINDLLIB "Dl-location" CACHE PATH "Where to find DL Lib on Windows")
|
||||
SET(WINDLLIB
|
||||
"Dl-location"
|
||||
CACHE PATH "Where to find DL Lib on Windows"
|
||||
)
|
||||
|
||||
IF(NOT USE_QT4)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Core${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Gui${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Widgets${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5PrintSupport${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qwindows${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms)
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qminimal${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms)
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qoffscreen${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms)
|
||||
|
||||
IF( NOT USE_QT4 )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Core${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Gui${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Widgets${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5PrintSupport${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qwindows${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms )
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qminimal${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms )
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qoffscreen${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms )
|
||||
|
||||
IF( USE_FERVOR )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Network${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5WebKit${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5WebKitWidgets${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Quick${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Qml${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Multimedia${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Sql${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Positioning${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Sensors${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5MultimediaWidgets${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5OpenGL${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
IF(USE_FERVOR)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Network${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5WebKit${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5WebKitWidgets${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Quick${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Qml${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Multimedia${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Sql${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Positioning${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Sensors${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5MultimediaWidgets${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5OpenGL${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF( USE_OPENCV )
|
||||
SET(OpenCV_DLL_DIR "${OpenCV_DIR}/bin" CACHE PATH "Where to find OpenCV dlls")
|
||||
SET(OpenCV_INSTALL_MODULES ${OPENCV_MODULES} CACHE STRING "List of OpenCV modules")
|
||||
FOREACH(opencv_module IN LISTS OpenCV_INSTALL_MODULES )
|
||||
INSTALL(FILES ${OpenCV_DLL_DIR}/opencv_${opencv_module}${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll DESTINATION bin )
|
||||
IF(USE_OPENCV)
|
||||
SET(OpenCV_DLL_DIR
|
||||
"${OpenCV_DIR}/bin"
|
||||
CACHE PATH "Where to find OpenCV dlls"
|
||||
)
|
||||
SET(OpenCV_INSTALL_MODULES
|
||||
${OPENCV_MODULES}
|
||||
CACHE STRING "List of OpenCV modules"
|
||||
)
|
||||
FOREACH(opencv_module IN LISTS OpenCV_INSTALL_MODULES)
|
||||
INSTALL(FILES ${OpenCV_DLL_DIR}/opencv_${opencv_module}${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll DESTINATION bin)
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
IF( USE_FFMPEG )
|
||||
SET(FFMPEG_DIR "FFmpeg-Dir" CACHE PATH "Where to find FFmpeg Lib on Windows")
|
||||
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 )
|
||||
IF(USE_FFMPEG)
|
||||
SET(FFMPEG_DIR
|
||||
"FFmpeg-Dir"
|
||||
CACHE PATH "Where to find FFmpeg Lib on Windows"
|
||||
)
|
||||
INSTALL(DIRECTORY ${FFMPEG_DIR}/bin/ DESTINATION bin)
|
||||
ENDIF()
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -26,10 +26,10 @@
|
||||
#define __CONFIG_CALYP_H__
|
||||
|
||||
/* Version definition */
|
||||
#define CALYP_VERSION_MAJOR @CALYP_VERSION_MAJOR@
|
||||
#define CALYP_VERSION_MINOR @CALYP_VERSION_MINOR@
|
||||
#define CALYP_VERSION_PATCH @CALYP_VERSION_PATCH@
|
||||
#define CALYP_VERSION @CALYP_VERSION@
|
||||
#define CALYP_VERSION_MAJOR @CALYP_VERSION_MAJOR @
|
||||
#define CALYP_VERSION_MINOR @CALYP_VERSION_MINOR @
|
||||
#define CALYP_VERSION_PATCH @CALYP_VERSION_PATCH @
|
||||
#define CALYP_VERSION @CALYP_VERSION @
|
||||
#define CALYP_VERSION_STRING "@CALYP_VERSION_STRING@"
|
||||
|
||||
#define UPDATE_CHANNEL "@UPDATE_CHANNEL@"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
###
|
||||
### CMakeLists for examples
|
||||
###
|
||||
|
||||
|
||||
ADD_SUBDIRECTORY( modules )
|
||||
#
|
||||
# CMakeLists for examples
|
||||
#
|
||||
|
||||
ADD_SUBDIRECTORY(modules)
|
||||
ADD_SUBDIRECTORY(stream)
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "AbsoluteFrameDifferenceExample.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
REGISTER_CLASS_MAKER( AbsoluteFrameDifferenceExample )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,10 +25,10 @@
|
||||
#ifndef __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
#define __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
|
||||
#include "CalypModuleIf.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "CalypModuleIf.h"
|
||||
|
||||
class AbsoluteFrameDifferenceExample : public CalypModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( AbsoluteFrameDifferenceExample )
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
###
|
||||
### CMakeLists for modules_example
|
||||
###
|
||||
#
|
||||
# CMakeLists for modules_example
|
||||
#
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.9 )
|
||||
PROJECT("modules_example")
|
||||
|
||||
PROJECT( "modules_example" )
|
||||
|
||||
# THIS
|
||||
# FIND_PACKAGE( Calyp )
|
||||
#INCLUDE_DIRECTORIES( ${CALYP_INCLUDE_DIRS} )
|
||||
# OR
|
||||
INCLUDE_DIRECTORIES( ../../lib )
|
||||
# THIS FIND_PACKAGE( Calyp ) INCLUDE_DIRECTORIES( ${CALYP_INCLUDE_DIRS} ) OR
|
||||
INCLUDE_DIRECTORIES(../../lib)
|
||||
|
||||
ADD_LIBRARY(FrameBinarization SHARED FrameBinarization_APIv1.cpp)
|
||||
TARGET_LINK_LIBRARIES( FrameBinarization ${CALYP_LINKER_LIBS} )
|
||||
TARGET_LINK_LIBRARIES(FrameBinarization ${PROJECT_LIBRARY})
|
||||
|
||||
ADD_LIBRARY(AbsoluteFrameDifferenceExample SHARED AbsoluteFrameDifferenceExample.cpp)
|
||||
TARGET_LINK_LIBRARIES( AbsoluteFrameDifferenceExample ${PROJECT_LIBRARY} ${CALYP_LINKER_LIBS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES(AbsoluteFrameDifferenceExample ${PROJECT_LIBRARY})
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# CMakeLists for modules_example
|
||||
#
|
||||
INCLUDE_DIRECTORIES(../../lib)
|
||||
|
||||
ADD_DEFINITIONS(-DCALYP_TEST_DATA_DIR=\"${CALYP_TEST_DATA_DIR}\")
|
||||
|
||||
ADD_EXECUTABLE(testStreamReading testStreamReading.cpp)
|
||||
TARGET_LINK_LIBRARIES(testStreamReading ${PROJECT_LIBRARY})
|
||||
@@ -0,0 +1,69 @@
|
||||
/* This file is a part of Calyp 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 testStreamReading.cpp
|
||||
* \brief Example of open and reading from a stream
|
||||
*/
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
||||
#include "CalypFrame.h"
|
||||
#include "CalypStream.h"
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
// Use auto keyword to avoid typing long
|
||||
// type definitions to get the timepoint
|
||||
// at this instant use function now()
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
double n = 0;
|
||||
CalypStream stream;
|
||||
//stream.open( ClpString( CALYP_TEST_DATA_DIR ) + ClpString( "/Kendo_c4_1024x768_yuv420p.yuv" ), 1024, 768, 0, 8, CLP_BIG_ENDIAN, 1, true );
|
||||
stream.open( ClpString( CALYP_TEST_DATA_DIR ) + ClpString( "/SteamLocomotiveTrain_2560x1600_60_10bit_crop.yuv" ), 2560, 1600, 0, 10, CLP_LITTLE_ENDIAN, 1, true );
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
CalypFrame* frame = stream.getCurrFrame();
|
||||
frame->fillRGBBuffer();
|
||||
n++;
|
||||
if( stream.setNextFrame() )
|
||||
break;
|
||||
stream.readNextFrame();
|
||||
}
|
||||
|
||||
// After function call
|
||||
auto stop = std::chrono::high_resolution_clock::now();
|
||||
|
||||
// Subtract stop and start timepoints and
|
||||
// cast it to required unit. Predefined units
|
||||
// are nanoseconds, microseconds, milliseconds,
|
||||
// seconds, minutes, hours. Use duration_cast()
|
||||
// function.
|
||||
auto duration = std::chrono::duration_cast<std::chrono::microseconds>( stop - start );
|
||||
|
||||
// To get the value of duration use the count()
|
||||
// member function on the duration object
|
||||
std::cout << duration.count() / 1000.0 / n << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
+58
-71
@@ -1,22 +1,14 @@
|
||||
###
|
||||
### CMakeLists for calyp lib component
|
||||
###
|
||||
#
|
||||
# CMakeLists for calyp lib component
|
||||
#
|
||||
|
||||
INCLUDE(GNUInstallDirs)
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(Calyp_Lib_SRCS
|
||||
LibMemory.h
|
||||
CalypLib.h
|
||||
CalypDefs.h
|
||||
# Frame
|
||||
CalypFrame.h
|
||||
CalypFrame.cpp
|
||||
CalypPixel.cpp
|
||||
PixelFormats.h
|
||||
PixelFormats.cpp
|
||||
# Stream
|
||||
SET(Calyp_Lib_Frame_SRCS CalypPixel.cpp PixelFormats.h PixelFormats.cpp CalypFrame.h CalypFrame.cpp)
|
||||
|
||||
SET(Calyp_Lib_Stream_SRCS
|
||||
CalypStream.h
|
||||
CalypStream.cpp
|
||||
CalypStreamHandlerIf.h
|
||||
@@ -24,81 +16,76 @@ set(Calyp_Lib_SRCS
|
||||
StreamHandlerRaw.cpp
|
||||
StreamHandlerPortableMap.h
|
||||
StreamHandlerPortableMap.cpp
|
||||
# Options Parser
|
||||
CalypOptions.h
|
||||
CalypOptions.cpp
|
||||
# Modules
|
||||
CalypModuleIf.h
|
||||
CalypOpenCVModuleIf.h
|
||||
)
|
||||
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${PROJECT_LIBRARY} )
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR} )
|
||||
SET(Calyp_Lib_OptionParser_SRCS CalypOptions.h CalypOptions.cpp)
|
||||
|
||||
IF( USE_FFMPEG )
|
||||
LIST( APPEND Calyp_Lib_SRCS StreamHandlerLibav.h )
|
||||
LIST( APPEND Calyp_Lib_SRCS StreamHandlerLibav.cpp )
|
||||
SET(Calyp_Lib_Modules_SRCS CalypOptions.h CalypOptions.cpp)
|
||||
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${FFMPEG_LIBRARIES} )
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} )
|
||||
ENDIF()
|
||||
|
||||
IF( USE_OPENCV )
|
||||
LIST( APPEND Calyp_Lib_SRCS StreamHandlerOpenCV.h )
|
||||
LIST( APPEND Calyp_Lib_SRCS StreamHandlerOpenCV.cpp )
|
||||
|
||||
LIST( APPEND Calyp_Lib_SRCS CalypOpenCVModuleIf.cpp )
|
||||
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${OpenCV_LIBRARIES} )
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${OpenCV_INCLUDE_DIRS} )
|
||||
ENDIF()
|
||||
|
||||
set(Calyp_Lib_HEADERS
|
||||
SET(Calyp_Lib_SRCS
|
||||
LibMemory.h
|
||||
CalypLib.h
|
||||
CalypDefs.h
|
||||
CalypFrame.h
|
||||
CalypStream.h
|
||||
CalypOptions.h
|
||||
CalypModuleIf.h
|
||||
CalypOpenCVModuleIf.h
|
||||
${Calyp_Lib_Frame_SRCS}
|
||||
${Calyp_Lib_Stream_SRCS}
|
||||
${Calyp_Lib_OptionParser_SRCS}
|
||||
${Calyp_Lib_Modules_SRCS}
|
||||
)
|
||||
|
||||
CONFIGURE_FILE( CalypConfig.cmake.in CalypConfig.cmake @ONLY)
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${PROJECT_LIBRARY})
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} )
|
||||
IF(USE_FFMPEG)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerLibav.h)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerLibav.cpp)
|
||||
|
||||
IF( USE_STATIC )
|
||||
ADD_LIBRARY( ${PROJECT_LIBRARY} STATIC ${Calyp_Lib_SRCS} )
|
||||
ELSE()
|
||||
ADD_LIBRARY( ${PROJECT_LIBRARY} SHARED ${Calyp_Lib_SRCS} )
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${FFMPEG_LIBRARIES})
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
|
||||
IF(USE_OPENCV)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerOpenCV.h)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerOpenCV.cpp)
|
||||
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_LIBRARY}
|
||||
${FFMPEG_LIBRARIES}
|
||||
${OpenCV_LIBRARIES}
|
||||
)
|
||||
LIST(APPEND Calyp_Lib_SRCS CalypOpenCVModuleIf.cpp)
|
||||
|
||||
TARGET_INCLUDE_DIRECTORIES(${PROJECT_LIBRARY}
|
||||
PUBLIC
|
||||
$<INSTALL_INTERFACE:include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
|
||||
)
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${OpenCV_LIBRARIES})
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${OpenCV_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
|
||||
SET_TARGET_PROPERTIES( ${PROJECT_LIBRARY}
|
||||
PROPERTIES VERSION ${CALYP_VERSION}
|
||||
SOVERSION ${CALYP_VERSION_MAJOR}
|
||||
)
|
||||
SET(Calyp_Lib_HEADERS CalypDefs.h CalypFrame.h CalypStream.h CalypOptions.h CalypModuleIf.h CalypOpenCVModuleIf.h)
|
||||
|
||||
IF( NOT USE_STATIC )
|
||||
INSTALL( TARGETS ${PROJECT_LIBRARY}
|
||||
CONFIGURE_FILE(CalypConfig.cmake.in CalypConfig.cmake @ONLY)
|
||||
|
||||
INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
|
||||
|
||||
IF(USE_STATIC)
|
||||
ADD_LIBRARY(${PROJECT_LIBRARY} STATIC ${Calyp_Lib_SRCS})
|
||||
ELSE()
|
||||
ADD_LIBRARY(${PROJECT_LIBRARY} SHARED ${Calyp_Lib_SRCS})
|
||||
ENDIF()
|
||||
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_LIBRARY} ${FFMPEG_LIBRARIES} ${OpenCV_LIBRARIES})
|
||||
|
||||
TARGET_INCLUDE_DIRECTORIES(${PROJECT_LIBRARY} PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
||||
|
||||
SET_TARGET_PROPERTIES(${PROJECT_LIBRARY} PROPERTIES VERSION ${CALYP_VERSION} SOVERSION ${CALYP_VERSION_MAJOR})
|
||||
|
||||
IF(NOT USE_STATIC)
|
||||
INSTALL(
|
||||
TARGETS ${PROJECT_LIBRARY}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
INSTALL(FILES ${Calyp_Lib_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" )
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CalypConfig.cmake DESTINATION share/calyp )
|
||||
INSTALL(FILES ${Calyp_Lib_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CalypConfig.cmake DESTINATION share/calyp)
|
||||
ENDIF()
|
||||
|
||||
IF( BUILD_TESTS )
|
||||
ADD_SUBDIRECTORY( tests )
|
||||
IF(BUILD_TESTS)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ENDIF()
|
||||
|
||||
IF(BUILD_TESTS_CATCH2)
|
||||
ADD_SUBDIRECTORY(catch2)
|
||||
ENDIF()
|
||||
+7
-9
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -26,16 +26,14 @@
|
||||
#ifndef __CALYPDEFS_H__
|
||||
#define __CALYPDEFS_H__
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
typedef unsigned short ClpPel; ///< 16-bit pixel type
|
||||
typedef unsigned char ClpByte;
|
||||
typedef unsigned long long ClpULong;
|
||||
|
||||
typedef std::string ClpString;
|
||||
using ClpByte = std::uint8_t;
|
||||
using ClpPel = std::uint16_t;
|
||||
using ClpULong = std::uint64_t;
|
||||
using ClpString = std::string;
|
||||
|
||||
enum CLP_LOG_LEVEL
|
||||
{
|
||||
|
||||
+191
-84
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -24,13 +24,17 @@
|
||||
|
||||
#include "CalypFrame.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include "LibMemory.h"
|
||||
#include "PixelFormats.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#ifdef USE_OPENCV
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
@@ -88,7 +92,7 @@ int CalypFrame::pelformatColorSpace( const int idx )
|
||||
return g_CalypPixFmtDescriptorsMap.at( idx ).colorSpace;
|
||||
}
|
||||
|
||||
struct CalypFramePrivate
|
||||
class CalypFrame::CalypFramePrivate
|
||||
{
|
||||
public:
|
||||
bool m_bInit;
|
||||
@@ -102,45 +106,47 @@ public:
|
||||
int m_iPixelFormat; //!< Pixel format number (it follows the list of supported pixel formats)
|
||||
unsigned int m_uiBitsPel; //!< Bits per pixel/channel
|
||||
unsigned int m_uiHalfPelValue; //!< Bits per pixel/channel
|
||||
bool m_bHasNegativeValues; //!< Half of the scale correspond to negative values
|
||||
|
||||
ClpPel*** m_pppcInputPel;
|
||||
|
||||
bool m_bHasRGBPel; //!< Flag indicating that the ARGB buffer was computed
|
||||
unsigned char* m_pcARGB32; //!< Buffer with the ARGB pixels used in Qt libs
|
||||
bool m_bHasRGBPel; //!< Flag indicating that the ARGB buffer was computed
|
||||
std::vector<std::uint8_t> m_pcARGB32; //!< Buffer with the ARGB pixels used in Qt libs
|
||||
|
||||
/** Histogram control variables **/
|
||||
bool m_bHasHistogram;
|
||||
bool m_bHistogramRunning;
|
||||
/** The histogram data.*/
|
||||
unsigned int* m_puiHistogram;
|
||||
std::vector<unsigned int> m_puiHistogram;
|
||||
/** If the image is RGB and calcLuma is true, we have 1 more channel */
|
||||
unsigned int m_uiHistoChannels;
|
||||
/** Numbers of histogram segments depending of image bytes depth*/
|
||||
unsigned int m_uiHistoSegments;
|
||||
|
||||
/**
|
||||
* Common constructor function of a frame
|
||||
*
|
||||
* @param width width of the frame
|
||||
* @param height height of the frame
|
||||
* @param pel_format pixel format index (always use PixelFormats enum)
|
||||
*
|
||||
*/
|
||||
void init( unsigned int width, unsigned int height, int pel_format, unsigned bitsPixel )
|
||||
CalypFramePrivate()
|
||||
{
|
||||
m_bInit = false;
|
||||
m_bHasRGBPel = false;
|
||||
m_pppcInputPel = NULL;
|
||||
m_pcARGB32 = NULL;
|
||||
m_pppcInputPel = nullptr;
|
||||
}
|
||||
|
||||
void init( unsigned int width, unsigned int height, int pel_format, unsigned bitsPixel )
|
||||
{
|
||||
init( width, height, pel_format, bitsPixel, false );
|
||||
}
|
||||
|
||||
void init( unsigned int width, unsigned int height, int pel_format, unsigned bitsPixel, bool has_negative_values )
|
||||
{
|
||||
m_uiWidth = width;
|
||||
m_uiHeight = height;
|
||||
m_iPixelFormat = pel_format;
|
||||
m_uiBitsPel = bitsPixel < 8 ? 8 : bitsPixel;
|
||||
m_uiHalfPelValue = 1 << ( m_uiBitsPel - 1 );
|
||||
m_bHasNegativeValues = has_negative_values;
|
||||
|
||||
if( m_uiWidth == 0 || m_uiHeight == 0 || m_iPixelFormat == -1 || bitsPixel > 16 )
|
||||
{
|
||||
throw CalypFailure( "CalypFrame", "Cannot create a PlYUVerFrame of this type" );
|
||||
throw CalypFailure( "CalypFrame", "Cannot create a CalypFrame of this type" );
|
||||
}
|
||||
|
||||
m_pcPelFormat = &( g_CalypPixFmtDescriptorsMap.at( pel_format ) );
|
||||
@@ -177,9 +183,8 @@ public:
|
||||
}
|
||||
|
||||
/* Alloc ARGB memory */
|
||||
getMem1D( &m_pcARGB32, m_uiHeight * m_uiWidth * 4 );
|
||||
m_pcARGB32.resize( m_uiHeight * m_uiWidth * 4 );
|
||||
|
||||
m_puiHistogram = NULL;
|
||||
m_bHasHistogram = false;
|
||||
m_bHistogramRunning = false;
|
||||
|
||||
@@ -191,7 +196,7 @@ public:
|
||||
else
|
||||
m_uiHistoChannels = m_pcPelFormat->numberChannels;
|
||||
|
||||
getMem1D<unsigned int>( &( m_puiHistogram ), m_uiHistoSegments * m_uiHistoChannels );
|
||||
m_puiHistogram.resize( m_uiHistoSegments * m_uiHistoChannels );
|
||||
|
||||
m_cPelFmtName = CalypFrame::supportedPixelFormatListNames()[m_iPixelFormat].c_str();
|
||||
|
||||
@@ -243,15 +248,10 @@ public:
|
||||
{
|
||||
while( m_bHistogramRunning )
|
||||
;
|
||||
if( m_puiHistogram )
|
||||
freeMem1D( m_puiHistogram );
|
||||
m_bHasHistogram = false;
|
||||
|
||||
if( m_pppcInputPel )
|
||||
xFreeMem( m_pppcInputPel );
|
||||
|
||||
if( m_pcARGB32 )
|
||||
freeMem1D( m_pcARGB32 );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -259,31 +259,73 @@ public:
|
||||
* \brief Constructors
|
||||
*/
|
||||
|
||||
CalypFrame::CalypFrame()
|
||||
: d{ std::make_unique<CalypFramePrivate>() }
|
||||
{
|
||||
}
|
||||
|
||||
CalypFrame::CalypFrame( unsigned int width, unsigned int height, int pelFormat, unsigned bitsPixel )
|
||||
: d( new CalypFramePrivate )
|
||||
: d{ std::make_unique<CalypFramePrivate>() }
|
||||
{
|
||||
d->init( width, height, pelFormat, bitsPixel );
|
||||
}
|
||||
|
||||
CalypFrame::CalypFrame( const CalypFrame& other )
|
||||
: d( new CalypFramePrivate )
|
||||
CalypFrame::CalypFrame( unsigned int width, unsigned int height, int pelFormat, unsigned bitsPixel, bool has_negative_values )
|
||||
: d{ std::make_unique<CalypFramePrivate>() }
|
||||
{
|
||||
d->init( other.getWidth(), other.getHeight(), other.getPelFormat(), other.getBitsPel() );
|
||||
d->init( width, height, pelFormat, bitsPixel, has_negative_values );
|
||||
}
|
||||
|
||||
CalypFrame::CalypFrame( CalypFrame&& other ) noexcept
|
||||
: d{ std::move( other.d ) }
|
||||
{
|
||||
}
|
||||
|
||||
CalypFrame& CalypFrame::operator=( CalypFrame&& other ) noexcept
|
||||
{
|
||||
// Self-assignment detection
|
||||
if( &other == this )
|
||||
return *this;
|
||||
|
||||
// Transfer ownership of a.m_ptr to m_ptr
|
||||
d = std::move( other.d );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
CalypFrame::CalypFrame( const CalypFrame& other )
|
||||
: d{ std::make_unique<CalypFramePrivate>() }
|
||||
{
|
||||
d->init( other.getWidth(), other.getHeight(), other.getPelFormat(), other.getBitsPel(), other.getHasNegativeValues() );
|
||||
copyFrom( &other );
|
||||
}
|
||||
|
||||
CalypFrame::CalypFrame( const CalypFrame* other )
|
||||
: d( new CalypFramePrivate )
|
||||
: d{ std::make_unique<CalypFramePrivate>() }
|
||||
{
|
||||
if( other )
|
||||
{
|
||||
d->init( other->getWidth(), other->getHeight(), other->getPelFormat(), other->getBitsPel() );
|
||||
d->init( other->getWidth(), other->getHeight(), other->getPelFormat(), other->getBitsPel(), other->getHasNegativeValues() );
|
||||
copyFrom( other );
|
||||
}
|
||||
}
|
||||
|
||||
CalypFrame& CalypFrame::operator=( const CalypFrame& other )
|
||||
{
|
||||
// Self-assignment detection
|
||||
if( &other == this )
|
||||
return *this;
|
||||
|
||||
// Copy the resource
|
||||
d = std::make_unique<CalypFramePrivate>();
|
||||
d->init( other.getWidth(), other.getHeight(), other.getPelFormat(), other.getBitsPel(), other.getHasNegativeValues() );
|
||||
copyFrom( &other );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
CalypFrame::CalypFrame( const CalypFrame& other, unsigned int x, unsigned int y, unsigned int width, unsigned int height )
|
||||
: d( new CalypFramePrivate )
|
||||
: d{ std::make_unique<CalypFramePrivate>() }
|
||||
{
|
||||
const CalypPixelFormatDescriptor* pcPelFormat = &( g_CalypPixFmtDescriptorsMap.at( other.getPelFormat() ) );
|
||||
if( pcPelFormat->log2ChromaWidth )
|
||||
@@ -308,7 +350,7 @@ CalypFrame::CalypFrame( const CalypFrame& other, unsigned int x, unsigned int y,
|
||||
}
|
||||
|
||||
CalypFrame::CalypFrame( const CalypFrame* other, unsigned int posX, unsigned int posY, unsigned int areaWidth, unsigned int areaHeight )
|
||||
: d( new CalypFramePrivate )
|
||||
: d{ std::make_unique<CalypFramePrivate>() }
|
||||
{
|
||||
if( !other )
|
||||
return;
|
||||
@@ -335,10 +377,7 @@ CalypFrame::CalypFrame( const CalypFrame* other, unsigned int posX, unsigned int
|
||||
copyFrom( other, posX, posY );
|
||||
}
|
||||
|
||||
CalypFrame::~CalypFrame()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
CalypFrame::~CalypFrame() = default;
|
||||
|
||||
bool CalypFrame::haveSameFmt( const CalypFrame& other, unsigned int match ) const
|
||||
{
|
||||
@@ -397,6 +436,11 @@ unsigned CalypFrame::getHeight( unsigned channel ) const
|
||||
return CHROMASHIFT( d->m_uiHeight, channel > 0 ? d->m_pcPelFormat->log2ChromaHeight : 0 );
|
||||
}
|
||||
|
||||
bool CalypFrame::getHasNegativeValues() const
|
||||
{
|
||||
return d->m_bHasNegativeValues;
|
||||
}
|
||||
|
||||
ClpULong CalypFrame::getPixels( unsigned channel ) const
|
||||
{
|
||||
return getWidth( channel ) * getHeight( channel );
|
||||
@@ -485,24 +529,29 @@ unsigned char* CalypFrame::getRGBBuffer() const
|
||||
{
|
||||
if( d->m_bHasRGBPel )
|
||||
{
|
||||
return d->m_pcARGB32;
|
||||
return d->m_pcARGB32.data();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ClpPel CalypFrame::operator()( unsigned int ch, unsigned int xPos, unsigned int yPos )
|
||||
ClpPel CalypFrame::operator()( unsigned int ch, unsigned int xPos, unsigned int yPos, bool absolute ) const
|
||||
{
|
||||
int retValue = 0;
|
||||
if( ch < d->m_pcPelFormat->numberChannels )
|
||||
return d->m_pppcInputPel[ch][yPos][xPos];
|
||||
return 0;
|
||||
{
|
||||
retValue = d->m_pppcInputPel[ch][yPos][xPos];
|
||||
if( !absolute && d->m_bHasNegativeValues )
|
||||
retValue = retValue - int( d->m_uiHalfPelValue );
|
||||
}
|
||||
return ClpPel( retValue );
|
||||
}
|
||||
|
||||
CalypPixel CalypFrame::operator()( unsigned int xPos, unsigned int yPos )
|
||||
CalypPixel CalypFrame::operator()( unsigned int xPos, unsigned int yPos ) const
|
||||
{
|
||||
return getPixel( xPos, yPos );
|
||||
}
|
||||
|
||||
CalypPixel CalypFrame::getPixel( unsigned int xPos, unsigned int yPos )
|
||||
CalypPixel CalypFrame::getPixel( unsigned int xPos, unsigned int yPos ) const
|
||||
{
|
||||
CalypPixel PixelValue( d->m_pcPelFormat->colorSpace );
|
||||
for( unsigned int ch = 0; ch < d->m_pcPelFormat->numberChannels; ch++ )
|
||||
@@ -599,7 +648,7 @@ void CalypFrame::copyTo( const CalypFrame* other, unsigned x, unsigned y )
|
||||
copyTo( *other, x, y );
|
||||
}
|
||||
|
||||
void CalypFrame::frameFromBuffer( ClpByte* Buff, int iEndianness, unsigned long uiBuffSize )
|
||||
void CalypFrame::frameFromBuffer( const std::vector<ClpByte>& Buff, int iEndianness, unsigned long uiBuffSize )
|
||||
{
|
||||
if( uiBuffSize != getBytesPerFrame() )
|
||||
return;
|
||||
@@ -607,19 +656,14 @@ void CalypFrame::frameFromBuffer( ClpByte* Buff, int iEndianness, unsigned long
|
||||
frameFromBuffer( Buff, iEndianness );
|
||||
}
|
||||
|
||||
void CalypFrame::frameFromBuffer( ClpByte* Buff, int iEndianness )
|
||||
void CalypFrame::frameFromBuffer( const std::vector<ClpByte>& Buff, int iEndianness )
|
||||
{
|
||||
ClpByte* ppBuff[MAX_NUMBER_PLANES];
|
||||
ClpByte* pTmpBuff;
|
||||
ClpPel* pPel;
|
||||
const ClpByte* ppBuff[MAX_NUMBER_PLANES];
|
||||
unsigned int bytesPixel = ( d->m_uiBitsPel - 1 ) / 8 + 1;
|
||||
int ratioH, ratioW, step;
|
||||
unsigned int i, ch;
|
||||
int startByte = 0;
|
||||
int endByte = bytesPixel;
|
||||
int incByte = 1;
|
||||
int b;
|
||||
int maxval = pow( 2, d->m_uiBitsPel ) - 1;
|
||||
int maxval = ( 1 << d->m_uiBitsPel ) - 1;
|
||||
|
||||
if( iEndianness == CLP_BIG_ENDIAN )
|
||||
{
|
||||
@@ -628,37 +672,36 @@ void CalypFrame::frameFromBuffer( ClpByte* Buff, int iEndianness )
|
||||
incByte = -1;
|
||||
}
|
||||
|
||||
ppBuff[0] = Buff;
|
||||
for( i = 1; i < MAX_NUMBER_PLANES; i++ )
|
||||
ppBuff[0] = Buff.data();
|
||||
for( unsigned i = 1; i < MAX_NUMBER_PLANES; i++ )
|
||||
{
|
||||
ratioW = i > 1 ? d->m_pcPelFormat->log2ChromaWidth : 0;
|
||||
ratioH = i > 1 ? d->m_pcPelFormat->log2ChromaHeight : 0;
|
||||
int ratioW = i > 1 ? d->m_pcPelFormat->log2ChromaWidth : 0;
|
||||
int ratioH = i > 1 ? d->m_pcPelFormat->log2ChromaHeight : 0;
|
||||
ppBuff[i] = ppBuff[i - 1] + CHROMASHIFT( d->m_uiHeight, ratioH ) * CHROMASHIFT( d->m_uiWidth, ratioW ) * bytesPixel;
|
||||
}
|
||||
|
||||
for( ch = 0; ch < d->m_pcPelFormat->numberChannels; ch++ )
|
||||
xMemSet( ClpPel, getTotalNumberOfPixels(), d->m_pppcInputPel[0][0] );
|
||||
|
||||
for( unsigned ch = 0; ch < d->m_pcPelFormat->numberChannels; ch++ )
|
||||
{
|
||||
ratioW = ch > 0 ? d->m_pcPelFormat->log2ChromaWidth : 0;
|
||||
ratioH = ch > 0 ? d->m_pcPelFormat->log2ChromaHeight : 0;
|
||||
step = ( d->m_pcPelFormat->comp[ch].step_minus1 ) * bytesPixel;
|
||||
int ratioW = ch > 0 ? d->m_pcPelFormat->log2ChromaWidth : 0;
|
||||
int ratioH = ch > 0 ? d->m_pcPelFormat->log2ChromaHeight : 0;
|
||||
int step = ( d->m_pcPelFormat->comp[ch].step_minus1 ) * bytesPixel;
|
||||
|
||||
pPel = d->m_pppcInputPel[ch][0];
|
||||
pTmpBuff = ppBuff[d->m_pcPelFormat->comp[ch].plane] + ( d->m_pcPelFormat->comp[ch].offset_plus1 - 1 ) * bytesPixel;
|
||||
ClpPel* pPel = d->m_pppcInputPel[ch][0];
|
||||
const ClpByte* pTmpBuff = ppBuff[d->m_pcPelFormat->comp[ch].plane] + ( d->m_pcPelFormat->comp[ch].offset_plus1 - 1 ) * bytesPixel;
|
||||
|
||||
for( i = 0; i < CHROMASHIFT( d->m_uiHeight, ratioH ) * CHROMASHIFT( d->m_uiWidth, ratioW ); i++ )
|
||||
for( unsigned p = 0; p < CHROMASHIFT( d->m_uiHeight, ratioH ) * CHROMASHIFT( d->m_uiWidth, ratioW ); p++ )
|
||||
{
|
||||
*pPel = 0;
|
||||
for( b = startByte; b != endByte; b += incByte )
|
||||
for( int b = startByte; b != endByte; b += incByte )
|
||||
{
|
||||
*pPel += *pTmpBuff << ( b * 8 );
|
||||
pPel[p] += *pTmpBuff << ( b * 8 );
|
||||
pTmpBuff++;
|
||||
// Check max value and bound it to "maxval" to prevent segfault when
|
||||
// calculating histogram
|
||||
if( *pPel > maxval )
|
||||
*pPel = 0;
|
||||
// -----
|
||||
}
|
||||
pPel++;
|
||||
// Check max value and bound it to "maxval" to prevent segfault when
|
||||
// calculating histogram
|
||||
if( pPel[p] > maxval )
|
||||
pPel[p] = 0;
|
||||
pTmpBuff += step;
|
||||
}
|
||||
}
|
||||
@@ -666,7 +709,7 @@ void CalypFrame::frameFromBuffer( ClpByte* Buff, int iEndianness )
|
||||
d->m_bHasHistogram = false;
|
||||
}
|
||||
|
||||
void CalypFrame::frameToBuffer( ClpByte* output_buffer, int iEndianness )
|
||||
void CalypFrame::frameToBuffer( std::vector<ClpByte>& output_buffer, int iEndianness )
|
||||
{
|
||||
unsigned int bytesPixel = ( d->m_uiBitsPel - 1 ) / 8 + 1;
|
||||
ClpByte* ppBuff[MAX_NUMBER_PLANES];
|
||||
@@ -686,7 +729,7 @@ void CalypFrame::frameToBuffer( ClpByte* output_buffer, int iEndianness )
|
||||
incByte = -1;
|
||||
}
|
||||
|
||||
ppBuff[0] = output_buffer;
|
||||
ppBuff[0] = output_buffer.data();
|
||||
for( int i = 1; i < MAX_NUMBER_PLANES; i++ )
|
||||
{
|
||||
ratioW = i > 1 ? d->m_pcPelFormat->log2ChromaWidth : 0;
|
||||
@@ -716,11 +759,10 @@ void CalypFrame::frameToBuffer( ClpByte* output_buffer, int iEndianness )
|
||||
}
|
||||
}
|
||||
|
||||
void CalypFrame::fillRGBBuffer()
|
||||
{
|
||||
#define PEL_ARGB( a, r, g, b ) ( ( a & 0xff ) << 24 ) | ( ( r & 0xff ) << 16 ) | ( ( g & 0xff ) << 8 ) | ( b & 0xff )
|
||||
#define PEL_RGB( r, g, b ) PEL_ARGB( 0xffu, r, g, b )
|
||||
#define CLAMP_YUV2RGB( X ) X = X < 0 ? 0 : X > 255 ? 255 : X;
|
||||
#define CLAMP_YUV2RGB( X ) X = X < 0 ? 0 : X > 255 ? 255 : \
|
||||
X;
|
||||
#define YUV2RGB( iY, iU, iV, iR, iG, iB ) \
|
||||
iR = iY + ( ( 1436 * ( iV - 128 ) ) >> 10 ); \
|
||||
iG = iY - ( ( 352 * ( iU - 128 ) + 731 * ( iV - 128 ) ) >> 10 ); \
|
||||
@@ -729,12 +771,47 @@ void CalypFrame::fillRGBBuffer()
|
||||
CLAMP_YUV2RGB( iG ) \
|
||||
CLAMP_YUV2RGB( iB )
|
||||
|
||||
void fillRGBBufferYUV420p( ClpPel*** pppInputPel, uint32_t* pARGB, unsigned uiWidth, unsigned uiHeight, int shiftBits )
|
||||
{
|
||||
ClpPel* pY = pppInputPel[CLP_LUMA][0];
|
||||
ClpPel* pU = pppInputPel[CLP_CHROMA_U][0];
|
||||
ClpPel* pV = pppInputPel[CLP_CHROMA_V][0];
|
||||
|
||||
for( unsigned y = 0; y < uiHeight; y += 2 )
|
||||
{
|
||||
for( unsigned x = 0; x < uiWidth; x += 2 )
|
||||
{
|
||||
int iY, iU, iV, iR, iG, iB;
|
||||
iY = pY[y * uiWidth + x] >> shiftBits;
|
||||
iU = pU[y * uiWidth / 4 + x / 2] >> shiftBits;
|
||||
iV = pV[y * uiWidth / 4 + x / 2] >> shiftBits;
|
||||
YUV2RGB( iY, iU, iV, iR, iG, iB );
|
||||
pARGB[y * uiWidth + x] = PEL_RGB( iR, iG, iB );
|
||||
|
||||
iY = pY[y * uiWidth + x + 1] >> shiftBits;
|
||||
YUV2RGB( iY, iU, iV, iR, iG, iB );
|
||||
pARGB[y * uiWidth + x + 1] = PEL_RGB( iR, iG, iB );
|
||||
|
||||
iY = pY[y * uiWidth + uiWidth + x] >> shiftBits;
|
||||
YUV2RGB( iY, iU, iV, iR, iG, iB );
|
||||
pARGB[y * uiWidth + uiWidth + x] = PEL_RGB( iR, iG, iB );
|
||||
|
||||
iY = pY[y * uiWidth + uiWidth + x + 1] >> shiftBits;
|
||||
YUV2RGB( iY, iU, iV, iR, iG, iB );
|
||||
pARGB[y * uiWidth + uiWidth + x + 1] = PEL_RGB( iR, iG, iB );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CalypFrame::fillRGBBuffer()
|
||||
{
|
||||
if( d->m_bHasRGBPel )
|
||||
return;
|
||||
int shiftBits = d->m_uiBitsPel - 8;
|
||||
|
||||
d->m_bHasRGBPel = true;
|
||||
// 4 bytes for A, R, G and B
|
||||
uint32_t* pARGB = (uint32_t*)d->m_pcARGB32;
|
||||
uint32_t* pARGB = (uint32_t*)d->m_pcARGB32.data();
|
||||
if( d->m_pcPelFormat->colorSpace == CLP_COLOR_GRAY )
|
||||
{
|
||||
ClpPel* pY = d->m_pppcInputPel[CLP_LUMA][0];
|
||||
@@ -764,6 +841,11 @@ void CalypFrame::fillRGBBuffer()
|
||||
}
|
||||
else if( d->m_pcPelFormat->colorSpace == CLP_COLOR_YUV )
|
||||
{
|
||||
if( d->m_iPixelFormat == CLP_YUV420P )
|
||||
{
|
||||
fillRGBBufferYUV420p( d->m_pppcInputPel, pARGB, d->m_uiWidth, d->m_uiHeight, shiftBits );
|
||||
return;
|
||||
}
|
||||
ClpPel* pLineY = d->m_pppcInputPel[CLP_LUMA][0];
|
||||
ClpPel* pLineU = d->m_pppcInputPel[CLP_CHROMA_U][0];
|
||||
ClpPel* pLineV = d->m_pppcInputPel[CLP_CHROMA_V][0];
|
||||
@@ -806,7 +888,6 @@ void CalypFrame::fillRGBBuffer()
|
||||
pLineV += uiChromaStride;
|
||||
}
|
||||
}
|
||||
d->m_bHasRGBPel = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -815,12 +896,12 @@ void CalypFrame::fillRGBBuffer()
|
||||
|
||||
void CalypFrame::calcHistogram()
|
||||
{
|
||||
if( d->m_bHasHistogram || !d->m_puiHistogram )
|
||||
if( d->m_bHasHistogram || d->m_puiHistogram.empty() )
|
||||
return;
|
||||
|
||||
d->m_bHistogramRunning = true;
|
||||
|
||||
xMemSet( unsigned int, d->m_uiHistoSegments * d->m_uiHistoChannels, d->m_puiHistogram );
|
||||
std::fill( d->m_puiHistogram.begin(), d->m_puiHistogram.end(), 0 );
|
||||
|
||||
unsigned int numberChannels = d->m_pcPelFormat->numberChannels;
|
||||
for( unsigned int ch = 0; ch < numberChannels; ch++ )
|
||||
@@ -1117,6 +1198,32 @@ double CalypFrame::getHistogramValue( unsigned channel, unsigned int bin )
|
||||
return d->m_puiHistogram[indexStart + bin];
|
||||
}
|
||||
|
||||
double CalypFrame::getEntropy( unsigned channel, unsigned int start, unsigned int end )
|
||||
{
|
||||
if( !d->m_bHasHistogram )
|
||||
return 0;
|
||||
|
||||
channel = d->getRealHistogramChannel( channel );
|
||||
if( channel < 0 )
|
||||
return 0;
|
||||
|
||||
int indexStart = channel * d->m_uiHistoSegments;
|
||||
double numValues = getNumPixelsRange( channel, start, end );
|
||||
double entropy = 0.0;
|
||||
|
||||
for( unsigned b = start; b <= end; b++ )
|
||||
{
|
||||
if( d->m_puiHistogram[indexStart + b] == 0 )
|
||||
continue;
|
||||
|
||||
double prob = d->m_puiHistogram[indexStart + b] / numValues;
|
||||
|
||||
entropy -= prob * log2( prob );
|
||||
}
|
||||
|
||||
return entropy;
|
||||
}
|
||||
|
||||
/*
|
||||
**************************************************************
|
||||
* interface to other libs
|
||||
|
||||
+59
-10
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -26,6 +26,8 @@
|
||||
#ifndef __CALYPFRAME_H__
|
||||
#define __CALYPFRAME_H__
|
||||
|
||||
#include <span>
|
||||
|
||||
#include "CalypDefs.h"
|
||||
|
||||
namespace cv
|
||||
@@ -73,7 +75,8 @@ public:
|
||||
CalypPixel convertPixel( CalypColorSpace eOutputSpace );
|
||||
|
||||
private:
|
||||
struct CalypPixelPrivate* d;
|
||||
class CalypPixelPrivate;
|
||||
std::unique_ptr<CalypPixelPrivate> d;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -102,6 +105,11 @@ public:
|
||||
static int findPixelFormat( const ClpString& name );
|
||||
static int pelformatColorSpace( const int idx );
|
||||
|
||||
/**
|
||||
* Default constructor. Frame is not valid
|
||||
*/
|
||||
CalypFrame();
|
||||
|
||||
/**
|
||||
* Creates a new frame using the following configuration
|
||||
*
|
||||
@@ -113,6 +121,31 @@ public:
|
||||
*/
|
||||
CalypFrame( unsigned int width, unsigned int height, int pelFormat, unsigned bitsPixel = 8 );
|
||||
|
||||
/**
|
||||
* Creates a new frame using the following configuration
|
||||
*
|
||||
* @param width width of the frame
|
||||
* @param height height of the frame
|
||||
* @param pel_format pixel format index (always use PixelFormats enum)
|
||||
*
|
||||
* @note this function might misbehave if the pixel format enum is not correct
|
||||
*/
|
||||
CalypFrame( unsigned int width, unsigned int height, int pelFormat, unsigned bitsPixel, bool has_negative_values );
|
||||
|
||||
/**
|
||||
* Move contructor
|
||||
*
|
||||
* @param other existing frame to copy from
|
||||
*/
|
||||
CalypFrame( CalypFrame&& other ) noexcept;
|
||||
|
||||
/**
|
||||
* Move assignement contructor
|
||||
*
|
||||
* @param other existing frame to copy from
|
||||
*/
|
||||
CalypFrame& operator=( CalypFrame&& other ) noexcept;
|
||||
|
||||
/**
|
||||
* Copy contructor
|
||||
*
|
||||
@@ -121,6 +154,13 @@ public:
|
||||
CalypFrame( const CalypFrame& other );
|
||||
CalypFrame( const CalypFrame* other );
|
||||
|
||||
/**
|
||||
* Copy-assignement contructor
|
||||
*
|
||||
* @param other existing frame to copy from
|
||||
*/
|
||||
CalypFrame& operator=( const CalypFrame& other );
|
||||
|
||||
/**
|
||||
* Creates and new frame with the configuration of an existing one and copy
|
||||
* its contents. This function only copies a specific region from the existing
|
||||
@@ -197,6 +237,12 @@ public:
|
||||
*/
|
||||
unsigned int getHeight( unsigned channel = 0 ) const;
|
||||
|
||||
/**
|
||||
* Check if frame has negative values
|
||||
* @return Boolean with the flag value
|
||||
*/
|
||||
bool getHasNegativeValues() const;
|
||||
|
||||
/**
|
||||
* Get number of pixels of the frame
|
||||
* @param channel/component
|
||||
@@ -257,13 +303,14 @@ public:
|
||||
unsigned char* getRGBBuffer() const;
|
||||
|
||||
/**
|
||||
* Get pixel value at coordinates
|
||||
* Get pixel value at coordinates
|
||||
* @param ch frame channel
|
||||
* @param xPos position in X axis
|
||||
* @param yPos position in Y axis
|
||||
* @param absolute whether it should return positive/negative values
|
||||
* @return pixel value
|
||||
*/
|
||||
ClpPel operator()( unsigned int ch, unsigned int xPos, unsigned int yPos );
|
||||
ClpPel operator()( unsigned int ch, unsigned int xPos, unsigned int yPos, bool absolute = true ) const;
|
||||
|
||||
/**
|
||||
* Get pixel value at coordinates
|
||||
@@ -271,7 +318,7 @@ public:
|
||||
* @param yPos position in Y axis
|
||||
* @return pixel value
|
||||
*/
|
||||
CalypPixel operator()( unsigned int xPos, unsigned int yPos );
|
||||
CalypPixel operator()( unsigned int xPos, unsigned int yPos ) const;
|
||||
|
||||
/**
|
||||
* Get pixel value at coordinates
|
||||
@@ -279,7 +326,7 @@ public:
|
||||
* @param yPos position in Y axis
|
||||
* @return pixel value
|
||||
*/
|
||||
CalypPixel getPixel( unsigned int xPos, unsigned int yPos );
|
||||
CalypPixel getPixel( unsigned int xPos, unsigned int yPos ) const;
|
||||
|
||||
/**
|
||||
* Get pixel value at coordinates
|
||||
@@ -325,9 +372,9 @@ public:
|
||||
void copyTo( const CalypFrame& other, unsigned x, unsigned y );
|
||||
void copyTo( const CalypFrame* other, unsigned x, unsigned y );
|
||||
|
||||
void frameFromBuffer( ClpByte*, int, unsigned long );
|
||||
void frameFromBuffer( ClpByte*, int );
|
||||
void frameToBuffer( ClpByte*, int );
|
||||
void frameFromBuffer( const std::vector<ClpByte>&, int, unsigned long );
|
||||
void frameFromBuffer( const std::vector<ClpByte>&, int );
|
||||
void frameToBuffer( std::vector<ClpByte>&, int );
|
||||
|
||||
void fillRGBBuffer();
|
||||
|
||||
@@ -363,6 +410,7 @@ public:
|
||||
double getHistogramValue( unsigned channel, unsigned int bin );
|
||||
unsigned int getNEBins( unsigned channel );
|
||||
int getNumHistogramSegment();
|
||||
double getEntropy( unsigned channel, unsigned int start, unsigned int end );
|
||||
|
||||
/**
|
||||
* interface with OpenCV lib
|
||||
@@ -398,7 +446,8 @@ public:
|
||||
/** @} */
|
||||
|
||||
private:
|
||||
struct CalypFramePrivate* d;
|
||||
class CalypFramePrivate;
|
||||
std::unique_ptr<CalypFramePrivate> d;
|
||||
};
|
||||
|
||||
#endif // __CALYPFRAME_H__
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -34,6 +34,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "CalypFrame.h"
|
||||
#include "CalypOptions.h"
|
||||
|
||||
@@ -164,7 +166,7 @@ public:
|
||||
* Module API version 3
|
||||
*/
|
||||
virtual CalypFrame* getProcessedFrame() { return m_pcOutputFrame; }
|
||||
virtual bool needFrame() { return m_iFrameBufferCount == 0? true : false; };
|
||||
virtual bool needFrame() { return m_iFrameBufferCount == 0 ? true : false; };
|
||||
virtual bool flush()
|
||||
{
|
||||
m_iFrameBufferCount = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
|
||||
#include "CalypOptions.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "lib/CalypModuleIf.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include "config.h"
|
||||
#include "lib/CalypModuleIf.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct ParseFailure : public std::exception
|
||||
@@ -284,7 +284,7 @@ bool CalypOptions::hasOpt( const ClpString& optName )
|
||||
void CalypOptions::addDefaultOptions()
|
||||
{
|
||||
addOptions() /**/
|
||||
( "help,h", "produce help message" ) /**/
|
||||
( "help", "produce help message" ) /**/
|
||||
( "version", "show version and exit" ) /**/
|
||||
( "pel_fmts", "list pixel formats" ) /**/
|
||||
( "quality_metrics", "list supported quality metrics" ) /**/
|
||||
@@ -477,27 +477,26 @@ unsigned int CalypOptions::parseSHORT( unsigned int argc, char* argv[] )
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool CalypOptions::parse( unsigned int argc, char* argv[] )
|
||||
int CalypOptions::parse( unsigned int argc, char* argv[] )
|
||||
{
|
||||
try
|
||||
{
|
||||
m_aUnhandledArgs = scanArgv( argc, argv );
|
||||
|
||||
if( checkListingOpts() )
|
||||
{
|
||||
return false;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
catch( std::exception& e )
|
||||
{
|
||||
std::cerr << "error: " << e.what() << "\n";
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
std::cerr << "Exception of unknown type!\n";
|
||||
}
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
list<const char*> CalypOptions::scanArgv( unsigned int argc, char* argv[] )
|
||||
|
||||
+3
-3
@@ -40,11 +40,11 @@
|
||||
#ifndef __CALYPOPTIONS_H__
|
||||
#define __CALYPOPTIONS_H__
|
||||
|
||||
#include "CalypDefs.h"
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "CalypDefs.h"
|
||||
|
||||
/**
|
||||
* \class OptionBase
|
||||
* \ingroup CalypLibGrp
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
CalypOptions( const ClpString& name = "" );
|
||||
~CalypOptions();
|
||||
|
||||
bool parse( unsigned int argc, char* argv[] );
|
||||
int parse( unsigned int argc, char* argv[] );
|
||||
void parse( std::vector<ClpString> args_array );
|
||||
|
||||
std::list<const char*>& getUnhandledArgs() { return m_aUnhandledArgs; }
|
||||
|
||||
+18
-15
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -22,15 +22,17 @@
|
||||
* \brief Video Frame handling
|
||||
*/
|
||||
|
||||
#include "CalypFrame.h"
|
||||
#include <memory>
|
||||
|
||||
#include "CalypFrame.h"
|
||||
#include "PixelFormats.h"
|
||||
#include "config.h"
|
||||
|
||||
#define MAX_NUMBER_COMPONENTS 4
|
||||
|
||||
struct CalypPixelPrivate
|
||||
class CalypPixel::CalypPixelPrivate
|
||||
{
|
||||
public:
|
||||
CalypPixelPrivate( const int& ColorSpace )
|
||||
{
|
||||
iColorSpace = ColorSpace == CLP_COLOR_GRAY ?
|
||||
@@ -51,9 +53,12 @@ static inline void yuvToRgb( const int& iY, const int& iU, const int& iV, int& i
|
||||
iR = iY + ( ( 1436 * ( iV - 128 ) ) >> 10 );
|
||||
iG = iY - ( ( 352 * ( iU - 128 ) + 731 * ( iV - 128 ) ) >> 10 );
|
||||
iB = iY + ( ( 1812 * ( iU - 128 ) ) >> 10 );
|
||||
iR = iR < 0 ? 0 : iR > 255 ? 255 : iR;
|
||||
iG = iG < 0 ? 0 : iG > 255 ? 255 : iG;
|
||||
iB = iB < 0 ? 0 : iB > 255 ? 255 : iB;
|
||||
iR = iR < 0 ? 0 : iR > 255 ? 255 :
|
||||
iR;
|
||||
iG = iG < 0 ? 0 : iG > 255 ? 255 :
|
||||
iG;
|
||||
iB = iB < 0 ? 0 : iB > 255 ? 255 :
|
||||
iB;
|
||||
}
|
||||
|
||||
static inline void rgbToYuv( const int& iR, const int& iG, const int& iB, int& iY, int& iU, int& iV )
|
||||
@@ -69,18 +74,18 @@ int CalypPixel::getMaxNumberOfComponents()
|
||||
}
|
||||
|
||||
CalypPixel::CalypPixel( const int& ColorSpace )
|
||||
: d( new CalypPixelPrivate( ColorSpace ) )
|
||||
: d{ std::make_unique<CalypPixelPrivate>( ColorSpace ) }
|
||||
{
|
||||
}
|
||||
|
||||
CalypPixel::CalypPixel( const int& ColorSpace, const ClpPel& c0 )
|
||||
: d( new CalypPixelPrivate( ColorSpace ) )
|
||||
: d{ std::make_unique<CalypPixelPrivate>( ColorSpace ) }
|
||||
{
|
||||
d->PelComp[0] = c0;
|
||||
}
|
||||
|
||||
CalypPixel::CalypPixel( const int& ColorSpace, const ClpPel& c0, const ClpPel& c1, const ClpPel& c2 )
|
||||
: d( new CalypPixelPrivate( ColorSpace ) )
|
||||
: d{ std::make_unique<CalypPixelPrivate>( ColorSpace ) }
|
||||
{
|
||||
d->PelComp[0] = c0;
|
||||
d->PelComp[1] = c1;
|
||||
@@ -88,7 +93,7 @@ CalypPixel::CalypPixel( const int& ColorSpace, const ClpPel& c0, const ClpPel& c
|
||||
}
|
||||
|
||||
CalypPixel::CalypPixel( const int& ColorSpace, const ClpPel& c0, const ClpPel& c1, const ClpPel& c2, const ClpPel& c3 )
|
||||
: d( new CalypPixelPrivate( ColorSpace ) )
|
||||
: d{ std::make_unique<CalypPixelPrivate>( ColorSpace ) }
|
||||
{
|
||||
d->PelComp[0] = c0;
|
||||
d->PelComp[1] = c1;
|
||||
@@ -97,7 +102,8 @@ CalypPixel::CalypPixel( const int& ColorSpace, const ClpPel& c0, const ClpPel& c
|
||||
}
|
||||
|
||||
CalypPixel::CalypPixel( const CalypPixel& other )
|
||||
: d( new CalypPixelPrivate( other.colorSpace() ) )
|
||||
: d{ std::make_unique<CalypPixelPrivate>( other.colorSpace() ) }
|
||||
|
||||
{
|
||||
for( int i = 0; i < MAX_NUMBER_COMPONENTS; i++ )
|
||||
{
|
||||
@@ -105,10 +111,7 @@ CalypPixel::CalypPixel( const CalypPixel& other )
|
||||
}
|
||||
}
|
||||
|
||||
CalypPixel::~CalypPixel()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
CalypPixel::~CalypPixel() = default;
|
||||
|
||||
int CalypPixel::colorSpace() const
|
||||
{
|
||||
|
||||
+25
-39
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -103,19 +103,18 @@ private:
|
||||
unsigned int m_uiIndex;
|
||||
|
||||
public:
|
||||
CalypStreamBufferPrivate( unsigned int size, unsigned int width, unsigned int height, int pelFormat, int bitsPixel )
|
||||
CalypStreamBufferPrivate( unsigned int size, unsigned int width, unsigned int height, int pelFormat, int bitsPixel, bool hasNegative )
|
||||
{
|
||||
for( unsigned int i = 0; i < size; i++ )
|
||||
{
|
||||
CalypFrame* pFrame = new CalypFrame( width, height, pelFormat, bitsPixel );
|
||||
m_apcFrameBuffer.push_back( pFrame );
|
||||
m_apcFrameBuffer.push_back( new CalypFrame( width, height, pelFormat, bitsPixel, hasNegative ) );
|
||||
}
|
||||
m_uiIndex = 0;
|
||||
}
|
||||
|
||||
~CalypStreamBufferPrivate()
|
||||
{
|
||||
while( m_apcFrameBuffer.size() > 0 )
|
||||
while( !m_apcFrameBuffer.empty() )
|
||||
{
|
||||
delete m_apcFrameBuffer.back();
|
||||
m_apcFrameBuffer.pop_back();
|
||||
@@ -125,8 +124,7 @@ public:
|
||||
{
|
||||
for( unsigned int i = m_apcFrameBuffer.size(); i < newSize; i++ )
|
||||
{
|
||||
CalypFrame* pFrame = new CalypFrame( m_apcFrameBuffer.at( 0 ) );
|
||||
m_apcFrameBuffer.push_back( pFrame );
|
||||
m_apcFrameBuffer.push_back( new CalypFrame( m_apcFrameBuffer.at( 0 ) ) );
|
||||
}
|
||||
}
|
||||
unsigned int size() { return m_apcFrameBuffer.size(); }
|
||||
@@ -158,8 +156,9 @@ struct CalypStreamPrivate
|
||||
|
||||
CalypStreamPrivate()
|
||||
{
|
||||
handler = NULL;
|
||||
pfctCreateHandler = NULL;
|
||||
handler = nullptr;
|
||||
pfctCreateHandler = nullptr;
|
||||
frameBuffer = nullptr;
|
||||
isInput = true;
|
||||
isInit = false;
|
||||
bLoadAll = false;
|
||||
@@ -227,6 +226,7 @@ CalypStream::CalypStream()
|
||||
CalypStream::~CalypStream()
|
||||
{
|
||||
close();
|
||||
delete d;
|
||||
}
|
||||
|
||||
ClpString CalypStream::getFormatName() const
|
||||
@@ -238,7 +238,7 @@ ClpString CalypStream::getCodecName() const
|
||||
return !d->handler ? "" : d->handler->getCodecName();
|
||||
}
|
||||
|
||||
bool CalypStream::open( ClpString filename, ClpString resolution, ClpString input_format_name, unsigned int bitsPel, int endianness,
|
||||
bool CalypStream::open( ClpString filename, ClpString resolution, ClpString input_format_name, unsigned int bitsPel, int endianness, bool hasNegative,
|
||||
unsigned int frame_rate, bool bInput )
|
||||
{
|
||||
unsigned int width = 0;
|
||||
@@ -261,11 +261,17 @@ bool CalypStream::open( ClpString filename, ClpString resolution, ClpString inpu
|
||||
break;
|
||||
}
|
||||
}
|
||||
return open( filename, width, height, input_format, bitsPel, endianness, frame_rate, bInput );
|
||||
return open( filename, width, height, input_format, bitsPel, endianness, hasNegative, frame_rate, bInput );
|
||||
}
|
||||
|
||||
bool CalypStream::open( ClpString filename, unsigned int width, unsigned int height, int input_format, unsigned int bitsPel, int endianness,
|
||||
unsigned int frame_rate, bool bInput )
|
||||
{
|
||||
return open( filename, width, height, input_format, bitsPel, endianness, false, frame_rate, bInput );
|
||||
}
|
||||
|
||||
bool CalypStream::open( ClpString filename, unsigned int width, unsigned int height, int input_format, unsigned int bitsPel, int endianness, bool hasNegative,
|
||||
unsigned int frame_rate, bool bInput )
|
||||
{
|
||||
if( d->isInit )
|
||||
{
|
||||
@@ -314,7 +320,7 @@ bool CalypStream::open( ClpString filename, unsigned int width, unsigned int hei
|
||||
try
|
||||
{
|
||||
d->frameBuffer = new CalypStreamBufferPrivate( d->isInput ? 3 : 1, d->handler->m_uiWidth, d->handler->m_uiHeight,
|
||||
d->handler->m_iPixelFormat, d->handler->m_uiBitsPerPixel );
|
||||
d->handler->m_iPixelFormat, d->handler->m_uiBitsPerPixel, hasNegative );
|
||||
}
|
||||
catch( CalypFailure& e )
|
||||
{
|
||||
@@ -383,10 +389,13 @@ void CalypStream::close()
|
||||
if( !d->isInit )
|
||||
return;
|
||||
|
||||
d->handler->closeHandler();
|
||||
d->handler->Delete();
|
||||
|
||||
delete d->frameBuffer;
|
||||
if( d->handler )
|
||||
{
|
||||
d->handler->closeHandler();
|
||||
d->handler->Delete();
|
||||
}
|
||||
if( d->frameBuffer )
|
||||
delete d->frameBuffer;
|
||||
|
||||
d->bLoadAll = false;
|
||||
d->isInit = false;
|
||||
@@ -479,29 +488,6 @@ void CalypStream::loadAll()
|
||||
d->iCurrFrameNum = 0;
|
||||
}
|
||||
|
||||
void CalypStream::getDuration( int* duration_array ) const
|
||||
{
|
||||
// int hours, mins, secs = 0;
|
||||
// #ifdef USE_FFMPEG
|
||||
// if( m_iStreamHandler == FFMPEG )
|
||||
// {
|
||||
// secs = m_cLibAvContext->getStreamDuration();
|
||||
// }
|
||||
// else
|
||||
// #endif
|
||||
// if( m_iStreamHandler == YUV_IO )
|
||||
// {
|
||||
// secs = m_uiTotalFrameNum / m_dFrameRate;
|
||||
// }
|
||||
// mins = secs / 60;
|
||||
// secs %= 60;
|
||||
// hours = mins / 60;
|
||||
// mins %= 60;
|
||||
// *duration_array++ = hours;
|
||||
// *duration_array++ = mins;
|
||||
// *duration_array++ = secs;
|
||||
}
|
||||
|
||||
bool CalypStream::readFrame( CalypFrame* frame )
|
||||
{
|
||||
if( !d->isInit || !d->isInput || d->handler->m_uiCurrFrameFileIdx >= d->handler->m_uiTotalNumberFrames )
|
||||
|
||||
+5
-4
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -72,10 +72,13 @@ public:
|
||||
ClpString getCodecName() const;
|
||||
;
|
||||
|
||||
bool open( ClpString filename, ClpString resolution, ClpString input_format, unsigned int bitsPel, int endianness, unsigned int frame_rate,
|
||||
bool open( ClpString filename, ClpString resolution, ClpString input_format, unsigned int bitsPel, int endianness, bool hasNegative, unsigned int frame_rate,
|
||||
bool bInput );
|
||||
bool open( ClpString filename, unsigned int width, unsigned int height, int input_format, unsigned int bitsPel, int endianness, unsigned int frame_rate,
|
||||
bool bInput );
|
||||
bool open( ClpString filename, unsigned int width, unsigned int height, int input_format, unsigned int bitsPel, int endianness, bool hasNegative, unsigned int frame_rate,
|
||||
bool bInput );
|
||||
|
||||
bool reload();
|
||||
void close();
|
||||
|
||||
@@ -110,8 +113,6 @@ public:
|
||||
bool seekInputRelative( bool bIsFoward );
|
||||
bool seekInput( unsigned long new_frame_num );
|
||||
|
||||
void getDuration( int* duration_array ) const;
|
||||
|
||||
private:
|
||||
bool readFrame( CalypFrame* frame );
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef __CALYPSTREAMHANDLERIF_H__
|
||||
#define __CALYPSTREAMHANDLERIF_H__
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "CalypStream.h"
|
||||
|
||||
#define INI_REGIST_CALYP_SUPPORTED_FMT \
|
||||
@@ -78,7 +80,6 @@ public:
|
||||
, m_dFrameRate( 30 )
|
||||
, m_uiCurrFrameFileIdx( 0 )
|
||||
, m_uiTotalNumberFrames( 0 )
|
||||
, m_pStreamBuffer( NULL )
|
||||
, m_uiNBytesPerFrame( 0 )
|
||||
, m_isEOF( false )
|
||||
{
|
||||
@@ -114,7 +115,7 @@ protected:
|
||||
double m_dFrameRate;
|
||||
ClpULong m_uiCurrFrameFileIdx;
|
||||
ClpULong m_uiTotalNumberFrames;
|
||||
ClpByte* m_pStreamBuffer;
|
||||
std::vector<ClpByte> m_pStreamBuffer;
|
||||
ClpULong m_uiNBytesPerFrame;
|
||||
bool m_isEOF;
|
||||
};
|
||||
|
||||
+14
-45
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -40,7 +40,7 @@
|
||||
#endif
|
||||
#define xMemSet( type, len, ptr ) memset( ptr, 0, ( len ) * sizeof( type ) )
|
||||
|
||||
static inline void* xMallocMem( size_t nitems )
|
||||
[[deprecated]] static inline void* xMallocMem( size_t nitems )
|
||||
{
|
||||
void* d;
|
||||
if( ( d = xMalloc( nitems ) ) == NULL )
|
||||
@@ -51,7 +51,7 @@ static inline void* xMallocMem( size_t nitems )
|
||||
return d;
|
||||
}
|
||||
|
||||
static inline void* xCallocMem( size_t nitems, size_t size )
|
||||
[[deprecated]] static inline void* xCallocMem( size_t nitems, size_t size )
|
||||
{
|
||||
size_t padded_size = nitems * size;
|
||||
void* d = xMallocMem( padded_size );
|
||||
@@ -61,7 +61,7 @@ static inline void* xCallocMem( size_t nitems, size_t size )
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
int getMem1D( T** array1D, int dim0 )
|
||||
[[deprecated]] int getMem1D( T** array1D, int dim0 )
|
||||
{
|
||||
if( ( *array1D = (T*)xCallocMem( dim0, sizeof( T ) ) ) == NULL )
|
||||
return 0;
|
||||
@@ -69,6 +69,16 @@ int getMem1D( T** array1D, int dim0 )
|
||||
return ( sizeof( T* ) + dim0 * sizeof( T ) );
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
[[deprecated]] void freeMem1D( T*& array1D )
|
||||
{
|
||||
if( array1D )
|
||||
{
|
||||
xFreeMem( array1D );
|
||||
array1D = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
int getMem2D( T*** array2D, int dim0, int dim1 )
|
||||
{
|
||||
@@ -85,32 +95,6 @@ int getMem2D( T*** array2D, int dim0, int dim1 )
|
||||
return dim0 * ( sizeof( T* ) + dim1 * sizeof( T ) );
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
int getMem3D( T**** array3D, int dim0, int dim1, int dim2 )
|
||||
{
|
||||
int i, mem_size = dim0 * sizeof( T** );
|
||||
|
||||
if( ( ( *array3D ) = (T***)xMallocMem( dim0 * sizeof( T** ) ) ) == NULL )
|
||||
printf( "get_mem3Dint: array3D" );
|
||||
|
||||
mem_size += getMem2D( *array3D, dim0 * dim1, dim2 );
|
||||
|
||||
for( i = 1; i < dim0; i++ )
|
||||
( *array3D )[i] = ( *array3D )[i - 1] + dim1;
|
||||
|
||||
return mem_size;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void freeMem1D( T*& array1D )
|
||||
{
|
||||
if( array1D )
|
||||
{
|
||||
xFreeMem( array1D );
|
||||
array1D = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void freeMem2D( T**& array2D )
|
||||
{
|
||||
@@ -130,19 +114,4 @@ void freeMem2D( T**& array2D )
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void freeMem3D( T***& array3D )
|
||||
{
|
||||
if( array3D )
|
||||
{
|
||||
freeMem2D( *array3D );
|
||||
xFreeMem( array3D );
|
||||
array3D = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "free_mem3Dint: trying to free unused memory" );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __LIBMEMORY_H__
|
||||
+31
-31
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -56,9 +56,9 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
1,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV420P ),
|
||||
{
|
||||
{0, 0, 1}, /* Y */
|
||||
{1, 0, 1}, /* U */
|
||||
{2, 0, 1}, /* V */
|
||||
{ 0, 0, 1 }, /* Y */
|
||||
{ 1, 0, 1 }, /* U */
|
||||
{ 2, 0, 1 }, /* V */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -73,9 +73,9 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV422P ),
|
||||
{
|
||||
{0, 0, 1}, /* Y */
|
||||
{1, 0, 1}, /* U */
|
||||
{2, 0, 1}, /* V */
|
||||
{ 0, 0, 1 }, /* Y */
|
||||
{ 1, 0, 1 }, /* U */
|
||||
{ 2, 0, 1 }, /* V */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -90,9 +90,9 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUV444P ),
|
||||
{
|
||||
{0, 0, 1}, /* Y */
|
||||
{1, 0, 1}, /* U */
|
||||
{2, 0, 1}, /* V */
|
||||
{ 0, 0, 1 }, /* Y */
|
||||
{ 1, 0, 1 }, /* U */
|
||||
{ 2, 0, 1 }, /* V */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -107,9 +107,9 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_YUYV422 ),
|
||||
{
|
||||
{0, 1, 1}, /* Y */
|
||||
{0, 3, 2}, /* U */
|
||||
{0, 3, 4}, /* V */
|
||||
{ 0, 1, 1 }, /* Y */
|
||||
{ 0, 3, 2 }, /* U */
|
||||
{ 0, 3, 4 }, /* V */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -123,7 +123,7 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_GRAY8 ),
|
||||
{{0, 0, 1}}, /* Y */
|
||||
{ { 0, 0, 1 } }, /* Y */
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -137,9 +137,9 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_NONE ),
|
||||
{
|
||||
{0, 0, 1}, /* R */
|
||||
{1, 0, 1}, /* G */
|
||||
{2, 0, 1}, /* B */
|
||||
{ 0, 0, 1 }, /* R */
|
||||
{ 1, 0, 1 }, /* G */
|
||||
{ 2, 0, 1 }, /* B */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -154,9 +154,9 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_RGB24 ),
|
||||
{
|
||||
{0, 2, 1}, /* R */
|
||||
{0, 2, 2}, /* G */
|
||||
{0, 2, 3}, /* B */
|
||||
{ 0, 2, 1 }, /* R */
|
||||
{ 0, 2, 2 }, /* G */
|
||||
{ 0, 2, 3 }, /* B */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -171,9 +171,9 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_BGR24 ),
|
||||
{
|
||||
{0, 2, 3}, /* R */
|
||||
{0, 2, 2}, /* G */
|
||||
{0, 2, 1}, /* B */
|
||||
{ 0, 2, 3 }, /* R */
|
||||
{ 0, 2, 2 }, /* G */
|
||||
{ 0, 2, 1 }, /* B */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -188,10 +188,10 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_RGBA ),
|
||||
{
|
||||
{0, 3, 1}, /* R */
|
||||
{0, 3, 2}, /* G */
|
||||
{0, 3, 3}, /* B */
|
||||
{0, 3, 4}, /* A */
|
||||
{ 0, 3, 1 }, /* R */
|
||||
{ 0, 3, 2 }, /* G */
|
||||
{ 0, 3, 3 }, /* B */
|
||||
{ 0, 3, 4 }, /* A */
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -206,10 +206,10 @@ const std::map<int, CalypPixelFormatDescriptor> g_CalypPixFmtDescriptorsMap = {
|
||||
0,
|
||||
ADD_FFMPEG_PEL_FMT( AV_PIX_FMT_BGRA ),
|
||||
{
|
||||
{0, 3, 3}, /* R */
|
||||
{0, 3, 2}, /* G */
|
||||
{0, 3, 1}, /* B */
|
||||
{0, 3, 4}, /* A */
|
||||
{ 0, 3, 3 }, /* R */
|
||||
{ 0, 3, 2 }, /* G */
|
||||
{ 0, 3, 1 }, /* B */
|
||||
{ 0, 3, 4 }, /* A */
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2019 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* 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
|
||||
@@ -25,10 +25,10 @@
|
||||
#ifndef __PIXELFORMATS_H__
|
||||
#define __PIXELFORMATS_H__
|
||||
|
||||
#include "CalypFrame.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "CalypFrame.h"
|
||||
|
||||
#define CHROMA_RESAMPLING( X ) ( ( ( X + 1 ) >> 1 ) << 1 )
|
||||
|
||||
#define CHROMARATIO( SIZE, RATIO ) ( RATIO > 1 ? ( ( SIZE + 1 ) / RATIO ) : SIZE )
|
||||
|
||||
Loaded 100 of 185 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user