Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb31fc0287 | ||
|
|
ed075fcbd3 | ||
|
|
3581d2787d | ||
|
|
122e8ec990 |
No files matched your search
@@ -1,46 +0,0 @@
|
||||
image: Visual Studio 2019
|
||||
configuration: Release
|
||||
platform:
|
||||
- x64
|
||||
environment:
|
||||
access_token:
|
||||
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"
|
||||
- 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\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64'
|
||||
- choco install nsis
|
||||
- choco install opencv
|
||||
- 'C:\Tools\opencv\build\setup_vars_opencv4.cmd'
|
||||
- cd C:\Projects
|
||||
- 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\msvc2019_64" -DQt5_DIR="C:\Qt\latest\msvc2019_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 16 2019" -A x64 C:\Projects\calyp-deployment\cmake-helper
|
||||
- cmake --build . --target ALL_BUILD -- /p:Configuration=Release
|
||||
- cmake --build . --target INSTALL -- /p:Configuration=Release
|
||||
- cmake --build . --target PACKAGE -- /p:Configuration=Release
|
||||
|
||||
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'))
|
||||
|
||||
+21
-20
@@ -1,7 +1,7 @@
|
||||
---
|
||||
BasedOnStyle: Google
|
||||
Language: Cpp
|
||||
ColumnLimit: 0
|
||||
# BasedOnStyle: Chromium
|
||||
ColumnLimit: 100
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
@@ -15,29 +15,31 @@ AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterNamespace: true
|
||||
AfterClass: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterControlStatement: true
|
||||
AfterObjCDeclaration: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
BreakBeforeBraces: Custom
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
#BreakBeforeBraces: Attach
|
||||
BreakBeforeBraces: Allman
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
@@ -87,11 +89,10 @@ SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SortIncludes: true
|
||||
SpacesInParentheses: true
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Auto
|
||||
TabWidth: 2
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
---
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-non-private-member-variables-in-classes, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-constant-array-index'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
AnalyzeTemporaryDtors: false
|
||||
FormatStyle: none
|
||||
CheckOptions:
|
||||
- key: llvm-else-after-return.WarnOnConditionVariables
|
||||
value: '0'
|
||||
- key: modernize-loop-convert.MinConfidence
|
||||
value: reasonable
|
||||
- key: modernize-replace-auto-ptr.IncludeStyle
|
||||
value: llvm
|
||||
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
|
||||
value: '0'
|
||||
- key: google-readability-namespace-comments.ShortNamespaceLines
|
||||
value: '10'
|
||||
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
|
||||
value: '0'
|
||||
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
|
||||
value: '1'
|
||||
- key: cert-dcl16-c.NewSuffixes
|
||||
value: 'L;LL;LU;LLU'
|
||||
- key: google-readability-braces-around-statements.ShortStatementLines
|
||||
value: '1'
|
||||
- key: modernize-pass-by-value.IncludeStyle
|
||||
value: llvm
|
||||
- key: google-readability-namespace-comments.SpacesBeforeComments
|
||||
value: '2'
|
||||
- key: modernize-loop-convert.MaxCopySize
|
||||
value: '16'
|
||||
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
|
||||
value: '1'
|
||||
- key: modernize-use-nullptr.NullMacros
|
||||
value: 'NULL'
|
||||
- key: llvm-qualified-auto.AddConstToQualified
|
||||
value: '0'
|
||||
- key: modernize-loop-convert.NamingStyle
|
||||
value: CamelCase
|
||||
- key: llvm-else-after-return.WarnOnUnfixable
|
||||
value: '0'
|
||||
- key: google-readability-function-size.StatementThreshold
|
||||
value: '800'
|
||||
@@ -1,117 +0,0 @@
|
||||
# ----------------------------------
|
||||
# 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'
|
||||
@@ -1,62 +0,0 @@
|
||||
name: Build on Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- devel
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
check-build:
|
||||
# The CMake configure and build commands are platform agnostic and should work equally
|
||||
# well on Windows or Mac. You can convert this to a matrix build if you need
|
||||
# cross-platform coverage.
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install gcc-10 g++-10 cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Configure CMake
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_WERROR=ON
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
check-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install gcc-10 g++-10 cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Check out tests data
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
repository: 'pixlra/calyp-testdata'
|
||||
path: ${{github.workspace}}/tests_data
|
||||
|
||||
- name: Configure CMake
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON -DCALYP_TEST_DATA_DIR=${{github.workspace}}/tests_data
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: CalypLib tests
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -t test
|
||||
-149
@@ -1,149 +0,0 @@
|
||||
# Created by https://www.gitignore.io/api/c++,clion,linux
|
||||
# Edit at https://www.gitignore.io/?templates=c++,clion,linux
|
||||
|
||||
### C++ ###
|
||||
# Prerequisites
|
||||
*.d
|
||||
# Clang
|
||||
.cache/
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
### CLion ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
|
||||
# CMake
|
||||
bin/
|
||||
build/
|
||||
build-*
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
### CLion Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
|
||||
# *.iml
|
||||
# modules.xml
|
||||
# .idea/misc.xml
|
||||
# *.ipr
|
||||
|
||||
# Sonarlint plugin
|
||||
.idea/sonarlint
|
||||
|
||||
### Linux ###
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
### vscode ###
|
||||
.vscode/*
|
||||
*.code-workspace
|
||||
|
||||
# Documentation
|
||||
doc/
|
||||
|
||||
# CLang
|
||||
compile_commands.json
|
||||
|
||||
# Build dirs
|
||||
build*
|
||||
@@ -1,29 +0,0 @@
|
||||
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
|
||||
|
||||
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
language: cpp
|
||||
dist: bionic
|
||||
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 libgtest-dev
|
||||
script:
|
||||
- mkdir -p build && cd build && cmake .. && make && cd ..
|
||||
- sudo apt-get install build-essential cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev
|
||||
script: mkdir -p build && cd build && cmake .. && make && cd ..
|
||||
+137
-259
@@ -1,323 +1,201 @@
|
||||
#
|
||||
# CMakeLists for calyp
|
||||
#
|
||||
###
|
||||
### CMakeLists for playuver
|
||||
###
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
|
||||
cmake_minimum_required( VERSION 3.2.0 )
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Project Definition
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(PROJECT_NAME
|
||||
"calyp"
|
||||
CACHE INTERNAL "" FORCE
|
||||
)
|
||||
SET(PROJECT_LIBRARY
|
||||
"Calyp"
|
||||
CACHE INTERNAL "" FORCE
|
||||
)
|
||||
|
||||
SET(CALYP_VERSION_MAJOR "2")
|
||||
SET(CALYP_VERSION_MINOR "0")
|
||||
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 "playuver" CACHE INTERNAL "" FORCE )
|
||||
|
||||
PROJECT( ${PROJECT_NAME} )
|
||||
SET( PLAYUVER_VERSION_MAJOR "0" )
|
||||
SET( PLAYUVER_VERSION_MINOR "14" )
|
||||
SET( PLAYUVER_VERSION_PATCH "1" )
|
||||
SET( PLAYUVER_VERSION "${PLAYUVER_VERSION_MAJOR}.${PLAYUVER_VERSION_MINOR}.${PLAYUVER_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 Tests" OFF)
|
||||
OPTION(BUILD_WITH_SANITIZERS "Build with sanitizers" OFF)
|
||||
OPTION(BUILD_WITH_THREAD_SANITIZER "Build with thread sanitizer" 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" ON )
|
||||
|
||||
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" ON)
|
||||
OPTION(USE_WERROR "Warnings as errors" OFF)
|
||||
OPTION(USE_STATIC "Use static libs" OFF)
|
||||
OPTION(USE_IWYU "Use include what you use tool" 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(PLAYUVER_VERSION_STRING "${PLAYUVER_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
|
||||
OUTPUT_VARIABLE PLAYUVER_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
|
||||
OUTPUT_VARIABLE PLAYUVER_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 "PlaYUVer Git revision: ${PLAYUVER_GIT_REVISION}")
|
||||
set(PLAYUVER_VERSION_STRING "${PLAYUVER_VERSION} (rev. ${PLAYUVER_GIT_REVISION})")
|
||||
else()
|
||||
message(STATUS "PlaYUVer Git revision could not be determined")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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 )
|
||||
SET(UPDATE_CHANNEL "stable" CACHE STRING "Update channel" )
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/PlaYUVerUpdate.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PlaYUVerUpdate-${UPDATE_CHANNEL}.xml )
|
||||
|
||||
# ####################################################################################################################################################
|
||||
|
||||
######################################################################################
|
||||
# Dependencies
|
||||
# ####################################################################################################################################################
|
||||
INCLUDE(FetchContent)
|
||||
######################################################################################
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Doxygen
|
||||
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)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Catch2 and Google Tests
|
||||
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
|
||||
)
|
||||
|
||||
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)
|
||||
INCLUDE(CTest)
|
||||
ENABLE_TESTING()
|
||||
|
||||
SET(CALYP_TEST_DATA_DIR
|
||||
"CALYP_TEST_DATA_DIR"
|
||||
CACHE PATH "Location of video information for testing"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Type safe
|
||||
FETCHCONTENT_DECLARE(
|
||||
type_safe
|
||||
GIT_REPOSITORY https://github.com/foonathan/type_safe
|
||||
GIT_TAG v0.2.2
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(type_safe)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
type_safe PROPERTIES
|
||||
URL "https://github.com/foonathan/type_safe"
|
||||
DESCRIPTION "Zero overhead abstractions that use the C++ type system to prevent bugs."
|
||||
TYPE REQUIRED
|
||||
)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/_deps/type_safe-src/include/ ${CMAKE_CURRENT_BINARY_DIR}/_deps/type_safe-src/external/debug_assert/)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# OpenCV
|
||||
OPTION(USE_OPENCV "Add OpenCV support" ON)
|
||||
IF(USE_OPENCV)
|
||||
|
||||
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)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(USE_OPENCV FALSE)
|
||||
IF( BUILD_TESTS )
|
||||
FIND_PACKAGE(GTest)
|
||||
SET( BUILD_DOC ${GTEST_FOUND} )
|
||||
IF( GTEST_FOUND )
|
||||
ENABLE_TESTING()
|
||||
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
OpenCV PROPERTIES
|
||||
URL "http://opencv.willowgarage.com"
|
||||
DESCRIPTION "OpenCV library support in CalypFrame"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# FFmpeg
|
||||
OPTION(USE_FFMPEG "Add FFMPEG support" ON)
|
||||
IF(USE_FFMPEG)
|
||||
FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
|
||||
OPTION( USE_OPENCV "Add OpenCV support" ON )
|
||||
SET( OPENCV_OPTFLOW_FOUND OFF )
|
||||
IF( USE_OPENCV )
|
||||
LIST(APPEND OPENCV_MODULES core highgui imgproc video videoio )
|
||||
FIND_PACKAGE( OpenCV COMPONENTS ${OPENCV_MODULES} )
|
||||
SET(USE_OPENCV ${OpenCV_FOUND})
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(OpenCV PROPERTIES URL "http://opencv.willowgarage.com" DESCRIPTION "OpenCV library support in PlaYUVerFrame" TYPE OPTIONAL)
|
||||
|
||||
OPTION( USE_FFMPEG "Add FFMPEG support" ON )
|
||||
IF( USE_FFMPEG )
|
||||
FIND_PACKAGE( FFmpeg )
|
||||
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 PlaYUVerStream" TYPE OPTIONAL)
|
||||
|
||||
IF(WIN32)
|
||||
SET(USE_STATIC ON)
|
||||
INCLUDE(cmake/Win32.cmake)
|
||||
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" )
|
||||
|
||||
|
||||
IF( WIN32 )
|
||||
SET( USE_STATIC ON )
|
||||
INCLUDE( cmake/Win32.cmake )
|
||||
ENDIF()
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# CMake Defin1itions
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
######################################################################################
|
||||
# CMake Defin1itions
|
||||
######################################################################################
|
||||
|
||||
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})
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Compiler options
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 20)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
IF(MSVC)
|
||||
ADD_COMPILE_OPTIONS(/std:c++20)
|
||||
ELSE()
|
||||
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
|
||||
ADD_DEFINITIONS(-std=gnu++2a)
|
||||
ELSE()
|
||||
ADD_DEFINITIONS(-std=c++20)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
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 -funroll-loops")
|
||||
|
||||
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") endif()
|
||||
|
||||
IF(USE_WERROR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||
IF(BUILD_WITH_SANITIZERS)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fsanitize=leak -fsanitize=undefined")
|
||||
ENDIF()
|
||||
IF(BUILD_WITH_THREAD_SANITIZER)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=thread")
|
||||
ENDIF()
|
||||
|
||||
IF(USE_IWYU)
|
||||
FIND_PROGRAM(iwyu_path NAMES include-what-you-use iwyu REQUIRED)
|
||||
SET(CXX_INCLUDE_WHAT_YOU_USE ON)
|
||||
ENDIF()
|
||||
|
||||
# ####################################################################################################################################################
|
||||
######################################################################################
|
||||
# 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")
|
||||
SET(CMAKE_CXX_STANDARD 14)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ADD_DEFINITIONS(-std=gnu++0x)
|
||||
endif()
|
||||
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
|
||||
IF(${BUILD_TOOLS} OR ${BUILD_APP})
|
||||
ADD_SUBDIRECTORY(modules)
|
||||
IF (NOT CMAKE_BUILD_TYPE )
|
||||
MESSAGE(STATUS "No build type selected, default to Release")
|
||||
SET(CMAKE_BUILD_TYPE "Release")
|
||||
ENDIF()
|
||||
|
||||
IF(${BUILD_TOOLS})
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
||||
|
||||
IF( USE_WERROR )
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
|
||||
ENDIF()
|
||||
|
||||
IF(${BUILD_APP})
|
||||
ADD_SUBDIRECTORY(app)
|
||||
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0" )
|
||||
SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
|
||||
|
||||
|
||||
ADD_FEATURE_INFO(PlaYUVerApp BUILD_APP "Build Graphical Interface")
|
||||
ADD_FEATURE_INFO(PlaYUVerTools BUILD_TOOLS "Build Command line tool" )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h )
|
||||
|
||||
ADD_SUBDIRECTORY( lib )
|
||||
ADD_SUBDIRECTORY( modules )
|
||||
|
||||
IF( ${BUILD_TOOLS} )
|
||||
ADD_SUBDIRECTORY( tools )
|
||||
ENDIF()
|
||||
|
||||
IF(${BUILD_EXAMPLES})
|
||||
ADD_SUBDIRECTORY(examples)
|
||||
IF( ${BUILD_APP} )
|
||||
ADD_SUBDIRECTORY( app )
|
||||
ENDIF()
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
IF( ${BUILD_EXAMPLES} )
|
||||
ADD_SUBDIRECTORY( examples )
|
||||
ENDIF()
|
||||
|
||||
# ####################################################################################################################################################
|
||||
|
||||
######################################################################################
|
||||
# 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: " "${PLAYUVER_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)
|
||||
@@ -32,26 +32,26 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# title of most generated pages and in a few other places.
|
||||
# The default value is: My Project.
|
||||
|
||||
PROJECT_NAME = Calyp
|
||||
PROJECT_NAME = PlaYUVer
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER =
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
# quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF =
|
||||
PROJECT_BRIEF =
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
||||
# the logo to the output directory.
|
||||
|
||||
PROJECT_LOGO = app/resources/calyp.ico
|
||||
PROJECT_LOGO = /home/joaoc/Programming/PlaYUVerDev/playuver/app/resources/playuver.ico
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||
# into which the generated documentation will be written. If a relative path is
|
||||
@@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES
|
||||
# will be relative from the directory where doxygen is started.
|
||||
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
|
||||
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_PATH =
|
||||
|
||||
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
|
||||
# path mentioned in the documentation of a class, which tells the reader which
|
||||
@@ -171,7 +171,7 @@ STRIP_FROM_PATH =
|
||||
# specify the list of include paths that are normally passed to the compiler
|
||||
# using the -I flag.
|
||||
|
||||
STRIP_FROM_INC_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
|
||||
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
|
||||
# less readable) file names. This can be useful is your file systems doesn't
|
||||
@@ -244,7 +244,7 @@ ALIASES = "returns=\"\par Returns\" "
|
||||
# A mapping has the form "name=value". For example adding "class=itcl::class"
|
||||
# will allow you to use the command class in the itcl::class meaning.
|
||||
|
||||
TCL_SUBST =
|
||||
TCL_SUBST =
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C. For
|
||||
@@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
|
||||
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
|
||||
# the files are not read by doxygen.
|
||||
|
||||
EXTENSION_MAPPING =
|
||||
EXTENSION_MAPPING =
|
||||
|
||||
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
|
||||
# according to the Markdown format, which allows for more readable
|
||||
@@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES
|
||||
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
|
||||
# ... \endcond blocks.
|
||||
|
||||
ENABLED_SECTIONS =
|
||||
ENABLED_SECTIONS =
|
||||
|
||||
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
|
||||
# initial value of a variable or macro / define can have for it to appear in the
|
||||
@@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES
|
||||
# by doxygen. Whatever the program writes to standard output is used as the file
|
||||
# version. For an example see the documentation.
|
||||
|
||||
FILE_VERSION_FILTER =
|
||||
FILE_VERSION_FILTER =
|
||||
|
||||
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
|
||||
# by doxygen. The layout file controls the global structure of the generated
|
||||
@@ -703,7 +703,7 @@ FILE_VERSION_FILTER =
|
||||
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
|
||||
# tag is left empty.
|
||||
|
||||
LAYOUT_FILE =
|
||||
LAYOUT_FILE =
|
||||
|
||||
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
|
||||
# the reference definitions. This must be a list of .bib files. The .bib
|
||||
@@ -713,7 +713,7 @@ LAYOUT_FILE =
|
||||
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
|
||||
# search path. See also \cite for info how to create references.
|
||||
|
||||
CITE_BIB_FILES =
|
||||
CITE_BIB_FILES =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to warning and progress messages
|
||||
@@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text"
|
||||
# messages should be written. If left blank the output is written to standard
|
||||
# error (stderr).
|
||||
|
||||
WARN_LOGFILE =
|
||||
WARN_LOGFILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the input files
|
||||
@@ -790,10 +790,10 @@ WARN_LOGFILE =
|
||||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT =
|
||||
INPUT =
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
|
||||
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
|
||||
# possible encodings.
|
||||
@@ -896,7 +896,7 @@ EXCLUDE_SYMLINKS = NO
|
||||
# Note that the wildcards are matched against the file with absolute path, so to
|
||||
# exclude all test directories for example use the pattern */test/*
|
||||
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_PATTERNS =
|
||||
|
||||
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||
@@ -907,13 +907,13 @@ EXCLUDE_PATTERNS =
|
||||
# Note that the wildcards are matched against the file with absolute path, so to
|
||||
# exclude all test directories use the pattern */test/*
|
||||
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXCLUDE_SYMBOLS =
|
||||
|
||||
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
|
||||
# that contain example code fragments that are included (see the \include
|
||||
# command).
|
||||
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATH =
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
|
||||
@@ -933,7 +933,7 @@ EXAMPLE_RECURSIVE = NO
|
||||
# that contain images that are to be included in the documentation (see the
|
||||
# \image command).
|
||||
|
||||
IMAGE_PATH =
|
||||
IMAGE_PATH =
|
||||
|
||||
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||
@@ -954,7 +954,7 @@ IMAGE_PATH =
|
||||
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
|
||||
# properly processed by doxygen.
|
||||
|
||||
INPUT_FILTER =
|
||||
INPUT_FILTER =
|
||||
|
||||
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
|
||||
# basis. Doxygen will compare the file name with each pattern and apply the
|
||||
@@ -967,7 +967,7 @@ INPUT_FILTER =
|
||||
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
|
||||
# properly processed by doxygen.
|
||||
|
||||
FILTER_PATTERNS =
|
||||
FILTER_PATTERNS =
|
||||
|
||||
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
||||
# INPUT_FILTER) will also be used to filter the input files that are used for
|
||||
@@ -982,14 +982,14 @@ FILTER_SOURCE_FILES = NO
|
||||
# *.ext= (so without naming a filter).
|
||||
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
|
||||
|
||||
FILTER_SOURCE_PATTERNS =
|
||||
FILTER_SOURCE_PATTERNS =
|
||||
|
||||
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
|
||||
# is part of the input, its contents will be placed on the main page
|
||||
# (index.html). This can be useful if you have a project on for instance GitHub
|
||||
# and want to reuse the introduction page also for the doxygen output.
|
||||
|
||||
USE_MDFILE_AS_MAINPAGE =
|
||||
USE_MDFILE_AS_MAINPAGE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to source browsing
|
||||
@@ -1101,7 +1101,7 @@ COLS_IN_ALPHA_INDEX = 5
|
||||
# while generating the index headers.
|
||||
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
|
||||
|
||||
IGNORE_PREFIX =
|
||||
IGNORE_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the HTML output
|
||||
@@ -1145,7 +1145,7 @@ HTML_FILE_EXTENSION = .html
|
||||
# of the possible markers and block names see the documentation.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_HEADER =
|
||||
HTML_HEADER =
|
||||
|
||||
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
|
||||
# generated HTML page. If the tag is left blank doxygen will generate a standard
|
||||
@@ -1155,7 +1155,7 @@ HTML_HEADER =
|
||||
# that doxygen normally uses.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_FOOTER =
|
||||
HTML_FOOTER =
|
||||
|
||||
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
|
||||
# sheet that is used by each HTML page. It can be used to fine-tune the look of
|
||||
@@ -1167,7 +1167,7 @@ HTML_FOOTER =
|
||||
# obsolete.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_STYLESHEET =
|
||||
HTML_STYLESHEET =
|
||||
|
||||
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
|
||||
# cascading style sheets that are included after the standard style sheets
|
||||
@@ -1180,7 +1180,7 @@ HTML_STYLESHEET =
|
||||
# list). For an example see the documentation.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_EXTRA_STYLESHEET =
|
||||
HTML_EXTRA_STYLESHEET =
|
||||
|
||||
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
|
||||
# other source files which should be copied to the HTML output directory. Note
|
||||
@@ -1190,7 +1190,7 @@ HTML_EXTRA_STYLESHEET =
|
||||
# files will be copied as-is; there are no commands or markers available.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_EXTRA_FILES =
|
||||
HTML_EXTRA_FILES =
|
||||
|
||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
||||
# will adjust the colors in the style sheet and background images according to
|
||||
@@ -1319,7 +1319,7 @@ GENERATE_HTMLHELP = NO
|
||||
# written to the html output directory.
|
||||
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
||||
|
||||
CHM_FILE =
|
||||
CHM_FILE =
|
||||
|
||||
# The HHC_LOCATION tag can be used to specify the location (absolute path
|
||||
# including file name) of the HTML help compiler (hhc.exe). If non-empty,
|
||||
@@ -1327,7 +1327,7 @@ CHM_FILE =
|
||||
# The file has to be specified with full path.
|
||||
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
||||
|
||||
HHC_LOCATION =
|
||||
HHC_LOCATION =
|
||||
|
||||
# The GENERATE_CHI flag controls if a separate .chi index file is generated
|
||||
# (YES) or that it should be included in the master .chm file (NO).
|
||||
@@ -1340,7 +1340,7 @@ GENERATE_CHI = NO
|
||||
# and project file content.
|
||||
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
||||
|
||||
CHM_INDEX_ENCODING =
|
||||
CHM_INDEX_ENCODING =
|
||||
|
||||
# The BINARY_TOC flag controls whether a binary table of contents is generated
|
||||
# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
|
||||
@@ -1371,7 +1371,7 @@ GENERATE_QHP = NO
|
||||
# the HTML output folder.
|
||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||
|
||||
QCH_FILE =
|
||||
QCH_FILE =
|
||||
|
||||
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
|
||||
# Project output. For more information please see Qt Help Project / Namespace
|
||||
@@ -1396,7 +1396,7 @@ QHP_VIRTUAL_FOLDER = doc
|
||||
# filters).
|
||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||
|
||||
QHP_CUST_FILTER_NAME =
|
||||
QHP_CUST_FILTER_NAME =
|
||||
|
||||
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
|
||||
# custom filter to add. For more information please see Qt Help Project / Custom
|
||||
@@ -1404,21 +1404,21 @@ QHP_CUST_FILTER_NAME =
|
||||
# filters).
|
||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||
|
||||
QHP_CUST_FILTER_ATTRS =
|
||||
QHP_CUST_FILTER_ATTRS =
|
||||
|
||||
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
|
||||
# project's filter section matches. Qt Help Project / Filter Attributes (see:
|
||||
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
|
||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||
|
||||
QHP_SECT_FILTER_ATTRS =
|
||||
QHP_SECT_FILTER_ATTRS =
|
||||
|
||||
# The QHG_LOCATION tag can be used to specify the location of Qt's
|
||||
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
|
||||
# generated .qhp file.
|
||||
# This tag requires that the tag GENERATE_QHP is set to YES.
|
||||
|
||||
QHG_LOCATION =
|
||||
QHG_LOCATION =
|
||||
|
||||
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
|
||||
# generated, together with the HTML files, they form an Eclipse help plugin. To
|
||||
@@ -1551,7 +1551,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
|
||||
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
|
||||
# This tag requires that the tag USE_MATHJAX is set to YES.
|
||||
|
||||
MATHJAX_EXTENSIONS =
|
||||
MATHJAX_EXTENSIONS =
|
||||
|
||||
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
|
||||
# of code that will be used on startup of the MathJax code. See the MathJax site
|
||||
@@ -1559,7 +1559,7 @@ MATHJAX_EXTENSIONS =
|
||||
# example see the documentation.
|
||||
# This tag requires that the tag USE_MATHJAX is set to YES.
|
||||
|
||||
MATHJAX_CODEFILE =
|
||||
MATHJAX_CODEFILE =
|
||||
|
||||
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
|
||||
# the HTML output. The underlying search engine uses javascript and DHTML and
|
||||
@@ -1619,7 +1619,7 @@ EXTERNAL_SEARCH = NO
|
||||
# Searching" for details.
|
||||
# This tag requires that the tag SEARCHENGINE is set to YES.
|
||||
|
||||
SEARCHENGINE_URL =
|
||||
SEARCHENGINE_URL =
|
||||
|
||||
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
|
||||
# search data is written to a file for indexing by an external tool. With the
|
||||
@@ -1635,7 +1635,7 @@ SEARCHDATA_FILE = searchdata.xml
|
||||
# projects and redirect the results back to the right project.
|
||||
# This tag requires that the tag SEARCHENGINE is set to YES.
|
||||
|
||||
EXTERNAL_SEARCH_ID =
|
||||
EXTERNAL_SEARCH_ID =
|
||||
|
||||
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
|
||||
# projects other than the one defined by this configuration file, but that are
|
||||
@@ -1645,7 +1645,7 @@ EXTERNAL_SEARCH_ID =
|
||||
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
|
||||
# This tag requires that the tag SEARCHENGINE is set to YES.
|
||||
|
||||
EXTRA_SEARCH_MAPPINGS =
|
||||
EXTRA_SEARCH_MAPPINGS =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the LaTeX output
|
||||
@@ -1709,7 +1709,7 @@ PAPER_TYPE = a4wide
|
||||
# If left blank no extra packages will be included.
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
EXTRA_PACKAGES =
|
||||
EXTRA_PACKAGES =
|
||||
|
||||
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
|
||||
# generated LaTeX document. The header should contain everything until the first
|
||||
@@ -1725,7 +1725,7 @@ EXTRA_PACKAGES =
|
||||
# to HTML_HEADER.
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
LATEX_HEADER =
|
||||
LATEX_HEADER =
|
||||
|
||||
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
|
||||
# generated LaTeX document. The footer should contain everything after the last
|
||||
@@ -1736,7 +1736,7 @@ LATEX_HEADER =
|
||||
# Note: Only use a user-defined footer if you know what you are doing!
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
LATEX_FOOTER =
|
||||
LATEX_FOOTER =
|
||||
|
||||
# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
|
||||
# LaTeX style sheets that are included after the standard style sheets created
|
||||
@@ -1747,7 +1747,7 @@ LATEX_FOOTER =
|
||||
# list).
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
LATEX_EXTRA_STYLESHEET =
|
||||
LATEX_EXTRA_STYLESHEET =
|
||||
|
||||
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
|
||||
# other source files which should be copied to the LATEX_OUTPUT output
|
||||
@@ -1755,7 +1755,7 @@ LATEX_EXTRA_STYLESHEET =
|
||||
# markers available.
|
||||
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
||||
|
||||
LATEX_EXTRA_FILES =
|
||||
LATEX_EXTRA_FILES =
|
||||
|
||||
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
|
||||
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
|
||||
@@ -1863,14 +1863,14 @@ RTF_HYPERLINKS = NO
|
||||
# default style sheet that doxygen normally uses.
|
||||
# This tag requires that the tag GENERATE_RTF is set to YES.
|
||||
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_STYLESHEET_FILE =
|
||||
|
||||
# Set optional variables used in the generation of an RTF document. Syntax is
|
||||
# similar to doxygen's config file. A template extensions file can be generated
|
||||
# using doxygen -e rtf extensionFile.
|
||||
# This tag requires that the tag GENERATE_RTF is set to YES.
|
||||
|
||||
RTF_EXTENSIONS_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
|
||||
# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
|
||||
# with syntax highlighting in the RTF output.
|
||||
@@ -1915,7 +1915,7 @@ MAN_EXTENSION = .3
|
||||
# MAN_EXTENSION with the initial . removed.
|
||||
# This tag requires that the tag GENERATE_MAN is set to YES.
|
||||
|
||||
MAN_SUBDIR =
|
||||
MAN_SUBDIR =
|
||||
|
||||
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
|
||||
# will generate one additional man file for each entity documented in the real
|
||||
@@ -2028,7 +2028,7 @@ PERLMOD_PRETTY = YES
|
||||
# overwrite each other's variables.
|
||||
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
|
||||
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
@@ -2069,7 +2069,7 @@ SEARCH_INCLUDES = YES
|
||||
# preprocessor.
|
||||
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
|
||||
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_PATH =
|
||||
|
||||
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
||||
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
||||
@@ -2077,7 +2077,7 @@ INCLUDE_PATH =
|
||||
# used.
|
||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
|
||||
# The PREDEFINED tag can be used to specify one or more macro names that are
|
||||
# defined before the preprocessor is started (similar to the -D option of e.g.
|
||||
@@ -2087,7 +2087,7 @@ INCLUDE_FILE_PATTERNS =
|
||||
# recursively expanded use the := operator instead of the = operator.
|
||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||
|
||||
PREDEFINED =
|
||||
PREDEFINED =
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||
# tag can be used to specify a list of macro names that should be expanded. The
|
||||
@@ -2096,7 +2096,7 @@ PREDEFINED =
|
||||
# definition found in the source code.
|
||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||
|
||||
EXPAND_AS_DEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
|
||||
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
|
||||
# remove all references to function-like macros that are alone on a line, have
|
||||
@@ -2125,13 +2125,13 @@ SKIP_FUNCTION_MACROS = YES
|
||||
# the path). If a tag file is not located in the directory in which doxygen is
|
||||
# run, you must also specify the path to the tagfile here.
|
||||
|
||||
TAGFILES =
|
||||
TAGFILES =
|
||||
|
||||
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
|
||||
# tag file that is based on the input files it reads. See section "Linking to
|
||||
# external documentation" for more information about the usage of tag files.
|
||||
|
||||
GENERATE_TAGFILE =
|
||||
GENERATE_TAGFILE =
|
||||
|
||||
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
|
||||
# the class index. If set to NO, only the inherited external classes will be
|
||||
@@ -2180,14 +2180,14 @@ CLASS_DIAGRAMS = YES
|
||||
# the mscgen tool resides. If left empty the tool is assumed to be found in the
|
||||
# default search path.
|
||||
|
||||
MSCGEN_PATH =
|
||||
MSCGEN_PATH =
|
||||
|
||||
# You can include diagrams made with dia in doxygen documentation. Doxygen will
|
||||
# then run dia to produce the diagram and insert it in the documentation. The
|
||||
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
|
||||
# If left empty dia is assumed to be found in the default search path.
|
||||
|
||||
DIA_PATH =
|
||||
DIA_PATH =
|
||||
|
||||
# If set to YES the inheritance and collaboration graphs will hide inheritance
|
||||
# and usage relations if the target is undocumented or is not a class.
|
||||
@@ -2236,7 +2236,7 @@ DOT_FONTSIZE = 10
|
||||
# the path where dot can find it using this tag.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_FONTPATH =
|
||||
DOT_FONTPATH =
|
||||
|
||||
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
|
||||
# each documented class showing the direct and indirect inheritance relations.
|
||||
@@ -2367,7 +2367,7 @@ DOT_IMAGE_FORMAT = png
|
||||
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
||||
# enable generation of interactive SVG images that allow zooming and panning.
|
||||
#
|
||||
# Note that this requires a modern browser other than internet Explorer. Tested
|
||||
# Note that this requires a modern browser other than Internet Explorer. Tested
|
||||
# and working are Firefox, Chrome, Safari, and Opera.
|
||||
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
|
||||
# the SVG files visible. Older versions of IE do not have SVG support.
|
||||
@@ -2380,26 +2380,26 @@ INTERACTIVE_SVG = NO
|
||||
# found. If left blank, it is assumed the dot tool can be found in the path.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_PATH =
|
||||
DOT_PATH =
|
||||
|
||||
# The DOTFILE_DIRS tag can be used to specify one or more directories that
|
||||
# contain dot files that are included in the documentation (see the \dotfile
|
||||
# command).
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOTFILE_DIRS =
|
||||
DOTFILE_DIRS =
|
||||
|
||||
# The MSCFILE_DIRS tag can be used to specify one or more directories that
|
||||
# contain msc files that are included in the documentation (see the \mscfile
|
||||
# command).
|
||||
|
||||
MSCFILE_DIRS =
|
||||
MSCFILE_DIRS =
|
||||
|
||||
# The DIAFILE_DIRS tag can be used to specify one or more directories that
|
||||
# contain dia files that are included in the documentation (see the \diafile
|
||||
# command).
|
||||
|
||||
DIAFILE_DIRS =
|
||||
DIAFILE_DIRS =
|
||||
|
||||
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
|
||||
# path where java can find the plantuml.jar file. If left blank, it is assumed
|
||||
@@ -2407,17 +2407,17 @@ DIAFILE_DIRS =
|
||||
# generate a warning when it encounters a \startuml command in this case and
|
||||
# will not generate output for the diagram.
|
||||
|
||||
PLANTUML_JAR_PATH =
|
||||
PLANTUML_JAR_PATH =
|
||||
|
||||
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
|
||||
# configuration file for plantuml.
|
||||
|
||||
PLANTUML_CFG_FILE =
|
||||
PLANTUML_CFG_FILE =
|
||||
|
||||
# When using plantuml, the specified paths are searched for files specified by
|
||||
# the !include statement in a plantuml block.
|
||||
|
||||
PLANTUML_INCLUDE_PATH =
|
||||
PLANTUML_INCLUDE_PATH =
|
||||
|
||||
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
|
||||
# that will be shown in the graph. If the number of nodes in a graph becomes
|
||||
|
||||
+49
-29
@@ -1,9 +1,9 @@
|
||||
/** @mainpage Calyp Project
|
||||
/** @mainpage PlaYUVer Project
|
||||
|
||||
Description
|
||||
----------------------------------------------------------------
|
||||
|
||||
Calyp is an open-source video player with the following features:
|
||||
PlaYUVer is an open-source video player with the following features:
|
||||
- Support for libavformat and libavcodec;
|
||||
- Support for wide range of raw video formats;
|
||||
- Support up to 16 bits per pixel
|
||||
@@ -12,61 +12,81 @@ Calyp is an open-source video player with the following features:
|
||||
- Synchronized zoom across several videos (perfect for comparison operations)
|
||||
- Useful information in status bar, *e.g.*, pixel information
|
||||
Useful sidebars with frame information, *e.g.*, frame histogram
|
||||
- Constant growing libs for stream and frame processing (CalypStream and CalypFrame)
|
||||
- Constant growing libs for stream and frame processing (PlaYUVerStream and PlaYUVerFrame)
|
||||
- Advanced API for frame/video processing algorithms
|
||||
- Frame level quality measurement API based on the CalypFrame class
|
||||
- Frame level quality measurement API based on the PlaYUVerFrame class
|
||||
- Powefull command-line tool for quality and frame processing algorithms (uses the referred APIs)
|
||||
|
||||
Modules
|
||||
----------------------------------------------------------------
|
||||
- CalypLib: Low level library
|
||||
- CalypModules: Abstract interface for frame processing modules
|
||||
- Calyp: High level graphical interface
|
||||
- CalypTools: High level command line interface
|
||||
- PlaYUVerLib: Low level library
|
||||
- PlaYUVerModules: Abstract interface for frame processing modules
|
||||
- PlaYUVerApp: High level graphical interface
|
||||
- PlaYUVerTools: High level command line interface
|
||||
|
||||
|
||||
Supported Quality Metrics
|
||||
----------------------------------------------------------------
|
||||
- Peak Signal-to-Noise Ratio (PSNR)
|
||||
- Structural SIMilarity (SSIM)
|
||||
- Mean Square Error (MSE)
|
||||
- Weighted Spherical PSNR (WS-PSNR)
|
||||
|
||||
- PSNR
|
||||
- SSIM
|
||||
- MSE
|
||||
|
||||
Frame Processing Modules
|
||||
----------------------------------------------------------------
|
||||
- Component filtering
|
||||
- Frame difference, crop, shift, binarization and rotation
|
||||
- Frame difference, crop, shift, binarization
|
||||
- Sub-sampling operations
|
||||
- Measuring modules
|
||||
- Modules based on opencv:
|
||||
- Disparity estimation
|
||||
- Motion estimation
|
||||
* Disparity estimation
|
||||
* Motion estimation
|
||||
|
||||
Supported Formats
|
||||
----------------------------------------------------------------
|
||||
- Supports for the following pixel formats:
|
||||
* YUV: 444, 420, 422
|
||||
* YUV: 420, 44, 422, 400
|
||||
* RGB
|
||||
* Gray
|
||||
- Supported formats:
|
||||
* Raw video:
|
||||
* YUV: 444, 420, 422
|
||||
* RGB
|
||||
* Gray
|
||||
* Joint Photographic Experts Group (jpeg)
|
||||
* Portable Map (ppm, pgm)
|
||||
- Partially supported formats:
|
||||
- Support containers:
|
||||
* Raw video (yuv,rgb,gray)
|
||||
* Portable Network Graphics (png)
|
||||
* Joint Photographic Experts Group (jpeg)
|
||||
* Windows Bitmap (bmp)
|
||||
* Tagged Image File Format (tiff)
|
||||
* Portable Map (ppm,pgm,pbm)
|
||||
|
||||
Developers
|
||||
----------------------------------------------------------------
|
||||
|
||||
- [**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)
|
||||
- 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 playuver)
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DUSE_QT4=OFF -DUSE_FFMPEG=ON -DUSE_OPENCV=ON .. (for FFmpeg and OpenCV support)
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss
|
||||
version="2.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle"
|
||||
xmlns:fervor="https://github.com/pypt/fervor"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
|
||||
<channel>
|
||||
<title>Your Great App's Changelog</title>
|
||||
<link>http://pypt.github.com/fervor/Appcast.xml</link>
|
||||
<description>Most recent changes with links to updates.</description>
|
||||
<language>en</language>
|
||||
<atom:link href="http://pypt.github.com/fervor/Appcast.xml" rel="self" type="application/rss+xml" />
|
||||
|
||||
<item>
|
||||
<title>Version @PLAYUVER_VERSION_STRING@</title>
|
||||
<pubDate>Mon, 09 Jan 2006 19:20:11 +0000</pubDate>
|
||||
<guid isPermaLink="true">http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html</guid>
|
||||
|
||||
<!-- One of those (<link> is preferred by Fervor, <sparkle:releaseNotesLink> is used by Sparkle) -->
|
||||
<link>http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html</link> <!-- or -->
|
||||
<sparkle:releaseNotesLink>http://192.168.96.201/share/PlaYUVerProject/ReleaseNotes-@UPDATE_CHANNEL@.html</sparkle:releaseNotesLink>
|
||||
|
||||
<!--
|
||||
See QtGlobal's QT_OS_* constants for valid platform versions.
|
||||
-->
|
||||
|
||||
<!-- Windows version. -->
|
||||
<enclosure
|
||||
url="http://sourceforge.net/projects/playuver/files/playuver-@UPDATE_CHANNEL@-windows-amd64.zip/download "
|
||||
fervor:version="@PLAYUVER_VERSION_STRING@"
|
||||
fervor:platform="Q_OS_WIN32"
|
||||
fervor:dependencies="ALL"
|
||||
type="application/octet-stream" />
|
||||
|
||||
<!-- Linux version. -->
|
||||
<enclosure
|
||||
url="http://sourceforge.net/projects/playuver/files/playuver-@UPDATE_CHANNEL@-linux-amd64.zip/download"
|
||||
fervor:version="@PLAYUVER_VERSION_STRING@"
|
||||
fervor:platform="Q_OS_LINUX"
|
||||
fervor:dependencies="ALL"
|
||||
type="application/octet-stream" />
|
||||
|
||||
|
||||
</item>
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,14 +1,6 @@
|
||||
# Calyp
|
||||
# [PlaYUVer](https://github.com/pixlra/playuver)
|
||||
## Enhanced YUV video player based on Qt focusing on image/video analysis
|
||||
|
||||
## Build Status
|
||||
|
||||
| Master | Development |
|
||||
|--|--|
|
||||
|  |  |
|
||||
|
||||
[](https://ci.appveyor.com/project/jfmcarreira/calyp/branch/master)
|
||||
|
||||
|
||||
## Features
|
||||
- Support for libavformat and libavcodec;
|
||||
@@ -19,26 +11,25 @@
|
||||
- Synchronized zoom across several videos (perfect for comparison operations)
|
||||
- Useful information in status bar, *e.g.*, pixel information
|
||||
Useful sidebars with frame information, *e.g.*, frame histogram
|
||||
- Constant growing libs for stream and frame processing (CalypStream and CalypFrame)
|
||||
- Constant growing libs for stream and frame processing (PlaYUVerStream and PlaYUVerFrame)
|
||||
- Advanced API for frame/video processing algorithms
|
||||
- Frame level quality measurement API based on the CalypFrame class
|
||||
- Powerful command-line tool for quality and frame processing algorithms (uses the referred APIs)
|
||||
- Frame level quality measurement API based on the PlaYUVerFrame class
|
||||
- Powefull command-line tool for quality and frame processing algorithms (uses the referred APIs)
|
||||
|
||||
## Modules
|
||||
- CalypLib: Low level library
|
||||
- CalypModules: Abstract interface for frame processing modules
|
||||
- Calyp: High level graphical interface
|
||||
- CalypTools: High level command line interface
|
||||
- PlaYUVerLib: Low level library
|
||||
- PlaYUVerModules: Abstract interface for frame processing modules
|
||||
- PlaYUVerApp: High level graphical interface
|
||||
- PlaYUVerTools: High level command line interface
|
||||
|
||||
## Supported Quality Metrics
|
||||
- Peak Signal-to-Noise Ratio (PSNR)
|
||||
- Structural SIMilarity (SSIM)
|
||||
- Mean Square Error (MSE)
|
||||
- Weighted Spherical PSNR (WS-PSNR)
|
||||
- PSNR
|
||||
- SSIM
|
||||
- MSE
|
||||
|
||||
## Frame Processing Modules
|
||||
- Component filtering
|
||||
- Frame difference, crop, shift, binarization and rotation
|
||||
- Frame difference, crop, shift, binarization
|
||||
- Sub-sampling operations
|
||||
- Measuring modules
|
||||
- Modules based on opencv:
|
||||
@@ -47,41 +38,34 @@
|
||||
|
||||
## Supported Formats
|
||||
- Supports for the following pixel formats:
|
||||
* YUV: 444, 420, 422
|
||||
* YUV: 420, 44, 422, 400
|
||||
* RGB
|
||||
* Gray
|
||||
- Supported formats:
|
||||
* Raw video:
|
||||
* YUV: 444, 420, 422
|
||||
* RGB
|
||||
* Gray
|
||||
* Joint Photographic Experts Group (jpeg)
|
||||
* Portable Map (ppm, pgm)
|
||||
- Partially supported formats:
|
||||
- Support containers:
|
||||
* Raw video (yuv,rgb,gray)
|
||||
* Portable Network Graphics (png)
|
||||
* Joint Photographic Experts Group (jpeg)
|
||||
* Windows Bitmap (bmp)
|
||||
* Tagged Image File Format (tiff)
|
||||
* Portable Map (ppm,pgm,pbm)
|
||||
|
||||
## Development Team
|
||||
- [**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)
|
||||
## Developers
|
||||
- **Joao Carreira** (jfmcarreira@gmail.com)
|
||||
- **Luis Lucas** (luisfrlucas@gmail.com)
|
||||
|
||||
|
||||
### Binaries and Build
|
||||
* Packages are available for [Debian](https://launchpad.net/~pixlra/+archive/ubuntu/ppa)
|
||||
* **Daily builds** available for [Windows](https://github.com/pixlra/calyp-releases/blob/master/installers/win/calyp-latest.exe)
|
||||
* **Daily builds** available for Windows and Linux in our [SourceForge page](https://sourceforge.net/projects/playuver/)
|
||||
* **Dependencies**
|
||||
1. an ordinary C++ development environment (g++, make, C++ libraries and headers, ...)
|
||||
2. cmake
|
||||
3. a Qt development environment: QtCore, QtGui, QtWidgets, QtPrintSupport and QtConcurrent (version 5 or higher)
|
||||
3. a Qt development environment: QtCore, QtGui, QtWidgets, QtPrintSupport and QtConcurrent (version 4 or higher)
|
||||
4. Optional: QtDBus, OpenCV, FFmpeg
|
||||
* **List of required commands**
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DUSE_FFMPEG=ON -DUSE_OPENCV=ON .. (for FFmpeg and OpenCV support)
|
||||
cmake -DUSE_QT4=OFF -DUSE_FFMPEG=ON -DUSE_OPENCV=ON .. (for FFmpeg and OpenCV support)
|
||||
make
|
||||
make install
|
||||
```
|
||||
@@ -1,7 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Santos (joaompssantos@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,31 +24,32 @@
|
||||
* in KTikZ project
|
||||
*/
|
||||
|
||||
#include "AboutDialog.h"
|
||||
#include <config.h>
|
||||
|
||||
#include "AboutDialog.h"
|
||||
#include <QApplication>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define TAB_FROM_SPACES " "
|
||||
|
||||
AboutDialog::AboutDialog( QWidget* parent )
|
||||
: QDialog( parent )
|
||||
AboutDialog::AboutDialog( QWidget* parent ) : QDialog( parent )
|
||||
{
|
||||
QPixmap logo = QPixmap( ":logos/calyp-logo.png" ).scaledToWidth( 200, Qt::SmoothTransformation );
|
||||
QPixmap logo = QPixmap( ":/images/playuver-backgroud-logo.png" )
|
||||
.scaled( QSize( 500, 350 ), Qt::KeepAspectRatio );
|
||||
QLabel* pixmapLabel = new QLabel;
|
||||
pixmapLabel->setPixmap( logo );
|
||||
|
||||
QLabel* label = new QLabel( QString( "<h2 style='text-align:center'>%1</h2><h3 style='text-align:center'>Version %2</h3>" )
|
||||
.arg( tr( "Enhanced open-source video player" ) )
|
||||
.arg( QApplication::applicationVersion() ) );
|
||||
label->setWordWrap( false );
|
||||
QLabel* label =
|
||||
new QLabel( QString( "<h1 style='text-align:center'>%1 Version %2</h1><h2>%3</h2>" )
|
||||
.arg( QApplication::applicationName() )
|
||||
.arg( QApplication::applicationVersion() )
|
||||
.arg( tr( "Enhanced open-source Qt-based raw video player" ) ) );
|
||||
label->setWordWrap( true );
|
||||
|
||||
QString featuresList = QStringLiteral( "<p><h4><b>Features:</b></h4><ul>" );
|
||||
QString featuresList = QStringLiteral( "<p><b>Features:</b><ul>" );
|
||||
|
||||
#ifdef USE_QTDBUS
|
||||
featuresList.append( QStringLiteral( "<li>Support for Qt DBus messages" ) );
|
||||
@@ -61,23 +61,18 @@ AboutDialog::AboutDialog( QWidget* parent )
|
||||
featuresList.append( QStringLiteral( "<li>Support for OpenCV" ) );
|
||||
#endif
|
||||
featuresList.append( QStringLiteral( "</ul></p>" ) );
|
||||
|
||||
QLabel* labelFeatures = new QLabel( featuresList );
|
||||
|
||||
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" ) );
|
||||
QLabel* labelCopyright =
|
||||
new QLabel( QStringLiteral( "Copyright © 2014–2017 Luis Lucas and Joao Carreira" ) );
|
||||
|
||||
QWidget* topWidget = new QWidget;
|
||||
QVBoxLayout* topLayout = new QVBoxLayout;
|
||||
topLayout->addWidget( pixmapLabel, 0, Qt::AlignHCenter );
|
||||
topLayout->addWidget( pixmapLabel );
|
||||
topLayout->addWidget( label );
|
||||
topLayout->addWidget( labelCopyright );
|
||||
topLayout->addWidget( labelFeatures );
|
||||
topLayout->addWidget( labelContributors );
|
||||
topLayout->addWidget( labelCopyright );
|
||||
topWidget->setLayout( topLayout );
|
||||
|
||||
// QTextEdit *textEdit = new QTextEdit(tr("<p>This program is free "
|
||||
@@ -101,7 +96,4 @@ AboutDialog::AboutDialog( QWidget* parent )
|
||||
buttonBox->setFocus();
|
||||
|
||||
setWindowTitle( tr( "About %1" ).arg( QApplication::applicationName() ) );
|
||||
|
||||
// Prevent window resize
|
||||
this->layout()->setSizeConstraint( QLayout::SetFixedSize );
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
+138
-134
@@ -1,180 +1,184 @@
|
||||
#
|
||||
# CMakeLists for calyp app component
|
||||
#
|
||||
###
|
||||
### CMakeLists for playuver app component
|
||||
###
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR} ${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}/external )
|
||||
|
||||
OPTION(USE_QTDBUS "Build with QtDBus" ON)
|
||||
OPTION(USE_FERVOR "Add Fervor support" OFF)
|
||||
OPTION(CALYP_MANAGED_RESOURCES "Handle streams in separate threads" ON)
|
||||
OPTION(CALYP_THREADED_MODULES "Use threads for modules" ON)
|
||||
OPTION( USE_QT4 "Build with Qt4" OFF )
|
||||
OPTION( USE_QTDBUS "Build with QtDBus" ON )
|
||||
OPTION( USE_FERVOR "Add Fervor support" OFF )
|
||||
|
||||
ADD_SUBDIRECTORY(external)
|
||||
#####################################################################################
|
||||
# Qt library
|
||||
######################################################################################
|
||||
|
||||
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_QT4 )
|
||||
|
||||
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)
|
||||
FIND_PACKAGE( Qt4 REQUIRED COMPONENTS QtCore QtGui QtDBus QtNetwork QtWebKit )
|
||||
SET( USE_QTDBUS TRUE )
|
||||
IF( NOT QT4_FOUND )
|
||||
SET(USE_QT4 FALSE)
|
||||
ELSE()
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
|
||||
SET( QT_LINKER_LIBS ${QT_LIBRARIES} )
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
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( NOT USE_QT4 )
|
||||
FIND_PACKAGE( Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport Concurrent )
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Concurrent )
|
||||
LIST(APPEND QT_MODULES Core Gui Widgets PrintSupport Concurrent )
|
||||
|
||||
SET(Calyp_App_SRCS
|
||||
# Main
|
||||
main.cpp
|
||||
MainWindow.cpp
|
||||
# Module SubWindow
|
||||
SubWindowHandle.cpp
|
||||
MdiSubWindow.cpp
|
||||
SubWindowAbstract.cpp
|
||||
# Module Video
|
||||
ResourceHandle.cpp
|
||||
VideoHandle.cpp
|
||||
VideoSubWindow.cpp
|
||||
VideoStreamSubWindow.cpp
|
||||
ModuleSubWindow.cpp
|
||||
ViewArea.cpp
|
||||
GridManager.cpp
|
||||
# Module Quality
|
||||
QualityHandle.cpp
|
||||
PlotSubWindow.cpp
|
||||
# Module Plugins
|
||||
ModulesHandle.cpp
|
||||
CalypAppModuleIf.cpp
|
||||
# Dialogs
|
||||
dialog/AboutDialog.cpp
|
||||
dialog/ConfigureFormatDialog.cpp
|
||||
dialog/SubWindowSelectorDialog.cpp
|
||||
dialog/ProgressBar.cpp
|
||||
dialog/SeekStreamDialog.cpp
|
||||
dialog/ModulesHandleOptDialog.cpp
|
||||
# Widgets
|
||||
widgets/HistogramWidget.cpp
|
||||
widgets/FrameNumberWidget.cpp
|
||||
# Docks
|
||||
docks/FramePropertiesDock.cpp
|
||||
docks/ModuleHandleDock.cpp
|
||||
docks/QualityMeasurementSidebar.cpp
|
||||
)
|
||||
FIND_PACKAGE( Qt5DBus )
|
||||
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()
|
||||
|
||||
IF(USE_QTDBUS)
|
||||
LIST(APPEND Calyp_App_SRCS DBusAppAdaptor.cpp)
|
||||
ENDIF()
|
||||
|
||||
SET(Calyp_App_UI "")
|
||||
set(plaYUVer_App_SRCS
|
||||
# Main
|
||||
main.cpp
|
||||
PlaYUVerApp.cpp
|
||||
PlaYUVerSubWindowHandle.cpp
|
||||
PlaYUVerMdiSubWindow.cpp
|
||||
SubWindowAbstract.cpp
|
||||
# Module Video
|
||||
VideoSubWindow.cpp
|
||||
ViewArea.cpp
|
||||
VideoHandle.cpp
|
||||
FramePropertiesDock.cpp
|
||||
# Module Quality
|
||||
QualityHandle.cpp
|
||||
QualityMeasurementSidebar.cpp
|
||||
PlotSubWindow.cpp
|
||||
external/qcustomplot.cpp
|
||||
# Module Plugins
|
||||
ModulesHandle.cpp
|
||||
ModulesHandleOptDialog.cpp
|
||||
ModuleHandleDock.cpp
|
||||
PlaYUVerAppModuleIf.cpp
|
||||
GridManager.cpp
|
||||
# Dialogs
|
||||
AboutDialog.cpp
|
||||
ConfigureFormatDialog.cpp
|
||||
DialogSubWindowSelector.cpp
|
||||
ProgressBar.cpp
|
||||
SeekStreamDialog.cpp
|
||||
# Widgets
|
||||
HistogramWidget.cpp
|
||||
WidgetFrameNumber.cpp
|
||||
WidgetFrameNumber.cpp
|
||||
)
|
||||
|
||||
SET(Calyp_App_RCC resources/${PROJECT_NAME}.qrc)
|
||||
IF( USE_QTDBUS )
|
||||
LIST( APPEND plaYUVer_App_SRCS PlaYUVerAppAdaptor.cpp )
|
||||
ENDIF()
|
||||
|
||||
IF(USE_FERVOR)
|
||||
|
||||
SET(FERVOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/fervor)
|
||||
set(PlaYUVer_App_UI "" )
|
||||
|
||||
IF(EXISTS ${FERVOR_DIR})
|
||||
set(PlaYUVer_App_RCC
|
||||
resources/playuver.qrc
|
||||
)
|
||||
|
||||
SET(FERVOR_APP_NAME ${PROJECT_NAME})
|
||||
SET(FERVOR_APP_VERSION ${CALYP_VERSION_STRING})
|
||||
|
||||
ADD_SUBDIRECTORY(${FERVOR_DIR})
|
||||
|
||||
INCLUDE_DIRECTORIES(${FERVOR_DIR})
|
||||
|
||||
LIST(APPEND APP_LINKER_LIBS Fervor)
|
||||
IF( USE_FERVOR )
|
||||
|
||||
FIND_PACKAGE(Qt5 REQUIRED Network WebKit WebKitWidgets)
|
||||
SET( FERVOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/fervor )
|
||||
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Network Qt5::WebKit Qt5::WebKitWidgets)
|
||||
LIST(APPEND QT_MODULES Network WebKit WebKitWidgets)
|
||||
IF(EXISTS ${FERVOR_DIR} )
|
||||
|
||||
# LIST(APPEND APP_LINKER_LIBS ${FERVOR_DEPENDENCIES} )
|
||||
INCLUDE_DIRECTORIES(${FERVOR_INCLUDE_DIRS})
|
||||
SET( FERVOR_APP_NAME ${PROJECT_NAME} )
|
||||
SET( FERVOR_APP_VERSION ${PLAYUVER_VERSION_STRING} )
|
||||
|
||||
ADD_SUBDIRECTORY( ${FERVOR_DIR} )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${FERVOR_DIR} )
|
||||
|
||||
LIST(APPEND APP_LINKER_LIBS Fervor )
|
||||
|
||||
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} )
|
||||
|
||||
SET(QT_USE_QTNETWORK true)
|
||||
SET(QT_USE_QTWEBKIT true)
|
||||
|
||||
IF( WIN32 )
|
||||
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 )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5PrintSupport${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
ENDIF()
|
||||
|
||||
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})
|
||||
IF( USE_QT4 )
|
||||
QT4_WRAP_UI( PlaYUVer_App_UI_Wrap ${PlaYUVer_App_UI} )
|
||||
QT4_ADD_RESOURCES( PlaYUVer_App_RCC ${PlaYUVer_App_RCC} )
|
||||
ELSE()
|
||||
QT5_WRAP_UI( PlaYUVer_App_UI_Wrap ${PlaYUVer_App_UI} )
|
||||
QT5_ADD_RESOURCES( PlaYUVer_App_RCC ${PlaYUVer_App_RCC} )
|
||||
ENDIF()
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-enum-enum-conversion")
|
||||
ENDIF()
|
||||
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}
|
||||
COMMAND rc.exe /fo ${WINDOWS_RES_FILE} ${PROJECT_NAME}.rc
|
||||
IF( WIN32 )
|
||||
set(WINDOWS_RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/resources.obj)
|
||||
IF( MSVC )
|
||||
add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
|
||||
COMMAND rc.exe /fo ${WINDOWS_RES_FILE} playuver.rc
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources
|
||||
COMMENT "Add icon on windows platform"
|
||||
)
|
||||
ELSE()
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${WINDOWS_RES_FILE}
|
||||
COMMAND windres.exe ${PROJECT_NAME}.rc ${WINDOWS_RES_FILE}
|
||||
add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
|
||||
COMMAND windres.exe playuver.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()
|
||||
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)
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} ${plaYUVer_App_SRCS} ${HEADERS_MOC_FILES} ${PlaYUVer_App_UI_Wrap} ${PlaYUVer_App_RCC} ${WINDOWS_RES_FILE} )
|
||||
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PlaYUVerLib PlaYUVerModules ${APP_LINKER_LIBS} ${QT_LINKER_LIBS} )
|
||||
|
||||
IF( NOT USE_QT4 )
|
||||
QT5_USE_MODULES( ${PROJECT_NAME} ${QT_MODULES} )
|
||||
ENDIF()
|
||||
|
||||
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin )
|
||||
INSTALL(FILES resources/playuver.desktop DESTINATION share/applications )
|
||||
INSTALL(FILES resources/playuver.png DESTINATION share/pixmaps )
|
||||
INSTALL(FILES resources/playuver.xml DESTINATION share/mime/packages )
|
||||
|
||||
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
/* 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 CalypAppModuleIf.cpp
|
||||
* \brief Calyp modules interface
|
||||
*/
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "ModuleHandleDock.h"
|
||||
#include "ModuleSubWindow.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
CalypAppModuleIf::CalypAppModuleIf( QObject* parent, QAction* action, CalypModulePtr&& module )
|
||||
: m_pcModuleAction( action ), m_pcModule( std ::move( module ) )
|
||||
{
|
||||
setParent( parent );
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
setObjectName( m_pcModule->m_pchModuleName );
|
||||
#endif
|
||||
m_frameList.reserve( m_pcModule->m_uiNumberOfFrames );
|
||||
m_frameListPtr.reserve( m_pcModule->m_uiNumberOfFrames );
|
||||
m_pcSubWindow.resize( m_pcModule->m_uiNumberOfFrames, nullptr );
|
||||
}
|
||||
|
||||
CalypAppModuleIf::~CalypAppModuleIf()
|
||||
{
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
wait();
|
||||
#endif
|
||||
if( m_pcModuleDock )
|
||||
{
|
||||
auto* ptr = m_pcModuleDock;
|
||||
m_pcModuleDock = NULL;
|
||||
ptr->close();
|
||||
delete ptr;
|
||||
}
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
auto* ptr = m_pcDisplaySubWindow;
|
||||
m_pcDisplaySubWindow = NULL;
|
||||
ptr->closeSubWindow();
|
||||
delete ptr;
|
||||
}
|
||||
if( m_pcDockWidget )
|
||||
{
|
||||
m_pcDockWidget->close();
|
||||
delete m_pcDockWidget;
|
||||
}
|
||||
if( m_pcModule )
|
||||
{
|
||||
m_pcModule->destroy();
|
||||
m_pcModule = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void CalypAppModuleIf::update( bool isPlaying )
|
||||
{
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
m_pcDisplaySubWindow->refreshSubWindow();
|
||||
}
|
||||
else
|
||||
{
|
||||
apply( isPlaying );
|
||||
}
|
||||
}
|
||||
|
||||
// void CalypAppModuleIf::setPlaying( bool isPlaying )
|
||||
// {
|
||||
// if( m_pcDisplaySubWindow )
|
||||
// {
|
||||
// m_pcDisplaySubWindow->setPlaying( isPlaying );
|
||||
// }
|
||||
// }
|
||||
|
||||
bool CalypAppModuleIf::isRunning() const
|
||||
{
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
return QThread::isRunning();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CalypAppModuleIf::run()
|
||||
{
|
||||
bool result = process();
|
||||
if( result )
|
||||
{
|
||||
EventData* eventData = new EventData( m_bSuccess, this );
|
||||
QCoreApplication::postEvent( parent(), eventData );
|
||||
}
|
||||
}
|
||||
|
||||
bool CalypAppModuleIf::apply( bool isPlaying, bool disableThreads )
|
||||
{
|
||||
bool moduleExecuted = false;
|
||||
if( m_pcModule->m_iModuleType == ClpModuleType::FrameProcessing )
|
||||
{
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
m_pcDisplaySubWindow->setFillWindow( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcSubWindow[0]->setFillWindow( true );
|
||||
}
|
||||
}
|
||||
|
||||
if( !( isPlaying && m_pcModule->m_uiModuleRequirements.is_set( ClpModuleFeature::SkipWhilePlaying ) ) )
|
||||
{
|
||||
m_frameList.clear();
|
||||
for( unsigned int i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ )
|
||||
{
|
||||
m_frameList.push_back( m_pcSubWindow[i]->getCurrFrameAsset() );
|
||||
}
|
||||
|
||||
// Skip module is is already running
|
||||
if( isRunning() )
|
||||
return moduleExecuted;
|
||||
|
||||
moduleExecuted = true;
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
if( !disableThreads )
|
||||
{
|
||||
wait();
|
||||
start();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
process();
|
||||
QApplication::restoreOverrideCursor();
|
||||
show();
|
||||
}
|
||||
}
|
||||
return moduleExecuted;
|
||||
}
|
||||
|
||||
bool CalypAppModuleIf::process()
|
||||
{
|
||||
m_bSuccess = false;
|
||||
|
||||
if( m_frameList.empty() )
|
||||
return false;
|
||||
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
QMutexLocker locker( &m_Mutex );
|
||||
#endif
|
||||
|
||||
m_frameListPtr.clear();
|
||||
for( auto& frame : m_frameList )
|
||||
{
|
||||
m_frameListPtr.push_back( frame.get() );
|
||||
}
|
||||
|
||||
if( m_pcModule->m_iModuleType == ClpModuleType::FrameProcessing )
|
||||
{
|
||||
CalypFrame* framePtr{ nullptr };
|
||||
if( m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
|
||||
{
|
||||
framePtr = m_pcModule->process( m_frameListPtr );
|
||||
}
|
||||
else
|
||||
{
|
||||
framePtr = m_pcModule->process( m_pcSubWindow[0]->getCurrFrame() );
|
||||
}
|
||||
assert( framePtr != nullptr );
|
||||
m_pcProcessedFrame = std::shared_ptr<CalypFrame>{ framePtr, []( CalypFrame* ptr ) {} };
|
||||
}
|
||||
else if( m_pcModule->m_iModuleType == ClpModuleType::FrameMeasurement )
|
||||
{
|
||||
if( m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
|
||||
{
|
||||
m_dMeasurementResult = m_pcModule->measure( m_frameListPtr );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dMeasurementResult = m_pcModule->measure( m_pcSubWindow[0]->getCurrFrame() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_bSuccess = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalypAppModuleIf::show()
|
||||
{
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
if( m_canceling )
|
||||
return;
|
||||
#endif
|
||||
switch( m_pcModule->m_iModuleType )
|
||||
{
|
||||
case ClpModuleType::FrameProcessing: {
|
||||
auto displayWindow = qobject_cast<VideoSubWindow*>( m_pcDisplaySubWindow );
|
||||
if( displayWindow == nullptr )
|
||||
displayWindow = m_pcSubWindow[0];
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
if( m_Mutex.try_lock() )
|
||||
{
|
||||
displayWindow->setFillWindow( false );
|
||||
displayWindow->setCurrFrame( m_pcProcessedFrame );
|
||||
m_Mutex.unlock();
|
||||
}
|
||||
#else
|
||||
displayWindow->setFillWindow( false );
|
||||
displayWindow->setCurrFrame( m_pcProcessedFrame );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case ClpModuleType::FrameMeasurement:
|
||||
m_pcModuleDock->setModuleReturnValue( m_dMeasurementResult );
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
}
|
||||
}
|
||||
|
||||
void CalypAppModuleIf::disable()
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
m_canceling = true;
|
||||
m_Mutex.lock();
|
||||
m_Mutex.unlock();
|
||||
#endif
|
||||
m_frameList.clear();
|
||||
m_frameListPtr.clear();
|
||||
while( m_pcSubWindow.size() > 0 )
|
||||
{
|
||||
auto window = m_pcSubWindow.back();
|
||||
m_pcSubWindow.erase( m_pcSubWindow.end() - 1 );
|
||||
if( window != nullptr )
|
||||
window->disableModule( this );
|
||||
}
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
/* 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 CalypAppModuleIf.h
|
||||
* \brief Calyp App modules interface
|
||||
*/
|
||||
|
||||
#ifndef __CALYPAPPMODULESIF_H__
|
||||
#define __CALYPAPPMODULESIF_H__
|
||||
|
||||
#include <QEvent>
|
||||
#include <QPointer>
|
||||
#include <QVector>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
#include <QMutex>
|
||||
#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;
|
||||
class CalypStream;
|
||||
class CalypFrame;
|
||||
|
||||
class VideoSubWindow;
|
||||
class ModuleSubWindow;
|
||||
|
||||
class CalypAppModuleIf : std::enable_shared_from_this<CalypAppModuleIf>,
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
public QThread
|
||||
#else
|
||||
public QObject
|
||||
#endif
|
||||
{
|
||||
friend class ModulesHandle;
|
||||
friend class ModuleHandleDock;
|
||||
friend class ModulesHandleOptDialog;
|
||||
|
||||
public:
|
||||
class EventData : public QEvent
|
||||
{
|
||||
public:
|
||||
EventData( bool success, CalypAppModuleIf* module )
|
||||
: QEvent( QEvent::User ), m_bSuccess{ success }, m_pcModule{ module }
|
||||
{
|
||||
}
|
||||
bool m_bSuccess;
|
||||
QPointer<CalypAppModuleIf> m_pcModule;
|
||||
};
|
||||
|
||||
CalypAppModuleIf( QObject* parent, QAction* action, CalypModulePtr&& module );
|
||||
~CalypAppModuleIf();
|
||||
|
||||
auto getSubWindowList() const -> const std::vector<VideoSubWindow*>& { return m_pcSubWindow; }
|
||||
|
||||
CalypModuleIf* getModule() { return m_pcModule.get(); }
|
||||
auto getModuleRequirements() const -> ClpModuleFeatures { return m_pcModule->m_uiModuleRequirements; }
|
||||
std::string moduleInfo() const { return m_pcModule->moduleInfo(); }
|
||||
void update( bool isPlaying );
|
||||
bool apply( bool isPlaying = false, bool disableThreads = false );
|
||||
bool process();
|
||||
// void setPlaying( bool isPlaying );
|
||||
bool isRunning() const;
|
||||
void show();
|
||||
void disable();
|
||||
|
||||
protected:
|
||||
virtual void run();
|
||||
|
||||
private:
|
||||
bool m_bSuccess{ false };
|
||||
|
||||
QAction* m_pcModuleAction{ nullptr };
|
||||
CalypModulePtr m_pcModule{ nullptr };
|
||||
|
||||
std::vector<VideoSubWindow*> m_pcSubWindow;
|
||||
|
||||
// The module owns the related widgets
|
||||
ModuleSubWindow* m_pcDisplaySubWindow{ nullptr };
|
||||
QDockWidget* m_pcDockWidget{ nullptr };
|
||||
ModuleHandleDock* m_pcModuleDock{ nullptr };
|
||||
|
||||
std::unique_ptr<CalypStream> m_pcModuleStream{ nullptr };
|
||||
|
||||
std::vector<std::shared_ptr<CalypFrame>> m_frameList;
|
||||
std::vector<CalypFrame*> m_frameListPtr;
|
||||
|
||||
std::shared_ptr<CalypFrame> m_pcProcessedFrame{ nullptr };
|
||||
double m_dMeasurementResult{ 0 };
|
||||
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
QMutex m_Mutex;
|
||||
std::atomic<bool> m_canceling{ false };
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // __CALYPAPPMODULESIF_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -22,8 +22,6 @@
|
||||
* \brief Dialog box to set the sequence resolution
|
||||
*/
|
||||
|
||||
#include "ConfigureFormatDialog.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -37,15 +35,17 @@
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
|
||||
#include "ConfigureFormatDialog.h"
|
||||
|
||||
#define MAX_SUPPORTED_RESOLUTION 99999
|
||||
|
||||
QDataStream& operator<<( QDataStream& out, const CalypStandardResolutionVector& array )
|
||||
QDataStream& operator<<( QDataStream& out, const PlaYUVerStdResolutionVector& array )
|
||||
{
|
||||
CalypStandardResolution d;
|
||||
PlaYUVerStdResolution d;
|
||||
out << array.size();
|
||||
for( int i = 0; i < array.size(); i++ )
|
||||
for( Int i = 0; i < array.size(); i++ )
|
||||
{
|
||||
d = array.at( i );
|
||||
out << QString::fromStdString( d.shortName ) << d.uiWidth << d.uiHeight;
|
||||
@@ -53,13 +53,13 @@ QDataStream& operator<<( QDataStream& out, const CalypStandardResolutionVector&
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream& operator>>( QDataStream& in, CalypStandardResolutionVector& array )
|
||||
QDataStream& operator>>( QDataStream& in, PlaYUVerStdResolutionVector& array )
|
||||
{
|
||||
CalypStandardResolution d;
|
||||
PlaYUVerStdResolution d;
|
||||
QString auxName;
|
||||
int array_size;
|
||||
Int array_size;
|
||||
in >> array_size;
|
||||
for( int i = 0; i < array_size; i++ )
|
||||
for( Int i = 0; i < array_size; i++ )
|
||||
{
|
||||
in >> auxName;
|
||||
d.shortName = auxName.toStdString();
|
||||
@@ -73,8 +73,7 @@ QDataStream& operator>>( QDataStream& in, CalypStandardResolutionVector& array )
|
||||
class AddCustomFormat : public QDialog
|
||||
{
|
||||
public:
|
||||
AddCustomFormat( QWidget* parent = NULL )
|
||||
: QDialog( parent, Qt::Dialog | Qt::WindowTitleHint )
|
||||
AddCustomFormat( QWidget* parent = NULL ) : QDialog( parent, Qt::Dialog | Qt::WindowTitleHint )
|
||||
{
|
||||
setWindowModality( Qt::ApplicationModal );
|
||||
setWindowTitle( "Add custom resolution" );
|
||||
@@ -118,9 +117,9 @@ public:
|
||||
connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
}
|
||||
|
||||
CalypStandardResolution runDialog()
|
||||
PlaYUVerStdResolution runDialog()
|
||||
{
|
||||
CalypStandardResolution stdResolution;
|
||||
PlaYUVerStdResolution stdResolution;
|
||||
stdResolution.shortName = "";
|
||||
if( exec() == QDialog::Accepted )
|
||||
{
|
||||
@@ -137,29 +136,31 @@ private:
|
||||
QSpinBox* m_spinHeight;
|
||||
};
|
||||
|
||||
ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
: QDialog( parent )
|
||||
ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( parent )
|
||||
{
|
||||
QString Name;
|
||||
unsigned int uiWidth, uiHeight;
|
||||
UInt uiWidth, uiHeight;
|
||||
|
||||
readSettings();
|
||||
for( int i = 0; i < aRCustomFileFormats.size(); i++ )
|
||||
for( Int i = 0; i < aRCustomFileFormats.size(); i++ )
|
||||
{
|
||||
Name = QString::fromStdString( aRCustomFileFormats[i].shortName );
|
||||
uiWidth = aRCustomFileFormats[i].uiWidth;
|
||||
uiHeight = aRCustomFileFormats[i].uiHeight;
|
||||
standardResolutionNames.append( QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
standardResolutionNames.append(
|
||||
QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
standardResolutionSizes.append( QSize( uiWidth, uiHeight ) );
|
||||
}
|
||||
|
||||
std::vector<CalypStandardResolution> listCalypStdResolution = CalypStream::stdResolutionSizes();
|
||||
for( unsigned int i = 0; i < listCalypStdResolution.size(); i++ )
|
||||
std::vector<PlaYUVerStdResolution> listPlaYUVerStdResolution =
|
||||
PlaYUVerStream::stdResolutionSizes();
|
||||
for( UInt i = 0; i < listPlaYUVerStdResolution.size(); i++ )
|
||||
{
|
||||
Name = QString::fromStdString( listCalypStdResolution[i].shortName );
|
||||
uiWidth = listCalypStdResolution[i].uiWidth;
|
||||
uiHeight = listCalypStdResolution[i].uiHeight;
|
||||
standardResolutionNames.append( QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
Name = QString::fromStdString( listPlaYUVerStdResolution[i].shortName );
|
||||
uiWidth = listPlaYUVerStdResolution[i].uiWidth;
|
||||
uiHeight = listPlaYUVerStdResolution[i].uiHeight;
|
||||
standardResolutionNames.append(
|
||||
QString( "%1 (%2x%3)" ).arg( Name ).arg( uiWidth ).arg( uiHeight ) );
|
||||
standardResolutionSizes.append( QSize( uiWidth, uiHeight ) );
|
||||
}
|
||||
|
||||
@@ -207,7 +208,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
m_labelFilename = new QLabel();
|
||||
m_labelFilename->setFont( titleFont );
|
||||
filenameLayout->addWidget( filenameLabel );
|
||||
filenameLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
filenameLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
filenameLayout->addWidget( m_labelFilename );
|
||||
MainLayout->addLayout( filenameLayout );
|
||||
|
||||
@@ -283,18 +285,21 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
m_comboBoxPixelFormat->setFont( normalFont );
|
||||
m_comboBoxPixelFormat->clear();
|
||||
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedColorSpacesListNames().size(); i++ )
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedColorSpacesListNames().size(); i++ )
|
||||
{
|
||||
m_comboBoxColorSpace->insertItem( i, CalypFrame::supportedColorSpacesListNames()[i].c_str() );
|
||||
m_comboBoxColorSpace->insertItem( i,
|
||||
PlaYUVerFrame::supportedColorSpacesListNames()[i].c_str() );
|
||||
}
|
||||
m_comboBoxColorSpace->setCurrentIndex( 1 );
|
||||
|
||||
pixelGridLayout->addWidget( colorSpaceLabel, 0, 0 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ),
|
||||
0, 1 );
|
||||
pixelGridLayout->addWidget( m_comboBoxColorSpace, 0, 2 );
|
||||
|
||||
pixelGridLayout->addWidget( pixelFormatLabel, 1, 0 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 1 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ),
|
||||
1, 1 );
|
||||
pixelGridLayout->addWidget( m_comboBoxPixelFormat, 1, 2 );
|
||||
|
||||
QLabel* bitsPerPelLabel = new QLabel();
|
||||
@@ -306,7 +311,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
m_spinBoxBits->setRange( 0, 16 );
|
||||
m_spinBoxBits->setValue( 8 );
|
||||
pixelGridLayout->addWidget( bitsPerPelLabel, 2, 0 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ), 2, 1 );
|
||||
pixelGridLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ),
|
||||
2, 1 );
|
||||
pixelGridLayout->addWidget( m_spinBoxBits, 2, 2 );
|
||||
|
||||
/*
|
||||
@@ -323,7 +329,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
m_comboBoxEndianness->addItem( QStringLiteral( "Big Endian" ) );
|
||||
m_comboBoxEndianness->addItem( QStringLiteral( "Little Endian" ) );
|
||||
endiannessLayout->addWidget( endiannessLabel );
|
||||
endiannessLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
endiannessLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
endiannessLayout->addWidget( m_comboBoxEndianness );
|
||||
m_widgetEndianness = new QWidget();
|
||||
m_widgetEndianness->setContentsMargins( 0, 0, 0, 0 );
|
||||
@@ -343,7 +350,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
m_spinBoxFrameRate->setRange( 0, 1000 );
|
||||
m_spinBoxFrameRate->setValue( 30 );
|
||||
framerateFormatLayout->addWidget( framerateFormatLabel );
|
||||
framerateFormatLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
framerateFormatLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
framerateFormatLayout->addWidget( m_spinBoxFrameRate );
|
||||
QWidget* framerateWidget = new QWidget();
|
||||
framerateWidget->setContentsMargins( 0, 0, 0, 0 );
|
||||
@@ -371,7 +379,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
SLOT( slotStandardResolutionSelected( int ) ) );
|
||||
connect( m_spinBoxWidth, SIGNAL( valueChanged( int ) ), this, SLOT( slotResolutionChange() ) );
|
||||
connect( m_spinBoxheight, SIGNAL( valueChanged( int ) ), this, SLOT( slotResolutionChange() ) );
|
||||
connect( m_comboBoxColorSpace, SIGNAL( currentIndexChanged( int ) ), this, SLOT( slotColorSpaceChange( int ) ) );
|
||||
connect( m_comboBoxColorSpace, SIGNAL( currentIndexChanged( int ) ), this,
|
||||
SLOT( slotColorSpaceChange( int ) ) );
|
||||
connect( m_spinBoxBits, SIGNAL( valueChanged( int ) ), this, SLOT( slotBitsChange( int ) ) );
|
||||
|
||||
connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
@@ -382,28 +391,13 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
setFixedSize( MainLayout->sizeHint() );
|
||||
}
|
||||
|
||||
auto findPelFormatColorSpace( ClpPixelFormats rInputFormat ) -> std::pair<int, std::int64_t>
|
||||
{
|
||||
if( rInputFormat != ClpPixelFormats::Invalid )
|
||||
{
|
||||
auto pelFmtName = CalypFrame::pixelFormatName( rInputFormat );
|
||||
for( unsigned int j = 0; j < CalypFrame::supportedColorSpacesListNames().size(); j++ )
|
||||
{
|
||||
const auto& formats_list = CalypFrame::supportedPixelFormatListNames( j );
|
||||
for( const auto& [key, name] : formats_list )
|
||||
{
|
||||
if( pelFmtName == name )
|
||||
{
|
||||
return std::make_pair( j, static_cast<int>( key ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::make_pair( 0, 0 );
|
||||
}
|
||||
|
||||
int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, unsigned int& rWidth, unsigned int& rHeight,
|
||||
ClpPixelFormats& rInputFormat, unsigned int& rBits, int& rEndianess, unsigned int& rFrameRate )
|
||||
Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
|
||||
UInt& rWidth,
|
||||
UInt& rHeight,
|
||||
Int& rInputFormat,
|
||||
UInt& rBits,
|
||||
Int& rEndianess,
|
||||
UInt& rFrameRate )
|
||||
{
|
||||
// Set default values
|
||||
// setWindowTitle( "Configure resolution for " + Filename );
|
||||
@@ -411,8 +405,24 @@ int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, un
|
||||
m_spinBoxWidth->setValue( rWidth );
|
||||
m_spinBoxheight->setValue( rHeight );
|
||||
|
||||
auto [colorSpace, sampling] = findPelFormatColorSpace( rInputFormat );
|
||||
|
||||
Int colorSpace = 0;
|
||||
Int sampling = 0;
|
||||
if( rInputFormat >= 0 )
|
||||
{
|
||||
String pelFmtName = PlaYUVerFrame::supportedPixelFormatListNames()[rInputFormat];
|
||||
for( UInt j = 0; j < PlaYUVerFrame::supportedColorSpacesListNames().size(); j++ )
|
||||
{
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames( j ).size(); i++ )
|
||||
{
|
||||
if( pelFmtName == PlaYUVerFrame::supportedPixelFormatListNames( j )[i] )
|
||||
{
|
||||
colorSpace = j;
|
||||
sampling = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_comboBoxColorSpace->setCurrentIndex( colorSpace );
|
||||
m_comboBoxPixelFormat->setCurrentIndex( sampling );
|
||||
m_spinBoxBits->setValue( rBits );
|
||||
@@ -427,7 +437,7 @@ int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, un
|
||||
}
|
||||
m_spinBoxFrameRate->setValue( rFrameRate );
|
||||
|
||||
for( int i = 0; i < standardResolutionSizes.size() - 1; i++ )
|
||||
for( Int i = 0; i < standardResolutionSizes.size() - 1; i++ )
|
||||
{
|
||||
if( standardResolutionSizes.at( i ) == QSize( rWidth, rHeight ) )
|
||||
{
|
||||
@@ -445,8 +455,16 @@ int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, un
|
||||
rWidth = m_spinBoxWidth->value();
|
||||
rHeight = m_spinBoxheight->value();
|
||||
colorSpace = m_comboBoxColorSpace->currentIndex();
|
||||
sampling = m_comboBoxPixelFormat->currentData().toInt();
|
||||
rInputFormat = static_cast<ClpPixelFormats>( sampling );
|
||||
sampling = m_comboBoxPixelFormat->currentIndex();
|
||||
String pelFmtName = PlaYUVerFrame::supportedPixelFormatListNames( colorSpace )[sampling];
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames().size(); i++ )
|
||||
{
|
||||
if( pelFmtName == PlaYUVerFrame::supportedPixelFormatListNames()[i] )
|
||||
{
|
||||
rInputFormat = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
rBits = m_spinBoxBits->value();
|
||||
rEndianess = m_comboBoxEndianness->currentIndex();
|
||||
rFrameRate = m_spinBoxFrameRate->value();
|
||||
@@ -454,19 +472,21 @@ int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, un
|
||||
return QDialog::Accepted;
|
||||
}
|
||||
|
||||
void ConfigureFormatDialog::slotStandardResolutionSelected( int idx )
|
||||
void ConfigureFormatDialog::slotStandardResolutionSelected( Int idx )
|
||||
{
|
||||
if( idx == standardResolutionSizes.size() - 1 )
|
||||
{
|
||||
AddCustomFormat* pcCustomFmtDialog = new AddCustomFormat;
|
||||
CalypStandardResolution customResolution = pcCustomFmtDialog->runDialog();
|
||||
PlaYUVerStdResolution customResolution = pcCustomFmtDialog->runDialog();
|
||||
aRCustomFileFormats.append( customResolution );
|
||||
if( customResolution.shortName != "" )
|
||||
{
|
||||
QString name = QString::fromStdString( customResolution.shortName );
|
||||
name.append( QString( " (%2x%3)" ).arg( customResolution.uiWidth ).arg( customResolution.uiHeight ) );
|
||||
name.append(
|
||||
QString( " (%2x%3)" ).arg( customResolution.uiWidth ).arg( customResolution.uiHeight ) );
|
||||
standardResolutionNames.insert( 0, name );
|
||||
standardResolutionSizes.insert( 0, QSize( customResolution.uiWidth, customResolution.uiHeight ) );
|
||||
standardResolutionSizes.insert(
|
||||
0, QSize( customResolution.uiWidth, customResolution.uiHeight ) );
|
||||
|
||||
m_comboBoxStandardResolution->blockSignals( true );
|
||||
m_comboBoxStandardResolution->insertItem( 0, name );
|
||||
@@ -489,10 +509,11 @@ void ConfigureFormatDialog::slotStandardResolutionSelected( int idx )
|
||||
void ConfigureFormatDialog::slotResolutionChange()
|
||||
{
|
||||
m_comboBoxStandardResolution->blockSignals( true );
|
||||
int newIdx = -1;
|
||||
for( int i = 0; i < standardResolutionSizes.size(); i++ )
|
||||
Int newIdx = -1;
|
||||
for( Int i = 0; i < standardResolutionSizes.size(); i++ )
|
||||
{
|
||||
if( standardResolutionSizes.at( i ) == QSize( m_spinBoxWidth->value(), m_spinBoxheight->value() ) )
|
||||
if( standardResolutionSizes.at( i ) ==
|
||||
QSize( m_spinBoxWidth->value(), m_spinBoxheight->value() ) )
|
||||
{
|
||||
newIdx = i;
|
||||
break;
|
||||
@@ -502,21 +523,21 @@ void ConfigureFormatDialog::slotResolutionChange()
|
||||
m_comboBoxStandardResolution->blockSignals( false );
|
||||
}
|
||||
|
||||
void ConfigureFormatDialog::slotColorSpaceChange( int idx )
|
||||
Void ConfigureFormatDialog::slotColorSpaceChange( Int idx )
|
||||
{
|
||||
if( idx == -1 )
|
||||
return;
|
||||
|
||||
m_comboBoxPixelFormat->clear();
|
||||
const auto& formats_list = CalypFrame::supportedPixelFormatListNames( idx );
|
||||
for( const auto& [key, name] : formats_list )
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames( idx ).size(); i++ )
|
||||
{
|
||||
m_comboBoxPixelFormat->addItem( QString::fromStdString( std::string( name ) ), static_cast<int>( key ) );
|
||||
m_comboBoxPixelFormat->insertItem(
|
||||
i, PlaYUVerFrame::supportedPixelFormatListNames( idx )[i].c_str() );
|
||||
}
|
||||
m_comboBoxPixelFormat->setCurrentIndex( 0 );
|
||||
}
|
||||
|
||||
void ConfigureFormatDialog::slotBitsChange( int idx )
|
||||
Void ConfigureFormatDialog::slotBitsChange( Int idx )
|
||||
{
|
||||
if( idx > 8 )
|
||||
{
|
||||
@@ -528,17 +549,17 @@ void ConfigureFormatDialog::slotBitsChange( int idx )
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureFormatDialog::readSettings()
|
||||
Void ConfigureFormatDialog::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
QVariant value = appSettings.value( "ConfigureFormatDialog/CustomFormats" );
|
||||
aRCustomFileFormats = value.value<CalypStandardResolutionVector>();
|
||||
aRCustomFileFormats = value.value<PlaYUVerStdResolutionVector>();
|
||||
}
|
||||
|
||||
void ConfigureFormatDialog::writeSettings()
|
||||
Void ConfigureFormatDialog::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
QVariant var;
|
||||
var.setValue<CalypStandardResolutionVector>( aRCustomFileFormats );
|
||||
var.setValue<PlaYUVerStdResolutionVector>( aRCustomFileFormats );
|
||||
appSettings.setValue( "ConfigureFormatDialog/CustomFormats", var );
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "lib/CalypStream.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
|
||||
class QComboBox;
|
||||
class QHBoxLayout;
|
||||
@@ -38,9 +38,9 @@ class QSpinBox;
|
||||
class QString;
|
||||
class QWidget;
|
||||
|
||||
using CalypStandardResolutionVector = QVector<CalypStandardResolution>;
|
||||
QDataStream& operator<<( QDataStream& out, const CalypStandardResolutionVector& array );
|
||||
QDataStream& operator>>( QDataStream& in, CalypStandardResolutionVector& array );
|
||||
typedef QVector<PlaYUVerStdResolution> PlaYUVerStdResolutionVector;
|
||||
QDataStream& operator<<( QDataStream& out, const PlaYUVerStdResolutionVector& array );
|
||||
QDataStream& operator>>( QDataStream& in, PlaYUVerStdResolutionVector& array );
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -51,11 +51,16 @@ class ConfigureFormatDialog : public QDialog
|
||||
|
||||
public:
|
||||
ConfigureFormatDialog( QWidget* parent = 0 );
|
||||
int runConfigureFormatDialog( const QString& Filename, unsigned int& rWidth, unsigned int& rHeight, ClpPixelFormats& rInputFormat, unsigned int& rBits,
|
||||
int& rEndianess, unsigned int& rFrameRate );
|
||||
Int runConfigureFormatDialog( const QString& Filename,
|
||||
UInt& rWidth,
|
||||
UInt& rHeight,
|
||||
Int& rInputFormat,
|
||||
UInt& rBits,
|
||||
Int& rEndianess,
|
||||
UInt& rFrameRate );
|
||||
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotStandardResolutionSelected( int );
|
||||
@@ -66,7 +71,7 @@ private Q_SLOTS:
|
||||
private:
|
||||
QStringList standardResolutionNames;
|
||||
QVector<QSize> standardResolutionSizes;
|
||||
CalypStandardResolutionVector aRCustomFileFormats;
|
||||
PlaYUVerStdResolutionVector aRCustomFileFormats;
|
||||
|
||||
QLabel* m_labelFilename;
|
||||
QComboBox* m_comboBoxStandardResolution;
|
||||
@@ -81,7 +86,7 @@ private:
|
||||
QSpinBox* m_spinBoxFrameRate;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( CalypStandardResolution )
|
||||
Q_DECLARE_METATYPE( CalypStandardResolutionVector )
|
||||
Q_DECLARE_METATYPE( PlaYUVerStdResolution );
|
||||
Q_DECLARE_METATYPE( PlaYUVerStdResolutionVector );
|
||||
|
||||
#endif // __CONFIGUREFORMATDIALOG_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -22,16 +22,17 @@
|
||||
* \brief Dialog box to select sub windows
|
||||
*/
|
||||
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "PlaYUVerSubWindowHandle.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 )
|
||||
DialogSubWindowSelector::DialogSubWindowSelector( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager,
|
||||
UInt uiCategory,
|
||||
Int minWindowsSelected,
|
||||
Int maxWindowsSelected )
|
||||
: QDialog( parent )
|
||||
, m_uiCategory( uiCategory )
|
||||
, m_iMinSelectedWindows( minWindowsSelected )
|
||||
@@ -86,7 +87,7 @@ SubWindowSelectorDialog::SubWindowSelectorDialog( QWidget* parent, SubWindowHand
|
||||
QString currSubWindowName;
|
||||
QCheckBox* windowCheckBox;
|
||||
m_apcSubWindowList = m_pcMainWindowManager->findSubWindow( m_uiCategory );
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
subWindow = m_apcSubWindowList.at( i );
|
||||
currSubWindowName = subWindow->getWindowName();
|
||||
@@ -101,17 +102,17 @@ SubWindowSelectorDialog::SubWindowSelectorDialog( QWidget* parent, SubWindowHand
|
||||
setFixedSize( mainLayout->sizeHint() );
|
||||
}
|
||||
|
||||
void SubWindowSelectorDialog::updateSubWindowList()
|
||||
Void DialogSubWindowSelector::updateSubWindowList()
|
||||
{
|
||||
QLayout* pcLayout = m_pcGroupCheckBox->layout();
|
||||
QLayoutItem* pcLayoutItem;
|
||||
QCheckBox* windowCheckBox;
|
||||
int iIdx;
|
||||
Int iIdx;
|
||||
|
||||
/**
|
||||
* Remove all check boxes
|
||||
*/
|
||||
for( int i = 0; i < pcLayout->count(); i++ )
|
||||
for( Int i = 0; i < pcLayout->count(); i++ )
|
||||
{
|
||||
pcLayoutItem = pcLayout->itemAt( i );
|
||||
if( pcLayoutItem )
|
||||
@@ -121,7 +122,7 @@ void SubWindowSelectorDialog::updateSubWindowList()
|
||||
}
|
||||
}
|
||||
|
||||
for( int i = 0; i < m_apcSelectedSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < m_apcSelectedSubWindowList.size(); i++ )
|
||||
{
|
||||
iIdx = m_apcSubWindowList.indexOf( m_apcSelectedSubWindowList.at( i ) );
|
||||
if( iIdx >= 0 )
|
||||
@@ -130,23 +131,23 @@ void SubWindowSelectorDialog::updateSubWindowList()
|
||||
m_pcGroupCheckBox->layout()->addWidget( windowCheckBox );
|
||||
}
|
||||
}
|
||||
for( int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
for( Int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
{
|
||||
if( !m_apcSelectedSubWindowList.contains( m_apcSubWindowList.at( i ) ) )
|
||||
m_pcGroupCheckBox->layout()->addWidget( m_apcWindowsListCheckBox.at( i ) );
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowSelectorDialog::selectSubWindow( SubWindowAbstract* subWindow )
|
||||
Void DialogSubWindowSelector::selectSubWindow( SubWindowAbstract* subWindow )
|
||||
{
|
||||
int iIdx = m_apcSubWindowList.indexOf( subWindow );
|
||||
Int iIdx = m_apcSubWindowList.indexOf( subWindow );
|
||||
if( iIdx >= 0 )
|
||||
{
|
||||
m_apcWindowsListCheckBox.at( iIdx )->setChecked( true );
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowSelectorDialog::update()
|
||||
Void DialogSubWindowSelector::update()
|
||||
{
|
||||
if( m_apcSelectedSubWindowList.size() > 0 )
|
||||
{
|
||||
@@ -178,7 +179,7 @@ void SubWindowSelectorDialog::update()
|
||||
}
|
||||
if( m_apcSelectedSubWindowList.size() >= m_iMaxSlectedWindows )
|
||||
{
|
||||
for( int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
for( Int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
{
|
||||
if( m_apcSelectedSubWindowList.contains( m_apcSubWindowList.at( i ) ) )
|
||||
{
|
||||
@@ -192,7 +193,7 @@ void SubWindowSelectorDialog::update()
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
for( Int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
{
|
||||
m_apcWindowsListCheckBox.at( i )->setEnabled( true );
|
||||
}
|
||||
@@ -203,9 +204,9 @@ void SubWindowSelectorDialog::update()
|
||||
|
||||
// ----------------------- Slot Functions -----------------------
|
||||
|
||||
void SubWindowSelectorDialog::toggleSubWindow( int idx )
|
||||
Void DialogSubWindowSelector::toggleSubWindow( Int idx )
|
||||
{
|
||||
bool isChecked = m_apcWindowsListCheckBox.at( idx )->isChecked();
|
||||
Bool isChecked = m_apcWindowsListCheckBox.at( idx )->isChecked();
|
||||
|
||||
if( isChecked )
|
||||
{
|
||||
@@ -218,19 +219,19 @@ void SubWindowSelectorDialog::toggleSubWindow( int idx )
|
||||
update();
|
||||
}
|
||||
|
||||
void SubWindowSelectorDialog::addAllSubWindow()
|
||||
Void DialogSubWindowSelector::addAllSubWindow()
|
||||
{
|
||||
m_apcSelectedSubWindowList.clear();
|
||||
for( int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
for( Int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
{
|
||||
m_apcWindowsListCheckBox.at( i )->setChecked( true );
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void SubWindowSelectorDialog::removeAllSubWindow()
|
||||
Void DialogSubWindowSelector::removeAllSubWindow()
|
||||
{
|
||||
for( int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
for( Int i = 0; i < m_apcWindowsListCheckBox.size(); i++ )
|
||||
{
|
||||
m_apcWindowsListCheckBox.at( i )->setChecked( false );
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,41 +25,48 @@
|
||||
#ifndef __DIALOGSUBWINDOWSELECTOR_H__
|
||||
#define __DIALOGSUBWINDOWSELECTOR_H__
|
||||
|
||||
#include <QVector>
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include <QtCore>
|
||||
|
||||
#include <QVector>
|
||||
|
||||
class QPixmap;
|
||||
class QColor;
|
||||
class QCheckBox;
|
||||
class QGroupBox;
|
||||
|
||||
class SubWindowHandle;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class SubWindowAbstract;
|
||||
|
||||
/**
|
||||
* Class to define the dialog box to select sub windows
|
||||
* This class enable the selection of several group of windows
|
||||
*/
|
||||
class SubWindowSelectorDialog : public QDialog
|
||||
class DialogSubWindowSelector : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SubWindowSelectorDialog( QWidget* parent, SubWindowHandle* windowManager, unsigned int uiCategory,
|
||||
int minWindowsSelected = 1, int maxWindowsSelected = -1 );
|
||||
DialogSubWindowSelector( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager,
|
||||
UInt uiCategory,
|
||||
Int minWindowsSelected = 1,
|
||||
Int maxWindowsSelected = -1 );
|
||||
|
||||
void selectSubWindow( SubWindowAbstract* subWindow );
|
||||
Void selectSubWindow( SubWindowAbstract* subWindow );
|
||||
QList<SubWindowAbstract*> getSelectedWindows() { return m_apcSelectedSubWindowList; }
|
||||
|
||||
private:
|
||||
unsigned int m_uiCategory;
|
||||
int m_iMinSelectedWindows;
|
||||
int m_iMaxSlectedWindows;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
UInt m_uiCategory;
|
||||
Int m_iMinSelectedWindows;
|
||||
Int m_iMaxSlectedWindows;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
|
||||
QList<SubWindowAbstract*> m_apcSubWindowList;
|
||||
QList<SubWindowAbstract*> m_apcSelectedSubWindowList;
|
||||
@@ -73,8 +80,8 @@ private:
|
||||
QPushButton* m_pushButtonAddAll;
|
||||
QPushButton* m_pushButtonRemoveAll;
|
||||
|
||||
void updateSubWindowList();
|
||||
void update();
|
||||
Void updateSubWindowList();
|
||||
Void update();
|
||||
|
||||
private Q_SLOTS:
|
||||
void toggleSubWindow( int );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,17 +23,16 @@
|
||||
*/
|
||||
|
||||
#include "FramePropertiesDock.h"
|
||||
|
||||
#include <QtDebug>
|
||||
#include <QtGui>
|
||||
#include <cmath>
|
||||
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitch )
|
||||
: QWidget( parent ), m_bIsPlaying( false ), m_bHasFrame( false )
|
||||
FramePropertiesDock::FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch )
|
||||
: QWidget( parent ), m_pbIsPlaying( pbMainPlaySwitch )
|
||||
{
|
||||
// -------------- Variables definition --------------
|
||||
m_pcFrame = NULL;
|
||||
m_pcSelectedFrame = NULL;
|
||||
m_iLastFrameType = -1;
|
||||
|
||||
// Histogram area -----------------------------------------------------
|
||||
@@ -42,25 +41,27 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
channelLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
|
||||
|
||||
channelCB = new QComboBox;
|
||||
//channelCB->addItem( tr( "Luminance" ) );
|
||||
//channelCB->setItemIcon( 0, QIcon( ":/images/channel-luma.png" ) );
|
||||
channelCB->addItem( tr( "Luminance" ) );
|
||||
channelCB->setItemIcon( 0, QIcon( ":/images/channel-luma.png" ) );
|
||||
|
||||
channelCB->setWhatsThis( tr( "<p>Select here the histogram channel to display:<p>"
|
||||
"<b>Luminance</b>: Display luminance (perceived brightness).<p>"
|
||||
"<b>Red</b>: Display the red image channel.<p>"
|
||||
"<b>Green</b>: Display the green image channel.<p>"
|
||||
"<b>Blue</b>: Display the blue image channel.<p>"
|
||||
"<b>Alpha</b>: Display the alpha image channel. "
|
||||
"This channel corresponds to the transparency value and "
|
||||
"is supported by some image formats such as PNG or TIFF.<p>"
|
||||
"<b>Colors</b>: Display all color channel values at "
|
||||
"the same time." ) );
|
||||
channelCB->setWhatsThis(
|
||||
tr( "<p>Select here the histogram channel to display:<p>"
|
||||
"<b>Luminance</b>: Display luminance (perceived brightness).<p>"
|
||||
"<b>Red</b>: Display the red image channel.<p>"
|
||||
"<b>Green</b>: Display the green image channel.<p>"
|
||||
"<b>Blue</b>: Display the blue image channel.<p>"
|
||||
"<b>Alpha</b>: Display the alpha image channel. "
|
||||
"This channel corresponds to the transparency value and "
|
||||
"is supported by some image formats such as PNG or TIFF.<p>"
|
||||
"<b>Colors</b>: Display all color channel values at "
|
||||
"the same time." ) );
|
||||
|
||||
QString scaleWhatsThis( tr( "<p>Select here the histogram scale.<p>"
|
||||
"If the image's maximal values are small, you can use the "
|
||||
"linear scale.<p>Logarithmic scale can be used when the maximal"
|
||||
" values are big; if it is used, all values (small and large) "
|
||||
"will be visible on the graph." ) );
|
||||
QString scaleWhatsThis(
|
||||
tr( "<p>Select here the histogram scale.<p>"
|
||||
"If the image's maximal values are small, you can use the "
|
||||
"linear scale.<p>Logarithmic scale can be used when the maximal"
|
||||
" values are big; if it is used, all values (small and large) "
|
||||
"will be visible on the graph." ) );
|
||||
|
||||
linHistoButton = new QPushButton;
|
||||
linHistoButton->setToolTip( tr( "Linear" ) );
|
||||
@@ -92,10 +93,11 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
colorsCB->hide();
|
||||
colorsLabel->hide();
|
||||
|
||||
QString regionWhatsThis( tr( "<p>Select here from which region the histogram will be computed:"
|
||||
"<p><b>Full Image</b>: Compute histogram using the full image."
|
||||
"<p><b>Selection</b>: Compute histogram using the current image "
|
||||
"selection." ) );
|
||||
QString regionWhatsThis(
|
||||
tr( "<p>Select here from which region the histogram will be computed:"
|
||||
"<p><b>Full Image</b>: Compute histogram using the full image."
|
||||
"<p><b>Selection</b>: Compute histogram using the current image "
|
||||
"selection." ) );
|
||||
|
||||
fullImageButton = new QPushButton;
|
||||
fullImageButton->setToolTip( tr( "Full Image" ) );
|
||||
@@ -132,8 +134,9 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
// -------------------------------------------------------------
|
||||
|
||||
histogramWidget = new HistogramWidget( 100, 100 );
|
||||
histogramWidget->setWhatsThis( tr( "<p>This is the histogram drawing of "
|
||||
"the selected image channel" ) );
|
||||
histogramWidget->setWhatsThis(
|
||||
tr( "<p>This is the histogram drawing of "
|
||||
"the selected image channel" ) );
|
||||
|
||||
QVBoxLayout* histogramLayout = new QVBoxLayout;
|
||||
histogramLayout->setSpacing( 1 );
|
||||
@@ -146,24 +149,26 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
QLabel* rangeSelectionLabel = new QLabel( tr( "Range:" ) );
|
||||
rangeSelectionLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
|
||||
mininterv = new QSpinBox;
|
||||
mininterv->setRange( 0, 255 );
|
||||
mininterv->setSingleStep( 1 );
|
||||
mininterv->setValue( 0 );
|
||||
mininterv->setWhatsThis( tr( "<p>Select here the minimal intensity "
|
||||
"value of the histogram selection." ) );
|
||||
minInterv = new QSpinBox;
|
||||
minInterv->setRange( 0, 255 );
|
||||
minInterv->setSingleStep( 1 );
|
||||
minInterv->setValue( 0 );
|
||||
minInterv->setWhatsThis(
|
||||
tr( "<p>Select here the minimal intensity "
|
||||
"value of the histogram selection." ) );
|
||||
|
||||
maxinterv = new QSpinBox;
|
||||
maxinterv->setRange( 0, 255 );
|
||||
maxinterv->setSingleStep( 1 );
|
||||
maxinterv->setValue( 0 );
|
||||
mininterv->setWhatsThis( tr( "<p>Select here the maximal intensity value"
|
||||
" of the histogram selection." ) );
|
||||
maxInterv = new QSpinBox;
|
||||
maxInterv->setRange( 0, 255 );
|
||||
maxInterv->setSingleStep( 1 );
|
||||
maxInterv->setValue( 0 );
|
||||
minInterv->setWhatsThis(
|
||||
tr( "<p>Select here the maximal intensity value"
|
||||
" of the histogram selection." ) );
|
||||
|
||||
QHBoxLayout* rangeLayout = new QHBoxLayout;
|
||||
rangeLayout->addWidget( rangeSelectionLabel );
|
||||
rangeLayout->addWidget( mininterv );
|
||||
rangeLayout->addWidget( maxinterv );
|
||||
rangeLayout->addWidget( minInterv );
|
||||
rangeLayout->addWidget( maxInterv );
|
||||
|
||||
mainLayout->addLayout( rangeLayout, 4, 0, 1, 4 );
|
||||
|
||||
@@ -184,11 +189,6 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
labelRangeValue = new QLabel;
|
||||
labelRangeValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QLabel* nEBinsLabel = new QLabel( tr( "Non empty bins:" ) );
|
||||
nEBinsLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
labelNEBinsValue = new QLabel;
|
||||
labelNEBinsValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QLabel* meanLabel = new QLabel( tr( "Mean:" ) );
|
||||
meanLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
labelMeanValue = new QLabel;
|
||||
@@ -204,17 +204,12 @@ 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;
|
||||
labelPercentileValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
int gridRow = 0;
|
||||
Int gridRow = 0;
|
||||
QGridLayout* statisticsLayout = new QGridLayout;
|
||||
statisticsLayout->addWidget( pixelsLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelPixelsValue, gridRow++, 1 );
|
||||
@@ -222,24 +217,21 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
statisticsLayout->addWidget( labelCountValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( rangeLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelRangeValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( nEBinsLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelNEBinsValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( meanLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelMeanValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( stdDevLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelStdDevValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( medianLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelMedianValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( percentileLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelPercentileValue, gridRow++, 1 );
|
||||
statisticsLayout->addWidget( entropyLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelEntropyValue, gridRow++, 1 );
|
||||
// statisticsLayout->addWidget( percentileLabel, 5, 0 );
|
||||
// statisticsLayout->addWidget( labelPercentileValue, 5, 1 );
|
||||
|
||||
QGroupBox* statisticsGroup = new QGroupBox( tr( "Statistics" ) );
|
||||
statisticsGroup->setLayout( statisticsLayout );
|
||||
statisticsGroup->setWhatsThis( tr( "<p>Here you can see the statistical results calculated from the "
|
||||
"selected histogram part. These values are available for all "
|
||||
"channels." ) );
|
||||
statisticsGroup->setWhatsThis(
|
||||
tr( "<p>Here you can see the statistical results calculated from the "
|
||||
"selected histogram part. These values are available for all "
|
||||
"channels." ) );
|
||||
|
||||
mainLayout->addWidget( statisticsGroup, 5, 0, 1, 4 );
|
||||
|
||||
@@ -248,16 +240,21 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
||||
setEnabled( false );
|
||||
|
||||
connect( channelCB, SIGNAL( activated( int ) ), this, SLOT( slotChannelChanged( int ) ) );
|
||||
connect( scaleButtonGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( slotScaleChanged( int ) ) );
|
||||
connect( scaleButtonGroup, SIGNAL( buttonClicked( int ) ), this,
|
||||
SLOT( slotScaleChanged( int ) ) );
|
||||
connect( colorsCB, SIGNAL( activated( int ) ), this, SLOT( slotColorsChanged( int ) ) );
|
||||
connect( renderingButtonGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( slotRenderingChanged( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalintervalChanged( int, int ) ), this, SLOT( slotUpdateinterval( int, int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalMaximumValueChanged( int ) ), this, SLOT( slotUpdateintervRange( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalHistogramComputationDone( int ) ), this, SLOT( slotRefreshOptions( int ) ) );
|
||||
connect( renderingButtonGroup, SIGNAL( buttonClicked( int ) ), this,
|
||||
SLOT( slotRenderingChanged( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalIntervalChanged( int, int ) ), this,
|
||||
SLOT( slotUpdateInterval( int, int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalMaximumValueChanged( int ) ), this,
|
||||
SLOT( slotUpdateIntervRange( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalHistogramComputationDone( int ) ), this,
|
||||
SLOT( slotRefreshOptions( int ) ) );
|
||||
connect( histogramWidget, SIGNAL( signalHistogramComputationFailed( void ) ), this,
|
||||
SLOT( slotHistogramComputationFailed( void ) ) );
|
||||
connect( mininterv, SIGNAL( valueChanged( int ) ), this, SLOT( slotMinValueChanged( int ) ) );
|
||||
connect( maxinterv, SIGNAL( valueChanged( int ) ), this, SLOT( slotMaxValueChanged( int ) ) );
|
||||
connect( minInterv, SIGNAL( valueChanged( int ) ), this, SLOT( slotMinValueChanged( int ) ) );
|
||||
connect( maxInterv, SIGNAL( valueChanged( int ) ), this, SLOT( slotMaxValueChanged( int ) ) );
|
||||
}
|
||||
|
||||
FramePropertiesDock::~FramePropertiesDock()
|
||||
@@ -278,25 +275,24 @@ QSize FramePropertiesDock::sizeHint() const
|
||||
return currSize;
|
||||
}
|
||||
|
||||
void FramePropertiesDock::reset()
|
||||
Void FramePropertiesDock::reset()
|
||||
{
|
||||
m_pcFrame = nullptr;
|
||||
m_pcSelectedFrame = nullptr;
|
||||
|
||||
m_bHasFrame = false;
|
||||
m_pcFrame = NULL;
|
||||
m_cSelectionArea = QRect();
|
||||
if( m_pcSelectedFrame )
|
||||
{
|
||||
delete m_pcSelectedFrame;
|
||||
m_pcSelectedFrame = NULL;
|
||||
}
|
||||
|
||||
m_iLastFrameType = -1;
|
||||
|
||||
labelRangeValue->clear();
|
||||
labelNEBinsValue->clear();
|
||||
labelMeanValue->clear();
|
||||
labelPixelsValue->clear();
|
||||
labelStdDevValue->clear();
|
||||
labelCountValue->clear();
|
||||
labelMedianValue->clear();
|
||||
labelPercentileValue->clear();
|
||||
labelEntropyValue->clear();
|
||||
|
||||
// Remove the histogram data from memory
|
||||
histogramWidget->reset();
|
||||
@@ -304,102 +300,100 @@ void FramePropertiesDock::reset()
|
||||
setEnabled( false );
|
||||
}
|
||||
|
||||
void FramePropertiesDock::setFrame( std::shared_ptr<CalypFrame> pcFrame, bool isPlaying )
|
||||
Void FramePropertiesDock::setFrame( PlaYUVerFrame* pcFrame )
|
||||
{
|
||||
int colorSpace = pcFrame->getColorSpace();
|
||||
Int colorSpace = pcFrame->getColorSpace();
|
||||
if( m_iLastFrameType != colorSpace )
|
||||
{
|
||||
m_iLastFrameType = colorSpace;
|
||||
if( colorSpace == CLP_COLOR_RGB || colorSpace == CLP_COLOR_RGBA )
|
||||
if( colorSpace == PlaYUVerPixel::COLOR_RGB || colorSpace == PlaYUVerPixel::COLOR_ARGB )
|
||||
{
|
||||
channelCB->clear();
|
||||
channelCB->addItem( QIcon( ":/images/channel-luma.png" ), "Luminance", CalypFrame::HIST_LUMA );
|
||||
channelCB->addItem( QIcon( ":/images/channel-red.png" ), "Red", CalypFrame::HIST_COLOR_R );
|
||||
channelCB->addItem( QIcon( ":/images/channel-green.png" ), "Green", CalypFrame::HIST_COLOR_G );
|
||||
channelCB->addItem( QIcon( ":/images/channel-blue.png" ), "Blue", CalypFrame::HIST_COLOR_B );
|
||||
if( colorSpace == CLP_COLOR_RGBA )
|
||||
channelCB->clear();
|
||||
channelCB->insertItem( LuminosityChannel, QIcon( ":/images/channel-luma.png" ), "Luminance" );
|
||||
channelCB->insertItem( FirstChannel, QIcon( ":/images/channel-red.png" ), "Red" );
|
||||
channelCB->insertItem( SecondChannel, QIcon( ":/images/channel-green.png" ), "Green" );
|
||||
channelCB->insertItem( ThirdChannel, QIcon( ":/images/channel-blue.png" ), "Blue" );
|
||||
if( colorSpace == PlaYUVerPixel::COLOR_ARGB )
|
||||
{
|
||||
channelCB->addItem( QIcon( ":/images/channel-alpha.png" ), "Alpha", CalypFrame::HIST_COLOR_A );
|
||||
channelCB->insertItem( AlphaChannel, QIcon( ":/images/channel-alpha.png" ), "Alpha" );
|
||||
}
|
||||
channelCB->addItem( QIcon( ":/images/channel-all.png" ), "Colors", CalypFrame::HIST_ALL_CHANNELS );
|
||||
channelCB->insertItem( ColorChannels, QIcon( ":/images/channel-all.png" ), "Colors" );
|
||||
|
||||
colorsCB->clear();
|
||||
colorsCB->addItem( "Red", CalypFrame::HIST_COLOR_R );
|
||||
colorsCB->addItem( "Green", CalypFrame::HIST_COLOR_G );
|
||||
colorsCB->addItem( "Blue", CalypFrame::HIST_COLOR_B );
|
||||
colorsCB->addItem( "Red" );
|
||||
colorsCB->addItem( "Green" );
|
||||
colorsCB->addItem( "Blue" );
|
||||
colorsCB->setEnabled( false );
|
||||
colorsCB->setWhatsThis( tr( "<p>Select here the main color displayed with Colors Channel mode:"
|
||||
"<p><b>Red</b>: Draw the Red image channel in the foreground.<p>"
|
||||
"<b>Green</b>: Draw the Green image channel in the foreground.<p>"
|
||||
"<b>Blue</b>: Draw the Blue image channel in the foreground.<p>" ) );
|
||||
colorsCB->setWhatsThis(
|
||||
tr( "<p>Select here the main color displayed with Colors Channel mode:"
|
||||
"<p><b>Red</b>: Draw the Red image channel in the foreground.<p>"
|
||||
"<b>Green</b>: Draw the Green image channel in the foreground.<p>"
|
||||
"<b>Blue</b>: Draw the Blue image channel in the foreground.<p>" ) );
|
||||
colorsCB->show();
|
||||
colorsLabel->show();
|
||||
}
|
||||
else if( colorSpace == CLP_COLOR_YUV )
|
||||
else if( colorSpace == PlaYUVerPixel::COLOR_YUV )
|
||||
{
|
||||
channelCB->clear();
|
||||
channelCB->addItem( QIcon( ":/images/channel-luma.png" ), "Luminance", CalypFrame::HIST_LUMA );
|
||||
channelCB->addItem( QIcon( ":/images/channel-red.png" ), "Chroma U", CalypFrame::HIST_CHROMA_U );
|
||||
channelCB->addItem( QIcon( ":/images/channel-green.png" ), "Chroma V", CalypFrame::HIST_CHROMA_V );
|
||||
channelCB->addItem( QIcon( ":/images/channel-all.png" ), "All Channels", CalypFrame::HIST_ALL_CHANNELS );
|
||||
channelCB->insertItem( FirstChannel, QIcon( ":/images/channel-luma.png" ), "Luminance" );
|
||||
channelCB->insertItem( SecondChannel, QIcon( ":/images/channel-red.png" ), "Chroma U" );
|
||||
channelCB->insertItem( ThirdChannel, QIcon( ":/images/channel-green.png" ), "Chroma V" );
|
||||
channelCB->insertItem( ColorChannels, QIcon( ":/images/channel-all.png" ), "All Channels" );
|
||||
|
||||
colorsCB->clear();
|
||||
colorsCB->addItem( "Luminance", CalypFrame::HIST_LUMA );
|
||||
colorsCB->addItem( "Chroma U", CalypFrame::HIST_CHROMA_U );
|
||||
colorsCB->addItem( "Chroma V", CalypFrame::HIST_CHROMA_V );
|
||||
colorsCB->addItem( "Luminance" );
|
||||
colorsCB->addItem( "Chroma U" );
|
||||
colorsCB->addItem( "Chroma V" );
|
||||
colorsCB->setEnabled( false );
|
||||
colorsCB->setWhatsThis( tr( "<p>Select here the main color displayed with Colors Channel mode:"
|
||||
"<p><b>Luminance</b>: DraupdateDataw the Luminance channel in the "
|
||||
"foreground.<p>"
|
||||
"<b>Chroma U</b>: Draw the Chroma U channel in the foreground.<p>"
|
||||
"<b>Chroma V</b>: Draw the Chroma V channel in the "
|
||||
"foreground.<p>" ) );
|
||||
colorsCB->setWhatsThis(
|
||||
tr( "<p>Select here the main color displayed with Colors Channel mode:"
|
||||
"<p><b>Luminance</b>: DraupdateDataw the Luminance channel in the "
|
||||
"foreground.<p>"
|
||||
"<b>Chroma U</b>: Draw the Chroma U channel in the foreground.<p>"
|
||||
"<b>Chroma V</b>: Draw the Chroma V channel in the foreground.<p>" ) );
|
||||
colorsCB->show();
|
||||
colorsLabel->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
channelCB->clear();
|
||||
channelCB->addItem( QIcon( ":/images/channel-luma.png" ), "Luminance", CalypFrame::HIST_LUMA );
|
||||
channelCB->addItem( tr( "Luminance" ) );
|
||||
channelCB->setItemIcon( 0, QIcon( ":/images/channel-luma.png" ) );
|
||||
colorsCB->hide();
|
||||
colorsLabel->hide();
|
||||
}
|
||||
}
|
||||
setEnabled( true );
|
||||
m_bIsPlaying = isPlaying;
|
||||
if( !m_bIsPlaying )
|
||||
if( m_pcFrame || !( *m_pbIsPlaying ) )
|
||||
{
|
||||
if( pcFrame )
|
||||
{
|
||||
m_bHasFrame = true;
|
||||
m_pcFrame = pcFrame;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bHasFrame = false;
|
||||
}
|
||||
m_pcFrame = pcFrame;
|
||||
updateDataHistogram();
|
||||
}
|
||||
updateDataHistogram();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
Void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
{
|
||||
if( m_bHasFrame )
|
||||
if( m_pcFrame )
|
||||
{
|
||||
bool bSelectionChanged = !( selectionArea.size() == m_cSelectionArea.size() );
|
||||
Bool bSelectionChanged = !( selectionArea.size() == m_cSelectionArea.size() );
|
||||
m_cSelectionArea = selectionArea;
|
||||
if( selectionArea.isValid() )
|
||||
{
|
||||
m_cSelectionArea = selectionArea;
|
||||
histogramWidget->stopHistogramComputation();
|
||||
|
||||
/*
|
||||
* Crop selection from frame
|
||||
* Allocate a new image for the selection
|
||||
* or just copy information
|
||||
*/
|
||||
if( bSelectionChanged )
|
||||
{
|
||||
m_pcSelectedFrame = std::make_shared<CalypFrame>( *m_pcFrame, selectionArea.x(),
|
||||
selectionArea.y(),
|
||||
selectionArea.width(),
|
||||
selectionArea.height() );
|
||||
if( m_pcSelectedFrame )
|
||||
{
|
||||
delete m_pcSelectedFrame;
|
||||
}
|
||||
m_pcSelectedFrame = new PlaYUVerFrame( m_pcFrame, selectionArea.x(), selectionArea.y(),
|
||||
selectionArea.width(), selectionArea.height() );
|
||||
}
|
||||
updateDataHistogram();
|
||||
selectionImageButton->click();
|
||||
@@ -414,23 +408,15 @@ void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
}
|
||||
}
|
||||
|
||||
void FramePropertiesDock::updateDataHistogram()
|
||||
Void FramePropertiesDock::updateDataHistogram()
|
||||
{
|
||||
if( m_bHasFrame && isVisible() )
|
||||
if( m_pcFrame && isVisible() )
|
||||
{
|
||||
if( m_bIsPlaying )
|
||||
if( !*m_pbIsPlaying )
|
||||
{
|
||||
histogramWidget->setLoadingSkipped();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_cSelectionArea.isValid() )
|
||||
if( m_pcSelectedFrame )
|
||||
{
|
||||
m_pcSelectedFrame = std::make_shared<CalypFrame>( *m_pcFrame,
|
||||
m_cSelectionArea.x(),
|
||||
m_cSelectionArea.y(),
|
||||
m_cSelectionArea.width(),
|
||||
m_cSelectionArea.height() );
|
||||
m_pcSelectedFrame->copyFrom( m_pcFrame, m_cSelectionArea.x(), m_cSelectionArea.y() );
|
||||
fullImageButton->show();
|
||||
selectionImageButton->show();
|
||||
}
|
||||
@@ -439,9 +425,12 @@ void FramePropertiesDock::updateDataHistogram()
|
||||
fullImageButton->hide();
|
||||
selectionImageButton->hide();
|
||||
}
|
||||
histogramWidget->updateData( m_pcFrame, m_cSelectionArea.isValid() ? m_pcSelectedFrame : nullptr );
|
||||
histogramWidget->updateData( m_pcFrame, m_pcSelectedFrame );
|
||||
}
|
||||
else
|
||||
{
|
||||
histogramWidget->setLoadingSkipped();
|
||||
}
|
||||
|
||||
histogramWidget->update();
|
||||
}
|
||||
else
|
||||
@@ -451,18 +440,18 @@ void FramePropertiesDock::updateDataHistogram()
|
||||
}
|
||||
}
|
||||
|
||||
void FramePropertiesDock::updateStatistiques()
|
||||
Void FramePropertiesDock::updateStatistiques()
|
||||
{
|
||||
QString value;
|
||||
|
||||
int min = mininterv->value();
|
||||
int max = maxinterv->value();
|
||||
int channel = histogramWidget->m_channelType;
|
||||
Int min = minInterv->value();
|
||||
Int max = maxInterv->value();
|
||||
Int channel = histogramWidget->m_channelType;
|
||||
|
||||
if( channel == CalypFrame::HIST_ALL_CHANNELS )
|
||||
channel = colorsCB->itemData( colorsCB->currentIndex() ).toInt();
|
||||
if( channel == HistogramWidget::ColorChannelsHistogram )
|
||||
channel = colorsCB->currentIndex();
|
||||
|
||||
std::shared_ptr<CalypFrame> frame;
|
||||
PlaYUVerFrame* frame;
|
||||
|
||||
if( histogramWidget->m_renderingType == HistogramWidget::FullImageHistogram )
|
||||
frame = histogramWidget->m_fullImage;
|
||||
@@ -471,11 +460,8 @@ void FramePropertiesDock::updateStatistiques()
|
||||
|
||||
if( frame )
|
||||
{
|
||||
double numBins = frame->getNEBins( channel );
|
||||
labelNEBinsValue->setText( value.setNum( (float)numBins, 'f', 0 ) );
|
||||
|
||||
QString rangeText =
|
||||
"[" + QString::number( frame->getMinimumPelValue( channel ) ) + ":" + QString::number( frame->getMaximumPelValue( channel ) ) + "]";
|
||||
QString rangeText = "[" + QString::number( frame->getMin( channel ) ) + ":" +
|
||||
QString::number( frame->getMax( channel ) ) + "]";
|
||||
labelRangeValue->setText( rangeText );
|
||||
|
||||
double mean = frame->getMean( channel, min, max );
|
||||
@@ -487,21 +473,18 @@ void FramePropertiesDock::updateStatistiques()
|
||||
double stddev = frame->getStdDev( channel, min, max );
|
||||
labelStdDevValue->setText( value.setNum( stddev, 'f', 1 ) );
|
||||
|
||||
double counts = frame->getNumPixelsRange( channel, min, max );
|
||||
double counts = frame->getCount( channel, min, max );
|
||||
labelCountValue->setText( value.setNum( (float)counts, 'f', 0 ) );
|
||||
|
||||
double median = frame->getMedian( channel, min, max );
|
||||
labelMedianValue->setText( value.setNum( median, 'f', 0 ) );
|
||||
|
||||
double entropy = frame->getEntropy( channel, min, max );
|
||||
labelEntropyValue->setText( value.setNum( entropy, 'f', 2 ) );
|
||||
labelMedianValue->setText( value.setNum( median, 'f', 1 ) );
|
||||
|
||||
double percentile = ( pixels > 0 ? ( 100.0 * counts / pixels ) : 0.0 );
|
||||
labelPercentileValue->setText( value.setNum( percentile, 'f', 1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
void FramePropertiesDock::stopHistogram()
|
||||
Void FramePropertiesDock::stopHistogram()
|
||||
{
|
||||
histogramWidget->stopHistogramComputation();
|
||||
}
|
||||
@@ -510,7 +493,7 @@ void FramePropertiesDock::stopHistogram()
|
||||
// SLOTS
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FramePropertiesDock::slotRefreshOptions( int range )
|
||||
Void FramePropertiesDock::slotRefreshOptions( int range )
|
||||
{
|
||||
if( !isVisible() )
|
||||
return;
|
||||
@@ -533,90 +516,127 @@ void FramePropertiesDock::slotRefreshOptions( int range )
|
||||
}
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotHistogramComputationFailed()
|
||||
Void FramePropertiesDock::slotHistogramComputationFailed()
|
||||
{
|
||||
m_bHasFrame = false;
|
||||
m_pcFrame = NULL;
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotChannelChanged( int index )
|
||||
Void FramePropertiesDock::slotChannelChanged( Int channel )
|
||||
{
|
||||
int channel = channelCB->itemData( index ).toInt();
|
||||
if( m_pcFrame->getColorSpace() == PlaYUVerPixel::COLOR_YUV )
|
||||
channel += 1;
|
||||
if( channel == AlphaChannel && m_pcFrame->getColorSpace() != PlaYUVerPixel::COLOR_ARGB )
|
||||
channel = ColorChannels;
|
||||
|
||||
histogramWidget->m_channelType = channel;
|
||||
if( channel == CalypFrame::HIST_ALL_CHANNELS )
|
||||
colorsCB->setEnabled( true );
|
||||
else
|
||||
switch( channel )
|
||||
{
|
||||
case FirstChannel:
|
||||
histogramWidget->m_channelType = HistogramWidget::FirstChannelHistogram;
|
||||
colorsCB->setEnabled( false );
|
||||
break;
|
||||
case SecondChannel:
|
||||
histogramWidget->m_channelType = HistogramWidget::SecondChannelHistogram;
|
||||
colorsCB->setEnabled( false );
|
||||
break;
|
||||
case ThirdChannel:
|
||||
histogramWidget->m_channelType = HistogramWidget::ThirdChannelHistogram;
|
||||
colorsCB->setEnabled( false );
|
||||
break;
|
||||
case AlphaChannel:
|
||||
histogramWidget->m_channelType = HistogramWidget::AlphaChannelHistogram;
|
||||
colorsCB->setEnabled( false );
|
||||
break;
|
||||
case ColorChannels:
|
||||
histogramWidget->m_channelType = HistogramWidget::ColorChannelsHistogram;
|
||||
colorsCB->setEnabled( true );
|
||||
break;
|
||||
default: // Luminance.
|
||||
// histogramWidget->m_channelType = HistogramWidget::LumaHistogram;
|
||||
histogramWidget->m_channelType = HistogramWidget::FirstChannelHistogram;
|
||||
colorsCB->setEnabled( false );
|
||||
break;
|
||||
}
|
||||
histogramWidget->update();
|
||||
updateStatistiques();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotScaleChanged( int scale )
|
||||
Void FramePropertiesDock::slotScaleChanged( Int scale )
|
||||
{
|
||||
histogramWidget->m_scaleType = scale;
|
||||
histogramWidget->update();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotColorsChanged( int index )
|
||||
Void FramePropertiesDock::slotColorsChanged( Int color )
|
||||
{
|
||||
int color = colorsCB->itemData( index ).toInt();
|
||||
histogramWidget->m_colorType = color;
|
||||
switch( color )
|
||||
{
|
||||
case AllColorsGreen:
|
||||
histogramWidget->m_colorType = HistogramWidget::SecondChannelColor;
|
||||
break;
|
||||
case AllColorsBlue:
|
||||
histogramWidget->m_colorType = HistogramWidget::ThirdChannelColor;
|
||||
break;
|
||||
default: // Red.
|
||||
histogramWidget->m_colorType = HistogramWidget::FirstChannelColor;
|
||||
break;
|
||||
}
|
||||
|
||||
histogramWidget->update();
|
||||
updateStatistiques();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotRenderingChanged( int rendering )
|
||||
Void FramePropertiesDock::slotRenderingChanged( Int rendering )
|
||||
{
|
||||
histogramWidget->m_renderingType = rendering;
|
||||
histogramWidget->update();
|
||||
updateStatistiques();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotMinValueChanged( int min )
|
||||
Void FramePropertiesDock::slotMinValueChanged( Int min )
|
||||
{
|
||||
// Called when user changes values of spin box.
|
||||
// Communicate the change to histogram widget.
|
||||
|
||||
// make the one control "push" the other
|
||||
if( min == maxinterv->value() + 1 )
|
||||
maxinterv->setValue( min );
|
||||
if( min == maxInterv->value() + 1 )
|
||||
maxInterv->setValue( min );
|
||||
|
||||
maxinterv->setMinimum( min - 1 );
|
||||
maxInterv->setMinimum( min - 1 );
|
||||
histogramWidget->slotMinValueChanged( min );
|
||||
updateStatistiques();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotMaxValueChanged( int max )
|
||||
Void FramePropertiesDock::slotMaxValueChanged( Int max )
|
||||
{
|
||||
if( max == mininterv->value() - 1 )
|
||||
mininterv->setValue( max );
|
||||
if( max == minInterv->value() - 1 )
|
||||
minInterv->setValue( max );
|
||||
|
||||
mininterv->setMaximum( max + 1 );
|
||||
minInterv->setMaximum( max + 1 );
|
||||
histogramWidget->slotMaxValueChanged( max );
|
||||
updateStatistiques();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotUpdateinterval( int min, int max )
|
||||
Void FramePropertiesDock::slotUpdateInterval( Int min, Int max )
|
||||
{
|
||||
// Called when value is set from within histogram widget.
|
||||
// Block signals to prevent slotMinValueChanged and
|
||||
// slotMaxValueChanged being called.
|
||||
mininterv->blockSignals( true );
|
||||
mininterv->setMaximum( max + 1 );
|
||||
mininterv->setValue( min );
|
||||
mininterv->blockSignals( false );
|
||||
minInterv->blockSignals( true );
|
||||
minInterv->setMaximum( max + 1 );
|
||||
minInterv->setValue( min );
|
||||
minInterv->blockSignals( false );
|
||||
|
||||
maxinterv->blockSignals( true );
|
||||
maxinterv->setMinimum( min - 1 );
|
||||
maxinterv->setValue( max );
|
||||
maxinterv->blockSignals( false );
|
||||
maxInterv->blockSignals( true );
|
||||
maxInterv->setMinimum( min - 1 );
|
||||
maxInterv->setValue( max );
|
||||
maxInterv->blockSignals( false );
|
||||
|
||||
updateStatistiques();
|
||||
}
|
||||
|
||||
void FramePropertiesDock::slotUpdateintervRange( int range )
|
||||
Void FramePropertiesDock::slotUpdateIntervRange( Int range )
|
||||
{
|
||||
maxinterv->blockSignals( true );
|
||||
maxinterv->setMaximum( range );
|
||||
maxinterv->blockSignals( false );
|
||||
maxInterv->blockSignals( true );
|
||||
maxInterv->setMaximum( range );
|
||||
maxInterv->blockSignals( false );
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,35 +25,55 @@
|
||||
#ifndef __FRAMEPROPERTIESDOCK_H__
|
||||
#define __FRAMEPROPERTIESDOCK_H__
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "HistogramWidget.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
class CalypStream;
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "HistogramWidget.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
|
||||
class FramePropertiesDock : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitch );
|
||||
FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch );
|
||||
~FramePropertiesDock();
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
void setFrame( std::shared_ptr<CalypFrame> m_pcFrame, bool isPlaying );
|
||||
void setSelection( const QRect& selectionArea );
|
||||
void reset();
|
||||
void stopHistogram();
|
||||
Void setFrame( PlaYUVerFrame* m_pcFrame );
|
||||
Void setSelection( const QRect& selectionArea );
|
||||
Void reset();
|
||||
Void stopHistogram();
|
||||
|
||||
private:
|
||||
std::shared_ptr<CalypFrame> m_pcFrame;
|
||||
std::shared_ptr<CalypFrame> m_pcSelectedFrame;
|
||||
int m_iLastFrameType;
|
||||
bool m_bIsPlaying;
|
||||
bool m_bHasFrame;
|
||||
enum ColorChannel
|
||||
{
|
||||
LuminosityChannel = 0,
|
||||
FirstChannel = 1,
|
||||
SecondChannel = 2,
|
||||
ThirdChannel = 3,
|
||||
ColorChannels = 4,
|
||||
AlphaChannel = 5,
|
||||
};
|
||||
|
||||
enum AllColorsColorType
|
||||
{
|
||||
AllColorsRed = 0,
|
||||
AllColorsGreen,
|
||||
AllColorsBlue
|
||||
};
|
||||
|
||||
PlaYUVerFrame* m_pcFrame;
|
||||
PlaYUVerFrame* m_pcSelectedFrame;
|
||||
Int m_iLastFrameType;
|
||||
|
||||
Bool* m_pbIsPlaying;
|
||||
|
||||
QComboBox* channelCB;
|
||||
QComboBox* colorsCB;
|
||||
@@ -67,17 +87,15 @@ private:
|
||||
QButtonGroup* scaleButtonGroup;
|
||||
QButtonGroup* renderingButtonGroup;
|
||||
|
||||
QSpinBox* mininterv;
|
||||
QSpinBox* maxinterv;
|
||||
QSpinBox* minInterv;
|
||||
QSpinBox* maxInterv;
|
||||
|
||||
QLabel* labelPixelsValue;
|
||||
QLabel* labelCountValue;
|
||||
QLabel* labelRangeValue;
|
||||
QLabel* labelNEBinsValue;
|
||||
QLabel* labelMeanValue;
|
||||
QLabel* labelStdDevValue;
|
||||
QLabel* labelMedianValue;
|
||||
QLabel* labelEntropyValue;
|
||||
QLabel* labelPercentileValue;
|
||||
|
||||
QLabel* colorsLabel;
|
||||
@@ -86,21 +104,21 @@ private:
|
||||
|
||||
HistogramWidget* histogramWidget;
|
||||
|
||||
void updateStatistiques();
|
||||
void updateDataHistogram();
|
||||
Void updateStatistiques();
|
||||
Void updateDataHistogram();
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotRefreshOptions( int range );
|
||||
void slotHistogramComputationFailed( void );
|
||||
void slotChannelChanged( int index );
|
||||
void slotChannelChanged( int channel );
|
||||
void slotScaleChanged( int scale );
|
||||
void slotColorsChanged( int index );
|
||||
void slotColorsChanged( int color );
|
||||
void slotRenderingChanged( int rendering );
|
||||
void slotMinValueChanged( int );
|
||||
void slotMaxValueChanged( int );
|
||||
|
||||
void slotUpdateinterval( int min, int max );
|
||||
void slotUpdateintervRange( int range );
|
||||
void slotUpdateInterval( int min, int max );
|
||||
void slotUpdateIntervRange( int range );
|
||||
};
|
||||
|
||||
#endif // __FRAMEPROPERTIESDOCK_H__
|
||||
+12
-15
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,8 +23,6 @@
|
||||
* Based on the work of Ricardo N. Rocha Sardo in SCode project
|
||||
*/
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
#include <QBitmap>
|
||||
#include <QColor>
|
||||
#include <QDebug>
|
||||
@@ -34,6 +32,8 @@
|
||||
#include <QRect>
|
||||
#include <QRectF>
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -44,15 +44,10 @@ GridManager::GridManager()
|
||||
m_cGridColor = QColor( Qt::white );
|
||||
}
|
||||
|
||||
void GridManager::setGridSize( int newsize )
|
||||
{
|
||||
m_uiHSpace = m_uiVSpace = newsize;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Grid Drawer
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void GridManager::drawGrid( const QImage& image, const QRect& area, QPainter* painter )
|
||||
void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter )
|
||||
{
|
||||
int offsetx = 0; // Grid offset doesn't applies to SCODE
|
||||
int offsety = 0; // project for now...
|
||||
@@ -70,8 +65,9 @@ void GridManager::drawGrid( const QImage& image, const QRect& area, QPainter* pa
|
||||
style = Solid;
|
||||
switch( style )
|
||||
{
|
||||
case intersectionDot:
|
||||
case intersectionCross: {
|
||||
case IntersectionDot:
|
||||
case IntersectionCross:
|
||||
{
|
||||
painter->setPen( mainPen );
|
||||
// Draw crosses or dots on intersections
|
||||
for( int x = offsetx; x <= area.right(); x += hSpacing )
|
||||
@@ -86,7 +82,7 @@ void GridManager::drawGrid( const QImage& image, const QRect& area, QPainter* pa
|
||||
|
||||
if( x >= area.x() && y >= area.y() )
|
||||
{
|
||||
if( style == intersectionDot )
|
||||
if( style == IntersectionDot )
|
||||
painter->drawPoint( x, y ); // Dot
|
||||
else
|
||||
{ // Crosses:
|
||||
@@ -98,7 +94,8 @@ void GridManager::drawGrid( const QImage& image, const QRect& area, QPainter* pa
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Dashed: {
|
||||
case Dashed:
|
||||
{
|
||||
// Change pen to the dashed line
|
||||
mainPen.setStyle( Qt::DashLine );
|
||||
}
|
||||
|
||||
+10
-13
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -26,13 +26,12 @@
|
||||
#ifndef __GRIDMANAGER_H__
|
||||
#define __GRIDMANAGER_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include <QColor>
|
||||
#include <QPen>
|
||||
#include <QRect>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QPoint;
|
||||
class QBitmap;
|
||||
class QPainter;
|
||||
@@ -45,17 +44,15 @@ class GridManager
|
||||
public:
|
||||
enum Style
|
||||
{
|
||||
intersectionDot = 0,
|
||||
intersectionCross,
|
||||
IntersectionDot = 0,
|
||||
IntersectionCross,
|
||||
Dashed,
|
||||
Solid
|
||||
};
|
||||
|
||||
GridManager();
|
||||
|
||||
void setGridSize( int newsize );
|
||||
|
||||
void drawGrid( const QImage& image, const QRect& area, QPainter* painter );
|
||||
void drawGrid( QPixmap& image, const QRect& area, QPainter* painter );
|
||||
|
||||
/**
|
||||
* @returns a QRect defined by the grid that contains the point (x, y).
|
||||
@@ -96,8 +93,8 @@ public:
|
||||
QPoint nearPos( int x = -1, int y = -1 );
|
||||
|
||||
private:
|
||||
unsigned int m_uiHSpace;
|
||||
unsigned int m_uiVSpace;
|
||||
UInt m_uiHSpace;
|
||||
UInt m_uiVSpace;
|
||||
QColor m_cGridColor;
|
||||
Style m_eGridStyle;
|
||||
QPoint m_nearPos;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,58 +25,68 @@
|
||||
|
||||
// TODO:
|
||||
// - Optimizar paintEvent. Parece haver codigo redundante !!
|
||||
|
||||
#include "HistogramWidget.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include "config.h"
|
||||
#include <QtDebug>
|
||||
#include <QtGui>
|
||||
#include <cmath>
|
||||
|
||||
class HistogramWorker : public QThread
|
||||
{
|
||||
private:
|
||||
QObject* m_parent;
|
||||
std::shared_ptr<CalypFrame> m_pcFrame{ nullptr };
|
||||
PlaYUVerFrame* m_pcFrame;
|
||||
|
||||
public:
|
||||
HistogramWorker( QObject* parent )
|
||||
: m_parent{ parent } {}
|
||||
|
||||
void reset() { m_pcFrame = nullptr; }
|
||||
|
||||
void setup( std::shared_ptr<CalypFrame> frame )
|
||||
{
|
||||
m_pcFrame = std::move( frame );
|
||||
EventData* eventData = new EventData(); // NOLINT
|
||||
eventData->starting = true;
|
||||
// QCoreApplication::postEvent( m_parent, eventData );
|
||||
start();
|
||||
m_pcFrame = NULL;
|
||||
m_parent = parent;
|
||||
}
|
||||
void run() override
|
||||
|
||||
Void setup( PlaYUVerFrame* frame )
|
||||
{
|
||||
EventData* eventData = new EventData(); // NOLINT
|
||||
if( m_pcFrame != nullptr )
|
||||
m_pcFrame = frame;
|
||||
run();
|
||||
}
|
||||
Void run()
|
||||
{
|
||||
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->frame = m_pcFrame.get();
|
||||
|
||||
eventData->starting = false;
|
||||
// eventData->success = m_pcFrame->getHasHistogram();
|
||||
eventData->success = true;
|
||||
eventData->frame = m_pcFrame;
|
||||
QCoreApplication::postEvent( m_parent, eventData );
|
||||
}
|
||||
eventData->success = true;
|
||||
QCoreApplication::postEvent( m_parent, eventData );
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom Event
|
||||
*/
|
||||
class EventData : public QEvent
|
||||
{
|
||||
public:
|
||||
EventData()
|
||||
: QEvent( QEvent::User ), frame{ nullptr } {}
|
||||
CalypFrame* frame{ nullptr };
|
||||
bool starting{ false };
|
||||
bool success{ false };
|
||||
EventData() : QEvent( QEvent::User )
|
||||
{
|
||||
starting = false;
|
||||
success = false;
|
||||
frame = NULL;
|
||||
}
|
||||
|
||||
bool starting;
|
||||
bool success;
|
||||
PlaYUVerFrame* frame;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -124,25 +134,25 @@ public:
|
||||
double xmin;
|
||||
double xminOrg;
|
||||
double xmax;
|
||||
int range;
|
||||
int clearFlag; // Clear drawing zone with message.
|
||||
Int range;
|
||||
Int clearFlag; // Clear drawing zone with message.
|
||||
|
||||
// Image informations
|
||||
int imageChannels;
|
||||
int imageColorSpace;
|
||||
int imageBits;
|
||||
Int imageChannels;
|
||||
Int imageColorSpace;
|
||||
Int imageBits;
|
||||
|
||||
bool guideVisible; // Display color guide.
|
||||
bool statisticsVisible; // Display tooltip histogram statistics.
|
||||
bool inSelected;
|
||||
bool selectMode; // If true, a part of the histogram can be
|
||||
// selected !
|
||||
// selected !
|
||||
bool blinkFlag;
|
||||
bool blinkComputation; // If true, a message will be displayed during
|
||||
// histogram computation, else nothing (limit
|
||||
// flicker effect in widget especially for small
|
||||
// image/computation time).
|
||||
bool lumaChannel; // Compute luminance channel if true.
|
||||
// histogram computation, else nothing (limit
|
||||
// flicker effect in widget especially for small
|
||||
// image/computation time).
|
||||
bool lumaChannel; // Compute luminance channel if true.
|
||||
bool inInitialRepaintWait;
|
||||
|
||||
QTimer* blinkTimer;
|
||||
@@ -155,19 +165,20 @@ public:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Constructor without image data
|
||||
HistogramWidget::HistogramWidget( int width, int height, QWidget* parent )
|
||||
: QWidget( parent )
|
||||
HistogramWidget::HistogramWidget( Int width, Int height, QWidget* parent ) : QWidget( parent )
|
||||
{
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
|
||||
d = new HistogramWidgetPrivate;
|
||||
|
||||
m_channelType = CalypFrame::HIST_LUMA;
|
||||
// m_channelType = LumaHistogram;
|
||||
m_channelType = FirstChannelHistogram;
|
||||
m_scaleType = LogScaleHistogram;
|
||||
m_colorType = -1;
|
||||
m_colorType = FirstChannelColor;
|
||||
m_renderingType = FullImageHistogram;
|
||||
|
||||
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode | HistogramWidget::ShowLumaChannel );
|
||||
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode |
|
||||
HistogramWidget::ShowLumaChannel );
|
||||
|
||||
setMouseTracking( true );
|
||||
setMinimumSize( width, height );
|
||||
@@ -192,6 +203,12 @@ HistogramWidget::~HistogramWidget()
|
||||
{
|
||||
d->blinkTimer->stop();
|
||||
|
||||
// if( m_imageHistogram )
|
||||
// delete m_imageHistogram;
|
||||
//
|
||||
// if( m_selectionHistogram )
|
||||
// delete m_selectionHistogram;
|
||||
|
||||
delete m_imageWorker;
|
||||
delete m_selectionWorker;
|
||||
|
||||
@@ -201,7 +218,7 @@ HistogramWidget::~HistogramWidget()
|
||||
// Setup Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::setOptions( HistogramOptions options )
|
||||
Void HistogramWidget::setOptions( HistogramOptions options )
|
||||
{
|
||||
d->statisticsVisible = (bool)( options & ShowStatistics );
|
||||
d->selectMode = (bool)( options & SelectMode );
|
||||
@@ -209,22 +226,20 @@ void HistogramWidget::setOptions( HistogramOptions options )
|
||||
d->lumaChannel = (bool)( options & ShowLumaChannel );
|
||||
}
|
||||
|
||||
void HistogramWidget::setHistogramGuideByColor( QColor color )
|
||||
Void HistogramWidget::setHistogramGuideByColor( QColor color )
|
||||
{
|
||||
d->guideVisible = true;
|
||||
d->colorGuide = color;
|
||||
update();
|
||||
}
|
||||
|
||||
void HistogramWidget::reset()
|
||||
Void HistogramWidget::reset()
|
||||
{
|
||||
d->guideVisible = false;
|
||||
d->clearFlag = HistogramWidgetPrivate::HistogramNone;
|
||||
// Remove histogram data from memory.
|
||||
m_fullImage = nullptr;
|
||||
m_selectionImage = nullptr;
|
||||
m_imageWorker->setup( nullptr );
|
||||
m_selectionWorker->setup( nullptr );
|
||||
m_fullImage = NULL;
|
||||
m_selectionImage = NULL;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -232,7 +247,7 @@ void HistogramWidget::reset()
|
||||
// Custom Event Handler
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::customEvent( QEvent* event )
|
||||
Void HistogramWidget::customEvent( QEvent* event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
@@ -246,7 +261,7 @@ void HistogramWidget::customEvent( QEvent* event )
|
||||
return;
|
||||
}
|
||||
|
||||
if( ed->frame != m_fullImage.get() && ed->frame != m_selectionImage.get() )
|
||||
if( ed->frame != m_fullImage && ed->frame != m_selectionImage )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -284,7 +299,7 @@ void HistogramWidget::customEvent( QEvent* event )
|
||||
unsetCursor();
|
||||
|
||||
// Send signals to refresh information if necessary.
|
||||
// The signals may trigger multiple repaints, avoid this,
|
||||
// The signals may trigger multiple repaints, aVoid this,
|
||||
// we repaint once afterwards.
|
||||
setUpdatesEnabled( false );
|
||||
|
||||
@@ -304,15 +319,27 @@ void HistogramWidget::customEvent( QEvent* event )
|
||||
// Remove old histogram data from memory.
|
||||
m_fullImage = NULL;
|
||||
m_selectionImage = NULL;
|
||||
// if( m_imageHistogram )
|
||||
// {
|
||||
// delete m_imageHistogram;
|
||||
// m_imageHistogram = 0;
|
||||
// }
|
||||
// if( m_selectionHistogram )
|
||||
// {
|
||||
// delete m_selectionHistogram;
|
||||
// m_selectionHistogram = 0;
|
||||
// }
|
||||
emit signalHistogramComputationFailed();
|
||||
}
|
||||
}
|
||||
|
||||
// delete ed;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Data Loading Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::setDataLoading()
|
||||
Void HistogramWidget::setDataLoading()
|
||||
{
|
||||
if( d->clearFlag != HistogramWidgetPrivate::HistogramDataLoading )
|
||||
{
|
||||
@@ -326,7 +353,7 @@ void HistogramWidget::setDataLoading()
|
||||
}
|
||||
}
|
||||
|
||||
void HistogramWidget::setLoadingSkipped()
|
||||
Void HistogramWidget::setLoadingSkipped()
|
||||
{
|
||||
d->clearFlag = HistogramWidgetPrivate::HistogramSkipped;
|
||||
d->blinkTimer->stop();
|
||||
@@ -335,7 +362,7 @@ void HistogramWidget::setLoadingSkipped()
|
||||
unsetCursor();
|
||||
}
|
||||
|
||||
void HistogramWidget::setLoadingFailed()
|
||||
Void HistogramWidget::setLoadingFailed()
|
||||
{
|
||||
d->clearFlag = HistogramWidgetPrivate::HistogramFailed;
|
||||
d->blinkTimer->stop();
|
||||
@@ -346,7 +373,7 @@ void HistogramWidget::setLoadingFailed()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::stopHistogramComputation()
|
||||
Void HistogramWidget::stopHistogramComputation()
|
||||
{
|
||||
// if( m_imageHistogram )
|
||||
// m_imageHistogram->setRunningFlag( false );
|
||||
@@ -361,29 +388,17 @@ void HistogramWidget::stopHistogramComputation()
|
||||
// Update Data Methods
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::updateData( std::shared_ptr<CalypFrame> pcFrame, std::shared_ptr<CalypFrame> pcFrameSelection )
|
||||
Void HistogramWidget::updateData( PlaYUVerFrame* pcFrame, PlaYUVerFrame* pcFrameSelection )
|
||||
{
|
||||
d->imageBits = pcFrame->getBitsPel();
|
||||
switch( pcFrame->getColorSpace() )
|
||||
{
|
||||
case CLP_COLOR_YUV:
|
||||
case CLP_COLOR_GRAY:
|
||||
d->imageColorSpace = 0;
|
||||
break;
|
||||
case CLP_COLOR_RGB:
|
||||
case CLP_COLOR_RGBA:
|
||||
d->imageColorSpace = 0;
|
||||
break;
|
||||
default:
|
||||
d->imageColorSpace = 0;
|
||||
}
|
||||
d->imageColorSpace = pcFrame->getColorSpace();
|
||||
d->imageChannels = pcFrame->getNumberChannels();
|
||||
|
||||
// We are deleting the histogram data,
|
||||
// so we must not use it to draw any more.
|
||||
d->clearFlag = HistogramWidgetPrivate::HistogramNone;
|
||||
|
||||
// Do not using CalypFrameStatistics::getHistogramSegment()
|
||||
// Do not using PlaYUVerFrameStatistics::getHistogramSegment()
|
||||
// method here because histogram hasn't yet been computed.
|
||||
|
||||
d->range = ( 1 << d->imageBits ) - 1;
|
||||
@@ -398,7 +413,7 @@ void HistogramWidget::updateData( std::shared_ptr<CalypFrame> pcFrame, std::shar
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::slotBlinkTimerDone()
|
||||
Void HistogramWidget::slotBlinkTimerDone()
|
||||
{
|
||||
d->blinkFlag = !d->blinkFlag;
|
||||
d->inInitialRepaintWait = false;
|
||||
@@ -410,7 +425,7 @@ void HistogramWidget::slotBlinkTimerDone()
|
||||
// Paint Event
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
{
|
||||
int maxX = size().width() - 1;
|
||||
int maxY = size().height() - 1;
|
||||
@@ -425,7 +440,8 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
QPainter p1( this );
|
||||
|
||||
p1.fillRect( 0, 0, maxX, maxY, palette().color( QPalette::Disabled, QPalette::Window ) );
|
||||
p1.setPen( QPen( palette().color( QPalette::Disabled, QPalette::WindowText ), 1, Qt::SolidLine ) );
|
||||
p1.setPen(
|
||||
QPen( palette().color( QPalette::Disabled, QPalette::WindowText ), 1, Qt::SolidLine ) );
|
||||
p1.drawRect( 0, 0, maxX, maxY );
|
||||
|
||||
return;
|
||||
@@ -447,7 +463,8 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
if( d->clearFlag == HistogramWidgetPrivate::HistogramDataLoading )
|
||||
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter, tr( "Loading image..." ) );
|
||||
else
|
||||
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter, tr( "Histogram\ncalculation\nin progress..." ) );
|
||||
p1.drawText( 0, 0, maxX, maxY, Qt::AlignCenter,
|
||||
tr( "Histogram\ncalculation\nin progress..." ) );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -479,7 +496,7 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
int wWidth = width() - 1;
|
||||
int wHeight = height() - 1;
|
||||
double max;
|
||||
std::shared_ptr<CalypFrame> frame;
|
||||
PlaYUVerFrame* frame;
|
||||
|
||||
if( m_renderingType == ImageSelectionHistogram && m_selectionImage )
|
||||
frame = m_selectionImage;
|
||||
@@ -496,12 +513,35 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
yb = 0;
|
||||
max = 0.0;
|
||||
|
||||
max = frame->getMaximum( m_channelType );
|
||||
switch( m_channelType )
|
||||
{
|
||||
case HistogramWidget::FirstChannelHistogram: // Y channel.
|
||||
max = frame->getMaximum( LUMA );
|
||||
break;
|
||||
case HistogramWidget::SecondChannelHistogram: // Cb channel.
|
||||
max = frame->getMaximum( CHROMA_U );
|
||||
break;
|
||||
case HistogramWidget::ThirdChannelHistogram: // Cr channel.
|
||||
max = frame->getMaximum( CHROMA_V );
|
||||
break;
|
||||
case HistogramWidget::AlphaChannelHistogram: // Alpha channel.
|
||||
max = frame->getMaximum( COLOR_A );
|
||||
break;
|
||||
|
||||
case HistogramWidget::ColorChannelsHistogram: // All color channels.
|
||||
max = qMax( qMax( frame->getMaximum( LUMA ), frame->getMaximum( CHROMA_U ) ),
|
||||
frame->getMaximum( CHROMA_V ) );
|
||||
break;
|
||||
// case HistogramWidget::LumaHistogram: // Luminance.
|
||||
// max = frame->getMaximum( LUMA );
|
||||
// break;
|
||||
}
|
||||
|
||||
switch( m_scaleType )
|
||||
{
|
||||
case HistogramWidget::LinScaleHistogram:
|
||||
break;
|
||||
|
||||
case HistogramWidget::LogScaleHistogram:
|
||||
if( max > 0.0 )
|
||||
max = log( max );
|
||||
@@ -512,9 +552,9 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
// From Qt 4.0, QWidget automatically double-buffers its painting,
|
||||
// so there's no need to write double-buffering code in paintEvent()
|
||||
// to avoid flicker.
|
||||
// to aVoid flicker.
|
||||
QPainter p1( this );
|
||||
int pallet = d->imageColorSpace;
|
||||
Int pallet = d->imageColorSpace;
|
||||
|
||||
// Drawing selection or all histogram values.
|
||||
|
||||
@@ -524,8 +564,8 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
double value_r = 0.0, value_g = 0.0, value_b = 0.0; // For all channels.
|
||||
int i, j;
|
||||
|
||||
i = ( x * frame->getNumHistogramSegment() ) / wWidth;
|
||||
j = ( ( x + 1 ) * frame->getNumHistogramSegment() ) / wWidth;
|
||||
i = ( x * frame->getHistogramSegment() ) / wWidth;
|
||||
j = ( ( x + 1 ) * frame->getHistogramSegment() ) / wWidth;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -537,12 +577,37 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
vg = 0.0;
|
||||
vb = 0.0;
|
||||
|
||||
if( m_channelType == CalypFrame::HIST_ALL_CHANNELS )
|
||||
switch( m_channelType )
|
||||
{
|
||||
vr = frame->getHistogramValue( CalypFrame::HIST_CHAN_ONE, i );
|
||||
vg = frame->getHistogramValue( CalypFrame::HIST_CHAN_TWO, i );
|
||||
vb = frame->getHistogramValue( CalypFrame::HIST_CHAN_THREE, i );
|
||||
case HistogramWidget::FirstChannelHistogram: // Y channel.
|
||||
v = frame->getHistogramValue( LUMA, i++ );
|
||||
break;
|
||||
case HistogramWidget::SecondChannelHistogram: // Cb channel.
|
||||
v = frame->getHistogramValue( CHROMA_U, i++ );
|
||||
break;
|
||||
case HistogramWidget::ThirdChannelHistogram: // Cr channel.
|
||||
v = frame->getHistogramValue( CHROMA_V, i++ );
|
||||
break;
|
||||
case HistogramWidget::AlphaChannelHistogram: // Alpha channel.
|
||||
v = frame->getHistogramValue( COLOR_A, i++ );
|
||||
break;
|
||||
case HistogramWidget::ColorChannelsHistogram: // All color.
|
||||
vr = frame->getHistogramValue( LUMA, i );
|
||||
vg = frame->getHistogramValue( CHROMA_U, i );
|
||||
vb = frame->getHistogramValue( CHROMA_V, i++ );
|
||||
break;
|
||||
// case HistogramWidget::LumaHistogram: // Luminance.
|
||||
// v = frame->getHistogramValue( LUMA, i++ );
|
||||
// break;
|
||||
}
|
||||
|
||||
if( m_channelType != HistogramWidget::ColorChannelsHistogram )
|
||||
{
|
||||
if( v > value )
|
||||
value = v;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( vr > value_r )
|
||||
value_r = vr;
|
||||
if( vg > value_g )
|
||||
@@ -550,16 +615,9 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
if( vb > value_b )
|
||||
value_b = vb;
|
||||
}
|
||||
else
|
||||
{
|
||||
v = frame->getHistogramValue( m_channelType, i );
|
||||
if( v > value )
|
||||
value = v;
|
||||
}
|
||||
i++;
|
||||
} while( i < j );
|
||||
|
||||
if( m_channelType != CalypFrame::HIST_ALL_CHANNELS )
|
||||
if( m_channelType != HistogramWidget::ColorChannelsHistogram )
|
||||
{
|
||||
switch( m_scaleType )
|
||||
{
|
||||
@@ -610,7 +668,7 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
// Drawing the histogram + selection or only the histogram.
|
||||
|
||||
if( m_channelType != CalypFrame::HIST_ALL_CHANNELS )
|
||||
if( m_channelType != HistogramWidget::ColorChannelsHistogram )
|
||||
{
|
||||
if( d->selectMode == true ) // Selection mode enable ?
|
||||
{
|
||||
@@ -663,23 +721,17 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// colors channel mode?
|
||||
switch( m_colorType )
|
||||
{
|
||||
case CalypFrame::HIST_LUMA:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
case HistogramWidget::FirstChannelColor:
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
case HistogramWidget::SecondChannelColor:
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_CHROMA_V:
|
||||
case CalypFrame::HIST_COLOR_B:
|
||||
default:
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
break;
|
||||
|
||||
default:
|
||||
Q_ASSERT( 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -688,13 +740,12 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// colors channel mode?
|
||||
switch( m_colorType )
|
||||
{
|
||||
case CalypFrame::HIST_LUMA:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
case HistogramWidget::FirstChannelColor:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -706,13 +757,12 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
case HistogramWidget::SecondChannelColor:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -723,25 +773,23 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
p1.drawLine( x, wHeight - yg - 1, x, wHeight - yg );
|
||||
|
||||
break;
|
||||
case CalypFrame::HIST_CHROMA_V:
|
||||
case CalypFrame::HIST_COLOR_B:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - qMax( qMax( yr, yg ), yb ), x, 0 );
|
||||
p1.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - yr - 1, x, wHeight - yr );
|
||||
p1.drawLine( x, wHeight - yg - 1, x, wHeight - yg );
|
||||
p1.drawLine( x, wHeight - yb - 1, x, wHeight - yb );
|
||||
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT( 0 );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - qMax( qMax( yr, yg ), yb ), x, 0 );
|
||||
p1.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - yr - 1, x, wHeight - yr );
|
||||
p1.drawLine( x, wHeight - yg - 1, x, wHeight - yg );
|
||||
p1.drawLine( x, wHeight - yb - 1, x, wHeight - yb );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if( x == wWidth / 4 || x == wWidth / 2 || x == 3 * wWidth / 4 )
|
||||
@@ -757,16 +805,15 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// colors channel mode?
|
||||
switch( m_colorType )
|
||||
{
|
||||
case CalypFrame::HIST_LUMA:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
case HistogramWidget::FirstChannelColor:
|
||||
p1.setPen( QPen( Qt::green, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
p1.setPen( QPen( Qt::blue, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( Qt::red, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -778,16 +825,15 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
case HistogramWidget::SecondChannelColor:
|
||||
p1.setPen( QPen( Qt::blue, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( Qt::red, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
p1.setPen( QPen( Qt::green, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -799,28 +845,25 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_CHROMA_V:
|
||||
case CalypFrame::HIST_COLOR_B:
|
||||
p1.setPen( QPen( Qt::red, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
p1.setPen( QPen( Qt::green, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
p1.setPen( QPen( Qt::blue, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - qMax( qMax( yr, yg ), yb ), x, 0 );
|
||||
p1.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - yr - 1, x, wHeight - yr );
|
||||
p1.drawLine( x, wHeight - yg - 1, x, wHeight - yg );
|
||||
p1.drawLine( x, wHeight - yb - 1, x, wHeight - yb );
|
||||
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT( 0 );
|
||||
p1.setPen( QPen( Qt::red, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
p1.setPen( QPen( Qt::green, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
p1.setPen( QPen( Qt::blue, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - qMax( qMax( yr, yg ), yb ), x, 0 );
|
||||
p1.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight - yr - 1, x, wHeight - yr );
|
||||
p1.drawLine( x, wHeight - yg - 1, x, wHeight - yg );
|
||||
p1.drawLine( x, wHeight - yb - 1, x, wHeight - yb );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if( x == wWidth / 4 || x == wWidth / 2 || x == 3 * wWidth / 4 )
|
||||
@@ -841,23 +884,22 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
{
|
||||
switch( m_channelType )
|
||||
{
|
||||
case CalypFrame::HIST_CHROMA_V:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
case HistogramWidget::FirstChannelHistogram:
|
||||
guidePos = d->colorGuide.red();
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
case HistogramWidget::SecondChannelHistogram:
|
||||
guidePos = d->colorGuide.green();
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_B:
|
||||
case HistogramWidget::ThirdChannelHistogram:
|
||||
guidePos = d->colorGuide.blue();
|
||||
break;
|
||||
|
||||
case CalypFrame::HIST_LUMA:
|
||||
guidePos = qMax( qMax( d->colorGuide.red(), d->colorGuide.green() ), d->colorGuide.blue() );
|
||||
break;
|
||||
// case HistogramWidget::LumaHistogram:
|
||||
// guidePos = qMax( qMax( d->colorGuide.red(), d->colorGuide.green()
|
||||
// ), d->colorGuide.blue() );
|
||||
// break;
|
||||
|
||||
default: // Alpha.
|
||||
guidePos = -1;
|
||||
@@ -866,7 +908,7 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
if( guidePos != -1 )
|
||||
{
|
||||
int xGuide = ( guidePos * wWidth ) / frame->getNumHistogramSegment();
|
||||
int xGuide = ( guidePos * wWidth ) / frame->getHistogramSegment();
|
||||
p1.drawLine( xGuide, 0, xGuide, wHeight );
|
||||
|
||||
QString string = tr( "x:%1" ).arg( guidePos );
|
||||
@@ -903,7 +945,7 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
tipText = "<table cellspacing=0 cellpadding=0>";
|
||||
|
||||
tipText += cellBeg + tr( "Mean:" ) + cellMid;
|
||||
double mean = frame->getMean( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
double mean = frame->getMean( m_channelType, 0, frame->getHistogramSegment() - 1 );
|
||||
tipText += value.setNum( mean, 'f', 1 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Pixels:" ) + cellMid;
|
||||
@@ -911,20 +953,16 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
tipText += value.setNum( (float)pixels, 'f', 0 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Std dev.:" ) + cellMid;
|
||||
double stddev = frame->getStdDev( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
double stddev = frame->getStdDev( m_channelType, 0, frame->getHistogramSegment() - 1 );
|
||||
tipText += value.setNum( stddev, 'f', 1 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Selected:" ) + cellMid;
|
||||
double counts = frame->getNumPixelsRange( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
double counts = frame->getCount( m_channelType, 0, frame->getHistogramSegment() - 1 );
|
||||
tipText += value.setNum( (float)counts, 'f', 0 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Median:" ) + cellMid;
|
||||
double median = frame->getMedian( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
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;
|
||||
double median = frame->getMedian( m_channelType, 0, frame->getHistogramSegment() - 1 );
|
||||
tipText += value.setNum( median, 'f', 1 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Percent:" ) + cellMid;
|
||||
double percentile = ( pixels > 0 ? ( 100.0 * counts / pixels ) : 0.0 );
|
||||
@@ -947,7 +985,7 @@ void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// Mouse Events
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::mousePressEvent( QMouseEvent* e )
|
||||
Void HistogramWidget::mousePressEvent( QMouseEvent* e )
|
||||
{
|
||||
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
|
||||
{
|
||||
@@ -965,7 +1003,7 @@ void HistogramWidget::mousePressEvent( QMouseEvent* e )
|
||||
}
|
||||
}
|
||||
|
||||
void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
|
||||
Void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
|
||||
{
|
||||
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
|
||||
|
||||
@@ -983,7 +1021,7 @@ void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
|
||||
}
|
||||
}
|
||||
|
||||
void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
|
||||
Void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
|
||||
{
|
||||
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
|
||||
{
|
||||
@@ -1018,12 +1056,13 @@ void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HistogramWidget::notifyValuesChanged()
|
||||
Void HistogramWidget::notifyValuesChanged()
|
||||
{
|
||||
emit signalintervalChanged( (int)( d->xmin * d->range ), d->xmax == 0.0 ? d->range : (int)( d->xmax * d->range ) );
|
||||
emit signalIntervalChanged( (int)( d->xmin * d->range ),
|
||||
d->xmax == 0.0 ? d->range : (int)( d->xmax * d->range ) );
|
||||
}
|
||||
|
||||
void HistogramWidget::slotMinValueChanged( int min )
|
||||
Void HistogramWidget::slotMinValueChanged( int min )
|
||||
{
|
||||
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
|
||||
{
|
||||
@@ -1041,7 +1080,7 @@ void HistogramWidget::slotMinValueChanged( int min )
|
||||
}
|
||||
}
|
||||
|
||||
void HistogramWidget::slotMaxValueChanged( int max )
|
||||
Void HistogramWidget::slotMaxValueChanged( int max )
|
||||
{
|
||||
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -26,13 +26,12 @@
|
||||
#ifndef __HISTOGRAMWIDGET_H__
|
||||
#define __HISTOGRAMWIDGET_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
#include <QColor>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
class QEvent;
|
||||
|
||||
class HistogramWorker;
|
||||
@@ -43,6 +42,20 @@ class HistogramWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum HistogramChannel
|
||||
{
|
||||
/** Luminance */
|
||||
// LumaHistogram = 0,
|
||||
/** Channels */
|
||||
FirstChannelHistogram = 0,
|
||||
SecondChannelHistogram,
|
||||
ThirdChannelHistogram,
|
||||
/** Alpha channel */
|
||||
AlphaChannelHistogram,
|
||||
/** All color channels */
|
||||
ColorChannelsHistogram,
|
||||
};
|
||||
|
||||
enum HistogramScale
|
||||
{
|
||||
/** Linear scale */
|
||||
@@ -51,6 +64,14 @@ public:
|
||||
LogScaleHistogram
|
||||
};
|
||||
|
||||
enum HistogramAllColorMode
|
||||
{
|
||||
// Select wich component is shown in foreground
|
||||
FirstChannelColor,
|
||||
SecondChannelColor,
|
||||
ThirdChannelColor,
|
||||
};
|
||||
|
||||
enum HistogramRendering
|
||||
{
|
||||
/** Full image histogram rendering */
|
||||
@@ -82,44 +103,46 @@ public:
|
||||
* @param height of the widget
|
||||
* @param parent the histogram widget parent
|
||||
*/
|
||||
HistogramWidget( int width, int height, QWidget* parent = 0 );
|
||||
HistogramWidget( Int width, Int height, QWidget* parent = 0 );
|
||||
|
||||
~HistogramWidget();
|
||||
|
||||
/** Stop current histogram computations.*/
|
||||
void stopHistogramComputation();
|
||||
Void stopHistogramComputation();
|
||||
|
||||
/** Update full image histogram data. */
|
||||
void updateData( std::shared_ptr<CalypFrame> pcFrame, std::shared_ptr<CalypFrame> pcFrameSelection );
|
||||
Void updateData( PlaYUVerFrame* pcFrame, PlaYUVerFrame* pcFrameSelection );
|
||||
|
||||
/** @see @p HistogramOption */
|
||||
void setOptions( HistogramOptions options = AllOptions );
|
||||
void setDataLoading();
|
||||
void setLoadingSkipped();
|
||||
void setLoadingFailed();
|
||||
void setHistogramGuideByColor( QColor color );
|
||||
Void setOptions( HistogramOptions options = AllOptions );
|
||||
Void setDataLoading();
|
||||
Void setLoadingSkipped();
|
||||
Void setLoadingFailed();
|
||||
Void setHistogramGuideByColor( QColor color );
|
||||
|
||||
void reset();
|
||||
Void reset();
|
||||
|
||||
public:
|
||||
/** Channel type to draw */
|
||||
int m_channelType;
|
||||
Int m_channelType;
|
||||
/** Scale to use for drawing */
|
||||
int m_scaleType;
|
||||
Int m_scaleType;
|
||||
/** Color to use for drawing in All Colors Channel mode */
|
||||
int m_colorType;
|
||||
Int m_colorType;
|
||||
/** Using full image or image selection for histogram rendering */
|
||||
int m_renderingType;
|
||||
Int m_renderingType;
|
||||
|
||||
/** Full image */
|
||||
HistogramWorker* m_imageWorker;
|
||||
std::shared_ptr<CalypFrame> m_fullImage;
|
||||
// PlaYUVerFrameStats* m_imageHistogram;
|
||||
PlaYUVerFrame* m_fullImage;
|
||||
/** Histogram area selection */
|
||||
HistogramWorker* m_selectionWorker;
|
||||
std::shared_ptr<CalypFrame> m_selectionImage;
|
||||
// PlaYUVerFrameStats* m_selectionHistogram;
|
||||
PlaYUVerFrame* m_selectionImage;
|
||||
|
||||
Q_SIGNALS:
|
||||
void signalintervalChanged( int min, int max );
|
||||
void signalIntervalChanged( int min, int max );
|
||||
void signalMaximumValueChanged( int );
|
||||
void signalHistogramComputationDone( int );
|
||||
void signalHistogramComputationFailed( void );
|
||||
@@ -132,14 +155,14 @@ protected slots:
|
||||
void slotBlinkTimerDone( void );
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent* );
|
||||
void mousePressEvent( QMouseEvent* e );
|
||||
void mouseReleaseEvent( QMouseEvent* e );
|
||||
void mouseMoveEvent( QMouseEvent* e );
|
||||
Void paintEvent( QPaintEvent* );
|
||||
Void mousePressEvent( QMouseEvent* e );
|
||||
Void mouseReleaseEvent( QMouseEvent* e );
|
||||
Void mouseMoveEvent( QMouseEvent* e );
|
||||
|
||||
private:
|
||||
void customEvent( QEvent* event );
|
||||
void notifyValuesChanged();
|
||||
Void customEvent( QEvent* event );
|
||||
Void notifyValuesChanged();
|
||||
|
||||
private:
|
||||
HistogramWidgetPrivate* d;
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,22 +23,17 @@
|
||||
*/
|
||||
|
||||
#include "ModuleHandleDock.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include "ModulesHandle.h"
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
#include <QtGui>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
ModuleHandleDock::ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf )
|
||||
ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf )
|
||||
: QWidget( parent ), m_pcCurrModuleIf( moduleIf )
|
||||
{
|
||||
// ----------------- Dock definition -----------------
|
||||
|
||||
QString labelStr;
|
||||
labelStr.append( moduleIf->m_pcModule->getModuleLongName() );
|
||||
labelStr.append( moduleIf->m_pcModule->m_pchModuleName );
|
||||
labelStr.append( " Result:" );
|
||||
labelModulueValueLabel = new QLabel( labelStr );
|
||||
labelModulueValueLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
@@ -47,7 +42,7 @@ ModuleHandleDock::ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf
|
||||
labelModulueReturnValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QGridLayout* modulesPropertiesLayout = new QGridLayout;
|
||||
int layout_line = 0;
|
||||
Int layout_line = 0;
|
||||
modulesPropertiesLayout->addWidget( labelModulueValueLabel, layout_line, 0 );
|
||||
modulesPropertiesLayout->addWidget( labelModulueReturnValue, layout_line, 1 );
|
||||
layout_line++;
|
||||
@@ -58,20 +53,22 @@ ModuleHandleDock::ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf
|
||||
setEnabled( true );
|
||||
}
|
||||
|
||||
ModuleHandleDock::~ModuleHandleDock() = default;
|
||||
ModuleHandleDock::~ModuleHandleDock() {}
|
||||
|
||||
void ModuleHandleDock::setModuleReturnValue( double value )
|
||||
Void ModuleHandleDock::setModulueReturnValue( Double value )
|
||||
{
|
||||
labelModulueReturnValue->clear();
|
||||
QString strValue = QString( "%1" ).arg( value );
|
||||
labelModulueReturnValue->setText( strValue );
|
||||
}
|
||||
|
||||
void ModuleHandleDock::visibilityChangedSlot( bool visiblity )
|
||||
Void ModuleHandleDock::visibilityChangedSlot( bool visiblity )
|
||||
{
|
||||
if( !visiblity )
|
||||
if( !visiblity && m_pcCurrModuleIf )
|
||||
{
|
||||
m_pcCurrModuleIf->disable();
|
||||
PlaYUVerAppModuleIf* pcCurrentModule = m_pcCurrModuleIf;
|
||||
m_pcCurrModuleIf = NULL;
|
||||
ModulesHandle::destroyModuleIf( pcCurrentModule );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,31 +25,32 @@
|
||||
#ifndef __MODULEHANDLEDOCK_H__
|
||||
#define __MODULEHANDLEDOCK_H__
|
||||
|
||||
#include <QSize>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#endif
|
||||
|
||||
class QLabel;
|
||||
|
||||
class CalypAppModuleIf;
|
||||
class PlaYUVerAppModuleIf;
|
||||
|
||||
class ModuleHandleDock : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf );
|
||||
ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf );
|
||||
~ModuleHandleDock();
|
||||
|
||||
void setModuleReturnValue( double value );
|
||||
Void setModulueReturnValue( Double value );
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
private:
|
||||
CalypAppModuleIf* m_pcCurrModuleIf;
|
||||
PlaYUVerAppModuleIf* m_pcCurrModuleIf;
|
||||
|
||||
bool m_bIsVisible;
|
||||
Bool m_bIsVisible;
|
||||
QLabel* labelModulueValueLabel;
|
||||
QLabel* labelModulueReturnValue;
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/* 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 ModuleSubWindow.cpp
|
||||
* \brief Video Sub windows handling
|
||||
*/
|
||||
|
||||
#include "ModuleSubWindow.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QStaticText>
|
||||
#include <cassert>
|
||||
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
ModuleSubWindow::ModuleSubWindow( CalypAppModuleIf* module, QWidget* parent )
|
||||
: VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW, parent )
|
||||
{
|
||||
m_pcDisplayModule = module;
|
||||
}
|
||||
|
||||
ModuleSubWindow::~ModuleSubWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void ModuleSubWindow::resetWindowName()
|
||||
{
|
||||
QString windowName{ "Module" };
|
||||
if( auto module_ptr = m_pcDisplayModule )
|
||||
{
|
||||
windowName.append( " " ).append( module_ptr->getModule()->m_pchModuleLongName );
|
||||
}
|
||||
setWindowName( windowName );
|
||||
}
|
||||
|
||||
void ModuleSubWindow::updateVideoWindowInfo()
|
||||
{
|
||||
m_cStreamInformation = "";
|
||||
|
||||
m_cStreamInformation = "Module";
|
||||
if( auto module_ptr = m_pcDisplayModule )
|
||||
{
|
||||
const auto& arraySubWindows = module_ptr->getSubWindowList();
|
||||
QStringList windowInfoList;
|
||||
if( arraySubWindows.size() > 0 )
|
||||
{
|
||||
for( std::size_t i = 0; i < arraySubWindows.size(); i++ )
|
||||
{
|
||||
if( arraySubWindows[i]->getWindowName() != getWindowName() )
|
||||
{
|
||||
windowInfoList.append( QString( "Input %1 - " + arraySubWindows[i]->getWindowName() ).arg( i + 1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( module_ptr->getModuleRequirements().is_set( ClpModuleFeature::HasInfo ) )
|
||||
{
|
||||
QStringList list = QString::fromStdString( module_ptr->moduleInfo() ).split( '\n' );
|
||||
windowInfoList.append( list );
|
||||
}
|
||||
if( windowInfoList.size() > 0 )
|
||||
{
|
||||
m_pcVideoInfo->setInformationTopLeft( windowInfoList );
|
||||
}
|
||||
}
|
||||
if( m_pcCurrFrameAsset )
|
||||
{
|
||||
QString m_cPelFmtName = QString::fromStdString( m_pcCurrFrameAsset->getPelFmtName() );
|
||||
m_cStreamInformation += " | " + m_cPelFmtName;
|
||||
}
|
||||
if( m_cStreamInformation.isEmpty() )
|
||||
{
|
||||
m_cStreamInformation = " ";
|
||||
}
|
||||
}
|
||||
|
||||
bool ModuleSubWindow::isPlaying()
|
||||
{
|
||||
if( auto module_ptr = m_pcDisplayModule )
|
||||
{
|
||||
for( auto window : module_ptr->getSubWindowList() )
|
||||
{
|
||||
if( window->isPlaying() )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ModuleSubWindow::refreshSubWindow()
|
||||
{
|
||||
if( auto module_ptr = m_pcDisplayModule )
|
||||
{
|
||||
setFillWindow( true );
|
||||
updateVideoWindowInfo();
|
||||
module_ptr->apply( isPlaying(), false );
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/* 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 ModuleSubWindow.h
|
||||
* \brief Video Sub windows handling
|
||||
*/
|
||||
|
||||
#ifndef __MODULESUBWINDOW_H__
|
||||
#define __MODULESUBWINDOW_H__
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QFuture>
|
||||
#include <QRect>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class VideoInformation;
|
||||
|
||||
class ModuleSubWindow : public VideoSubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ModuleSubWindow( CalypAppModuleIf* module, QWidget* parent = 0 );
|
||||
~ModuleSubWindow();
|
||||
|
||||
void resetWindowName();
|
||||
|
||||
void updateVideoWindowInfo();
|
||||
|
||||
bool isPlaying();
|
||||
void stop(){};
|
||||
void advanceOneFrame(){};
|
||||
auto getFrameNum() -> std::uint64_t { return 1; };
|
||||
|
||||
void refreshSubWindow();
|
||||
|
||||
void setCurrFrame( std::shared_ptr<CalypFrame> pcCurrFrame );
|
||||
};
|
||||
|
||||
#endif // __MODULESUBWINDOW_H__
|
||||
+263
-230
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -19,31 +19,33 @@
|
||||
|
||||
/**
|
||||
* \file ModulesHandle.cpp
|
||||
* \brief Calyp modules handle
|
||||
* \brief PlaYUVer modules handle
|
||||
*/
|
||||
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "ModuleSubWindow.h"
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "ModulesHandleOptDialog.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "VideoHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "modules/CalypModulesFactory.h"
|
||||
#include "modules/PlaYUVerModuleFactory.h"
|
||||
#include <cstdio>
|
||||
|
||||
ModulesHandle::ModulesHandle( QWidget* parent, SubWindowHandle* windowManager, VideoHandle* moduleVideo )
|
||||
: m_pcParent( parent ), m_pcMainWindowManager( windowManager ), m_appModuleVideo( moduleVideo )
|
||||
ModulesHandle::ModulesHandle( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager,
|
||||
VideoHandle* moduleVideo )
|
||||
: QWidget( parent )
|
||||
, m_pcParent( parent )
|
||||
, m_pcMainWindowManager( windowManager )
|
||||
, m_appModuleVideo( moduleVideo )
|
||||
{
|
||||
setParent( m_pcParent );
|
||||
}
|
||||
|
||||
ModulesHandle::~ModulesHandle() {}
|
||||
|
||||
void ModulesHandle::createActions()
|
||||
Void ModulesHandle::createActions()
|
||||
{
|
||||
m_arrayActions.resize( MODULES_TOTAL_ACT );
|
||||
|
||||
@@ -51,32 +53,36 @@ void ModulesHandle::createActions()
|
||||
connect( m_pcActionMapper, SIGNAL( mapped( int ) ), this, SLOT( processOpt( int ) ) );
|
||||
|
||||
// m_arrayActions[FORCE_PLAYING_REFRESH_ACT] = new QAction( "Refresh while
|
||||
// playing", m_pcParent );
|
||||
// playing", parent() );
|
||||
// m_arrayActions[FORCE_PLAYING_REFRESH_ACT]->setStatusTip( "Force module
|
||||
// refreshing while playing" );
|
||||
// m_arrayActions[FORCE_PLAYING_REFRESH_ACT]->setCheckable( true );
|
||||
|
||||
m_arrayActions[LOAD_EXTERNAL_ACT] = new QAction( "Load external module", m_pcParent );
|
||||
m_arrayActions[LOAD_EXTERNAL_ACT] = new QAction( "Load external module", parent() );
|
||||
m_arrayActions[LOAD_EXTERNAL_ACT]->setStatusTip( "Load an externally build module" );
|
||||
connect( m_arrayActions[LOAD_EXTERNAL_ACT], &QAction::triggered, this, &ModulesHandle::loadExternalModule );
|
||||
connect( m_arrayActions[LOAD_EXTERNAL_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( loadExternalModule() ) );
|
||||
|
||||
m_arrayActions[APPLY_ALL_ACT] = new QAction( "Apply to All", m_pcParent );
|
||||
m_arrayActions[APPLY_ALL_ACT] = new QAction( "Apply to All", parent() );
|
||||
m_arrayActions[APPLY_ALL_ACT]->setStatusTip( "Apply module to all frames and save the result" );
|
||||
connect( m_arrayActions[APPLY_ALL_ACT], SIGNAL( triggered() ), m_pcActionMapper, SLOT( map() ) );
|
||||
m_pcActionMapper->setMapping( m_arrayActions[APPLY_ALL_ACT], APPLY_ALL_ACT );
|
||||
|
||||
m_arrayActions[SWAP_FRAMES_ACT] = new QAction( "Swap frames", m_pcParent );
|
||||
m_arrayActions[SWAP_FRAMES_ACT] = new QAction( "Swap frames", parent() );
|
||||
m_arrayActions[SWAP_FRAMES_ACT]->setStatusTip( "Swap Sub Window order" );
|
||||
connect( m_arrayActions[SWAP_FRAMES_ACT], SIGNAL( triggered() ), m_pcActionMapper, SLOT( map() ) );
|
||||
connect( m_arrayActions[SWAP_FRAMES_ACT], SIGNAL( triggered() ), m_pcActionMapper,
|
||||
SLOT( map() ) );
|
||||
m_pcActionMapper->setMapping( m_arrayActions[SWAP_FRAMES_ACT], SWAP_FRAMES_ACT );
|
||||
|
||||
m_arrayActions[DISABLE_ACT] = new QAction( "Disable Modules", m_pcParent );
|
||||
connect( m_arrayActions[DISABLE_ACT], &QAction::triggered, this, &ModulesHandle::destroyWindowModules );
|
||||
m_arrayActions[DISABLE_ACT] = new QAction( "Disable Modules", parent() );
|
||||
connect( m_arrayActions[DISABLE_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( destroyWindowModules() ) );
|
||||
|
||||
m_arrayActions[DISABLE_ALL_ACT] = new QAction( "Disable All Modules", m_pcParent );
|
||||
connect( m_arrayActions[DISABLE_ALL_ACT], &QAction::triggered, this, &ModulesHandle::destroyAllModulesIf );
|
||||
m_arrayActions[DISABLE_ALL_ACT] = new QAction( "Disable All Modules", parent() );
|
||||
connect( m_arrayActions[DISABLE_ALL_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( destroyAllModulesIf() ) );
|
||||
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT] = new QAction( "Use New Window", m_pcParent );
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT] = new QAction( "Use New Window", parent() );
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setStatusTip(
|
||||
"Show module result in a new window. Some modules already force this "
|
||||
"feature" );
|
||||
@@ -85,64 +91,65 @@ void ModulesHandle::createActions()
|
||||
|
||||
QMenu* ModulesHandle::createMenu()
|
||||
{
|
||||
m_pcModulesMenu = new QMenu( "&Modules", m_pcParent );
|
||||
m_pcModulesMenu = new QMenu( "&Modules", this );
|
||||
buildMenu();
|
||||
return m_pcModulesMenu;
|
||||
}
|
||||
|
||||
void ModulesHandle::buildMenu()
|
||||
Void ModulesHandle::buildMenu()
|
||||
{
|
||||
for( auto& action : m_arrayModulesActions )
|
||||
PlaYUVerModuleIf* pcCurrModuleIf;
|
||||
QString ModuleIfInternalName;
|
||||
QAction* currAction;
|
||||
QMenu* currSubMenu;
|
||||
|
||||
for( Int i = 0; i < m_arrayModulesActions.size(); i++ )
|
||||
{
|
||||
delete action;
|
||||
delete m_arrayModulesActions.at( i );
|
||||
}
|
||||
m_arrayModulesActions.clear();
|
||||
m_pcModulesMenu->clear();
|
||||
m_pcModulesSubMenuList.clear();
|
||||
|
||||
CalypModulesFactoryMap& moduleFactoryMap = CalypModulesFactory::Get()->getMap();
|
||||
CalypModulesFactoryMap::iterator it = moduleFactoryMap.begin();
|
||||
for( ; it != moduleFactoryMap.end(); ++it )
|
||||
PlaYUVerModuleFactoryMap& PlaYUVerModuleFactoryMap = PlaYUVerModuleFactory::Get()->getMap();
|
||||
PlaYUVerModuleFactoryMap::iterator it = PlaYUVerModuleFactoryMap.begin();
|
||||
for( ; it != PlaYUVerModuleFactoryMap.end(); ++it )
|
||||
{
|
||||
auto pcCurrModuleIf = it->second();
|
||||
QString ModuleIfinternalName = QString::fromLocal8Bit( it->first );
|
||||
pcCurrModuleIf = it->second();
|
||||
ModuleIfInternalName = QString::fromLocal8Bit( it->first );
|
||||
|
||||
QMenu* currSubMenu{ nullptr };
|
||||
if( pcCurrModuleIf->m_iModuleAPI <= CLP_MODULE_API_2 )
|
||||
currSubMenu = NULL;
|
||||
if( pcCurrModuleIf->m_pchModuleCategory )
|
||||
{
|
||||
if( pcCurrModuleIf->m_pchModuleCategory )
|
||||
for( Int j = 0; j < m_pcModulesSubMenuList.size(); j++ )
|
||||
{
|
||||
for( int j = 0; j < m_pcModulesSubMenuList.size(); j++ )
|
||||
if( m_pcModulesSubMenuList.at( j )->title() ==
|
||||
QString( pcCurrModuleIf->m_pchModuleCategory ) )
|
||||
{
|
||||
if( m_pcModulesSubMenuList.at( j )->title() == QString( pcCurrModuleIf->m_pchModuleCategory ) )
|
||||
{
|
||||
currSubMenu = m_pcModulesSubMenuList.at( j );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !currSubMenu )
|
||||
{
|
||||
currSubMenu = m_pcModulesMenu->addMenu( pcCurrModuleIf->m_pchModuleCategory );
|
||||
m_pcModulesSubMenuList.append( currSubMenu );
|
||||
currSubMenu = m_pcModulesSubMenuList.at( j );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !currSubMenu )
|
||||
{
|
||||
currSubMenu = m_pcModulesMenu->addMenu( pcCurrModuleIf->m_pchModuleCategory );
|
||||
m_pcModulesSubMenuList.append( currSubMenu );
|
||||
}
|
||||
}
|
||||
|
||||
QAction* currAction = new QAction( pcCurrModuleIf->getModuleLongName(), m_pcParent );
|
||||
QString moduleTooltip = pcCurrModuleIf->m_pchModuleTooltip;
|
||||
if( pcCurrModuleIf->m_uiNumberOfFrames > 1 )
|
||||
moduleTooltip += QString( " | Requires %1 frames" ).arg( pcCurrModuleIf->m_uiNumberOfFrames );
|
||||
|
||||
currAction->setStatusTip( moduleTooltip );
|
||||
currAction->setData( ModuleIfinternalName );
|
||||
currAction = new QAction( pcCurrModuleIf->m_pchModuleName, parent() );
|
||||
currAction->setStatusTip( pcCurrModuleIf->m_pchModuleTooltip );
|
||||
currAction->setData( ModuleIfInternalName );
|
||||
currAction->setCheckable( false );
|
||||
connect( currAction, &QAction::triggered, this, &ModulesHandle::activateModule );
|
||||
connect( currAction, SIGNAL( triggered() ), this, SLOT( activateModule() ) );
|
||||
m_arrayModulesActions.append( currAction );
|
||||
|
||||
if( currSubMenu )
|
||||
currSubMenu->addAction( currAction );
|
||||
else
|
||||
m_pcModulesMenu->addAction( currAction );
|
||||
|
||||
pcCurrModuleIf->Delete();
|
||||
}
|
||||
|
||||
m_pcModulesMenu->addAction( m_arrayActions[LOAD_EXTERNAL_ACT] );
|
||||
@@ -154,76 +161,82 @@ void ModulesHandle::buildMenu()
|
||||
m_pcModulesMenu->addAction( m_arrayActions[FORCE_NEW_WINDOW_ACT] );
|
||||
}
|
||||
|
||||
void ModulesHandle::updateMenus()
|
||||
Void ModulesHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
Bool hasSubWindow = pcSubWindow ? true : false;
|
||||
QAction* currModuleAction;
|
||||
|
||||
bool hasSubWindow = pcSubWindow != nullptr ? true : false;
|
||||
|
||||
for( int i = 0; i < m_arrayModulesActions.size(); i++ )
|
||||
for( Int i = 0; i < m_arrayModulesActions.size(); i++ )
|
||||
{
|
||||
auto* currModuleAction = m_arrayModulesActions.at( i );
|
||||
// currModuleAction->setEnabled( hasSubWindow );
|
||||
currModuleAction = m_arrayModulesActions.at( i );
|
||||
currModuleAction->setEnabled( hasSubWindow );
|
||||
currModuleAction->setChecked( false );
|
||||
}
|
||||
// for( int i = 0; i < m_pcModulesSubMenuList.size(); i++ )
|
||||
//{
|
||||
// m_pcModulesSubMenuList.at( i )->setEnabled( hasSubWindow );
|
||||
// }
|
||||
for( Int i = 0; i < m_pcModulesSubMenuList.size(); i++ )
|
||||
{
|
||||
m_pcModulesSubMenuList.at( i )->setEnabled( hasSubWindow );
|
||||
}
|
||||
|
||||
for( int i = 0; i < m_arrayActions.size(); i++ )
|
||||
for( Int i = 0; i < m_arrayActions.size(); i++ )
|
||||
{
|
||||
m_arrayActions.at( i )->setEnabled( false );
|
||||
}
|
||||
m_arrayActions[LOAD_EXTERNAL_ACT]->setEnabled( true );
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[DISABLE_ALL_ACT]->setEnabled( true );
|
||||
m_arrayActions[DISABLE_ALL_ACT]->setEnabled( m_pcPlaYUVerAppModuleIfList.size() > 0 );
|
||||
|
||||
if( pcSubWindow )
|
||||
{
|
||||
m_arrayActions[DISABLE_ACT]->setEnabled( pcSubWindow->hasModules() );
|
||||
QList<PlaYUVerAppModuleIf*> apcCurrentModule = pcSubWindow->getModuleArray();
|
||||
m_arrayActions[DISABLE_ACT]->setEnabled( apcCurrentModule.size() > 0 );
|
||||
if( pcSubWindow->getDisplayModule() )
|
||||
{
|
||||
m_arrayActions[APPLY_ALL_ACT]->setEnabled( true );
|
||||
m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true );
|
||||
}
|
||||
// for( int i = 0; i < apcCurrentModule.size(); i++ )
|
||||
// {
|
||||
// currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction;
|
||||
// currModuleAction->setChecked( true );
|
||||
// }
|
||||
for( Int i = 0; i < apcCurrentModule.size(); i++ )
|
||||
{
|
||||
currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction;
|
||||
currModuleAction->setChecked( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ModulesHandle::readSettings()
|
||||
Void ModulesHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked( appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() );
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked(
|
||||
appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() );
|
||||
}
|
||||
|
||||
void ModulesHandle::writeSettings()
|
||||
Void ModulesHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "ModulesHandle/UseNewWindow", m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() );
|
||||
appSettings.setValue( "ModulesHandle/UseNewWindow",
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() );
|
||||
}
|
||||
|
||||
void ModulesHandle::processOpt( int index )
|
||||
Void ModulesHandle::processOpt( Int index )
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
CalypAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
|
||||
PlaYUVerAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
|
||||
if( pcCurrentModule )
|
||||
{
|
||||
PlaYUVerAppModuleIf* pcCurrModule = pcCurrentModule;
|
||||
switch( index )
|
||||
{
|
||||
case INVALID_OPT:
|
||||
break;
|
||||
case SWAP_FRAMES_ACT:
|
||||
swapModulesWindowsIf( pcCurrentModule );
|
||||
swapModulesWindowsIf( pcCurrModule );
|
||||
break;
|
||||
case APPLY_ALL_ACT:
|
||||
applyAllModuleIf( pcCurrentModule );
|
||||
applyAllModuleIf( pcCurrModule );
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT( 0 );
|
||||
@@ -233,68 +246,70 @@ void ModulesHandle::processOpt( int index )
|
||||
}
|
||||
}
|
||||
|
||||
void ModulesHandle::loadExternalModule()
|
||||
Void ModulesHandle::loadExternalModule()
|
||||
{
|
||||
bool bUpdate = false;
|
||||
Bool bUpdate = false;
|
||||
QString supported = tr( "Supported Files (*.so)" );
|
||||
QStringList formatsList;
|
||||
formatsList << "Shared Libraries (*.so)";
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
QStringList fileNames =
|
||||
QFileDialog::getOpenFileNames( m_pcParent, tr( "Open File" ), QString(), filter.join( ";;" ) );
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames( m_pcParent, tr( "Open File" ), QString(),
|
||||
filter.join( ";;" ) );
|
||||
|
||||
for( int i = 0; i < fileNames.size(); i++ )
|
||||
for( Int i = 0; i < fileNames.size(); i++ )
|
||||
{
|
||||
bUpdate |= CalypModulesFactory::Get()->RegisterDl( fileNames.at( i ).toStdString().data() );
|
||||
bUpdate |= PlaYUVerModuleFactory::Get()->RegisterDl( fileNames.at( i ).toStdString().data() );
|
||||
}
|
||||
if( bUpdate )
|
||||
buildMenu();
|
||||
}
|
||||
|
||||
void ModulesHandle::activateModule()
|
||||
Void ModulesHandle::activateModule()
|
||||
{
|
||||
QAction* pcAction = qobject_cast<QAction*>( sender() );
|
||||
Qt::KeyboardModifiers keyModifiers = QApplication::keyboardModifiers();
|
||||
bool bTmpForceNewWindow = false;
|
||||
Bool bTmpForceNewWindow = false;
|
||||
|
||||
VideoSubWindow* pcVideoSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
VideoSubWindow* pcVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( !pcVideoSubWindow )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( keyModifiers & Qt::ControlModifier ) || pcVideoSubWindow->checkCategory( VideoSubWindow::MODULE_SUBWINDOW ) )
|
||||
if( ( keyModifiers & Qt::ControlModifier ) ||
|
||||
pcVideoSubWindow->checkCategory( VideoSubWindow::MODULE_SUBWINDOW ) )
|
||||
{
|
||||
bTmpForceNewWindow = true;
|
||||
}
|
||||
|
||||
QString ModuleIfName = pcAction->data().toString();
|
||||
auto pcCurrModuleIf = CalypModulesFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() );
|
||||
if( pcCurrModuleIf == nullptr )
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto pcCurrAppModuleIf = std::make_shared<CalypAppModuleIf>( this, pcAction, std::move( pcCurrModuleIf ) );
|
||||
PlaYUVerModuleIf* pcCurrModuleIf =
|
||||
PlaYUVerModuleFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() );
|
||||
PlaYUVerAppModuleIf* pcCurrAppModuleIf =
|
||||
new PlaYUVerAppModuleIf( this, pcAction, pcCurrModuleIf );
|
||||
|
||||
QList<VideoSubWindow*> videoSubWindowList;
|
||||
int numberOfFrames = pcCurrAppModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
if( numberOfFrames > 1 ) // Show dialog to select sub windows
|
||||
Int numberOfFrames = pcCurrAppModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME ) // Show dialog to select sub windows
|
||||
{
|
||||
int minNumFrames = numberOfFrames;
|
||||
int maxNumFrames = numberOfFrames;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements.is_set( ClpModuleFeature::VariableNumOfFrames ) )
|
||||
Int minNumFrames = numberOfFrames;
|
||||
Int maxNumFrames = numberOfFrames;
|
||||
if( numberOfFrames == MODULE_REQUIRES_SEVERAL_FRAMES )
|
||||
{
|
||||
minNumFrames = numberOfFrames;
|
||||
minNumFrames = 0;
|
||||
maxNumFrames = 255;
|
||||
}
|
||||
SubWindowSelectorDialog dialogWindowsSelection( m_pcParent, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_SUBWINDOW, minNumFrames, maxNumFrames );
|
||||
QList<SubWindowAbstract*> windowsList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_SUBWINDOW,
|
||||
minNumFrames, maxNumFrames );
|
||||
QList<SubWindowAbstract*> windowsList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
|
||||
if( windowsList.size() == minNumFrames && windowsList.size() == maxNumFrames )
|
||||
{
|
||||
for( int i = 0; i < windowsList.size(); i++ )
|
||||
for( Int i = 0; i < windowsList.size(); i++ )
|
||||
{
|
||||
videoSubWindowList.append( qobject_cast<VideoSubWindow*>( windowsList.at( i ) ) );
|
||||
}
|
||||
@@ -303,7 +318,7 @@ void ModulesHandle::activateModule()
|
||||
{
|
||||
if( windowsList.size() <= minNumFrames )
|
||||
{
|
||||
for( int i = 0; i < windowsList.size(); i++ )
|
||||
for( Int i = 0; i < windowsList.size(); i++ )
|
||||
{
|
||||
dialogWindowsSelection.selectSubWindow( windowsList.at( i ) );
|
||||
}
|
||||
@@ -316,23 +331,25 @@ void ModulesHandle::activateModule()
|
||||
{
|
||||
VideoSubWindow* videoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList = dialogWindowsSelection.getSelectedWindows();
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
videoSubWindowList.append( videoSubWindow );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == CLP_MODULE_API_1 )
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_1 )
|
||||
{
|
||||
// Check for same fmt in more than one frame modules
|
||||
for( int i = 1; i < videoSubWindowList.size(); i++ )
|
||||
for( Int i = 1; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
if( !videoSubWindowList.at( i )->getCurrFrame()->haveSameFmt( videoSubWindowList.at( 0 )->getCurrFrame() ) )
|
||||
if( !videoSubWindowList.at( i )->getCurrFrame()->haveSameFmt(
|
||||
videoSubWindowList.at( 0 )->getCurrFrame() ) )
|
||||
{
|
||||
videoSubWindowList.clear();
|
||||
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Error! Incompatible frames", CLP_LOG_ERROR );
|
||||
// destroyModuleIf( pcCurrAppModuleIf );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! Incompatible frames", LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -345,83 +362,98 @@ void ModulesHandle::activateModule()
|
||||
|
||||
if( videoSubWindowList.size() == 0 )
|
||||
{
|
||||
qobject_cast<MainWindow*>( m_pcParent )
|
||||
->printMessage( "Error! There is no windows to apply the module", CLP_LOG_ERROR );
|
||||
// destroyModuleIf( pcCurrAppModuleIf );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! There is no windows to apply the module", LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
|
||||
for( int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcSubWindow[i] = videoSubWindowList.at( i );
|
||||
}
|
||||
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements.is_set( ClpModuleFeature::Options ) )
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_OPTIONS )
|
||||
{
|
||||
ModulesHandleOptDialog moduleOptDialog( m_pcParent, pcCurrAppModuleIf.get() );
|
||||
ModulesHandleOptDialog moduleOptDialog( m_pcParent, pcCurrAppModuleIf );
|
||||
if( moduleOptDialog.runConfiguration() == QDialog::Rejected )
|
||||
{
|
||||
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Module canceled by user!", CLP_LOG_WARNINGS );
|
||||
// destroyModuleIf( pcCurrAppModuleIf );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Module canceled by user!", LOG_WARNINGS );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow;
|
||||
Bool bShowModulesNewWindow =
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow;
|
||||
|
||||
QString windowName;
|
||||
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == ClpModuleType::FrameProcessing )
|
||||
VideoSubWindow* pcModuleSubWindow = NULL;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
if( bShowModulesNewWindow || pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements.is_set( ClpModuleFeature::NewWindow ) )
|
||||
if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) ||
|
||||
bShowModulesNewWindow )
|
||||
{
|
||||
auto pcModuleSubWindow = new ModuleSubWindow( pcCurrAppModuleIf.get() );
|
||||
pcModuleSubWindow->resetWindowName();
|
||||
pcModuleSubWindow = new VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW );
|
||||
windowName.append( QStringLiteral( "Module " ) );
|
||||
windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName );
|
||||
|
||||
connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ),
|
||||
m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) );
|
||||
connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ),
|
||||
m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
|
||||
connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ),
|
||||
m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) );
|
||||
|
||||
pcCurrAppModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow;
|
||||
// connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo,
|
||||
// SLOT( updateSelectionArea( QRect ) ) );
|
||||
// connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo,
|
||||
// SLOT( zoomToFactorAll( double, QPoint ) ) );
|
||||
// connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo,
|
||||
// SLOT( moveAllScrollBars( const QPoint ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcSubWindow[0]->setDisplayModule( pcCurrAppModuleIf.get() );
|
||||
}
|
||||
}
|
||||
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == ClpModuleType::FrameMeasurement )
|
||||
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcDisplaySubWindow = NULL;
|
||||
pcCurrAppModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent, pcCurrAppModuleIf.get() );
|
||||
pcCurrAppModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent, pcCurrAppModuleIf );
|
||||
QString titleDockWidget;
|
||||
titleDockWidget.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName );
|
||||
titleDockWidget.append( " Information" );
|
||||
pcCurrAppModuleIf->m_pcDockWidget = new QDockWidget( titleDockWidget, m_pcParent );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable |
|
||||
QDockWidget::DockWidgetFloatable );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setAllowedAreas( Qt::LeftDockWidgetArea |
|
||||
Qt::RightDockWidgetArea );
|
||||
pcCurrAppModuleIf->m_pcDockWidget->setWidget( pcCurrAppModuleIf->m_pcModuleDock );
|
||||
qobject_cast<QMainWindow*>( m_pcParent )
|
||||
->addDockWidget( Qt::RightDockWidgetArea, pcCurrAppModuleIf->m_pcDockWidget );
|
||||
}
|
||||
|
||||
for( int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
// Associate module with subwindows
|
||||
if( !pcCurrAppModuleIf->m_pcDisplaySubWindow && !pcCurrAppModuleIf->m_pcModuleDock )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcSubWindow[i]->associateModule( pcCurrAppModuleIf );
|
||||
pcCurrAppModuleIf->m_pcSubWindow[0]->enableModule( pcCurrAppModuleIf );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pcCurrAppModuleIf->m_pcDisplaySubWindow )
|
||||
pcCurrAppModuleIf->m_pcDisplaySubWindow->enableModule( pcCurrAppModuleIf );
|
||||
for( Int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcSubWindow[i]->associateModule( pcCurrAppModuleIf );
|
||||
}
|
||||
}
|
||||
|
||||
// Create Module
|
||||
bool moduleCreated = false;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
|
||||
Bool moduleCreated = false;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_2 )
|
||||
{
|
||||
std::vector<CalypFrame*> apcFrameList;
|
||||
for( int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
std::vector<PlaYUVerFrame*> apcFrameList;
|
||||
for( Int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
apcFrameList.push_back( pcCurrAppModuleIf->m_pcSubWindow[i]->getCurrFrame() );
|
||||
}
|
||||
moduleCreated = pcCurrAppModuleIf->m_pcModule->create( apcFrameList );
|
||||
}
|
||||
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == CLP_MODULE_API_1 )
|
||||
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_1 )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcModule->create( pcCurrAppModuleIf->m_pcSubWindow[0]->getCurrFrame() );
|
||||
moduleCreated = true;
|
||||
@@ -429,20 +461,20 @@ void ModulesHandle::activateModule()
|
||||
|
||||
if( !moduleCreated )
|
||||
{
|
||||
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Error! Module cannot be created", CLP_LOG_ERROR );
|
||||
// destroyModuleIf( pcCurrAppModuleIf );
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! Module cannot be created", LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
|
||||
pcCurrAppModuleIf->apply( false, true );
|
||||
|
||||
QCoreApplication::processEvents();
|
||||
|
||||
if( pcCurrAppModuleIf->m_pcDisplaySubWindow )
|
||||
if( pcModuleSubWindow )
|
||||
{
|
||||
m_pcMainWindowManager->addSubWindow( pcCurrAppModuleIf->m_pcDisplaySubWindow );
|
||||
pcCurrAppModuleIf->m_pcDisplaySubWindow->show();
|
||||
m_appModuleVideo->addSubWindow( pcCurrAppModuleIf->m_pcDisplaySubWindow );
|
||||
pcModuleSubWindow->setWindowName( windowName );
|
||||
m_pcMainWindowManager->addSubWindow( pcModuleSubWindow );
|
||||
pcModuleSubWindow->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -452,118 +484,123 @@ void ModulesHandle::activateModule()
|
||||
videoSubWindowList.at( 0 )->setWindowName( windowName );
|
||||
}
|
||||
|
||||
// Change ownership of the module
|
||||
// if( !pcCurrAppModuleIf->m_pcDisplaySubWindow && !pcCurrAppModuleIf->m_pcModuleDock )
|
||||
// {
|
||||
// pcCurrAppModuleIf->m_pcSubWindow[0]->enableModule( pcCurrAppModuleIf );
|
||||
// }
|
||||
// else if( pcCurrAppModuleIf->m_pcDisplaySubWindow )
|
||||
// {
|
||||
// pcCurrAppModuleIf->m_pcDisplaySubWindow->enableModule( pcCurrAppModuleIf );
|
||||
// }
|
||||
m_pcPlaYUVerAppModuleIfList.append( pcCurrAppModuleIf );
|
||||
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void ModulesHandle::destroyWindowModules()
|
||||
Void ModulesHandle::destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
if( pcCurrModuleIf )
|
||||
{
|
||||
pcCurrModuleIf->destroy();
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::destroyWindowModules()
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcVideoSubWindow )
|
||||
{
|
||||
pcVideoSubWindow->disableAllModules();
|
||||
pcVideoSubWindow->disableModule();
|
||||
emit changed();
|
||||
}
|
||||
}
|
||||
|
||||
void ModulesHandle::destroyAllModulesIf()
|
||||
Void ModulesHandle::destroyAllModulesIf()
|
||||
{
|
||||
bool emit_changed = false;
|
||||
QList<SubWindowAbstract*> windowsList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( auto window : windowsList )
|
||||
for( Int i = 0; i < m_pcPlaYUVerAppModuleIfList.size(); i++ )
|
||||
{
|
||||
emit_changed |= qobject_cast<VideoSubWindow*>( window )->disableAllModules();
|
||||
destroyModuleIf( m_pcPlaYUVerAppModuleIfList.at( i ) );
|
||||
}
|
||||
if( emit_changed )
|
||||
emit changed();
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void ModulesHandle::applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf )
|
||||
Void ModulesHandle::applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
|
||||
Bool isPlaying,
|
||||
Bool disableThreads )
|
||||
{
|
||||
for( Int i = 0; i < pcCurrModuleIfList.size() && !isPlaying; i++ )
|
||||
{
|
||||
pcCurrModuleIfList.at( i )->apply( isPlaying, disableThreads );
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
{
|
||||
if( pcCurrModuleIf )
|
||||
{
|
||||
if( !pcCurrModuleIf->m_pcModuleStream )
|
||||
{
|
||||
UInt Width = 0, Height = 0, FrameRate = 30;
|
||||
Int BitsPixel, InputFormat = -1;
|
||||
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
std::vector<CalypStreamFormat> supportedFmts = CalypStream::supportedWriteFormats();
|
||||
|
||||
for( unsigned int i = 0; i < supportedFmts.size(); i++ )
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedWriteFormats();
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
{
|
||||
std::vector<std::string> arrayExt = supportedFmts[i].getExts();
|
||||
if( arrayExt.size() > 0 )
|
||||
{
|
||||
QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (" );
|
||||
for( std::vector<std::string>::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e )
|
||||
{
|
||||
supported.append( " *." );
|
||||
currFmt.append( "*." );
|
||||
supported.append( QString::fromStdString( *e ) );
|
||||
currFmt.append( QString::fromStdString( *e ) );
|
||||
}
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
}
|
||||
QString currFmt;
|
||||
supported.append( " *." );
|
||||
supported.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (*." );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
}
|
||||
supported.append( " )" );
|
||||
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(), filter.join( ";;" ) );
|
||||
if( fileName.isEmpty() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto Width = pcCurrModuleIf->m_pcProcessedFrame->getWidth();
|
||||
auto Height = pcCurrModuleIf->m_pcProcessedFrame->getHeight();
|
||||
auto InputFormat = pcCurrModuleIf->m_pcProcessedFrame->getPelFormat();
|
||||
auto BitsPixel = pcCurrModuleIf->m_pcProcessedFrame->getBitsPel();
|
||||
auto FrameRate = 30;
|
||||
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(),
|
||||
filter.join( ";;" ) );
|
||||
|
||||
pcCurrModuleIf->m_pcModuleStream = std::unique_ptr<CalypStream>();
|
||||
if( !pcCurrModuleIf->m_pcModuleStream->open( fileName.toStdString(), Width, Height, InputFormat, BitsPixel,
|
||||
CLP_LITTLE_ENDIAN, FrameRate, CalypStream::Type::Output ) )
|
||||
Width = pcCurrModuleIf->m_pcProcessedFrame->getWidth();
|
||||
Height = pcCurrModuleIf->m_pcProcessedFrame->getHeight();
|
||||
InputFormat = pcCurrModuleIf->m_pcProcessedFrame->getPelFormat();
|
||||
BitsPixel = pcCurrModuleIf->m_pcProcessedFrame->getBitsPel();
|
||||
FrameRate = pcCurrModuleIf->m_pcSubWindow[0]->getInputStream()->getFrameRate();
|
||||
|
||||
pcCurrModuleIf->m_pcModuleStream = new PlaYUVerStream;
|
||||
if( !pcCurrModuleIf->m_pcModuleStream->open( fileName.toStdString(), Width, Height,
|
||||
InputFormat, BitsPixel, PLAYUVER_LITTLE_ENDIAN,
|
||||
FrameRate, false ) )
|
||||
{
|
||||
pcCurrModuleIf->m_pcModuleStream = nullptr;
|
||||
delete pcCurrModuleIf->m_pcModuleStream;
|
||||
pcCurrModuleIf->m_pcModuleStream = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( pcCurrModuleIf->m_pcModuleStream )
|
||||
{
|
||||
unsigned int numberOfWindows = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
std::uint64_t currFrames = 0;
|
||||
std::uint64_t numberOfFrames = -1;
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
UInt numberOfWindows = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
UInt64 currFrames = 0;
|
||||
UInt64 numberOfFrames = INT_MAX;
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
currFrames = pcCurrModuleIf->m_pcSubWindow[i]->getFrameNum();
|
||||
currFrames = pcCurrModuleIf->m_pcSubWindow[i]->getInputStream()->getFrameNum();
|
||||
if( currFrames < numberOfFrames )
|
||||
numberOfFrames = currFrames;
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->stop();
|
||||
}
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
for( unsigned int f = 1; f < numberOfFrames; f++ )
|
||||
for( UInt f = 1; f < numberOfFrames; f++ )
|
||||
{
|
||||
pcCurrModuleIf->apply( false, true );
|
||||
QCoreApplication::processEvents();
|
||||
pcCurrModuleIf->m_pcModuleStream->writeFrame( *pcCurrModuleIf->m_pcProcessedFrame );
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
pcCurrModuleIf->m_pcModuleStream->writeFrame( pcCurrModuleIf->m_pcProcessedFrame );
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->advanceOneFrame();
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->play();
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->playEvent();
|
||||
}
|
||||
}
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->stop();
|
||||
}
|
||||
@@ -571,30 +608,26 @@ void ModulesHandle::applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf )
|
||||
}
|
||||
}
|
||||
|
||||
void ModulesHandle::swapModulesWindowsIf( CalypAppModuleIf* pcCurrModuleIf )
|
||||
Void ModulesHandle::swapModulesWindowsIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
{
|
||||
if( pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames == 2 )
|
||||
if( pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames == MODULE_REQUIRES_TWO_FRAMES )
|
||||
{
|
||||
VideoSubWindow* auxWindowHandle = pcCurrModuleIf->m_pcSubWindow[0];
|
||||
pcCurrModuleIf->m_pcSubWindow[0] = pcCurrModuleIf->m_pcSubWindow[1];
|
||||
pcCurrModuleIf->m_pcSubWindow[1] = auxWindowHandle;
|
||||
pcCurrModuleIf->m_pcDisplaySubWindow->updateVideoWindowInfo();
|
||||
pcCurrModuleIf->apply();
|
||||
}
|
||||
}
|
||||
|
||||
void ModulesHandle::customEvent( QEvent* event )
|
||||
Void ModulesHandle::customEvent( QEvent* event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
return;
|
||||
|
||||
CalypAppModuleIf::EventData* eventData = (CalypAppModuleIf::EventData*)event;
|
||||
}
|
||||
PlaYUVerAppModuleIf::EventData* eventData = (PlaYUVerAppModuleIf::EventData*)event;
|
||||
if( eventData->m_bSuccess )
|
||||
{
|
||||
event->accept();
|
||||
// The module could be freed by the time the event is processed
|
||||
if( eventData->m_pcModule.isNull() )
|
||||
return;
|
||||
eventData->m_pcModule->show();
|
||||
}
|
||||
}
|
||||
+35
-25
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,46 +18,56 @@
|
||||
*/
|
||||
/**
|
||||
* \file ModulesHandle.h
|
||||
* \brief Calyp modules handle
|
||||
* \brief PlaYUVer modules handle
|
||||
*/
|
||||
|
||||
#ifndef __MODULESHANDLE_H__
|
||||
#define __MODULESHANDLE_H__
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
#include "config.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include <QtCore>
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
|
||||
class VideoHandle;
|
||||
class SubWindowHandle;
|
||||
class CalypAppModuleIf;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class PlaYUVerAppModuleIf;
|
||||
class SubWindowHandle;
|
||||
|
||||
class ModulesHandle : public QObject
|
||||
class ModulesHandle : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ModulesHandle( QWidget*, SubWindowHandle*, VideoHandle* );
|
||||
ModulesHandle( QWidget*, PlaYUVerSubWindowHandle*, VideoHandle* );
|
||||
~ModulesHandle();
|
||||
|
||||
void createActions();
|
||||
Void createActions();
|
||||
QMenu* createMenu();
|
||||
// QDockWidget* createDock();
|
||||
void buildMenu();
|
||||
void updateMenus();
|
||||
Void buildMenu();
|
||||
Void updateMenus();
|
||||
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
static Void destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
static Void applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
|
||||
Bool isPlaying = false,
|
||||
Bool disableThreads = false );
|
||||
|
||||
private:
|
||||
QWidget* m_pcParent;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
VideoHandle* m_appModuleVideo;
|
||||
|
||||
enum
|
||||
@@ -69,7 +79,7 @@ private:
|
||||
|
||||
QMenu* m_pcModulesMenu;
|
||||
QList<QMenu*> m_pcModulesSubMenuList;
|
||||
QList<CalypAppModuleIf*> m_pcCalypAppModuleIfList;
|
||||
QList<PlaYUVerAppModuleIf*> m_pcPlaYUVerAppModuleIfList;
|
||||
|
||||
QVector<QAction*> m_arrayModulesActions;
|
||||
|
||||
@@ -87,11 +97,11 @@ private:
|
||||
QVector<QAction*> m_arrayActions;
|
||||
QSignalMapper* m_pcActionMapper;
|
||||
|
||||
void enableModuleIf( CalypAppModuleIf* pcCurrModuleIf );
|
||||
void applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf );
|
||||
void swapModulesWindowsIf( CalypAppModuleIf* pcCurrModuleIf );
|
||||
Void enableModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
Void applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
Void swapModulesWindowsIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
|
||||
void customEvent( QEvent* event );
|
||||
Void customEvent( QEvent* event );
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,28 +25,24 @@
|
||||
#include "ModulesHandleOptDialog.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/CalypOptions.h"
|
||||
#include "lib/PlaYUVerOptions.h"
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
class OptionConfiguration : public QWidget
|
||||
class OpionConfiguration : public QWidget
|
||||
{
|
||||
public:
|
||||
OptionConfiguration( CalypOptions::OptionBase* option )
|
||||
: m_cName{ option->opt_string }
|
||||
OpionConfiguration( OptionBase* option )
|
||||
{
|
||||
auto* pcDescription = new QLabel;
|
||||
QString desc = QString::fromStdString( option->opt_desc );
|
||||
pcDescription->setText( desc );
|
||||
m_pcChecked = NULL;
|
||||
m_cName = option->opt_string;
|
||||
m_pcDescription = new QLabel;
|
||||
m_pcDescription->setText( QString::fromStdString( option->opt_desc ) );
|
||||
QHBoxLayout* layout = new QHBoxLayout;
|
||||
layout->addWidget( pcDescription, 0, Qt::AlignLeft );
|
||||
layout->addWidget( m_pcDescription, 0, Qt::AlignLeft );
|
||||
if( !option->isBinary() )
|
||||
{
|
||||
m_pcValue = new QLineEdit;
|
||||
@@ -63,7 +59,7 @@ public:
|
||||
layout->setContentsMargins( 1, 1, 1, 1 );
|
||||
setLayout( layout );
|
||||
}
|
||||
auto getValue() const -> QString
|
||||
const QString getValue() const
|
||||
{
|
||||
if( m_pcChecked )
|
||||
{
|
||||
@@ -71,26 +67,31 @@ public:
|
||||
}
|
||||
return m_pcValue->text();
|
||||
}
|
||||
auto getName() const -> std::string { return m_cName; }
|
||||
const String& getName() { return m_cName; }
|
||||
|
||||
private:
|
||||
QLineEdit* m_pcValue{ nullptr };
|
||||
QCheckBox* m_pcChecked{ nullptr };
|
||||
std::string m_cName;
|
||||
QLineEdit* m_pcValue;
|
||||
QCheckBox* m_pcChecked;
|
||||
QLabel* m_pcDescription;
|
||||
String m_cName;
|
||||
};
|
||||
|
||||
ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent, CalypAppModuleIf* pcCurrModuleIf )
|
||||
ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent,
|
||||
PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
: QDialog( parent ), m_pcCurrModuleIf( pcCurrModuleIf )
|
||||
{
|
||||
resize( 400, 10 );
|
||||
setWindowTitle( "Select module parameters" );
|
||||
|
||||
auto& moduleOptions = m_pcCurrModuleIf->m_pcModule->m_cModuleOptions.getOptionList();
|
||||
const PlaYUVerOptions::OptionsList& moduleOptions =
|
||||
m_pcCurrModuleIf->m_pcModule->m_cModuleOptions.getOptionList();
|
||||
|
||||
QVBoxLayout* optionsLayout = new QVBoxLayout;
|
||||
for( auto& option : moduleOptions )
|
||||
OpionConfiguration* pcOption;
|
||||
for( PlaYUVerOptions::OptionsList::const_iterator it = moduleOptions.begin();
|
||||
it != moduleOptions.end(); ++it )
|
||||
{
|
||||
auto pcOption = new OptionConfiguration( option->base_opt.get() );
|
||||
pcOption = new OpionConfiguration( ( *it )->opt );
|
||||
m_apcOptionList.append( pcOption );
|
||||
optionsLayout->addWidget( pcOption );
|
||||
}
|
||||
@@ -111,24 +112,24 @@ ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent, CalypAppModuleI
|
||||
connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
}
|
||||
|
||||
int ModulesHandleOptDialog::runConfiguration()
|
||||
Int ModulesHandleOptDialog::runConfiguration()
|
||||
{
|
||||
if( exec() == QDialog::Rejected )
|
||||
{
|
||||
return QDialog::Rejected;
|
||||
}
|
||||
|
||||
std::vector<std::string> argsArray;
|
||||
std::string optionString;
|
||||
std::vector<String> argsArray;
|
||||
String optionString;
|
||||
QString valueString( "" );
|
||||
|
||||
for( const auto& option : m_apcOptionList )
|
||||
for( Int i = 0; i < m_apcOptionList.size(); i++ )
|
||||
{
|
||||
valueString = option->getValue();
|
||||
valueString = m_apcOptionList.at( i )->getValue();
|
||||
if( !valueString.isEmpty() )
|
||||
{
|
||||
optionString.append( "--" );
|
||||
optionString.append( option->getName() );
|
||||
optionString.append( m_apcOptionList.at( i )->getName() );
|
||||
if( !( valueString == "true" ) )
|
||||
{
|
||||
optionString.append( "=" );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,14 +25,13 @@
|
||||
#ifndef __MODULEHANDLEOPTDIALOG_H__
|
||||
#define __MODULEHANDLEOPTDIALOG_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
#include "config.h"
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class OptionConfiguration;
|
||||
class OpionConfiguration;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -42,12 +41,12 @@ class ModulesHandleOptDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ModulesHandleOptDialog( QWidget* parent, CalypAppModuleIf* pcCurrModuleIf );
|
||||
int runConfiguration();
|
||||
ModulesHandleOptDialog( QWidget* parent, PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
Int runConfiguration();
|
||||
|
||||
private:
|
||||
CalypAppModuleIf* m_pcCurrModuleIf;
|
||||
QVector<OptionConfiguration*> m_apcOptionList;
|
||||
PlaYUVerAppModuleIf* m_pcCurrModuleIf;
|
||||
QVector<OpionConfiguration*> m_apcOptionList;
|
||||
};
|
||||
|
||||
#endif // __MODULEHANDLEOPTDIALOG_H__
|
||||
@@ -1,7 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Santos (joaompssantos@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -19,12 +18,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file MainWindow.cpp
|
||||
* \brief Definition of the main window
|
||||
* \file PlaYUVerApp.cpp
|
||||
* \brief Main definition of the PlaYUVerApp app
|
||||
*/
|
||||
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include "PlaYUVerApp.h"
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QCloseEvent>
|
||||
@@ -33,35 +31,33 @@
|
||||
#include <QDropEvent>
|
||||
#include <QSignalMapper>
|
||||
#include <QtDebug>
|
||||
#include <memory>
|
||||
|
||||
#include "AboutDialog.h"
|
||||
#include "ModulesHandle.h"
|
||||
#include "QualityHandle.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "lib/CalypOptions.h"
|
||||
#ifdef USE_FERVOR
|
||||
#include "fvupdater.h"
|
||||
#endif
|
||||
#include "AboutDialog.h"
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "ModulesHandle.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "QualityHandle.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "VideoHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "lib/PlaYUVerOptions.h"
|
||||
|
||||
MainWindow::MainWindow()
|
||||
#define SYNCHRONISED_ZOON 1
|
||||
|
||||
PlaYUVerApp::PlaYUVerApp()
|
||||
: m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), m_pcAboutDialog( NULL )
|
||||
{
|
||||
setWindowModality( Qt::ApplicationModal );
|
||||
setWindowModality( Qt::NonModal );
|
||||
|
||||
// DBus
|
||||
// DBus
|
||||
#ifdef USE_QTDBUS
|
||||
m_pDBusAdaptor = new DBusAppAdaptor( this );
|
||||
m_pDBusAdaptor = new PlaYUVerAppAdaptor( this );
|
||||
#endif
|
||||
|
||||
m_appResourceHandle = std::make_unique<ResourceHandle>();
|
||||
|
||||
m_pcWindowHandle = new SubWindowHandle( this );
|
||||
m_pcWindowHandle = new PlaYUVerSubWindowHandle( this );
|
||||
|
||||
m_appModuleVideo = new VideoHandle( this, m_pcWindowHandle );
|
||||
m_appModuleQuality = new QualityHandle( this, m_pcWindowHandle );
|
||||
@@ -77,34 +73,34 @@ MainWindow::MainWindow()
|
||||
readSettings();
|
||||
|
||||
setWindowTitle( QApplication::applicationName() );
|
||||
setWindowIcon( QIcon( ":logos/calyp-icon.png" ) );
|
||||
setWindowIcon( QIcon( ":/images/playuver.png" ) );
|
||||
setUnifiedTitleAndToolBarOnMac( true );
|
||||
setCentralWidget( m_pcWindowHandle->getWidget() );
|
||||
setCentralWidget( m_pcWindowHandle );
|
||||
setAcceptDrops( true );
|
||||
setBackgroundRole( QPalette::Window );
|
||||
setBackgroundRole( QPalette::Background );
|
||||
|
||||
connect( m_pcWindowHandle, &SubWindowHandle::windowActivated, this, &MainWindow::updateMainWindow );
|
||||
connect( m_pcWindowHandle, &SubWindowHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
|
||||
connect( m_appModuleVideo, &VideoHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
|
||||
connect( m_appModuleQuality, &QualityHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
|
||||
connect( m_appModuleExtensions, &ModulesHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
|
||||
connect( m_pcWindowHandle, SIGNAL( windowActivated() ), this, SLOT( update() ) );
|
||||
connect( m_pcWindowHandle, SIGNAL( changed() ), this, SLOT( update() ) );
|
||||
connect( m_appModuleVideo, SIGNAL( changed() ), this, SLOT( update() ) );
|
||||
connect( m_appModuleQuality, SIGNAL( changed() ), this, SLOT( update() ) );
|
||||
connect( m_appModuleExtensions, SIGNAL( changed() ), this, SLOT( update() ) );
|
||||
}
|
||||
|
||||
bool MainWindow::parseArgs( int argc, char* argv[] )
|
||||
Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] )
|
||||
{
|
||||
bool bRet = false;
|
||||
CalypOptions pcCmdParser;
|
||||
Bool bRet = false;
|
||||
PlaYUVerOptions pcCmdParser;
|
||||
|
||||
std::vector<std::string> m_apcInputs;
|
||||
std::string strResolution( "" );
|
||||
std::string strPelFmt( "" );
|
||||
std::vector<String> m_apcInputs;
|
||||
String strResolution( "" );
|
||||
String strPelFmt( "" );
|
||||
|
||||
pcCmdParser.addOptions() /**/
|
||||
( "input,i", m_apcInputs, "input file" ) /**/
|
||||
( "size,s", strResolution, "size (WxH)" ) /**/
|
||||
( "pel_fmt", strPelFmt, "pixel format" );
|
||||
|
||||
if( pcCmdParser.parse( argc, argv ) < 0 )
|
||||
if( !pcCmdParser.parse( argc, argv ) )
|
||||
{
|
||||
bRet |= true;
|
||||
}
|
||||
@@ -117,13 +113,14 @@ bool MainWindow::parseArgs( int argc, char* argv[] )
|
||||
}
|
||||
if( pcCmdParser.hasOpt( "input" ) )
|
||||
{
|
||||
for( unsigned int i = 1; i < m_apcInputs.size(); i++ )
|
||||
for( UInt i = 1; i < m_apcInputs.size(); i++ )
|
||||
{
|
||||
loadFile( QString::fromStdString( m_apcInputs[i] ) );
|
||||
}
|
||||
}
|
||||
std::list<const char*>& argv_unhandled = pcCmdParser.getUnhandledArgs();
|
||||
for( std::list<const char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
|
||||
std::list<const Char*>& argv_unhandled = pcCmdParser.getUnhandledArgs();
|
||||
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin();
|
||||
it != argv_unhandled.end(); it++ )
|
||||
{
|
||||
loadFile( QString::fromStdString( *it ) );
|
||||
}
|
||||
@@ -132,22 +129,22 @@ bool MainWindow::parseArgs( int argc, char* argv[] )
|
||||
return bRet;
|
||||
}
|
||||
|
||||
void MainWindow::about()
|
||||
Void PlaYUVerApp::about()
|
||||
{
|
||||
if( !m_pcAboutDialog )
|
||||
m_pcAboutDialog = new AboutDialog( this );
|
||||
m_pcAboutDialog->exec();
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent( QCloseEvent* event )
|
||||
Void PlaYUVerApp::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
int mayCloseAll = true;
|
||||
int msgBoxCloseRet = QMessageBox::Yes;
|
||||
Int mayCloseAll = true;
|
||||
Int msgBoxCloseRet = QMessageBox::Yes;
|
||||
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow();
|
||||
if( subWindowList.size() >= 1 )
|
||||
{
|
||||
QMessageBox msgBoxClose( QMessageBox::Question, "Calyp", "There are open files!",
|
||||
QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!",
|
||||
QMessageBox::Yes | QMessageBox::No, this );
|
||||
msgBoxClose.setDefaultButton( QMessageBox::No );
|
||||
msgBoxClose.setInformativeText( "Close all?" );
|
||||
@@ -157,7 +154,7 @@ void MainWindow::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
case QMessageBox::Yes:
|
||||
mayCloseAll = true;
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
mayCloseAll &= subWindowList.at( i )->mayClose();
|
||||
}
|
||||
@@ -180,71 +177,64 @@ void MainWindow::closeEvent( QCloseEvent* event )
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::closeAll()
|
||||
Void PlaYUVerApp::closeAll()
|
||||
{
|
||||
m_pcWindowHandle->removeAllSubWindow();
|
||||
}
|
||||
|
||||
void MainWindow::loadFile( CalypFileInfo pStreamInfo )
|
||||
{
|
||||
QString filename{ pStreamInfo.m_cFilename };
|
||||
loadFile( std::move( filename ), std::move( pStreamInfo ) );
|
||||
}
|
||||
|
||||
void MainWindow::loadFile( QString fileName, std::optional<CalypFileInfo> streamInfo )
|
||||
Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
{
|
||||
if( !QFileInfo( fileName ).exists() )
|
||||
{
|
||||
printMessage( "File " + fileName + " do not exist!", CLP_LOG_ERROR );
|
||||
printMessage( "File " + fileName + " do not exist!", LOG_ERROR );
|
||||
return;
|
||||
}
|
||||
auto* videoSubWindow = MainWindow::findVideoStreamSubWindow( m_pcWindowHandle, fileName );
|
||||
VideoSubWindow* videoSubWindow =
|
||||
PlaYUVerApp::findVideoStreamSubWindow( m_pcWindowHandle, fileName );
|
||||
if( videoSubWindow )
|
||||
{
|
||||
m_pcWindowHandle->setActiveSubWindow( videoSubWindow );
|
||||
return;
|
||||
}
|
||||
videoSubWindow = new VideoStreamSubWindow(); // createSubWindow();
|
||||
videoSubWindow->setResourceManaget( m_appResourceHandle.get() );
|
||||
|
||||
if( !streamInfo.has_value() )
|
||||
videoSubWindow =
|
||||
new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); // createSubWindow();
|
||||
SubWindowAbstract* subWindow = videoSubWindow;
|
||||
if( !pStreamInfo )
|
||||
{
|
||||
auto idx = findCalypStreamInfo( m_aRecentFileStreamInfo, fileName );
|
||||
if( idx >= 0 )
|
||||
streamInfo = m_aRecentFileStreamInfo.at( idx );
|
||||
Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName );
|
||||
pStreamInfo = (PlaYUVerStreamInfo*)( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
bool opened = false;
|
||||
Bool opened = false;
|
||||
|
||||
if( streamInfo.has_value() )
|
||||
{
|
||||
try
|
||||
{
|
||||
opened = videoSubWindow->loadFile( std::move( *streamInfo ) );
|
||||
}
|
||||
catch( CalypFailure& e )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if( !opened )
|
||||
if( !pStreamInfo )
|
||||
opened = videoSubWindow->loadFile( fileName );
|
||||
else
|
||||
opened = videoSubWindow->loadFile( pStreamInfo );
|
||||
|
||||
if( opened )
|
||||
{
|
||||
printMessage( "Loading file...", CLP_LOG_INFO );
|
||||
printMessage( "Loading file...", LOG_INFO );
|
||||
m_pcWindowHandle->addSubWindow( videoSubWindow );
|
||||
videoSubWindow->show();
|
||||
|
||||
m_appModuleVideo->addSubWindow( videoSubWindow );
|
||||
connect( subWindow, SIGNAL( aboutToClose( SubWindowAbstract* ) ), m_appModuleVideo,
|
||||
SLOT( closeSubWindow( SubWindowAbstract* ) ) );
|
||||
connect( subWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ),
|
||||
m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
|
||||
connect( subWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo,
|
||||
SLOT( moveAllScrollBars( const QPoint ) ) );
|
||||
|
||||
videoSubWindow->zoomToFit();
|
||||
updateZoomFactorSBox();
|
||||
|
||||
m_appModuleVideo->openSubWindow( videoSubWindow );
|
||||
|
||||
addStreamInfoToRecentList( videoSubWindow->getStreamInfo() );
|
||||
|
||||
printMessage( "File loaded", CLP_LOG_INFO );
|
||||
printMessage( "File loaded", LOG_INFO );
|
||||
m_cLastOpenPath = QFileInfo( fileName ).path();
|
||||
}
|
||||
else
|
||||
@@ -252,43 +242,34 @@ void MainWindow::loadFile( QString fileName, std::optional<CalypFileInfo> stream
|
||||
videoSubWindow->close();
|
||||
}
|
||||
}
|
||||
catch( CalypFailure& e )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
videoSubWindow->close();
|
||||
QString warningMsg =
|
||||
"Cannot open file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, CLP_LOG_ERROR );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------- File Functions -----------------------
|
||||
|
||||
QStringList MainWindow::showFileDialog( bool bRead )
|
||||
Void PlaYUVerApp::open()
|
||||
{
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
std::vector<CalypStreamFormat> supportedFmts;
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedReadFormats();
|
||||
|
||||
if( bRead )
|
||||
supportedFmts = CalypStream::supportedReadFormats();
|
||||
else
|
||||
supportedFmts = CalypStream::supportedWriteFormats();
|
||||
|
||||
for( unsigned int i = 0; i < supportedFmts.size(); i++ )
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
{
|
||||
std::vector<std::string> arrayExt = supportedFmts[i].getExts();
|
||||
if( arrayExt.size() > 0 )
|
||||
if( supportedFmts[i].formatExt != "" )
|
||||
{
|
||||
QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (" );
|
||||
for( std::vector<std::string>::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e )
|
||||
{
|
||||
supported.append( " *." );
|
||||
currFmt.append( "*." );
|
||||
supported.append( QString::fromStdString( *e ) );
|
||||
currFmt.append( QString::fromStdString( *e ) );
|
||||
}
|
||||
QString currFmt;
|
||||
supported.append( " *." );
|
||||
supported.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (*." );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
}
|
||||
@@ -298,107 +279,84 @@ QStringList MainWindow::showFileDialog( bool bRead )
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QStringList fileNameList;
|
||||
fileNameList.clear();
|
||||
if( bRead )
|
||||
{
|
||||
fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ), m_cLastOpenPath, filter.join( ";;" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save File" ), m_cLastOpenPath, filter.join( ";;" ) );
|
||||
if( !fileName.isEmpty() )
|
||||
fileNameList.append( fileName );
|
||||
}
|
||||
return fileNameList;
|
||||
}
|
||||
QStringList fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ),
|
||||
m_cLastOpenPath, filter.join( ";;" ) );
|
||||
|
||||
void MainWindow::open()
|
||||
{
|
||||
QStringList fileNameList = showFileDialog( true );
|
||||
for( int i = 0; i < fileNameList.size(); i++ )
|
||||
for( Int i = 0; i < fileNameList.size(); i++ )
|
||||
{
|
||||
if( !fileNameList.at( i ).isEmpty() )
|
||||
{
|
||||
loadFile( std::move( fileNameList.at( i ) ) );
|
||||
loadFile( fileNameList.at( i ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// void CalypApp::openDevice()
|
||||
// Void PlaYUVerApp::openDevice()
|
||||
//{
|
||||
// loadFile( "/dev/video0", NULL );
|
||||
//}
|
||||
|
||||
void MainWindow::openRecent()
|
||||
Void PlaYUVerApp::openRecent()
|
||||
{
|
||||
QAction* action = qobject_cast<QAction*>( sender() );
|
||||
PlaYUVerStreamInfo recentFile = action->data().value<PlaYUVerStreamInfo>();
|
||||
if( action )
|
||||
{
|
||||
loadFile( action->data().value<CalypFileInfo>() );
|
||||
}
|
||||
loadFile( recentFile.m_cFilename, &recentFile );
|
||||
}
|
||||
|
||||
void MainWindow::saveFrame()
|
||||
Void PlaYUVerApp::save()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
VideoSubWindow* saveWindow = m_pcCurrentVideoSubWindow;
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
|
||||
QStringList fileNameList = showFileDialog( false );
|
||||
if( fileNameList.size() == 1 )
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedWriteFormats();
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
{
|
||||
QString currFmt;
|
||||
supported.append( " *." );
|
||||
supported.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (*." );
|
||||
currFmt.append( QString::fromStdString( supportedFmts[i].formatExt ) );
|
||||
currFmt.append( ")" );
|
||||
formatsList << currFmt;
|
||||
}
|
||||
supported.append( " )" );
|
||||
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName( this, tr( "Open File" ), m_cLastOpenPath,
|
||||
filter.join( ";;" ) );
|
||||
|
||||
if( !fileName.isEmpty() )
|
||||
{
|
||||
QString fileName = fileNameList[0];
|
||||
m_cLastOpenPath = QFileInfo( fileName ).path();
|
||||
try
|
||||
{
|
||||
saveWindow->save( fileName );
|
||||
}
|
||||
catch( CalypFailure& e )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
QApplication::restoreOverrideCursor();
|
||||
QString warningMsg =
|
||||
"Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, CLP_LOG_ERROR );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::saveStream()
|
||||
Void PlaYUVerApp::format()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
VideoSubWindow* saveWindow = m_pcCurrentVideoSubWindow;
|
||||
|
||||
QStringList fileNameList = showFileDialog( false );
|
||||
if( fileNameList.size() == 1 )
|
||||
{
|
||||
QString fileName = fileNameList[0];
|
||||
m_cLastOpenPath = QFileInfo( fileName ).path();
|
||||
try
|
||||
{
|
||||
saveWindow->save( fileName );
|
||||
}
|
||||
catch( CalypFailure& e )
|
||||
{
|
||||
QApplication::restoreOverrideCursor();
|
||||
QString warningMsg =
|
||||
"Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, CLP_LOG_ERROR );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::format()
|
||||
{
|
||||
if( auto* pcVideoSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow = m_pcCurrentVideoSubWindow;
|
||||
try
|
||||
{
|
||||
if( pcVideoSubWindow->loadFile( pcVideoSubWindow->getCurrentFileName(), true ) )
|
||||
@@ -406,63 +364,65 @@ void MainWindow::format()
|
||||
addStreamInfoToRecentList( pcVideoSubWindow->getStreamInfo() );
|
||||
}
|
||||
}
|
||||
catch( CalypFailure& e )
|
||||
catch( PlaYUVerFailure& e )
|
||||
{
|
||||
QString warningMsg = "Cannot change format of " + QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() +
|
||||
QString warningMsg = "Cannot change format of " +
|
||||
QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, CLP_LOG_ERROR );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
qDebug() << warningMsg;
|
||||
m_pcCurrentSubWindow->close();
|
||||
}
|
||||
m_pcCurrentSubWindow = NULL;
|
||||
updateMainWindow();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::reload()
|
||||
Void PlaYUVerApp::reload()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
m_pcCurrentSubWindow->refreshSubWindow();
|
||||
m_pcCurrentSubWindow = NULL;
|
||||
updateMainWindow();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::reloadAll()
|
||||
Void PlaYUVerApp::reloadAll()
|
||||
{
|
||||
unsigned int windowCategoryOrder[] = {
|
||||
UInt windowCategoryOrder[] = {
|
||||
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW,
|
||||
SubWindowAbstract::MODULE_SUBWINDOW,
|
||||
SubWindowAbstract::MODULE_SUBWINDOW,
|
||||
};
|
||||
|
||||
for( unsigned int c = 0; c < 3; c++ )
|
||||
for( UInt c = 0; c < 3; c++ )
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
subWindowList.at( i )->refreshSubWindow();
|
||||
}
|
||||
}
|
||||
m_pcCurrentSubWindow = NULL;
|
||||
updateMainWindow();
|
||||
update();
|
||||
}
|
||||
|
||||
void MainWindow::loadAll()
|
||||
Void PlaYUVerApp::loadAll()
|
||||
{
|
||||
if( auto* pcVideoSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
printMessage( "Loading file into memory...", CLP_LOG_INFO );
|
||||
pcVideoSubWindow->loadAll();
|
||||
printMessage( "File loaded", CLP_LOG_INFO );
|
||||
printMessage( "Loading file into memory...", LOG_INFO );
|
||||
m_pcCurrentVideoSubWindow->loadAll();
|
||||
printMessage( "File loaded", LOG_INFO );
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------- Zoom Functions -----------------------
|
||||
|
||||
void MainWindow::normalSize()
|
||||
Void PlaYUVerApp::normalSize()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
@@ -471,7 +431,7 @@ void MainWindow::normalSize()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::zoomToFit()
|
||||
Void PlaYUVerApp::zoomToFit()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
@@ -480,11 +440,12 @@ void MainWindow::zoomToFit()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::zoomToFitAll()
|
||||
Void PlaYUVerApp::zoomToFitAll()
|
||||
{
|
||||
VideoSubWindow* videoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
videoSubWindow->zoomToFit();
|
||||
@@ -493,28 +454,28 @@ void MainWindow::zoomToFitAll()
|
||||
updateZoomFactorSBox();
|
||||
}
|
||||
|
||||
void MainWindow::scaleFrame( int ratio )
|
||||
Void PlaYUVerApp::scaleFrame( int ratio )
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
m_pcCurrentSubWindow->scaleView( (double)( ratio ) / 100.0 );
|
||||
m_pcCurrentSubWindow->scaleView( ( Double )( ratio ) / 100.0 );
|
||||
updateZoomFactorSBox();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::zoomFromSBox( double zoom )
|
||||
Void PlaYUVerApp::zoomFromSBox( double zoom )
|
||||
{
|
||||
SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow();
|
||||
double factor = zoom / 100;
|
||||
Double factor = zoom / 100;
|
||||
if( activeSubWindow )
|
||||
{
|
||||
activeSubWindow->zoomToFactor( factor );
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateZoomFactorSBox()
|
||||
Void PlaYUVerApp::updateZoomFactorSBox()
|
||||
{
|
||||
double factor;
|
||||
Double factor;
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
factor = m_pcCurrentSubWindow->getScaleFactor();
|
||||
@@ -524,14 +485,14 @@ void MainWindow::updateZoomFactorSBox()
|
||||
|
||||
// ----------------------- Drag and drop functions ----------------------
|
||||
|
||||
void MainWindow::dragEnterEvent( QDragEnterEvent* event )
|
||||
Void PlaYUVerApp::dragEnterEvent( QDragEnterEvent* event )
|
||||
{
|
||||
// setText(tr("<drop content>"));
|
||||
// mdiArea->setBackgroundRole( QPalette::Highlight );
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
void MainWindow::dropEvent( QDropEvent* event )
|
||||
Void PlaYUVerApp::dropEvent( QDropEvent* event )
|
||||
{
|
||||
const QMimeData* mimeData = event->mimeData();
|
||||
QList<QUrl> urlList = mimeData->urls();
|
||||
@@ -545,23 +506,25 @@ void MainWindow::dropEvent( QDropEvent* event )
|
||||
|
||||
// ----------------------- Sub Window Functions -----------------------
|
||||
|
||||
VideoStreamSubWindow* MainWindow::findVideoStreamSubWindow( const SubWindowHandle* windowManager,
|
||||
const QString& fileName )
|
||||
VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
|
||||
const QString& fileName )
|
||||
{
|
||||
QString canonicalFilePath = QFileInfo( fileName ).canonicalFilePath();
|
||||
QList<SubWindowAbstract*> subWindowList = windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
VideoSubWindow* pcSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
auto* pcSubWindow = qobject_cast<VideoStreamSubWindow*>( subWindowList.at( i ) );
|
||||
pcSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( pcSubWindow->getCurrentFileName() == canonicalFilePath )
|
||||
return pcSubWindow;
|
||||
return qobject_cast<VideoSubWindow*>( pcSubWindow );
|
||||
}
|
||||
return nullptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------- Update Functions -----------------------
|
||||
|
||||
void MainWindow::updateMainWindow()
|
||||
Void PlaYUVerApp::update()
|
||||
{
|
||||
SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow();
|
||||
QCoreApplication::processEvents();
|
||||
@@ -594,38 +557,31 @@ void MainWindow::updateMainWindow()
|
||||
updateMenus();
|
||||
}
|
||||
|
||||
void MainWindow::printMessage( const QString& msg )
|
||||
Void PlaYUVerApp::printMessage( const QString& msg )
|
||||
{
|
||||
printMessage( msg, 0 );
|
||||
}
|
||||
|
||||
void MainWindow::printMessage( const QString& msg, unsigned int logLevel )
|
||||
Void PlaYUVerApp::printMessage( const QString& msg, UInt logLevel )
|
||||
{
|
||||
if( !msg.isEmpty() )
|
||||
{
|
||||
statusBar()->showMessage( msg, 10000 );
|
||||
if( logLevel >= CLP_LOG_INFO )
|
||||
if( logLevel >= LOG_INFO )
|
||||
{
|
||||
m_pcWindowHandle->processLogMsg( msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateMenus()
|
||||
Void PlaYUVerApp::updateMenus()
|
||||
{
|
||||
bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 );
|
||||
Bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 );
|
||||
|
||||
bool hasVideoStreamSubWindow{ false };
|
||||
bool supportsFormat{ false };
|
||||
if( m_pcCurrentSubWindow && m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW )
|
||||
{
|
||||
hasVideoStreamSubWindow = true;
|
||||
|
||||
if( auto* pcVideoSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
supportsFormat = pcVideoSubWindow->supportsFormatConfiguration();
|
||||
}
|
||||
}
|
||||
Bool hasVideoStreamSubWindow = false;
|
||||
if( m_pcCurrentSubWindow )
|
||||
if( m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW )
|
||||
hasVideoStreamSubWindow = true;
|
||||
|
||||
m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false );
|
||||
|
||||
@@ -635,7 +591,7 @@ void MainWindow::updateMenus()
|
||||
m_arrayActions[RELOAD_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasSubWindow );
|
||||
|
||||
m_arrayActions[FORMAT_ACT]->setEnabled( supportsFormat );
|
||||
m_arrayActions[FORMAT_ACT]->setEnabled( hasVideoStreamSubWindow );
|
||||
m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow );
|
||||
|
||||
m_arrayActions[ZOOM_IN_ACT]->setEnabled( hasSubWindow );
|
||||
@@ -652,44 +608,38 @@ void MainWindow::updateMenus()
|
||||
|
||||
// ----------------------- Create Functions -----------------------
|
||||
|
||||
void MainWindow::createActions()
|
||||
Void PlaYUVerApp::createActions()
|
||||
{
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
|
||||
// ------------ File ------------
|
||||
m_arrayActions[OPEN_ACT] = new QAction( tr( "&Open" ), this );
|
||||
m_arrayActions[OPEN_ACT] = new QAction( QIcon( ":/images/open.png" ), tr( "&Open" ), this );
|
||||
m_arrayActions[OPEN_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogOpenButton ) );
|
||||
m_arrayActions[OPEN_ACT]->setShortcuts( QKeySequence::Open );
|
||||
m_arrayActions[OPEN_ACT]->setStatusTip( tr( "Open stream" ) );
|
||||
connect( m_arrayActions[OPEN_ACT], SIGNAL( triggered() ), this, SLOT( open() ) );
|
||||
|
||||
// m_arrayActions[OPEN_DEVICE_ACT] = new QAction( tr( "&Open Capture Device"
|
||||
// ), this ); m_arrayActions[OPEN_DEVICE_ACT]->setStatusTip( tr( "Open
|
||||
// capture device (webcam)" ) ); connect( m_arrayActions[OPEN_DEVICE_ACT],
|
||||
// SIGNAL( triggered() ), this, SLOT( openDevice() ) );
|
||||
// m_arrayActions[OPEN_DEVICE_ACT] = new QAction( tr( "&Open Capture Device" ), this );
|
||||
// m_arrayActions[OPEN_DEVICE_ACT]->setStatusTip( tr( "Open capture device (webcam)" ) );
|
||||
// connect( m_arrayActions[OPEN_DEVICE_ACT], SIGNAL( triggered() ), this, SLOT( openDevice() ) );
|
||||
|
||||
m_arrayRecentFilesActions.resize( MAX_RECENT_FILES );
|
||||
for( int i = 0; i < MAX_RECENT_FILES; i++ )
|
||||
for( Int i = 0; i < MAX_RECENT_FILES; i++ )
|
||||
{
|
||||
m_arrayRecentFilesActions[i] = new QAction( this );
|
||||
m_arrayRecentFilesActions[i]->setVisible( false );
|
||||
connect( m_arrayRecentFilesActions[i], SIGNAL( triggered() ), this, SLOT( openRecent() ) );
|
||||
}
|
||||
|
||||
m_arrayActions[SAVE_ACT] = new QAction( tr( "&Save Frame" ), this );
|
||||
m_arrayActions[SAVE_ACT] = new QAction( QIcon( ":/images/save.png" ), tr( "&Save Frame" ), this );
|
||||
m_arrayActions[SAVE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogSaveButton ) );
|
||||
m_arrayActions[SAVE_ACT]->setShortcuts( QKeySequence::SaveAs );
|
||||
m_arrayActions[SAVE_ACT]->setStatusTip( tr( "Save current frame" ) );
|
||||
connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( saveFrame() ) );
|
||||
|
||||
m_arrayActions[SAVE_STREAM_ACT] = new QAction( tr( "&Save Stream" ), this );
|
||||
m_arrayActions[SAVE_STREAM_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogSaveButton ) );
|
||||
m_arrayActions[SAVE_STREAM_ACT]->setShortcuts( QKeySequence::SaveAs );
|
||||
m_arrayActions[SAVE_STREAM_ACT]->setStatusTip( tr( "Save current stream" ) );
|
||||
connect( m_arrayActions[SAVE_STREAM_ACT], SIGNAL( triggered() ), this, SLOT( saveStream() ) );
|
||||
connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( save() ) );
|
||||
|
||||
m_arrayActions[FORMAT_ACT] = new QAction( tr( "&Format" ), this );
|
||||
m_arrayActions[FORMAT_ACT]->setIcon( QIcon::fromTheme( "transform-scale" ) );
|
||||
m_arrayActions[FORMAT_ACT]->setIcon(
|
||||
QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
|
||||
m_arrayActions[FORMAT_ACT]->setShortcut( Qt::CTRL + Qt::Key_F );
|
||||
m_arrayActions[FORMAT_ACT]->setStatusTip( tr( "Open format dialog" ) );
|
||||
connect( m_arrayActions[FORMAT_ACT], SIGNAL( triggered() ), this, SLOT( format() ) );
|
||||
@@ -713,11 +663,13 @@ void MainWindow::createActions()
|
||||
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeActiveSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), m_pcWindowHandle,
|
||||
SLOT( removeActiveSubWindow() ) );
|
||||
|
||||
m_arrayActions[CLOSEALL_ACT] = new QAction( tr( "Close &All" ), this );
|
||||
m_arrayActions[CLOSEALL_ACT]->setStatusTip( tr( "Close all the windows" ) );
|
||||
connect( m_arrayActions[CLOSEALL_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeAllSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSEALL_ACT], SIGNAL( triggered() ), m_pcWindowHandle,
|
||||
SLOT( removeAllSubWindow() ) );
|
||||
|
||||
m_arrayActions[EXIT_ACT] = new QAction( tr( "E&xit" ), this );
|
||||
m_arrayActions[EXIT_ACT]->setShortcuts( QKeySequence::Quit );
|
||||
@@ -729,27 +681,31 @@ void MainWindow::createActions()
|
||||
connect( mapperZoom, SIGNAL( mapped( int ) ), this, SLOT( scaleFrame( int ) ) );
|
||||
|
||||
m_arrayActions[ZOOM_IN_ACT] = new QAction( tr( "Zoom &In (+25%)" ), this );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setIcon( QIcon::fromTheme( "zoom-in" ) );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-in", QIcon( ":/images/zoomin.png" ) ) );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setShortcut( tr( "Ctrl++" ) );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setStatusTip( tr( "Scale the image up by 25%" ) );
|
||||
connect( m_arrayActions[ZOOM_IN_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
|
||||
mapperZoom->setMapping( m_arrayActions[ZOOM_IN_ACT], 125 );
|
||||
|
||||
m_arrayActions[ZOOM_OUT_ACT] = new QAction( tr( "Zoom &Out (-25%)" ), this );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setIcon( QIcon::fromTheme( "zoom-out" ) );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-out", QIcon( ":/images/zoomout.png" ) ) );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setShortcut( tr( "Ctrl+-" ) );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setStatusTip( tr( "Scale the image down by 25%" ) );
|
||||
connect( m_arrayActions[ZOOM_OUT_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
|
||||
mapperZoom->setMapping( m_arrayActions[ZOOM_OUT_ACT], 80 );
|
||||
|
||||
m_arrayActions[ZOOM_NORMAL_ACT] = new QAction( tr( "&Normal Size" ), this );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setIcon( QIcon::fromTheme( "zoom-original" ) );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-original", QIcon( ":/images/zoomtonormal.png" ) ) );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setShortcut( tr( "Ctrl+N" ) );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setStatusTip( tr( "Show the image at its original size" ) );
|
||||
connect( m_arrayActions[ZOOM_NORMAL_ACT], SIGNAL( triggered() ), this, SLOT( normalSize() ) );
|
||||
|
||||
m_arrayActions[ZOOM_FIT_ACT] = new QAction( tr( "Zoom to &Fit" ), this );
|
||||
m_arrayActions[ZOOM_FIT_ACT]->setIcon( QIcon::fromTheme( "zoom-fit-best" ) );
|
||||
m_arrayActions[ZOOM_FIT_ACT]->setIcon(
|
||||
QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
|
||||
m_arrayActions[ZOOM_FIT_ACT]->setStatusTip( tr( "Zoom in or out to fit on the window." ) );
|
||||
connect( m_arrayActions[ZOOM_FIT_ACT], SIGNAL( triggered() ), this, SLOT( zoomToFit() ) );
|
||||
|
||||
@@ -775,7 +731,6 @@ void MainWindow::createActions()
|
||||
#endif
|
||||
|
||||
m_arrayActions[ABOUT_ACT] = new QAction( tr( "&About" ), this );
|
||||
m_arrayActions[ABOUT_ACT]->setIcon( QIcon( ":logos/calyp-icon.png" ) );
|
||||
m_arrayActions[ABOUT_ACT]->setStatusTip( tr( "Show the application's About box" ) );
|
||||
connect( m_arrayActions[ABOUT_ACT], SIGNAL( triggered() ), this, SLOT( about() ) );
|
||||
|
||||
@@ -785,7 +740,7 @@ void MainWindow::createActions()
|
||||
connect( m_arrayActions[ABOUTQT_ACT], SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) );
|
||||
}
|
||||
|
||||
void MainWindow::createMenus()
|
||||
Void PlaYUVerApp::createMenus()
|
||||
{
|
||||
m_arrayMenu.resize( TOTAL_MENUS );
|
||||
|
||||
@@ -793,13 +748,12 @@ void MainWindow::createMenus()
|
||||
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[OPEN_ACT] );
|
||||
// m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[OPEN_DEVICE_ACT] );
|
||||
m_arrayMenu[RECENT_MENU] = m_arrayMenu[FILE_MENU]->addMenu( tr( "Open Recent" ) );
|
||||
for( int i = 0; i < MAX_RECENT_FILES; ++i )
|
||||
for( Int i = 0; i < MAX_RECENT_FILES; ++i )
|
||||
{
|
||||
m_arrayMenu[RECENT_MENU]->addAction( m_arrayRecentFilesActions[i] );
|
||||
}
|
||||
|
||||
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[SAVE_ACT] );
|
||||
// m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[SAVE_STREAM_ACT] );
|
||||
m_arrayMenu[FILE_MENU]->addSeparator();
|
||||
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[FORMAT_ACT] );
|
||||
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[RELOAD_ACT] );
|
||||
@@ -829,9 +783,12 @@ void MainWindow::createMenus()
|
||||
|
||||
menuBar()->addMenu( m_appModuleVideo->createVideoMenu() );
|
||||
menuBar()->addMenu( m_appModuleVideo->createImageMenu() );
|
||||
menuBar()->addMenu( m_appModuleQuality->createMenu() );
|
||||
menuBar()->addMenu( m_appModuleExtensions->createMenu() );
|
||||
menuBar()->addMenu( m_pcWindowHandle->createMenu() );
|
||||
QMenu* QualityMenu = m_appModuleQuality->createMenu();
|
||||
menuBar()->addMenu( QualityMenu );
|
||||
QMenu* ModuleMenu = m_appModuleExtensions->createMenu();
|
||||
menuBar()->addMenu( ModuleMenu );
|
||||
QMenu* windowMenu = m_pcWindowHandle->createMenu();
|
||||
menuBar()->addMenu( windowMenu );
|
||||
|
||||
menuBar()->addSeparator();
|
||||
|
||||
@@ -844,7 +801,7 @@ void MainWindow::createMenus()
|
||||
m_arrayMenu[ABOUT_MENU]->addAction( m_arrayActions[ABOUTQT_ACT] );
|
||||
}
|
||||
|
||||
void MainWindow::createToolBars()
|
||||
Void PlaYUVerApp::createToolBars()
|
||||
{
|
||||
m_arrayToolBars.resize( TOTAL_TOOLBAR );
|
||||
|
||||
@@ -865,7 +822,8 @@ void MainWindow::createToolBars()
|
||||
m_pcZoomFactorSBox->setSingleStep( 10.0 );
|
||||
m_pcZoomFactorSBox->setValue( 100.0 );
|
||||
m_pcZoomFactorSBox->setSuffix( "%" );
|
||||
connect( m_pcZoomFactorSBox, SIGNAL( valueChanged( double ) ), this, SLOT( zoomFromSBox( double ) ) );
|
||||
connect( m_pcZoomFactorSBox, SIGNAL( valueChanged( double ) ), this,
|
||||
SLOT( zoomFromSBox( double ) ) );
|
||||
m_arrayToolBars[VIEW_TOOLBAR]->addWidget( m_pcZoomFactorSBox );
|
||||
m_arrayToolBars[VIEW_TOOLBAR]->addAction( m_arrayActions[ZOOM_IN_ACT] );
|
||||
m_arrayToolBars[VIEW_TOOLBAR]->addAction( m_arrayActions[ZOOM_OUT_ACT] );
|
||||
@@ -878,7 +836,7 @@ void MainWindow::createToolBars()
|
||||
addToolBar( Qt::TopToolBarArea, m_appModuleVideo->createToolBar() );
|
||||
}
|
||||
|
||||
void MainWindow::createDockWidgets()
|
||||
Void PlaYUVerApp::createDockWidgets()
|
||||
{
|
||||
// Properties Dock Window
|
||||
m_arraySideBars.resize( TOTAL_DOCK );
|
||||
@@ -886,16 +844,16 @@ void MainWindow::createDockWidgets()
|
||||
addDockWidget( Qt::RightDockWidgetArea, m_appModuleQuality->createDock() );
|
||||
}
|
||||
|
||||
void MainWindow::createStatusBar()
|
||||
Void PlaYUVerApp::createStatusBar()
|
||||
{
|
||||
//! Warning: the following widget cannot change size too much
|
||||
statusBar()->addPermanentWidget( m_appModuleVideo->createStatusBarMessage() );
|
||||
printMessage( "Ready!", CLP_LOG_INFO );
|
||||
printMessage( "Ready!", LOG_INFO );
|
||||
}
|
||||
|
||||
void MainWindow::addStreamInfoToRecentList( CalypFileInfo streamInfo )
|
||||
Void PlaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo )
|
||||
{
|
||||
int idx = findCalypStreamInfo( m_aRecentFileStreamInfo, streamInfo.m_cFilename );
|
||||
Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, streamInfo.m_cFilename );
|
||||
if( idx >= 0 )
|
||||
m_aRecentFileStreamInfo.remove( idx );
|
||||
m_aRecentFileStreamInfo.prepend( streamInfo );
|
||||
@@ -904,11 +862,11 @@ void MainWindow::addStreamInfoToRecentList( CalypFileInfo streamInfo )
|
||||
updateRecentFileActions();
|
||||
}
|
||||
|
||||
void MainWindow::updateRecentFileActions()
|
||||
Void PlaYUVerApp::updateRecentFileActions()
|
||||
{
|
||||
int numRecentFiles = m_aRecentFileStreamInfo.size();
|
||||
Int numRecentFiles = m_aRecentFileStreamInfo.size();
|
||||
numRecentFiles = qMin( numRecentFiles, MAX_RECENT_FILES );
|
||||
int actionIdx = 0;
|
||||
Int actionIdx = 0;
|
||||
while( actionIdx < numRecentFiles )
|
||||
{
|
||||
QString text = m_aRecentFileStreamInfo.at( actionIdx ).m_cFilename;
|
||||
@@ -928,9 +886,9 @@ void MainWindow::updateRecentFileActions()
|
||||
m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false );
|
||||
}
|
||||
|
||||
void MainWindow::checkRecentFileActions()
|
||||
Void PlaYUVerApp::checkRecentFileActions()
|
||||
{
|
||||
int i = 0;
|
||||
Int i = 0;
|
||||
while( i < m_aRecentFileStreamInfo.size() )
|
||||
{
|
||||
if( !QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).exists() )
|
||||
@@ -940,7 +898,7 @@ void MainWindow::checkRecentFileActions()
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned long long int fileSize = QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).size();
|
||||
UInt64 fileSize = QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).size();
|
||||
if( m_aRecentFileStreamInfo.at( i ).m_uiFileSize != fileSize )
|
||||
{
|
||||
m_aRecentFileStreamInfo.remove( i );
|
||||
@@ -951,7 +909,7 @@ void MainWindow::checkRecentFileActions()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::readSettings()
|
||||
Void PlaYUVerApp::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
|
||||
@@ -963,7 +921,7 @@ void MainWindow::readSettings()
|
||||
m_cLastOpenPath = appSettings.value( "MainWindow/LastOpenPath", QDir::homePath() ).toString();
|
||||
|
||||
QVariant value = appSettings.value( "MainWindow/RecentFileList" );
|
||||
m_aRecentFileStreamInfo = value.value<CalypFileInfoVector>();
|
||||
m_aRecentFileStreamInfo = value.value<PlaYUVerStreamInfoVector>();
|
||||
checkRecentFileActions();
|
||||
updateRecentFileActions();
|
||||
|
||||
@@ -973,7 +931,7 @@ void MainWindow::readSettings()
|
||||
m_pcWindowHandle->readSettings();
|
||||
}
|
||||
|
||||
void MainWindow::writeSettings()
|
||||
Void PlaYUVerApp::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
|
||||
@@ -982,7 +940,7 @@ void MainWindow::writeSettings()
|
||||
appSettings.setValue( "MainWindow/LastOpenPath", m_cLastOpenPath );
|
||||
|
||||
QVariant var;
|
||||
var.setValue<CalypFileInfoVector>( m_aRecentFileStreamInfo );
|
||||
var.setValue<PlaYUVerStreamInfoVector>( m_aRecentFileStreamInfo );
|
||||
appSettings.setValue( "MainWindow/RecentFileList", var );
|
||||
|
||||
m_appModuleVideo->writeSettings();
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,14 +18,14 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file MainWindow.cpp
|
||||
* \brief Definition of the main window
|
||||
* \ingroup CalypApp
|
||||
* \file PlaYUVerApp.h
|
||||
* \ingroup PlaYUVerApp
|
||||
* \brief Main definition of the PlaYUVerApp app
|
||||
*
|
||||
* @defgroup CalypApp Calyp App (GUI)
|
||||
* @defgroup PlaYUVerApp PlaYUVer App (GUI)
|
||||
* @{
|
||||
*
|
||||
* CalypApp is an high level interface providing a GUI
|
||||
* PlaYUVerApp is an high level interface providing a GUI
|
||||
* based on the Qt libs in order to display provide important
|
||||
* information about video streams.
|
||||
*
|
||||
@@ -33,22 +33,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MAINWINDOW_H__
|
||||
#define __MAINWINDOW_H__
|
||||
#ifndef __PLAYUVERAPP_H__
|
||||
#define __PLAYUVERAPP_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <optional>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "VideoStreamSubWindow.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "config.h"
|
||||
#ifdef USE_QTDBUS
|
||||
#include "DBusAppAdaptor.h"
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
#endif
|
||||
#include "ResourceHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
class QCloseEvent;
|
||||
class QDragEnterEvent;
|
||||
@@ -58,34 +54,32 @@ class QActionGroup;
|
||||
class QAction;
|
||||
class QSignalMapper;
|
||||
|
||||
class CalypOptions;
|
||||
class CalypStream;
|
||||
class SubWindowHandle;
|
||||
class VideoStreamSubWindow;
|
||||
class PlaYUVerOptions;
|
||||
class PlaYUVerStream;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class VideoHandle;
|
||||
class QualityHandle;
|
||||
class ModulesHandle;
|
||||
class DBusAppAdaptor;
|
||||
class PlaYUVerAppAdaptor;
|
||||
class VideoSubWindow;
|
||||
class SubWindowAbstract;
|
||||
class AboutDialog;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
class PlaYUVerApp : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow();
|
||||
bool parseArgs( int argc, char* argv[] );
|
||||
void loadFile( CalypFileInfo pStreamInfo );
|
||||
void loadFile( QString fileName, std::optional<CalypFileInfo> pStreamInfo = {} );
|
||||
PlaYUVerApp();
|
||||
Bool parseArgs( Int argc, Char* argv[] );
|
||||
Void loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo = NULL );
|
||||
|
||||
public Q_SLOTS:
|
||||
void printMessage( const QString& msg );
|
||||
void printMessage( const QString& msg, unsigned int logLevel );
|
||||
void printMessage( const QString& msg, UInt logLevel );
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent* event );
|
||||
Void closeEvent( QCloseEvent* event );
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -97,8 +91,7 @@ private Q_SLOTS:
|
||||
void open();
|
||||
// void openDevice();
|
||||
void openRecent();
|
||||
void saveFrame();
|
||||
void saveStream();
|
||||
void save();
|
||||
void format();
|
||||
void reload();
|
||||
void reloadAll();
|
||||
@@ -119,12 +112,12 @@ private Q_SLOTS:
|
||||
void dragEnterEvent( QDragEnterEvent* event );
|
||||
void dropEvent( QDropEvent* event );
|
||||
|
||||
void updateMainWindow();
|
||||
void update();
|
||||
void updateZoomFactorSBox();
|
||||
|
||||
private:
|
||||
DBusAppAdaptor* m_pDBusAdaptor;
|
||||
CalypOptions* m_pcCmdParser;
|
||||
PlaYUVerAppAdaptor* m_pDBusAdaptor;
|
||||
PlaYUVerOptions* m_pcCmdParser;
|
||||
/**
|
||||
* Save the current subwindow for every category
|
||||
*/
|
||||
@@ -132,25 +125,24 @@ private:
|
||||
VideoSubWindow* m_pcCurrentVideoSubWindow;
|
||||
|
||||
QString m_cLastOpenPath;
|
||||
QStringList showFileDialog( bool bRead );
|
||||
|
||||
static VideoStreamSubWindow* findVideoStreamSubWindow( const SubWindowHandle* windowManager,
|
||||
const QString& fileName );
|
||||
static VideoSubWindow* findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
|
||||
const QString& fileName );
|
||||
|
||||
void updateMenus();
|
||||
Void updateMenus();
|
||||
|
||||
void createActions();
|
||||
void createMenus();
|
||||
void createToolBars();
|
||||
void createDockWidgets();
|
||||
void createStatusBar();
|
||||
Void createActions();
|
||||
Void createMenus();
|
||||
Void createToolBars();
|
||||
Void createDockWidgets();
|
||||
Void createStatusBar();
|
||||
|
||||
void addStreamInfoToRecentList( CalypFileInfo streamInfo );
|
||||
void updateRecentFileActions();
|
||||
void checkRecentFileActions();
|
||||
Void addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo );
|
||||
Void updateRecentFileActions();
|
||||
Void checkRecentFileActions();
|
||||
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
QDoubleSpinBox* m_pcZoomFactorSBox;
|
||||
|
||||
@@ -163,11 +155,10 @@ private:
|
||||
* Quality
|
||||
* Modules
|
||||
*/
|
||||
std::unique_ptr<ResourceHandle> m_appResourceHandle;
|
||||
VideoHandle* m_appModuleVideo;
|
||||
QualityHandle* m_appModuleQuality;
|
||||
ModulesHandle* m_appModuleExtensions;
|
||||
SubWindowHandle* m_pcWindowHandle;
|
||||
PlaYUVerSubWindowHandle* m_pcWindowHandle;
|
||||
|
||||
/**
|
||||
* Array of menus for the main app
|
||||
@@ -219,7 +210,6 @@ private:
|
||||
OPEN_ACT = 0,
|
||||
OPEN_DEVICE_ACT,
|
||||
SAVE_ACT,
|
||||
SAVE_STREAM_ACT,
|
||||
FORMAT_ACT,
|
||||
RELOAD_ACT,
|
||||
RELOAD_ALL_ACT,
|
||||
@@ -241,9 +231,9 @@ private:
|
||||
|
||||
#define MAX_RECENT_FILES 20
|
||||
QVector<QAction*> m_arrayRecentFilesActions;
|
||||
CalypFileInfoVector m_aRecentFileStreamInfo;
|
||||
PlaYUVerStreamInfoVector m_aRecentFileStreamInfo;
|
||||
|
||||
AboutDialog* m_pcAboutDialog;
|
||||
};
|
||||
|
||||
#endif // __MAINWINDOW_H__
|
||||
#endif // __PLAYUVERAPP_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,35 +18,30 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file DBusAppAdaptor.cpp
|
||||
* \file PlaYUVerAppAdaptor.h
|
||||
* \brief Define function to manage the interface in DBus
|
||||
*/
|
||||
|
||||
#include "DBusAppAdaptor.h"
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include <QDBusAbstractAdaptor>
|
||||
|
||||
#include "MainWindow.h"
|
||||
|
||||
//#include <QDBusConnectioninterface>
|
||||
//#include <QDBusinterface>
|
||||
#include <QDBusMessage>
|
||||
#include <QDBusReply>
|
||||
|
||||
DBusAppAdaptor::DBusAppAdaptor( MainWindow* app )
|
||||
PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp* app )
|
||||
: QDBusAbstractAdaptor( app ), m_app( app )
|
||||
{
|
||||
// application dbus interface
|
||||
bool isRegistered = QDBusConnection::sessionBus().registerObject( QStringLiteral( CALYP_DBUS_PATH ), QStringLiteral( CALYP_DBUS_SESSION_NAME ),
|
||||
this, QDBusConnection::ExportAllSlots );
|
||||
Bool isRegistered = QDBusConnection::sessionBus().registerObject(
|
||||
QStringLiteral( PLAYUVER_DBUS_PATH ), this, QDBusConnection::ExportAllSlots );
|
||||
|
||||
Q_ASSERT( isRegistered == true );
|
||||
}
|
||||
|
||||
DBusAppAdaptor::~DBusAppAdaptor()
|
||||
PlaYUVerAppAdaptor::~PlaYUVerAppAdaptor()
|
||||
{
|
||||
QDBusConnection::sessionBus().unregisterObject( QStringLiteral( CALYP_DBUS_PATH ) );
|
||||
QDBusConnection::sessionBus().unregisterObject( QStringLiteral( PLAYUVER_DBUS_PATH ) );
|
||||
}
|
||||
|
||||
void DBusAppAdaptor::activate()
|
||||
void PlaYUVerAppAdaptor::activate()
|
||||
{
|
||||
if( !m_app )
|
||||
{
|
||||
@@ -55,13 +50,13 @@ void DBusAppAdaptor::activate()
|
||||
m_app->raise();
|
||||
}
|
||||
|
||||
QString DBusAppAdaptor::activeSession()
|
||||
QString PlaYUVerAppAdaptor::activeSession()
|
||||
{
|
||||
// return m_app->sessionManager()->activeSession()->name();
|
||||
return QString( "Calyp" );
|
||||
return QString( "PlaYUVer" );
|
||||
}
|
||||
|
||||
bool DBusAppAdaptor::loadFile( const QString& filename )
|
||||
bool PlaYUVerAppAdaptor::loadFile( const QString& filename )
|
||||
{
|
||||
m_app->loadFile( filename );
|
||||
return true;
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,31 +18,33 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file DBusAppAdaptor.h
|
||||
* \file PlaYUVerAppAdaptor.h
|
||||
* \brief Define function to manage the interface in DBus
|
||||
*/
|
||||
|
||||
#ifndef __DBUSAPPADAPTOR_H__
|
||||
#define __DBUSAPPADAPTOR_H__
|
||||
#ifndef __PlaYUVerAppAdaptor_H__
|
||||
#define __PlaYUVerAppAdaptor_H__
|
||||
|
||||
#include <QDBusAbstractAdaptor>
|
||||
#include <QDBusConnectionInterface>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusMessage>
|
||||
#include <QDBusReply>
|
||||
#include <QtCore>
|
||||
#include <QtDBus>
|
||||
|
||||
#define CALYP_DBUS_SESSION_NAME "org.pixlra.Calyp.application"
|
||||
#define CALYP_DBUS_PATH "/"
|
||||
#define PLAYUVER_DBUS_SESSION_NAME "org.pixlra.PlaYUVer.application"
|
||||
#define PLAYUVER_DBUS_PATH "/"
|
||||
|
||||
class MainWindow;
|
||||
class PlaYUVerApp;
|
||||
|
||||
class DBusAppAdaptor : public QDBusAbstractAdaptor
|
||||
class PlaYUVerAppAdaptor : public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO( "D-Bus interface", CALYP_DBUS_SESSION_NAME )
|
||||
Q_CLASSINFO( "D-Bus Interface", PLAYUVER_DBUS_SESSION_NAME )
|
||||
Q_PROPERTY( QString activeSession READ activeSession )
|
||||
public:
|
||||
DBusAppAdaptor( MainWindow* app );
|
||||
~DBusAppAdaptor();
|
||||
PlaYUVerAppAdaptor( PlaYUVerApp* app );
|
||||
~PlaYUVerAppAdaptor();
|
||||
/**
|
||||
* emit the exiting signal
|
||||
*/
|
||||
@@ -75,7 +77,7 @@ public:
|
||||
QString activeSession();
|
||||
|
||||
private:
|
||||
MainWindow* m_app;
|
||||
PlaYUVerApp* m_app;
|
||||
};
|
||||
|
||||
#endif // __DBUSAPPADAPTOR_H__
|
||||
#endif // __PlaYUVerAppAdaptor_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,14 +18,14 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file CommonDefs.h
|
||||
* \brief Define common types
|
||||
* \file PlaYUVerAppDefs.h
|
||||
* \brief Define types for PlaYUVerApp
|
||||
*/
|
||||
|
||||
#ifndef __COMMONDEFS_H__
|
||||
#define __COMMONDEFS_H__
|
||||
#ifndef __PLAYUVERAPPDEFS_H__
|
||||
#define __PLAYUVERAPPDEFS_H__
|
||||
|
||||
#include "lib/CalypDefs.h"
|
||||
#include "lib/PlaYUVerDefs.h"
|
||||
|
||||
// ====================================================================================================================
|
||||
// Qt compatibility redefinition
|
||||
@@ -38,4 +38,4 @@
|
||||
#define QStringLiteral( str ) QString::fromUtf8( "" str "", sizeof( str ) - 1 )
|
||||
#endif
|
||||
|
||||
#endif // __COMMONDEFS_H__
|
||||
#endif // __PLAYUVERAPPDEFS_H__
|
||||
@@ -0,0 +1,219 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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 PlaYUVerAppModuleIf.cpp
|
||||
* \brief PlaYUVer modules interface
|
||||
*/
|
||||
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent,
|
||||
QAction* action,
|
||||
PlaYUVerModuleIf* module )
|
||||
: m_bIsRunning( false )
|
||||
, m_pcModuleAction( action )
|
||||
, m_pcModule( module )
|
||||
, m_pcDisplaySubWindow( NULL )
|
||||
, m_pcDockWidget( NULL )
|
||||
, m_pcModuleDock( NULL )
|
||||
, m_pcModuleStream( NULL )
|
||||
, m_pcProcessedFrame( NULL )
|
||||
, m_dMeasurementResult( 0 )
|
||||
{
|
||||
setParent( parent );
|
||||
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
|
||||
{
|
||||
m_pcSubWindow[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::update()
|
||||
{
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
m_pcDisplaySubWindow->refreshFrame( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
apply();
|
||||
}
|
||||
}
|
||||
|
||||
Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads )
|
||||
{
|
||||
Bool bRet = false;
|
||||
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
m_pcDisplaySubWindow->setFillWindow( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcSubWindow[0]->setFillWindow( true );
|
||||
}
|
||||
}
|
||||
if( !( isPlaying && ( m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_SKIP_WHILE_PLAY ) ) )
|
||||
{
|
||||
#ifdef PLAYUVER_THREADED_MODULES
|
||||
if( !disableThreads )
|
||||
{
|
||||
wait();
|
||||
start();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
run();
|
||||
show();
|
||||
}
|
||||
|
||||
if( m_pcDisplaySubWindow || m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
|
||||
{
|
||||
bRet = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bRet = true;
|
||||
}
|
||||
QApplication::restoreOverrideCursor();
|
||||
return bRet;
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::run()
|
||||
{
|
||||
m_bIsRunning = true;
|
||||
m_bSuccess = false;
|
||||
std::vector<PlaYUVerFrame*> apcFrameList;
|
||||
for( UInt i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ )
|
||||
{
|
||||
apcFrameList.push_back( m_pcSubWindow[i]->getCurrFrame() );
|
||||
}
|
||||
|
||||
if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
if( m_pcModule->m_iModuleAPI == MODULE_API_2 )
|
||||
{
|
||||
m_pcProcessedFrame = m_pcModule->process( apcFrameList );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcProcessedFrame = m_pcModule->process( m_pcSubWindow[0]->getCurrFrame() );
|
||||
}
|
||||
}
|
||||
else if( m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
|
||||
{
|
||||
if( m_pcModule->m_iModuleAPI == MODULE_API_2 )
|
||||
{
|
||||
m_dMeasurementResult = m_pcModule->measure( apcFrameList );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dMeasurementResult = m_pcModule->measure( m_pcSubWindow[0]->getCurrFrame() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_bSuccess = true;
|
||||
m_bIsRunning = false;
|
||||
#ifdef PLAYUVER_THREADED_MODULES
|
||||
EventData* eventData = new EventData( m_bSuccess, this );
|
||||
if( parent() )
|
||||
QCoreApplication::postEvent( parent(), eventData );
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::show()
|
||||
{
|
||||
switch( m_pcModule->m_iModuleType )
|
||||
{
|
||||
case FRAME_PROCESSING_MODULE:
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
m_pcDisplaySubWindow->setCurrFrame( m_pcProcessedFrame );
|
||||
m_pcDisplaySubWindow->setFillWindow( false );
|
||||
m_pcDisplaySubWindow->clearWindowBusy();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcSubWindow[0]->setCurrFrame( m_pcProcessedFrame );
|
||||
m_pcSubWindow[0]->setFillWindow( false );
|
||||
m_pcSubWindow[0]->clearWindowBusy();
|
||||
}
|
||||
break;
|
||||
case FRAME_MEASUREMENT_MODULE:
|
||||
m_pcModuleDock->setModulueReturnValue( m_dMeasurementResult );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::destroy()
|
||||
{
|
||||
if( m_bIsRunning )
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
while( m_bIsRunning )
|
||||
{
|
||||
}
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
if( m_pcModuleDock )
|
||||
{
|
||||
m_pcModuleDock->close();
|
||||
m_pcModuleDock = NULL;
|
||||
}
|
||||
if( m_pcDockWidget )
|
||||
{
|
||||
m_pcDockWidget->close();
|
||||
m_pcDockWidget = NULL;
|
||||
}
|
||||
if( m_pcDisplaySubWindow )
|
||||
m_pcDisplaySubWindow->closeSubWindow();
|
||||
m_pcDisplaySubWindow = NULL;
|
||||
|
||||
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
|
||||
{
|
||||
if( m_pcSubWindow[i] )
|
||||
{
|
||||
m_pcSubWindow[i]->disableModule( this );
|
||||
m_pcSubWindow[i] = NULL;
|
||||
}
|
||||
}
|
||||
if( m_pcModuleStream )
|
||||
{
|
||||
m_pcModuleStream->close();
|
||||
delete m_pcModuleStream;
|
||||
m_pcModuleStream = NULL;
|
||||
}
|
||||
if( m_pcModule )
|
||||
{
|
||||
m_pcModule->destroy();
|
||||
m_pcModule->Delete();
|
||||
m_pcModule = NULL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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 PlaYUVerAppModuleIf.h
|
||||
* \brief PlaYUVer App modules interface
|
||||
*/
|
||||
|
||||
#ifndef __PLAYUVERAPPMODULESIF_H__
|
||||
#define __PLAYUVERAPPMODULESIF_H__
|
||||
|
||||
#include "ModuleHandleDock.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include <QVector>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
class QAction;
|
||||
|
||||
//#define PLAYUVER_THREADED_MODULES
|
||||
|
||||
class VideoSubWindow;
|
||||
|
||||
class PlaYUVerAppModuleIf
|
||||
#ifdef PLAYUVER_THREADED_MODULES
|
||||
: public QThread
|
||||
#else
|
||||
: public QObject
|
||||
#endif
|
||||
{
|
||||
friend class ModulesHandle;
|
||||
friend class ModuleHandleDock;
|
||||
friend class ModulesHandleOptDialog;
|
||||
|
||||
private:
|
||||
Bool m_bIsRunning;
|
||||
Bool m_bSuccess;
|
||||
|
||||
QAction* m_pcModuleAction;
|
||||
PlaYUVerModuleIf* m_pcModule;
|
||||
|
||||
VideoSubWindow* m_pcSubWindow[MODULE_REQUIRES_MAX_NUM_FRAMES];
|
||||
|
||||
VideoSubWindow* m_pcDisplaySubWindow;
|
||||
|
||||
QDockWidget* m_pcDockWidget;
|
||||
ModuleHandleDock* m_pcModuleDock;
|
||||
|
||||
PlaYUVerStream* m_pcModuleStream;
|
||||
PlaYUVerFrame* m_pcProcessedFrame;
|
||||
Double m_dMeasurementResult;
|
||||
|
||||
public:
|
||||
class EventData : public QEvent
|
||||
{
|
||||
public:
|
||||
EventData( bool success, PlaYUVerAppModuleIf* module ) : QEvent( QEvent::User )
|
||||
{
|
||||
m_bSuccess = success;
|
||||
m_pcModule = module;
|
||||
}
|
||||
Bool m_bSuccess;
|
||||
PlaYUVerAppModuleIf* m_pcModule;
|
||||
};
|
||||
|
||||
PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaYUVerModuleIf* module );
|
||||
virtual ~PlaYUVerAppModuleIf() {}
|
||||
QList<VideoSubWindow*> getSubWindowList()
|
||||
{
|
||||
QList<VideoSubWindow*> arraySubWindows;
|
||||
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
|
||||
if( m_pcSubWindow[i] )
|
||||
arraySubWindows.append( m_pcSubWindow[i] );
|
||||
return arraySubWindows;
|
||||
}
|
||||
|
||||
PlaYUVerModuleIf* getModule() { return m_pcModule; }
|
||||
UInt getModuleRequirements() { return m_pcModule->m_uiModuleRequirements; }
|
||||
Void update();
|
||||
Bool apply( Bool isPlaying = false, Bool disableThreads = false );
|
||||
Void show();
|
||||
Void destroy();
|
||||
|
||||
protected:
|
||||
virtual void run();
|
||||
};
|
||||
|
||||
#endif // __PLAYUVERAPPMODULESIF_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,24 +18,21 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file MdiSubWindow.cpp
|
||||
* \file PlaYUVerMdiSubWindow.cpp
|
||||
* \brief Re-implementation QMdiSubWindow
|
||||
*/
|
||||
|
||||
#include "MdiSubWindow.h"
|
||||
|
||||
#include "PlaYUVerMdiSubWindow.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
MdiSubWindow::MdiSubWindow( QWidget* parent )
|
||||
: QMdiSubWindow( parent )
|
||||
PlaYUVerMdiSubWindow::PlaYUVerMdiSubWindow( QWidget* parent ) : QMdiSubWindow( parent )
|
||||
{
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
setBackgroundRole( QPalette::Window );
|
||||
setBackgroundRole( QPalette::Background );
|
||||
}
|
||||
|
||||
QSize MdiSubWindow::sizeHint() const
|
||||
QSize PlaYUVerMdiSubWindow::sizeHint() const
|
||||
{
|
||||
QSize maxSize;
|
||||
if( parent() )
|
||||
@@ -44,7 +41,7 @@ QSize MdiSubWindow::sizeHint() const
|
||||
return sizeHint;
|
||||
}
|
||||
|
||||
void MdiSubWindow::closeEvent( QCloseEvent* event )
|
||||
Void PlaYUVerMdiSubWindow::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
emit aboutToClose( this );
|
||||
event->accept();
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,31 +18,30 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file MdiSubWindow.h
|
||||
* \file PlaYUVerMdiSubWindow.h
|
||||
* \brief Re-implementation QMdiSubWindow
|
||||
*/
|
||||
|
||||
#ifndef __MDISUBWINDOW_H_
|
||||
#define __MDISUBWINDOW_H_
|
||||
#ifndef __PLAYUVERMDISUBWINDOW_H__
|
||||
#define __PLAYUVERMDISUBWINDOW_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include <QMdiSubWindow>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class MdiSubWindow : public QMdiSubWindow
|
||||
class PlaYUVerMdiSubWindow : public QMdiSubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MdiSubWindow( QWidget* parent = 0 );
|
||||
PlaYUVerMdiSubWindow( QWidget* parent = 0 );
|
||||
|
||||
Q_SIGNALS:
|
||||
void aboutToClose( MdiSubWindow* );
|
||||
void aboutToClose( PlaYUVerMdiSubWindow* );
|
||||
|
||||
protected:
|
||||
QSize sizeHint() const;
|
||||
void closeEvent( QCloseEvent* event );
|
||||
};
|
||||
|
||||
#endif // __MDISUBWINDOW_H_
|
||||
#endif // __PLAYUVERMDISUBWINDOW_H__
|
||||
@@ -1,7 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Santos (joaompssantos@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -19,40 +18,38 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SubWindowHandle.cpp
|
||||
* \file PlaYUVerSubWindowHandle.cpp
|
||||
* \brief Handle multiple sub-windows
|
||||
*/
|
||||
|
||||
#include "SubWindowHandle.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 "PlaYUVerSubWindowHandle.h"
|
||||
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerMdiSubWindow.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
class MdiArea : public QMdiArea
|
||||
class PlaYUVerMdiArea : public QMdiArea
|
||||
{
|
||||
public:
|
||||
MdiArea( QWidget* parent = 0 )
|
||||
: QMdiArea( parent ), m_pixmapLogo( ":/logos/calyp-logo.png" )
|
||||
PlaYUVerMdiArea( QWidget* parent = 0 )
|
||||
: QMdiArea( parent ), m_pixmapLogo( ":/images/playuver-backgroud-logo.png" )
|
||||
{
|
||||
setBackgroundRole( QPalette::Window );
|
||||
setBackgroundRole( QPalette::Background );
|
||||
}
|
||||
|
||||
void appendLogMessage( const QString& msg )
|
||||
Void appendLogMessage( const QString& msg )
|
||||
{
|
||||
m_acLogMessages.push_front( msg );
|
||||
if( m_acLogMessages.size() > 5 )
|
||||
@@ -65,13 +62,13 @@ protected:
|
||||
{
|
||||
QMdiArea::paintEvent( event );
|
||||
QPainter painter( viewport() );
|
||||
QPixmap pixFinalLogo = m_pixmapLogo.scaled( 2 * size() / 5, Qt::KeepAspectRatio );
|
||||
QPixmap pixFinalLogo = m_pixmapLogo.scaled( 2 * size() / 3, Qt::KeepAspectRatio );
|
||||
// Calculate the logo position - the bottom right corner of the mdi area.
|
||||
int x = width() / 2 - pixFinalLogo.width() / 2;
|
||||
int y = height() / 2 - pixFinalLogo.height() / 2;
|
||||
painter.drawPixmap( x, y, pixFinalLogo );
|
||||
|
||||
// for( int i = 0; i < m_acLogMessages.size(); i++ )
|
||||
// for( Int i = 0; i < m_acLogMessages.size(); i++ )
|
||||
// {
|
||||
// painter.drawText( 5, height() - 5 - i * 15, m_acLogMessages.at( i )
|
||||
// );
|
||||
@@ -84,8 +81,7 @@ private:
|
||||
QPixmap m_pixmapLogo;
|
||||
};
|
||||
|
||||
SubWindowHandle::SubWindowHandle( QWidget* parent )
|
||||
: m_pcApp( qobject_cast<MainWindow*>( parent ) )
|
||||
PlaYUVerSubWindowHandle::PlaYUVerSubWindowHandle( QWidget* parent ) : QWidget( parent )
|
||||
{
|
||||
m_iWindowMode = -1;
|
||||
m_pcWindowManagerLayout = NULL;
|
||||
@@ -94,12 +90,12 @@ SubWindowHandle::SubWindowHandle( QWidget* parent )
|
||||
m_apcSubWindowList.clear();
|
||||
m_apcMdiSubWindowList.clear();
|
||||
|
||||
m_pcCentralWidget = new QWidget;
|
||||
m_pcApp = qobject_cast<PlaYUVerApp*>( parentWidget() );
|
||||
// setWindowMode( DETACHEDSUBWINDOWMODE );
|
||||
setWindowMode( MDISUBWINDOWMODE );
|
||||
}
|
||||
|
||||
void SubWindowHandle::processLogMsg( const QString& msg )
|
||||
Void PlaYUVerSubWindowHandle::processLogMsg( const QString& msg )
|
||||
{
|
||||
if( m_pcMdiArea )
|
||||
{
|
||||
@@ -107,7 +103,7 @@ void SubWindowHandle::processLogMsg( const QString& msg )
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::resetWindowMode()
|
||||
Void PlaYUVerSubWindowHandle::resetWindowMode()
|
||||
{
|
||||
QList<SubWindowAbstract*> apcSubWindowList = m_apcSubWindowList;
|
||||
|
||||
@@ -118,14 +114,14 @@ void SubWindowHandle::resetWindowMode()
|
||||
{
|
||||
m_cMdiModeWindowPosition = m_pcApp->pos();
|
||||
m_cMdiModeWindowSize = m_pcApp->size();
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
m_apcSubWindowList.at( i )->setParent( NULL );
|
||||
}
|
||||
for( int i = 0; i < m_apcMdiSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < m_apcMdiSubWindowList.size(); i++ )
|
||||
{
|
||||
disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( MdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( MdiSubWindow* ) ) );
|
||||
disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ),
|
||||
this, SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
m_apcMdiSubWindowList.at( i )->close();
|
||||
}
|
||||
m_apcMdiSubWindowList.clear();
|
||||
@@ -137,7 +133,7 @@ void SubWindowHandle::resetWindowMode()
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::setWindowMode( int iWindowMode )
|
||||
Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
{
|
||||
if( m_iWindowMode == iWindowMode )
|
||||
return;
|
||||
@@ -146,17 +142,17 @@ void SubWindowHandle::setWindowMode( int iWindowMode )
|
||||
|
||||
if( iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
m_apcSubWindowList.at( i )->setParent( NULL );
|
||||
m_apcSubWindowList.at( i )->resize( m_apcSubWindowList.at( i )->sizeHint() );
|
||||
m_apcSubWindowList.at( i )->show();
|
||||
}
|
||||
m_pcCentralWidget->setVisible( false );
|
||||
m_pcApp->update();
|
||||
setVisible( false );
|
||||
parentWidget()->update();
|
||||
m_pcApp->showNormal();
|
||||
qApp->processEvents();
|
||||
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
QSize screenSize = QApplication::desktop()->availableGeometry().size();
|
||||
m_pcApp->move( 0, 0 );
|
||||
m_pcApp->resize( screenSize.width(), 5 );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() );
|
||||
@@ -164,14 +160,15 @@ void SubWindowHandle::setWindowMode( int iWindowMode )
|
||||
|
||||
if( iWindowMode == MDISUBWINDOWMODE )
|
||||
{
|
||||
m_pcCentralWidget->setVisible( true );
|
||||
m_pcMdiArea = new MdiArea;
|
||||
setVisible( true );
|
||||
m_pcMdiArea = new PlaYUVerMdiArea;
|
||||
m_pcMdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
|
||||
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( updateActiveSubWindow() ) );
|
||||
m_pcWindowManagerLayout = new QHBoxLayout( m_pcCentralWidget );
|
||||
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this,
|
||||
SLOT( updateActiveSubWindow() ) );
|
||||
m_pcWindowManagerLayout = new QHBoxLayout( this );
|
||||
m_pcWindowManagerLayout->addWidget( m_pcMdiArea );
|
||||
m_pcCentralWidget->setLayout( m_pcWindowManagerLayout );
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
setLayout( m_pcWindowManagerLayout );
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
addMdiSubWindow( m_apcSubWindowList.at( i ) );
|
||||
m_apcSubWindowList.at( i )->resize( m_apcSubWindowList.at( i )->sizeHint() );
|
||||
@@ -180,11 +177,8 @@ void SubWindowHandle::setWindowMode( int iWindowMode )
|
||||
// m_pcApp->resize( m_cMdiModeWindowSize );
|
||||
if( m_pcActiveWindow )
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() +
|
||||
" :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
}
|
||||
m_iWindowMode = iWindowMode;
|
||||
@@ -193,7 +187,7 @@ void SubWindowHandle::setWindowMode( int iWindowMode )
|
||||
// qApp->processEvents();
|
||||
}
|
||||
|
||||
void SubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
@@ -211,7 +205,8 @@ void SubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
if( mdiSubWindow )
|
||||
{
|
||||
QWidget* activeWidget = m_pcMdiArea->activeSubWindow()->widget();
|
||||
int windowIdx = m_apcSubWindowList.indexOf( qobject_cast<SubWindowAbstract*>( activeWidget ) );
|
||||
Int windowIdx =
|
||||
m_apcSubWindowList.indexOf( qobject_cast<SubWindowAbstract*>( activeWidget ) );
|
||||
if( windowIdx >= 0 )
|
||||
{
|
||||
m_pcActiveWindow = m_apcSubWindowList.at( windowIdx );
|
||||
@@ -220,33 +215,30 @@ void SubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
}
|
||||
if( m_pcActiveWindow )
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() +
|
||||
" :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
|
||||
Void PlaYUVerSubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
MdiSubWindow* mdiSubWindow = new MdiSubWindow;
|
||||
PlaYUVerMdiSubWindow* mdiSubWindow = new PlaYUVerMdiSubWindow;
|
||||
mdiSubWindow->setWidget( window );
|
||||
m_pcMdiArea->addSubWindow( mdiSubWindow );
|
||||
m_apcMdiSubWindowList.append( mdiSubWindow );
|
||||
window->setSubWindow( mdiSubWindow );
|
||||
connect( mdiSubWindow, SIGNAL( aboutToClose( MdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( MdiSubWindow* ) ) );
|
||||
connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
}
|
||||
|
||||
void SubWindowHandle::addSubWindow( SubWindowAbstract* window )
|
||||
Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags )
|
||||
{
|
||||
if( window )
|
||||
{
|
||||
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp,
|
||||
SLOT( printMessage( const QString& ) ) );
|
||||
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp,
|
||||
connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_pcApp,
|
||||
SLOT( updateZoomFactorSBox() ) );
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
@@ -263,7 +255,7 @@ void SubWindowHandle::addSubWindow( SubWindowAbstract* window )
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::removeSubWindow( int windowIdx )
|
||||
Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx )
|
||||
{
|
||||
if( windowIdx >= 0 )
|
||||
{
|
||||
@@ -275,7 +267,7 @@ void SubWindowHandle::removeSubWindow( int windowIdx )
|
||||
}
|
||||
if( m_iWindowMode == MDISUBWINDOWMODE )
|
||||
{
|
||||
MdiSubWindow* mdiSubWindow = m_apcMdiSubWindowList.at( windowIdx );
|
||||
PlaYUVerMdiSubWindow* mdiSubWindow = m_apcMdiSubWindowList.at( windowIdx );
|
||||
m_apcMdiSubWindowList.removeAt( windowIdx );
|
||||
m_pcMdiArea->removeSubWindow( m_apcSubWindowList.at( windowIdx ) );
|
||||
m_apcSubWindowList.at( windowIdx )->close();
|
||||
@@ -286,28 +278,23 @@ void SubWindowHandle::removeSubWindow( int windowIdx )
|
||||
if( !m_apcSubWindowList.isEmpty() )
|
||||
m_apcSubWindowList.front()->setFocus();
|
||||
else
|
||||
m_pcActiveWindow = nullptr;
|
||||
|
||||
if( m_pcActiveWindow == nullptr )
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() );
|
||||
}
|
||||
m_pcActiveWindow = NULL;
|
||||
|
||||
emit changed();
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::removeSubWindow( SubWindowAbstract* window )
|
||||
Void PlaYUVerSubWindowHandle::removeSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
removeSubWindow( m_apcSubWindowList.indexOf( window ) );
|
||||
}
|
||||
|
||||
void SubWindowHandle::removeMdiSubWindow( MdiSubWindow* window )
|
||||
Void PlaYUVerSubWindowHandle::removeMdiSubWindow( PlaYUVerMdiSubWindow* window )
|
||||
{
|
||||
removeSubWindow( m_apcMdiSubWindowList.indexOf( window ) );
|
||||
}
|
||||
|
||||
void SubWindowHandle::removeAllSubWindow()
|
||||
Void PlaYUVerSubWindowHandle::removeAllSubWindow()
|
||||
{
|
||||
while( m_apcSubWindowList.size() > 0 )
|
||||
{
|
||||
@@ -315,12 +302,17 @@ void SubWindowHandle::removeAllSubWindow()
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::removeActiveSubWindow()
|
||||
Void PlaYUVerSubWindowHandle::removeActiveSubWindow()
|
||||
{
|
||||
removeSubWindow( m_pcActiveWindow );
|
||||
}
|
||||
|
||||
QList<SubWindowAbstract*> SubWindowHandle::findSubWindow( const unsigned int uiCategory ) const
|
||||
SubWindowAbstract* PlaYUVerSubWindowHandle::activeSubWindow() const
|
||||
{
|
||||
return m_pcActiveWindow;
|
||||
}
|
||||
|
||||
QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const
|
||||
{
|
||||
QList<SubWindowAbstract*> apcSubWindowList;
|
||||
if( uiCategory == 0 )
|
||||
@@ -329,7 +321,7 @@ QList<SubWindowAbstract*> SubWindowHandle::findSubWindow( const unsigned int uiC
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
if( m_apcSubWindowList.at( i )->getCategory() & uiCategory )
|
||||
apcSubWindowList.append( m_apcSubWindowList.at( i ) );
|
||||
@@ -338,14 +330,14 @@ QList<SubWindowAbstract*> SubWindowHandle::findSubWindow( const unsigned int uiC
|
||||
return apcSubWindowList;
|
||||
}
|
||||
|
||||
QList<SubWindowAbstract*> SubWindowHandle::findSubWindow( const QString& windowName,
|
||||
const unsigned int uiCategory ) const
|
||||
QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const QString& windowName,
|
||||
const UInt uiCategory ) const
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList = findSubWindow( uiCategory );
|
||||
QList<SubWindowAbstract*> apcSubWindowList;
|
||||
if( !windowName.isEmpty() )
|
||||
{
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
if( subWindowList.at( i )->getWindowName() == windowName )
|
||||
apcSubWindowList.append( subWindowList.at( i ) );
|
||||
@@ -354,10 +346,11 @@ QList<SubWindowAbstract*> SubWindowHandle::findSubWindow( const QString& windowN
|
||||
return apcSubWindowList;
|
||||
}
|
||||
|
||||
SubWindowAbstract* SubWindowHandle::findSubWindow( const SubWindowAbstract* subWindow ) const
|
||||
SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow(
|
||||
const SubWindowAbstract* subWindow ) const
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList = findSubWindow();
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
if( subWindow == subWindowList.at( i ) )
|
||||
return subWindowList.at( i );
|
||||
@@ -365,7 +358,7 @@ SubWindowAbstract* SubWindowHandle::findSubWindow( const SubWindowAbstract* subW
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SubWindowHandle::setActiveSubWindow( QWidget* window )
|
||||
Void PlaYUVerSubWindowHandle::setActiveSubWindow( QWidget* window )
|
||||
{
|
||||
if( !window )
|
||||
return;
|
||||
@@ -382,16 +375,16 @@ void SubWindowHandle::setActiveSubWindow( QWidget* window )
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::tileSubWindows()
|
||||
Void PlaYUVerSubWindowHandle::tileSubWindows()
|
||||
{
|
||||
unsigned int numberOfWindows = m_apcSubWindowList.size();
|
||||
UInt numberOfWindows = m_apcSubWindowList.size();
|
||||
if( numberOfWindows == 0 )
|
||||
return;
|
||||
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
unsigned int minWindowsInRow = 1;
|
||||
QSize screenSize = QApplication::desktop()->availableGeometry().size();
|
||||
UInt minWindowsInRow = 1;
|
||||
while( ( screenSize.width() / minWindowsInRow ) > 500 )
|
||||
{
|
||||
minWindowsInRow++;
|
||||
@@ -408,12 +401,12 @@ void SubWindowHandle::tileSubWindows()
|
||||
{
|
||||
numberOfWindows++;
|
||||
}
|
||||
unsigned int numberTillingRows = 1;
|
||||
unsigned int numberTillingColumns;
|
||||
UInt numberTillingRows = 1;
|
||||
UInt numberTillingColumns;
|
||||
if( numberOfWindows > minWindowsInRow )
|
||||
{
|
||||
numberTillingColumns = minWindowsInRow;
|
||||
for( int i = numberOfWindows; i > 0; )
|
||||
for( Int i = numberOfWindows; i > 0; )
|
||||
{
|
||||
numberTillingRows = ( numberOfWindows + numberTillingColumns - 1 ) / numberTillingColumns;
|
||||
if( numberTillingColumns > numberTillingRows )
|
||||
@@ -433,9 +426,10 @@ void SubWindowHandle::tileSubWindows()
|
||||
}
|
||||
|
||||
QSize totalWindowsSize( screenSize.width(), screenSize.height() - topLeftCornerWindow.y() );
|
||||
QSize windowsSize( totalWindowsSize.width() / numberTillingColumns, totalWindowsSize.height() / numberTillingRows );
|
||||
QSize windowsSize( totalWindowsSize.width() / numberTillingColumns,
|
||||
totalWindowsSize.height() / numberTillingRows );
|
||||
QPoint windowRelativePos;
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
windowRelativePos.setY( ( i / numberTillingColumns ) * windowsSize.height() );
|
||||
windowRelativePos.setX( ( i % numberTillingColumns ) * windowsSize.width() );
|
||||
@@ -449,7 +443,7 @@ void SubWindowHandle::tileSubWindows()
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::cascadeSubWindows()
|
||||
Void PlaYUVerSubWindowHandle::cascadeSubWindows()
|
||||
{
|
||||
if( m_iWindowMode == MDISUBWINDOWMODE )
|
||||
{
|
||||
@@ -457,10 +451,11 @@ void SubWindowHandle::cascadeSubWindows()
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::createActions()
|
||||
Void PlaYUVerSubWindowHandle::createActions()
|
||||
{
|
||||
m_mapperWindow = new QSignalMapper( this );
|
||||
connect( m_mapperWindow, SIGNAL( mapped( QWidget* ) ), this, SLOT( setActiveSubWindow( QWidget* ) ) );
|
||||
connect( m_mapperWindow, SIGNAL( mapped( QWidget* ) ), this,
|
||||
SLOT( setActiveSubWindow( QWidget* ) ) );
|
||||
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
|
||||
@@ -474,30 +469,36 @@ void SubWindowHandle::createActions()
|
||||
m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] = new QAction( tr( "&Detached SubWindows" ), this );
|
||||
m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT]->setCheckable( true );
|
||||
m_actionGroupWindowMode->addAction( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] );
|
||||
connect( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode, SLOT( map() ) );
|
||||
m_mapperWindowMode->setMapping( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT], DETACHEDSUBWINDOWMODE );
|
||||
connect( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode,
|
||||
SLOT( map() ) );
|
||||
m_mapperWindowMode->setMapping( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT],
|
||||
DETACHEDSUBWINDOWMODE );
|
||||
|
||||
m_arrayActions[MDI_SUBWINDOW_MODE_ACT] = new QAction( "&MDI SubWindows", this );
|
||||
m_arrayActions[MDI_SUBWINDOW_MODE_ACT]->setCheckable( true );
|
||||
m_actionGroupWindowMode->addAction( m_arrayActions[MDI_SUBWINDOW_MODE_ACT] );
|
||||
connect( m_arrayActions[MDI_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode, SLOT( map() ) );
|
||||
connect( m_arrayActions[MDI_SUBWINDOW_MODE_ACT], SIGNAL( triggered() ), m_mapperWindowMode,
|
||||
SLOT( map() ) );
|
||||
m_mapperWindowMode->setMapping( m_arrayActions[MDI_SUBWINDOW_MODE_ACT], MDISUBWINDOWMODE );
|
||||
|
||||
m_actionGroupWindowMode->actions().at( m_iWindowMode )->setChecked( true );
|
||||
|
||||
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( m_pcApp->style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this, SLOT( removeActiveSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( removeActiveSubWindow() ) );
|
||||
|
||||
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( m_pcApp->style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
|
||||
m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this, SLOT( removeActiveSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( removeActiveSubWindow() ) );
|
||||
|
||||
m_arrayActions[CLOSE_ALL_ACT] = new QAction( tr( "Close &All" ), this );
|
||||
m_arrayActions[CLOSE_ALL_ACT]->setStatusTip( tr( "Close all the windows" ) );
|
||||
connect( m_arrayActions[CLOSE_ALL_ACT], SIGNAL( triggered() ), this, SLOT( removeAllSubWindow() ) );
|
||||
connect( m_arrayActions[CLOSE_ALL_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( removeAllSubWindow() ) );
|
||||
|
||||
m_arrayActions[TILE_WINDOWS_ACT] = new QAction( tr( "Tile" ), this );
|
||||
m_arrayActions[TILE_WINDOWS_ACT]->setIcon( QIcon( ":images/windowstile.png" ) );
|
||||
@@ -505,24 +506,29 @@ void SubWindowHandle::createActions()
|
||||
m_arrayActions[TILE_WINDOWS_ACT]->setShortcut( tr( "Ctrl+T" ) );
|
||||
// connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), mdiArea,
|
||||
// SLOT( tileSubWindows() ) );
|
||||
connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), this, SLOT( tileSubWindows() ) );
|
||||
connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( tileSubWindows() ) );
|
||||
|
||||
m_arrayActions[CASCADE_WINDOWS_ACT] = new QAction( tr( "Cascade" ), this );
|
||||
m_arrayActions[CASCADE_WINDOWS_ACT]->setIcon( QIcon( ":images/windowscascade.png" ) );
|
||||
m_arrayActions[CASCADE_WINDOWS_ACT]->setStatusTip( tr( "Cascade the windows" ) );
|
||||
connect( m_arrayActions[CASCADE_WINDOWS_ACT], SIGNAL( triggered() ), this, SLOT( cascadeSubWindows() ) );
|
||||
connect( m_arrayActions[CASCADE_WINDOWS_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( cascadeSubWindows() ) );
|
||||
|
||||
m_arrayActions[NEXT_WINDOWS_ACT] = new QAction( tr( "Ne&xt" ), this );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setShortcuts( QKeySequence::NextChild );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setIcon( QIcon( m_pcApp->style()->standardIcon( QStyle::SP_ArrowRight ) ) );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setIcon(
|
||||
QIcon( style()->standardIcon( QStyle::SP_ArrowRight ) ) );
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setStatusTip( tr( "Move the focus to the next window" ) );
|
||||
// connect( m_arrayActions[NEXT_WINDOWS_ACT], SIGNAL( triggered() ), this,
|
||||
// SLOT( activateNextSubWindow() ) );
|
||||
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT] = new QAction( tr( "Pre&vious" ), this );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setShortcuts( QKeySequence::PreviousChild );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setIcon( QIcon( m_pcApp->style()->standardIcon( QStyle::SP_ArrowLeft ) ) );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setStatusTip( tr( "Move the focus to the previous window" ) );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setIcon(
|
||||
QIcon( style()->standardIcon( QStyle::SP_ArrowLeft ) ) );
|
||||
m_arrayActions[PREVIOUS_WINDOWS_ACT]->setStatusTip(
|
||||
tr( "Move the focus to the previous window" ) );
|
||||
// connect( m_arrayActions[PREVIOUS_WINDOWS_ACT], SIGNAL( triggered() ),
|
||||
// this, SLOT( activatePreviousSubWindow() ) );
|
||||
|
||||
@@ -530,20 +536,15 @@ void SubWindowHandle::createActions()
|
||||
m_arrayActions[SEPARATOR_ACT]->setSeparator( true );
|
||||
}
|
||||
|
||||
QMenu* SubWindowHandle::createMenu()
|
||||
QMenu* PlaYUVerSubWindowHandle::createMenu()
|
||||
{
|
||||
m_pcMenuWindow = new QMenu( "&Window", m_pcApp );
|
||||
m_pcMenuWindow = new QMenu( "&Window", this );
|
||||
updateMenu();
|
||||
connect( m_pcMenuWindow, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) );
|
||||
return m_pcMenuWindow;
|
||||
}
|
||||
|
||||
auto SubWindowHandle::getWidget() -> QWidget*
|
||||
{
|
||||
return m_pcCentralWidget;
|
||||
}
|
||||
|
||||
void SubWindowHandle::updateMenu()
|
||||
Void PlaYUVerSubWindowHandle::updateMenu()
|
||||
{
|
||||
m_pcMenuWindow->clear();
|
||||
m_pcMenuWindow->addAction( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] );
|
||||
@@ -559,7 +560,7 @@ void SubWindowHandle::updateMenu()
|
||||
// m_pcMenuWindow->addAction( m_arrayActions[PREVIOUS_WINDOWS_ACT] );
|
||||
// m_pcMenuWindow->addSeparator();
|
||||
|
||||
int number_windows = m_apcSubWindowList.size();
|
||||
Int number_windows = m_apcSubWindowList.size();
|
||||
if( number_windows > 1 )
|
||||
{
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setEnabled( true );
|
||||
@@ -573,7 +574,7 @@ void SubWindowHandle::updateMenu()
|
||||
|
||||
m_arrayActions[SEPARATOR_ACT]->setVisible( number_windows > 0 );
|
||||
|
||||
for( int i = 0; i < number_windows; ++i )
|
||||
for( Int i = 0; i < number_windows; ++i )
|
||||
{
|
||||
SubWindowAbstract* subWindow = m_apcSubWindowList.at( i );
|
||||
|
||||
@@ -594,17 +595,19 @@ void SubWindowHandle::updateMenu()
|
||||
}
|
||||
}
|
||||
|
||||
void SubWindowHandle::readSettings()
|
||||
Void PlaYUVerSubWindowHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_cMdiModeWindowPosition = appSettings.value( "SubWindowManager/LastMdiPosition", QPoint( 200, 200 ) ).toPoint();
|
||||
m_cMdiModeWindowSize = appSettings.value( "SubWindowManager/LastMdiSize", QSize( 500, 400 ) ).toSize();
|
||||
int iWindowMode = appSettings.value( "SubWindowManager/SubWindowMode", MDISUBWINDOWMODE ).toInt();
|
||||
m_cMdiModeWindowPosition =
|
||||
appSettings.value( "SubWindowManager/LastMdiPosition", QPoint( 200, 200 ) ).toPoint();
|
||||
m_cMdiModeWindowSize =
|
||||
appSettings.value( "SubWindowManager/LastMdiSize", QSize( 500, 400 ) ).toSize();
|
||||
Int iWindowMode = appSettings.value( "SubWindowManager/SubWindowMode", MDISUBWINDOWMODE ).toInt();
|
||||
setWindowMode( iWindowMode );
|
||||
m_actionGroupWindowMode->actions().at( iWindowMode )->setChecked( true );
|
||||
}
|
||||
|
||||
void SubWindowHandle::writeSettings()
|
||||
Void PlaYUVerSubWindowHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "SubWindowManager/LastMdiPosition", m_cMdiModeWindowPosition );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -18,18 +18,18 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SubWindowHandle.h
|
||||
* \file PlaYUVerSubWindowHandle.h
|
||||
* \brief Handle multiple sub-windows
|
||||
*/
|
||||
|
||||
#ifndef __SUBWINDOWHANDLE_H__
|
||||
#define __SUBWINDOWHANDLE_H__
|
||||
#ifndef __PLAYUVERSUBWINDOWHANDLE_H__
|
||||
#define __PLAYUVERSUBWINDOWHANDLE_H__
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
|
||||
class QAction;
|
||||
class QActionGroup;
|
||||
@@ -37,40 +37,33 @@ class QHBoxLayout;
|
||||
class QMenu;
|
||||
class QSignalMapper;
|
||||
|
||||
class MainWindow;
|
||||
class PlaYUVerApp;
|
||||
class SubWindowAbstract;
|
||||
class MdiArea;
|
||||
class MdiSubWindow;
|
||||
class PlaYUVerMdiArea;
|
||||
class PlaYUVerMdiSubWindow;
|
||||
|
||||
class SubWindowHandle : public QObject
|
||||
class PlaYUVerSubWindowHandle : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SubWindowHandle( QWidget* parent );
|
||||
PlaYUVerSubWindowHandle( QWidget* parent );
|
||||
|
||||
void processLogMsg( const QString& msg );
|
||||
Void processLogMsg( const QString& msg );
|
||||
|
||||
void addSubWindow( SubWindowAbstract* widget );
|
||||
Void addSubWindow( SubWindowAbstract* widget, Qt::WindowFlags flags = 0 );
|
||||
|
||||
template <class T = SubWindowAbstract>
|
||||
T* activeSubWindow() const
|
||||
{
|
||||
static_assert( std::is_base_of<SubWindowAbstract, T>::value, "T must inherit from SubWindowAbstract" );
|
||||
return qobject_cast<T*>( m_pcActiveWindow );
|
||||
}
|
||||
SubWindowAbstract* activeSubWindow() const;
|
||||
|
||||
QList<SubWindowAbstract*> findSubWindow( const unsigned int uiCategory = 0 ) const;
|
||||
QList<SubWindowAbstract*> findSubWindow( const QString& aName, const unsigned int uiCategory = 0 ) const;
|
||||
QList<SubWindowAbstract*> findSubWindow( const UInt uiCategory = 0 ) const;
|
||||
QList<SubWindowAbstract*> findSubWindow( const QString& aName, const UInt uiCategory = 0 ) const;
|
||||
SubWindowAbstract* findSubWindow( const SubWindowAbstract* subWindow ) const;
|
||||
|
||||
void createActions();
|
||||
Void createActions();
|
||||
QMenu* createMenu();
|
||||
|
||||
auto getWidget() -> QWidget*;
|
||||
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
enum WindowMode
|
||||
{
|
||||
@@ -79,14 +72,13 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
MainWindow* m_pcApp;
|
||||
int m_iWindowMode;
|
||||
PlaYUVerApp* m_pcApp;
|
||||
Int m_iWindowMode;
|
||||
QList<SubWindowAbstract*> m_apcSubWindowList;
|
||||
|
||||
QWidget* m_pcCentralWidget;
|
||||
QHBoxLayout* m_pcWindowManagerLayout;
|
||||
MdiArea* m_pcMdiArea;
|
||||
QList<MdiSubWindow*> m_apcMdiSubWindowList;
|
||||
PlaYUVerMdiArea* m_pcMdiArea;
|
||||
QList<PlaYUVerMdiSubWindow*> m_apcMdiSubWindowList;
|
||||
|
||||
SubWindowAbstract* m_pcActiveWindow;
|
||||
|
||||
@@ -113,18 +105,18 @@ private:
|
||||
QMenu* m_pcMenuWindow;
|
||||
|
||||
/**
|
||||
* internal functions
|
||||
* Internal functions
|
||||
*/
|
||||
void addMdiSubWindow( SubWindowAbstract* window );
|
||||
void resetWindowMode();
|
||||
void removeSubWindow( int windowIdx );
|
||||
Void addMdiSubWindow( SubWindowAbstract* window );
|
||||
Void resetWindowMode();
|
||||
Void removeSubWindow( Int windowIdx );
|
||||
|
||||
public Q_SLOTS:
|
||||
void setWindowMode( int iWindowMode );
|
||||
void updateActiveSubWindow( SubWindowAbstract* window = 0 );
|
||||
void setActiveSubWindow( QWidget* window );
|
||||
void removeSubWindow( SubWindowAbstract* window );
|
||||
void removeMdiSubWindow( MdiSubWindow* window );
|
||||
void removeMdiSubWindow( PlaYUVerMdiSubWindow* window );
|
||||
void removeActiveSubWindow();
|
||||
void removeAllSubWindow();
|
||||
void tileSubWindows();
|
||||
@@ -136,4 +128,4 @@ Q_SIGNALS:
|
||||
void windowActivated();
|
||||
};
|
||||
|
||||
#endif // __SUBWINDOWHANDLE_H__
|
||||
#endif // __PLAYUVERSUBWINDOWHANDLE_H__
|
||||
+40
-55
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,14 +23,9 @@
|
||||
*/
|
||||
|
||||
#include "PlotSubWindow.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QSize>
|
||||
|
||||
#include "qcustomplot.h"
|
||||
|
||||
void PlotSubWindow::definePlotColors()
|
||||
Void PlotSubWindow::definePlotColors()
|
||||
{
|
||||
m_arrayColorList.append( Qt::blue );
|
||||
m_arrayColorList.append( Qt::red );
|
||||
@@ -99,15 +94,18 @@ PlotSubWindow::PlotSubWindow( const QString& windowTitle, QWidget* parent )
|
||||
m_cPlotArea->yAxis2->setTickLabels( false );
|
||||
// make left and bottom axes always transfer their ranges to right and top
|
||||
// axes:
|
||||
connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->xAxis2, SLOT( setRange( QCPRange ) ) );
|
||||
connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->yAxis2, SLOT( setRange( QCPRange ) ) );
|
||||
connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->xAxis2,
|
||||
SLOT( setRange( QCPRange ) ) );
|
||||
connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged( QCPRange ) ), m_cPlotArea->yAxis2,
|
||||
SLOT( setRange( QCPRange ) ) );
|
||||
|
||||
QFont legendFont = font(); // start out with MainWindow's font..
|
||||
legendFont.setPointSize( 9 ); // and make a bit smaller for legend
|
||||
m_cPlotArea->legend->setFont( legendFont );
|
||||
m_cPlotArea->legend->setBrush( backgroundBrush );
|
||||
m_cPlotArea->legend->setTextColor( palette().text().color() );
|
||||
m_cPlotArea->legend->setBorderPen( QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) );
|
||||
m_cPlotArea->legend->setBorderPen(
|
||||
QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) );
|
||||
m_cPlotArea->legend->setVisible( false );
|
||||
|
||||
m_cPlotArea->setInteractions( QCP::iRangeZoom | QCP::iRangeDrag ); // QCP::iSelectPlottables
|
||||
@@ -117,11 +115,6 @@ PlotSubWindow::PlotSubWindow( const QString& windowTitle, QWidget* parent )
|
||||
m_cPlotPen.setWidthF( 2 );
|
||||
|
||||
setWidget( m_cPlotArea );
|
||||
|
||||
m_aAxisRange[AXIS_HORIZONTAL][0] = 99999;
|
||||
m_aAxisRange[AXIS_HORIZONTAL][1] = 0;
|
||||
m_aAxisRange[AXIS_VERTICAL][0] = 99999;
|
||||
m_aAxisRange[AXIS_VERTICAL][1] = 0;
|
||||
}
|
||||
|
||||
PlotSubWindow::~PlotSubWindow()
|
||||
@@ -129,22 +122,22 @@ PlotSubWindow::~PlotSubWindow()
|
||||
delete m_cPlotArea;
|
||||
}
|
||||
|
||||
void PlotSubWindow::normalSize()
|
||||
Void PlotSubWindow::normalSize()
|
||||
{
|
||||
m_cPlotArea->xAxis->setRange( m_aAxisRange[AXIS_HORIZONTAL][0], m_aAxisRange[AXIS_HORIZONTAL][1] );
|
||||
m_cPlotArea->yAxis->setRange( m_aAxisRange[AXIS_VERTICAL][0], m_aAxisRange[AXIS_VERTICAL][1] );
|
||||
m_cPlotArea->xAxis->setRange( m_aAxisRange[HORIZONTAL][0], m_aAxisRange[HORIZONTAL][1] );
|
||||
m_cPlotArea->yAxis->setRange( m_aAxisRange[VERTICAL][0], m_aAxisRange[VERTICAL][1] );
|
||||
m_cPlotArea->replot();
|
||||
m_dScaleFactor = 1;
|
||||
}
|
||||
|
||||
void PlotSubWindow::zoomToFit()
|
||||
Void PlotSubWindow::zoomToFit()
|
||||
{
|
||||
normalSize();
|
||||
}
|
||||
|
||||
void PlotSubWindow::zoomToFactor( double factor, QPoint center ) {}
|
||||
Void PlotSubWindow::zoomToFactor( Double factor, QPoint center ) {}
|
||||
|
||||
void PlotSubWindow::scaleView( double scale, QPoint center )
|
||||
Void PlotSubWindow::scaleView( Double scale, QPoint center )
|
||||
{
|
||||
scale -= 1;
|
||||
scale /= 10;
|
||||
@@ -152,9 +145,9 @@ void PlotSubWindow::scaleView( double scale, QPoint center )
|
||||
|
||||
m_dScaleFactor *= scale;
|
||||
//
|
||||
// unsigned int aNewAxisRange[2][2];
|
||||
// for( unsigned int axis = 0; axis < 2; axis++ )
|
||||
// for( unsigned int dim = 0; dim < 2; dim++ )
|
||||
// UInt aNewAxisRange[2][2];
|
||||
// for( UInt axis = 0; axis < 2; axis++ )
|
||||
// for( UInt dim = 0; dim < 2; dim++ )
|
||||
// aNewAxisRange[axis][dim] = m_aAxisRange[axis][dim] / m_dScaleFactor;
|
||||
//
|
||||
// m_cPlotArea->xAxis->setRange( aNewAxisRange[HORIZONTAL][0],
|
||||
@@ -177,7 +170,7 @@ QSize PlotSubWindow::sizeHint() const
|
||||
}
|
||||
else
|
||||
{
|
||||
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
maxSize = QApplication::desktop()->availableGeometry().size();
|
||||
}
|
||||
return sizeHint( maxSize );
|
||||
}
|
||||
@@ -187,52 +180,42 @@ QSize PlotSubWindow::sizeHint( const QSize& maxSize ) const
|
||||
return maxSize * 2 / 3;
|
||||
}
|
||||
|
||||
void PlotSubWindow::setAxisName( const QString& nameAxisX, const QString& nameAxisY )
|
||||
Void PlotSubWindow::setAxisName( const QString& nameAxisX, const QString& nameAxisY )
|
||||
{
|
||||
m_cPlotArea->xAxis->setLabel( nameAxisX );
|
||||
m_cPlotArea->yAxis->setLabel( nameAxisY );
|
||||
}
|
||||
|
||||
void PlotSubWindow::setAxisRange( const QLine& axisLimits )
|
||||
Void PlotSubWindow::setAxisRange( const QLine& axisLimits )
|
||||
{
|
||||
setAxisRange( AXIS_HORIZONTAL, axisLimits.x1(), axisLimits.x2() );
|
||||
setAxisRange( AXIS_VERTICAL, axisLimits.y1(), axisLimits.y2() );
|
||||
setAxisRange( HORIZONTAL, axisLimits.x1(), axisLimits.x2() );
|
||||
setAxisRange( VERTICAL, axisLimits.y1(), axisLimits.y2() );
|
||||
}
|
||||
|
||||
void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd )
|
||||
Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis,
|
||||
const Int& axisStart,
|
||||
const Int& axisEnd )
|
||||
{
|
||||
if( eAxis == AXIS_HORIZONTAL )
|
||||
if( eAxis == HORIZONTAL )
|
||||
{
|
||||
m_cPlotArea->xAxis->setRange( axisStart, axisEnd );
|
||||
// horizontalScrollBar()->setRange( axisStart * 100, axisEnd * 100 );
|
||||
m_aAxisRange[AXIS_HORIZONTAL][0] = axisStart;
|
||||
m_aAxisRange[AXIS_HORIZONTAL][1] = axisEnd;
|
||||
m_aAxisRange[HORIZONTAL][0] = axisStart;
|
||||
m_aAxisRange[HORIZONTAL][1] = axisEnd;
|
||||
}
|
||||
if( eAxis == AXIS_VERTICAL )
|
||||
if( eAxis == VERTICAL )
|
||||
{
|
||||
m_cPlotArea->yAxis->setRange( axisStart, axisEnd );
|
||||
// verticalScrollBar()->setRange( axisStart * 100, axisEnd * 100 );
|
||||
m_aAxisRange[AXIS_VERTICAL][0] = axisStart;
|
||||
m_aAxisRange[AXIS_VERTICAL][1] = axisEnd;
|
||||
m_aAxisRange[VERTICAL][0] = axisStart;
|
||||
m_aAxisRange[VERTICAL][1] = axisEnd;
|
||||
}
|
||||
m_cPlotArea->replot();
|
||||
}
|
||||
|
||||
void PlotSubWindow::appendAxisLimit( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd )
|
||||
{
|
||||
m_aAxisRange[eAxis][0] = std::min<double>( m_aAxisRange[eAxis][0], axisStart );
|
||||
m_aAxisRange[eAxis][1] = std::max<double>( m_aAxisRange[eAxis][1], axisEnd );
|
||||
|
||||
if( eAxis == AXIS_HORIZONTAL )
|
||||
m_cPlotArea->xAxis->setRange( m_aAxisRange[AXIS_HORIZONTAL][0], m_aAxisRange[AXIS_HORIZONTAL][1] );
|
||||
|
||||
if( eAxis == AXIS_VERTICAL )
|
||||
m_cPlotArea->xAxis->setRange( m_aAxisRange[AXIS_VERTICAL][0], m_aAxisRange[AXIS_VERTICAL][1] );
|
||||
|
||||
m_cPlotArea->replot();
|
||||
}
|
||||
|
||||
void PlotSubWindow::addPlot( const QVector<double>& arrayX, const QVector<double>& arrayY, const QString& key )
|
||||
Void PlotSubWindow::addPlot( const QVector<Double>& arrayX,
|
||||
const QVector<Double>& arrayY,
|
||||
const QString& key )
|
||||
{
|
||||
QCPGraph* newPlot = m_cPlotArea->addGraph();
|
||||
QColor plotColor = m_arrayColorList.at( 0 );
|
||||
@@ -254,8 +237,10 @@ void PlotSubWindow::addPlot( const QVector<double>& arrayX, const QVector<double
|
||||
newPlot->setName( key );
|
||||
}
|
||||
|
||||
appendAxisLimit( AXIS_HORIZONTAL, m_cPlotArea->xAxis->range().lower, m_cPlotArea->xAxis->range().upper );
|
||||
appendAxisLimit( AXIS_VERTICAL, m_cPlotArea->yAxis->range().lower, m_cPlotArea->yAxis->range().upper );
|
||||
m_aAxisRange[HORIZONTAL][0] = m_cPlotArea->xAxis->range().lower;
|
||||
m_aAxisRange[HORIZONTAL][1] = m_cPlotArea->xAxis->range().upper;
|
||||
m_aAxisRange[VERTICAL][0] = m_cPlotArea->yAxis->range().lower;
|
||||
m_aAxisRange[VERTICAL][1] = m_cPlotArea->yAxis->range().upper;
|
||||
|
||||
m_iNumberPlots++;
|
||||
}
|
||||
+29
-25
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,11 +25,14 @@
|
||||
#ifndef __PLOTWINDOWHANDLE_H__
|
||||
#define __PLOTWINDOWHANDLE_H__
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
class QCustomPlot;
|
||||
|
||||
@@ -45,44 +48,45 @@ private:
|
||||
|
||||
enum Axis
|
||||
{
|
||||
AXIS_HORIZONTAL,
|
||||
AXIS_VERTICAL,
|
||||
HORIZONTAL,
|
||||
VERTICAL,
|
||||
};
|
||||
double m_aAxisRange[2][2];
|
||||
double m_dScaleFactor;
|
||||
int m_iNumberPlots;
|
||||
Double m_aAxisRange[2][2];
|
||||
Double m_dScaleFactor;
|
||||
Int m_iNumberPlots;
|
||||
|
||||
public:
|
||||
PlotSubWindow( const QString& windowTitle, QWidget* parent = NULL );
|
||||
~PlotSubWindow();
|
||||
|
||||
void definePlotColors();
|
||||
Void definePlotColors();
|
||||
|
||||
void refreshSubWindow() {}
|
||||
Void refreshSubWindow() {}
|
||||
/**
|
||||
* Virtual functions from SubWindowAbstract
|
||||
*/
|
||||
void normalSize();
|
||||
void zoomToFit();
|
||||
void zoomToFactor( double factor, QPoint center = QPoint() );
|
||||
void scaleView( double scale, QPoint center = QPoint() );
|
||||
Void normalSize();
|
||||
Void zoomToFit();
|
||||
Void zoomToFactor( Double factor, QPoint center = QPoint() );
|
||||
Void scaleView( Double scale, QPoint center = QPoint() );
|
||||
|
||||
double getScaleFactor() { return m_dScaleFactor; }
|
||||
Double getScaleFactor() { return m_dScaleFactor; }
|
||||
/**
|
||||
* Size related functions
|
||||
*/
|
||||
QSize sizeHint() const;
|
||||
QSize sizeHint( const QSize& ) const;
|
||||
|
||||
void setAxisName( const QString& nameAxisX, const QString& nameAxisY );
|
||||
Void setAxisName( const QString& nameAxisX, const QString& nameAxisY );
|
||||
|
||||
void setAxisRange( const QLine& axisLimits );
|
||||
void setAxisRange( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd );
|
||||
void appendAxisLimit( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd );
|
||||
Void setAxisRange( const QLine& axisLimits );
|
||||
Void setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd );
|
||||
|
||||
void setKey( const QString& key );
|
||||
Void setKey( const QString& key );
|
||||
|
||||
void addPlot( const QVector<double>& arrayX, const QVector<double>& arrayY, const QString& key = QString() );
|
||||
Void addPlot( const QVector<Double>& arrayX,
|
||||
const QVector<Double>& arrayY,
|
||||
const QString& key = QString() );
|
||||
};
|
||||
|
||||
#endif // __PLOTWINDOWHANDLE_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,14 +23,13 @@
|
||||
*/
|
||||
|
||||
#include "ProgressBar.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QLabel>
|
||||
#include <QProgressBar>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
ProgressBar::ProgressBar( QWidget* parent, unsigned long long int maxValue )
|
||||
ProgressBar::ProgressBar( QWidget* parent, UInt maxValue )
|
||||
: QWidget( parent ), m_uiTotalProgress( maxValue ), m_uiProgress( 0 )
|
||||
{
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout( this );
|
||||
@@ -51,7 +50,7 @@ ProgressBar::ProgressBar( QWidget* parent, unsigned long long int maxValue )
|
||||
show();
|
||||
}
|
||||
|
||||
void ProgressBar::incrementProgress( unsigned int increment )
|
||||
Void ProgressBar::incrementProgress( UInt increment )
|
||||
{
|
||||
m_uiProgress += increment;
|
||||
m_pcProgressBar->setValue( m_uiProgress );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,11 +25,10 @@
|
||||
#ifndef __PROGRESSBAR_H__
|
||||
#define __PROGRESSBAR_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include <QDialog>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
|
||||
class QProgressBar;
|
||||
|
||||
class ProgressBar : public QWidget
|
||||
@@ -37,13 +36,13 @@ class ProgressBar : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProgressBar( QWidget* parent, unsigned long long int maxValue );
|
||||
ProgressBar( QWidget* parent, UInt maxValue );
|
||||
|
||||
void incrementProgress( unsigned int );
|
||||
Void incrementProgress( UInt );
|
||||
|
||||
private:
|
||||
unsigned int m_uiTotalProgress;
|
||||
unsigned int m_uiProgress;
|
||||
UInt m_uiTotalProgress;
|
||||
UInt m_uiProgress;
|
||||
QProgressBar* m_pcProgressBar;
|
||||
};
|
||||
|
||||
+83
-75
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,24 +23,25 @@
|
||||
*/
|
||||
|
||||
#include "QualityHandle.h"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#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>
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
#endif
|
||||
|
||||
QualityHandle::QualityHandle( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: m_pcParent( parent ), m_pcMainWindowManager( windowManager )
|
||||
QualityHandle::QualityHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
}
|
||||
|
||||
QualityHandle::~QualityHandle() {}
|
||||
|
||||
void QualityHandle::createActions()
|
||||
Void QualityHandle::createActions()
|
||||
{
|
||||
m_actionGroupQualityMetric = new QActionGroup( this );
|
||||
m_actionGroupQualityMetric->setExclusive( true );
|
||||
@@ -48,9 +49,9 @@ void QualityHandle::createActions()
|
||||
m_mapperQualityMetric = new QSignalMapper( this );
|
||||
|
||||
QAction* currAction;
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedQualityMetricsList().size(); i++ )
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
currAction = new QAction( CalypFrame::supportedQualityMetricsList()[i].c_str(), this );
|
||||
currAction = new QAction( PlaYUVerFrame::supportedQualityMetricsList()[i].c_str(), this );
|
||||
currAction->setCheckable( true );
|
||||
m_actionGroupQualityMetric->addAction( currAction );
|
||||
connect( currAction, SIGNAL( triggered() ), m_mapperQualityMetric, SLOT( map() ) );
|
||||
@@ -60,17 +61,20 @@ void QualityHandle::createActions()
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
|
||||
m_arrayActions[SELECT_CURR_REF_ACT] = new QAction( "Mark as Reference", this );
|
||||
connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectCurrentAsReference() ) );
|
||||
connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( slotSelectCurrentAsReference() ) );
|
||||
|
||||
m_arrayActions[PLOT_QUALITY] = new QAction( "Plot Window's Quality", this );
|
||||
connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySingle() ) );
|
||||
connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this,
|
||||
SLOT( slotPlotQualitySingle() ) );
|
||||
m_arrayActions[PLOT_SEVERAL_QUALITY] = new QAction( "Plot Several Quality", this );
|
||||
connect( m_arrayActions[PLOT_SEVERAL_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySeveral() ) );
|
||||
connect( m_arrayActions[PLOT_SEVERAL_QUALITY], SIGNAL( triggered() ), this,
|
||||
SLOT( slotPlotQualitySeveral() ) );
|
||||
}
|
||||
|
||||
QMenu* QualityHandle::createMenu()
|
||||
{
|
||||
m_pcMenuQuality = new QMenu( "Quality", m_pcParent );
|
||||
m_pcMenuQuality = new QMenu( "Quality", this );
|
||||
m_pcSubMenuQualityMetrics = m_pcMenuQuality->addMenu( "Quality Metrics" );
|
||||
m_pcSubMenuQualityMetrics->addActions( m_actionGroupQualityMetric->actions() );
|
||||
m_pcMenuQuality->addAction( m_arrayActions[SELECT_CURR_REF_ACT] );
|
||||
@@ -82,26 +86,28 @@ QMenu* QualityHandle::createMenu()
|
||||
|
||||
QDockWidget* QualityHandle::createDock()
|
||||
{
|
||||
m_pcQualityHandleSideBar = new QualityMeasurementSidebar( m_pcParent, m_pcMainWindowManager );
|
||||
m_pcQualityHandleDock = new QDockWidget( tr( "Quality Measurement" ), m_pcParent );
|
||||
m_pcQualityHandleSideBar = new QualityMeasurementSidebar( m_pcParet, m_pcMainWindowManager );
|
||||
m_pcQualityHandleDock = new QDockWidget( tr( "Quality Measurement" ), this );
|
||||
m_pcQualityHandleDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
m_pcQualityHandleDock->setWidget( m_pcQualityHandleSideBar );
|
||||
|
||||
connect( m_pcQualityHandleSideBar, SIGNAL( signalQualityMetricChanged( int ) ), this,
|
||||
SLOT( slotQualityMetricChanged( int ) ) );
|
||||
connect( m_mapperQualityMetric, SIGNAL( mapped( int ) ), this, SLOT( slotQualityMetricChanged( int ) ) );
|
||||
connect( m_mapperQualityMetric, SIGNAL( mapped( int ) ), this,
|
||||
SLOT( slotQualityMetricChanged( int ) ) );
|
||||
|
||||
slotQualityMetricChanged( 0 );
|
||||
|
||||
return m_pcQualityHandleDock;
|
||||
}
|
||||
|
||||
void QualityHandle::updateMenus()
|
||||
Void QualityHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcCurrentVideoSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
bool hasSubWindow = pcCurrentVideoSubWindow ? true : false;
|
||||
bool hasReference = false;
|
||||
bool isReference = false;
|
||||
VideoSubWindow* pcCurrentVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
Bool hasSubWindow = pcCurrentVideoSubWindow ? true : false;
|
||||
Bool hasReference = false;
|
||||
Bool isReference = false;
|
||||
|
||||
if( hasSubWindow )
|
||||
{
|
||||
@@ -111,7 +117,7 @@ void QualityHandle::updateMenus()
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( pcVideoSubWindow->getRefSubWindow() == pcCurrentVideoSubWindow )
|
||||
@@ -132,35 +138,36 @@ void QualityHandle::updateMenus()
|
||||
m_pcQualityHandleSideBar->updateSideBar( hasSubWindow );
|
||||
}
|
||||
|
||||
void QualityHandle::readSettings()
|
||||
Void QualityHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
int metric = appSettings.value( "QualityHandle/Metric", 0 ).toInt();
|
||||
Int metric = appSettings.value( "QualityHandle/Metric", 0 ).toInt();
|
||||
slotQualityMetricChanged( metric );
|
||||
if( !appSettings.value( "QualityHandle/QualitySideBar", true ).toBool() )
|
||||
m_pcQualityHandleDock->close();
|
||||
}
|
||||
|
||||
void QualityHandle::writeSettings()
|
||||
Void QualityHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "QualityHandle/Metric", m_iQualityMetricIdx );
|
||||
appSettings.setValue( "QualityHandle/QualitySideBar", m_pcQualityHandleDock->isVisible() );
|
||||
}
|
||||
|
||||
void QualityHandle::update( VideoSubWindow* currSubWindow )
|
||||
Void QualityHandle::update( VideoSubWindow* currSubWindow )
|
||||
{
|
||||
m_pcQualityHandleSideBar->updateCurrentWindow( currSubWindow );
|
||||
}
|
||||
|
||||
void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
Void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
{
|
||||
unsigned numberOfWindows = apcWindowList.size();
|
||||
std::uint64_t currFrames = 0;
|
||||
std::uint64_t numberOfFrames = -1;
|
||||
QVector<Double>* padQualityValues;
|
||||
UInt numberOfWindows = apcWindowList.size();
|
||||
UInt64 currFrames = 0;
|
||||
UInt64 numberOfFrames = INT_MAX;
|
||||
|
||||
//! Check reference window
|
||||
for( unsigned i = 0; i < numberOfWindows; i++ )
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
if( !apcWindowList.at( i )->getRefSubWindow() )
|
||||
{
|
||||
@@ -169,66 +176,64 @@ void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
}
|
||||
VideoSubWindow* pcReferenceWindow = apcWindowList.at( 0 )->getRefSubWindow();
|
||||
|
||||
numberOfFrames = pcReferenceWindow->getFrameNum();
|
||||
for( unsigned i = 0; i < numberOfWindows; i++ )
|
||||
numberOfFrames = pcReferenceWindow->getInputStream()->getFrameNum();
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
currFrames = apcWindowList.at( i )->getFrameNum();
|
||||
currFrames = apcWindowList.at( i )->getInputStream()->getFrameNum();
|
||||
if( currFrames < numberOfFrames )
|
||||
numberOfFrames = currFrames;
|
||||
apcWindowList.at( i )->stop();
|
||||
}
|
||||
pcReferenceWindow->stop();
|
||||
|
||||
ProgressBar* pcProgressBar = new ProgressBar( m_pcParent, numberOfFrames );
|
||||
ProgressBar* pcProgressBar = new ProgressBar( m_pcParet, numberOfFrames );
|
||||
|
||||
QVector<double>* padQualityValues = new QVector<double>[numberOfWindows + 1];
|
||||
double* padAverageQuality = new double[numberOfWindows + 1];
|
||||
padQualityValues = new QVector<Double>[numberOfWindows + 1];
|
||||
|
||||
for( unsigned i = 0; i < numberOfWindows + 1; i++ )
|
||||
{
|
||||
padAverageQuality[i] = 0;
|
||||
}
|
||||
|
||||
CalypFrame* pcReferenceFrame;
|
||||
CalypFrame* pcCurrFrame;
|
||||
for( unsigned int f = 0; f < numberOfFrames; f++ )
|
||||
PlaYUVerFrame* pcReferenceFrame;
|
||||
PlaYUVerFrame* pcCurrFrame;
|
||||
for( UInt f = 0; f < numberOfFrames; f++ )
|
||||
{
|
||||
padQualityValues[0].append( f );
|
||||
pcReferenceFrame = pcReferenceWindow->getCurrFrame();
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
pcCurrFrame = apcWindowList.at( i )->getCurrFrame();
|
||||
double dCurrentQuality = pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, CLP_LUMA );
|
||||
padAverageQuality[i + 1] = ( padAverageQuality[i + 1] * double( f ) + dCurrentQuality ) / double( f + 1 );
|
||||
padQualityValues[i + 1].append( dCurrentQuality );
|
||||
apcWindowList.at( i )->advanceOneFrame();
|
||||
padQualityValues[i + 1].append(
|
||||
pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, LUMA ) );
|
||||
apcWindowList.at( i )->seekRelativeEvent( true );
|
||||
}
|
||||
pcReferenceWindow->advanceOneFrame();
|
||||
pcReferenceWindow->seekRelativeEvent( true );
|
||||
pcProgressBar->incrementProgress( 1 );
|
||||
}
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
apcWindowList.at( i )->stop();
|
||||
}
|
||||
pcReferenceWindow->stop();
|
||||
|
||||
QString qualityName = QString::fromStdString( CalypFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] );
|
||||
QString qualityUnits = QString::fromStdString( CalypFrame::supportedQualityMetricsUnitsList()[m_iQualityMetricIdx] );
|
||||
|
||||
QString plotWindowTitle( QStringLiteral( "Quality" ) );
|
||||
if( apcWindowList.size() == 1 )
|
||||
{
|
||||
plotWindowTitle += " - " + apcWindowList.at( 0 )->getWindowName();
|
||||
}
|
||||
PlotSubWindow* pcPlotWindow = new PlotSubWindow( plotWindowTitle );
|
||||
pcPlotWindow->setAxisName( "Frame Number", QString( "%1 [%2]" ).arg( qualityName ).arg( qualityUnits ) );
|
||||
pcPlotWindow->setAxisName(
|
||||
"Frame Number",
|
||||
QString::fromStdString( PlaYUVerFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) );
|
||||
|
||||
QString key;
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
if( apcWindowList.size() > 1 )
|
||||
{
|
||||
key = apcWindowList.at( i )->getWindowName();
|
||||
key = QString( "[%1 %2] " ).arg( padAverageQuality[i + 1] ).arg( qualityUnits ) + key;
|
||||
pcPlotWindow->addPlot( padQualityValues[0], padQualityValues[i + 1], key );
|
||||
QString key;
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
key = apcWindowList.at( i )->getWindowName();
|
||||
pcPlotWindow->addPlot( padQualityValues[0], padQualityValues[i + 1], key );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pcPlotWindow->addPlot( padQualityValues[0], padQualityValues[1] );
|
||||
}
|
||||
|
||||
m_pcMainWindowManager->addSubWindow( pcPlotWindow );
|
||||
@@ -237,7 +242,7 @@ void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
pcProgressBar->close();
|
||||
}
|
||||
|
||||
void QualityHandle::slotQualityMetricChanged( int idx )
|
||||
Void QualityHandle::slotQualityMetricChanged( Int idx )
|
||||
{
|
||||
m_actionGroupQualityMetric->actions().at( idx )->setChecked( true );
|
||||
m_pcQualityHandleSideBar->updateQualityMetric( idx );
|
||||
@@ -245,15 +250,16 @@ void QualityHandle::slotQualityMetricChanged( int idx )
|
||||
m_iQualityMetricIdx = idx;
|
||||
}
|
||||
|
||||
void QualityHandle::slotSelectCurrentAsReference()
|
||||
Void QualityHandle::slotSelectCurrentAsReference()
|
||||
{
|
||||
VideoSubWindow* pcRefSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
VideoSubWindow* pcRefSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcRefSubWindow )
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( pcVideoSubWindow != pcRefSubWindow )
|
||||
@@ -265,9 +271,10 @@ void QualityHandle::slotSelectCurrentAsReference()
|
||||
}
|
||||
}
|
||||
|
||||
void QualityHandle::slotPlotQualitySingle()
|
||||
Void QualityHandle::slotPlotQualitySingle()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
if( pcSubWindow->getRefSubWindow() )
|
||||
@@ -289,9 +296,10 @@ void QualityHandle::slotPlotQualitySingle()
|
||||
}
|
||||
}
|
||||
|
||||
void QualityHandle::slotPlotQualitySeveral()
|
||||
Void QualityHandle::slotPlotQualitySeveral()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
QVector<VideoSubWindow*> apcWindowList;
|
||||
@@ -305,7 +313,7 @@ void QualityHandle::slotPlotQualitySeveral()
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( pcVideoSubWindow->getRefSubWindow() == pcRefSubWindow )
|
||||
|
||||
+25
-22
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,37 +25,40 @@
|
||||
#ifndef __QUALITYMEASUREMENT_H__
|
||||
#define __QUALITYMEASUREMENT_H__
|
||||
|
||||
#include <QFuture>
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "QualityMeasurementSidebar.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include <QtCore>
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "QFuture"
|
||||
#include "QualityMeasurementSidebar.h"
|
||||
|
||||
class SubWindowHandle;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class VideoSubWindow;
|
||||
|
||||
class QualityHandle : public QObject
|
||||
class QualityHandle : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QualityHandle( QWidget*, SubWindowHandle* );
|
||||
QualityHandle( QWidget*, PlaYUVerSubWindowHandle* );
|
||||
~QualityHandle();
|
||||
|
||||
void createActions();
|
||||
Void createActions();
|
||||
QMenu* createMenu();
|
||||
QDockWidget* createDock();
|
||||
void updateMenus();
|
||||
Void updateMenus();
|
||||
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
void update( VideoSubWindow* currSubWindow );
|
||||
Void update( VideoSubWindow* currSubWindow );
|
||||
|
||||
private:
|
||||
QWidget* m_pcParent;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
QWidget* m_pcParet;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -67,7 +70,7 @@ private:
|
||||
QVector<QAction*> m_arrayActions;
|
||||
QActionGroup* m_actionGroupQualityMetric;
|
||||
QSignalMapper* m_mapperQualityMetric;
|
||||
int m_iQualityMetricIdx;
|
||||
Int m_iQualityMetricIdx;
|
||||
|
||||
QMenu* m_pcMenuQuality;
|
||||
QMenu* m_pcSubMenuQualityMetrics;
|
||||
@@ -75,8 +78,8 @@ private:
|
||||
QDockWidget* m_pcQualityHandleDock;
|
||||
QualityMeasurementSidebar* m_pcQualityHandleSideBar;
|
||||
|
||||
QFuture<void> m_cMeasurementResult;
|
||||
void measureQuality( QVector<VideoSubWindow*> apcWindowList );
|
||||
QFuture<Void> m_cMeasurementResult;
|
||||
Void measureQuality( QVector<VideoSubWindow*> apcWindowList );
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,13 +23,12 @@
|
||||
*/
|
||||
|
||||
#include "QualityMeasurementSidebar.h"
|
||||
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include <QtGui>
|
||||
|
||||
#include "SubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, SubWindowHandle* windowManager )
|
||||
QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager )
|
||||
: QWidget( parent ), m_pcMainWindowManager( windowManager ), m_pcCurrentVideoSubWindow( NULL )
|
||||
{
|
||||
// Side bar area -----------------------------------------------------
|
||||
@@ -44,9 +43,9 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, SubWindow
|
||||
RecLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
|
||||
|
||||
m_comboBoxMetric = new QComboBox;
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedQualityMetricsList().size(); i++ )
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
m_comboBoxMetric->insertItem( i, CalypFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
m_comboBoxMetric->insertItem( i, PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
}
|
||||
m_comboBoxMetric->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
||||
m_comboBoxMetric->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||
@@ -64,34 +63,35 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, SubWindow
|
||||
mainLayout->addWidget( RefLabel, 1, 0, Qt::AlignLeft );
|
||||
mainLayout->addWidget( m_comboBoxRef, 1, 1, 1, 2, Qt::AlignLeft );
|
||||
|
||||
m_ppcLabelQualityLabel[CLP_LUMA] = new QLabel( "PSNR Y:" );
|
||||
m_ppcLabelQualityLabel[CLP_LUMA]->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityValue[CLP_LUMA] = new QLabel;
|
||||
m_ppcLabelQualityValue[CLP_LUMA]->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityLabel[LUMA] = new QLabel( "PSNR Y:" );
|
||||
m_ppcLabelQualityLabel[LUMA]->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityValue[LUMA] = new QLabel;
|
||||
m_ppcLabelQualityValue[LUMA]->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
m_ppcLabelQualityLabel[CLP_CHROMA_U] = new QLabel( "PSNR U:" );
|
||||
m_ppcLabelQualityLabel[CLP_CHROMA_U]->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityValue[CLP_CHROMA_U] = new QLabel;
|
||||
m_ppcLabelQualityValue[CLP_CHROMA_U]->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityLabel[CHROMA_U] = new QLabel( "PSNR U:" );
|
||||
m_ppcLabelQualityLabel[CHROMA_U]->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityValue[CHROMA_U] = new QLabel;
|
||||
m_ppcLabelQualityValue[CHROMA_U]->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
m_ppcLabelQualityLabel[CLP_CHROMA_V] = new QLabel( "PSNR V:" );
|
||||
m_ppcLabelQualityLabel[CLP_CHROMA_V]->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityValue[CLP_CHROMA_V] = new QLabel;
|
||||
m_ppcLabelQualityValue[CLP_CHROMA_V]->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityLabel[CHROMA_V] = new QLabel( "PSNR V:" );
|
||||
m_ppcLabelQualityLabel[CHROMA_V]->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
m_ppcLabelQualityValue[CHROMA_V] = new QLabel;
|
||||
m_ppcLabelQualityValue[CHROMA_V]->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||
|
||||
QGridLayout* qualityResultsLayout = new QGridLayout;
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityLabel[CLP_LUMA], 0, 0 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityValue[CLP_LUMA], 0, 1 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityLabel[CLP_CHROMA_U], 1, 0 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityValue[CLP_CHROMA_U], 1, 1 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityLabel[CLP_CHROMA_V], 2, 0 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityValue[CLP_CHROMA_V], 2, 1 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityLabel[LUMA], 0, 0 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityValue[LUMA], 0, 1 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityLabel[CHROMA_U], 1, 0 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityValue[CHROMA_U], 1, 1 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityLabel[CHROMA_V], 2, 0 );
|
||||
qualityResultsLayout->addWidget( m_ppcLabelQualityValue[CHROMA_V], 2, 1 );
|
||||
|
||||
// QGroupBox *statisticsGroup = new QGroupBox( tr( "Quality" ) );
|
||||
QGroupBox* statisticsGroup = new QGroupBox;
|
||||
statisticsGroup->setLayout( qualityResultsLayout );
|
||||
statisticsGroup->setWhatsThis( tr( "<p>Here you can see the quality results calculated for the "
|
||||
"selected windows." ) );
|
||||
statisticsGroup->setWhatsThis(
|
||||
tr( "<p>Here you can see the quality results calculated for the "
|
||||
"selected windows." ) );
|
||||
|
||||
mainLayout->addWidget( statisticsGroup, 4, 0, 3, 3 );
|
||||
|
||||
@@ -99,7 +99,8 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, SubWindow
|
||||
setLayout( mainLayout );
|
||||
|
||||
connect( m_comboBoxRef, SIGNAL( activated( int ) ), this, SLOT( slotReferenceChanged( int ) ) );
|
||||
connect( m_comboBoxMetric, SIGNAL( currentIndexChanged( int ) ), this, SLOT( slotQualityMetricChanged( int ) ) );
|
||||
connect( m_comboBoxMetric, SIGNAL( currentIndexChanged( int ) ), this,
|
||||
SLOT( slotQualityMetricChanged( int ) ) );
|
||||
}
|
||||
|
||||
QualityMeasurementSidebar::~QualityMeasurementSidebar() {}
|
||||
@@ -114,22 +115,23 @@ QSize QualityMeasurementSidebar::sizeHint() const
|
||||
return currSize;
|
||||
}
|
||||
|
||||
void QualityMeasurementSidebar::updateSideBar( bool hasSubWindow )
|
||||
Void QualityMeasurementSidebar::updateSideBar( Bool hasSubWindow )
|
||||
{
|
||||
if( !hasSubWindow )
|
||||
m_comboBoxRef->clear();
|
||||
setEnabled( hasSubWindow );
|
||||
}
|
||||
|
||||
void QualityMeasurementSidebar::updateSubWindowList()
|
||||
Void QualityMeasurementSidebar::updateSubWindowList()
|
||||
{
|
||||
QString currSubWindowName;
|
||||
m_pcWindowListNames.clear();
|
||||
m_pcVideoWindowList.clear();
|
||||
|
||||
VideoSubWindow* pcVideoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcVideoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( m_pcCurrentVideoSubWindow == pcVideoSubWindow )
|
||||
@@ -138,7 +140,8 @@ void QualityMeasurementSidebar::updateSubWindowList()
|
||||
}
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt( pcVideoSubWindow->getCurrFrame() ) )
|
||||
if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt(
|
||||
pcVideoSubWindow->getCurrFrame() ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -154,19 +157,19 @@ void QualityMeasurementSidebar::updateSubWindowList()
|
||||
{
|
||||
if( VideoSubWindow* refSubWindow = m_pcCurrentVideoSubWindow->getRefSubWindow() )
|
||||
{
|
||||
int index = m_pcVideoWindowList.indexOf( refSubWindow );
|
||||
Int index = m_pcVideoWindowList.indexOf( refSubWindow );
|
||||
m_comboBoxRef->setCurrentIndex( index );
|
||||
}
|
||||
}
|
||||
// m_comboBoxRef->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
||||
}
|
||||
|
||||
void QualityMeasurementSidebar::updateCurrentWindow( VideoSubWindow* subWindow )
|
||||
Void QualityMeasurementSidebar::updateCurrentWindow( VideoSubWindow* subWindow )
|
||||
{
|
||||
m_pcCurrentVideoSubWindow = subWindow;
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
int index = -1;
|
||||
Int index = -1;
|
||||
if( VideoSubWindow* refSubWindow = m_pcCurrentVideoSubWindow->getRefSubWindow() )
|
||||
{
|
||||
index = m_pcVideoWindowList.indexOf( refSubWindow );
|
||||
@@ -177,7 +180,7 @@ void QualityMeasurementSidebar::updateCurrentWindow( VideoSubWindow* subWindow )
|
||||
}
|
||||
}
|
||||
|
||||
void QualityMeasurementSidebar::updateSidebarData()
|
||||
Void QualityMeasurementSidebar::updateSidebarData()
|
||||
{
|
||||
QString zeroValue( "0.0000" );
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
@@ -185,13 +188,11 @@ void QualityMeasurementSidebar::updateSidebarData()
|
||||
VideoSubWindow* refSubWindow = m_pcCurrentVideoSubWindow->getRefSubWindow();
|
||||
if( refSubWindow )
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
|
||||
CalypFrame* currFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
CalypFrame* refFrame = refSubWindow->getCurrFrame();
|
||||
double quality;
|
||||
PlaYUVerFrame* currFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
PlaYUVerFrame* refFrame = refSubWindow->getCurrFrame();
|
||||
Double quality;
|
||||
QString value;
|
||||
unsigned int component = 0;
|
||||
UInt component = 0;
|
||||
for( ; component < currFrame->getNumberChannels(); component++ )
|
||||
{
|
||||
quality = currFrame->getQuality( m_comboBoxMetric->currentIndex(), refFrame, component );
|
||||
@@ -199,9 +200,9 @@ void QualityMeasurementSidebar::updateSidebarData()
|
||||
}
|
||||
for( ; component < 3; component++ )
|
||||
{
|
||||
quality = currFrame->getQuality( m_comboBoxMetric->currentIndex(), refFrame, component );
|
||||
m_ppcLabelQualityValue[component]->setText( zeroValue );
|
||||
}
|
||||
QApplication::restoreOverrideCursor();
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -209,23 +210,23 @@ void QualityMeasurementSidebar::updateSidebarData()
|
||||
m_comboBoxRef->setCurrentIndex( -1 );
|
||||
}
|
||||
}
|
||||
for( int component = 0; component < 3; component++ )
|
||||
for( Int component = 0; component < 3; component++ )
|
||||
{
|
||||
m_ppcLabelQualityValue[component]->setText( zeroValue );
|
||||
}
|
||||
}
|
||||
|
||||
void QualityMeasurementSidebar::updateQualityMetric( int idx )
|
||||
Void QualityMeasurementSidebar::updateQualityMetric( Int idx )
|
||||
{
|
||||
m_comboBoxMetric->setCurrentIndex( idx );
|
||||
QString labelQuality( CalypFrame::supportedQualityMetricsList()[idx].c_str() );
|
||||
m_ppcLabelQualityLabel[CLP_LUMA]->setText( labelQuality + " Y" );
|
||||
m_ppcLabelQualityLabel[CLP_CHROMA_U]->setText( labelQuality + " U" );
|
||||
m_ppcLabelQualityLabel[CLP_CHROMA_V]->setText( labelQuality + " V" );
|
||||
QString labelQuality( PlaYUVerFrame::supportedQualityMetricsList()[idx].c_str() );
|
||||
m_ppcLabelQualityLabel[LUMA]->setText( labelQuality + " Y" );
|
||||
m_ppcLabelQualityLabel[CHROMA_U]->setText( labelQuality + " U" );
|
||||
m_ppcLabelQualityLabel[CHROMA_V]->setText( labelQuality + " V" );
|
||||
updateSidebarData();
|
||||
}
|
||||
|
||||
void QualityMeasurementSidebar::slotReferenceChanged( int index )
|
||||
Void QualityMeasurementSidebar::slotReferenceChanged( Int index )
|
||||
{
|
||||
if( index > -1 && m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
@@ -247,7 +248,7 @@ void QualityMeasurementSidebar::slotReferenceChanged( int index )
|
||||
}
|
||||
}
|
||||
|
||||
void QualityMeasurementSidebar::slotQualityMetricChanged( int idx )
|
||||
Void QualityMeasurementSidebar::slotQualityMetricChanged( Int idx )
|
||||
{
|
||||
emit signalQualityMetricChanged( idx );
|
||||
// updateQualityMetric( idx );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,35 +25,39 @@
|
||||
#ifndef __QUALITYMEASUREMENTSIDEBAR_H__
|
||||
#define __QUALITYMEASUREMENTSIDEBAR_H__
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "HistogramWidget.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypStream.h"
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "HistogramWidget.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
|
||||
class SubWindowHandle;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class VideoSubWindow;
|
||||
|
||||
class QualityMeasurementSidebar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QualityMeasurementSidebar( QWidget*, SubWindowHandle* );
|
||||
QualityMeasurementSidebar( QWidget*, PlaYUVerSubWindowHandle* );
|
||||
~QualityMeasurementSidebar();
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
void updateSideBar( bool hasSubWindow );
|
||||
Void updateSideBar( Bool hasSubWindow );
|
||||
|
||||
void updateSubWindowList();
|
||||
void updateCurrentWindow( VideoSubWindow* );
|
||||
void updateSidebarData();
|
||||
void updateQualityMetric( int );
|
||||
Void updateSubWindowList();
|
||||
Void updateCurrentWindow( VideoSubWindow* );
|
||||
Void updateSidebarData();
|
||||
Void updateQualityMetric( Int );
|
||||
|
||||
private:
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
|
||||
QVector<VideoSubWindow*> m_pcVideoWindowList;
|
||||
QStringList m_pcWindowListNames;
|
||||
@@ -1,167 +0,0 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Santos (joaompssantos@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 ResourceHandle.cpp
|
||||
* \brief Handle resources
|
||||
*/
|
||||
|
||||
#include "ResourceHandle.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QEvent>
|
||||
#include <QFileInfo>
|
||||
#include <QMutex>
|
||||
#include <QThread>
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
ResourceWorker::ResourceWorker( std::shared_ptr<CalypStream> stream )
|
||||
{
|
||||
m_pcStream = stream;
|
||||
}
|
||||
|
||||
void ResourceWorker::stop()
|
||||
{
|
||||
m_bStop = true;
|
||||
wake();
|
||||
wait();
|
||||
}
|
||||
|
||||
void ResourceWorker::wake()
|
||||
{
|
||||
m_Mutex.lock();
|
||||
m_ResourceIdle.wakeAll();
|
||||
m_Mutex.unlock();
|
||||
}
|
||||
|
||||
void ResourceWorker::run()
|
||||
{
|
||||
m_bStop = false;
|
||||
// Loop forever
|
||||
while( !m_bStop )
|
||||
{
|
||||
//auto start = std::chrono::steady_clock::now();
|
||||
m_pcStream->readNextFrameFillRGBBuffer();
|
||||
// auto end = std::chrono::steady_clock::now();
|
||||
// std::cout << "Elapsed time reading and processing a frame: "
|
||||
// << std::chrono::duration_cast<std::chrono::milliseconds>( end - start ).count()
|
||||
// << " ms" << std::endl;
|
||||
|
||||
// if( !m_pcStream->hasWritingSlot() )
|
||||
// {
|
||||
// m_Mutex.lock();
|
||||
// m_ResourceIdle.wait( &m_Mutex );
|
||||
// m_Mutex.unlock();
|
||||
// }
|
||||
while( !m_bStop && !m_pcStream->hasWritingSlot() )
|
||||
{
|
||||
// Wait here
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ResourceHandle::ResourceHandle()
|
||||
{
|
||||
}
|
||||
|
||||
auto ResourceHandle::addResource() -> std::size_t
|
||||
{
|
||||
auto resource_id = unique_id;
|
||||
unique_id++;
|
||||
auto newStreamResource = std::make_shared<CalypStream>();
|
||||
auto newStreamResourceWorker = std::make_unique<ResourceWorker>( newStreamResource );
|
||||
m_apcStreamResourcesList[resource_id] = newStreamResource;
|
||||
m_apcStreamResourcesWorkersList[resource_id] = std::move( newStreamResourceWorker );
|
||||
return resource_id;
|
||||
}
|
||||
|
||||
auto ResourceHandle::getResource( CalypStream* ptr ) -> std::size_t
|
||||
{
|
||||
if( ptr != nullptr )
|
||||
{
|
||||
for( std::size_t i = 0; i < m_apcStreamResourcesList.size(); i++ )
|
||||
{
|
||||
if( m_apcStreamResourcesList[i].get() == ptr )
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return addResource();
|
||||
}
|
||||
|
||||
auto ResourceHandle::getResourceAsset( std::size_t id ) -> CalypStream*
|
||||
{
|
||||
if( m_apcStreamResourcesWorkersList.count( id ) )
|
||||
{
|
||||
return m_apcStreamResourcesList[id].get();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ResourceHandle::removeResource( std::size_t id )
|
||||
{
|
||||
if( !m_apcStreamResourcesWorkersList.count( id ) )
|
||||
{
|
||||
assert( false );
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove worker first
|
||||
m_apcStreamResourcesWorkersList[id]->stop();
|
||||
m_apcStreamResourcesWorkersList[id] = nullptr;
|
||||
|
||||
// Then the underlying stream
|
||||
m_apcStreamResourcesList[id] = nullptr;
|
||||
}
|
||||
|
||||
void ResourceHandle::stopResourceWorker( std::size_t id )
|
||||
{
|
||||
if( !m_apcStreamResourcesWorkersList.count( id ) )
|
||||
{
|
||||
assert( false );
|
||||
return;
|
||||
}
|
||||
m_apcStreamResourcesWorkersList[id]->stop();
|
||||
}
|
||||
|
||||
void ResourceHandle::startResourceWorker( std::size_t id )
|
||||
{
|
||||
if( !m_apcStreamResourcesWorkersList.count( id ) )
|
||||
{
|
||||
assert( false );
|
||||
return;
|
||||
}
|
||||
m_apcStreamResourcesWorkersList[id]->setObjectName(
|
||||
"RW-" +
|
||||
QFileInfo( QString::fromStdString( m_apcStreamResourcesList[id]->getFileName() ) ).completeBaseName() );
|
||||
m_apcStreamResourcesWorkersList[id]->start();
|
||||
}
|
||||
|
||||
void ResourceHandle::wakeResourceWorker( std::size_t id )
|
||||
{
|
||||
if( !m_apcStreamResourcesWorkersList.count( id ) )
|
||||
{
|
||||
assert( false );
|
||||
return;
|
||||
}
|
||||
m_apcStreamResourcesWorkersList[id]->wake();
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/* 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 ResourceHandle.h
|
||||
* \brief Handle multiple sub-windows
|
||||
*/
|
||||
|
||||
#ifndef __RESOURCEHANDLE_H__
|
||||
#define __RESOURCEHANDLE_H__
|
||||
|
||||
#include <QMutex>
|
||||
#include <QThread>
|
||||
#include <QVector>
|
||||
#include <QWaitCondition>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class ResourceWorker : public QThread
|
||||
{
|
||||
private:
|
||||
QMutex m_Mutex;
|
||||
QWaitCondition m_ResourceIdle;
|
||||
std::shared_ptr<CalypStream> m_pcStream;
|
||||
bool m_bStop{ false };
|
||||
|
||||
public:
|
||||
ResourceWorker( std::shared_ptr<CalypStream> stream );
|
||||
void stop();
|
||||
void wake();
|
||||
void run();
|
||||
};
|
||||
|
||||
class ResourceHandle
|
||||
{
|
||||
public:
|
||||
ResourceHandle();
|
||||
~ResourceHandle() = default;
|
||||
|
||||
auto getResource( CalypStream* ptr ) -> std::size_t;
|
||||
auto getResourceAsset( std::size_t id ) -> CalypStream*;
|
||||
void removeResource( std::size_t id );
|
||||
void stopResourceWorker( std::size_t id );
|
||||
void startResourceWorker( std::size_t id );
|
||||
void wakeResourceWorker( std::size_t id );
|
||||
|
||||
private:
|
||||
auto addResource() -> std::size_t;
|
||||
|
||||
private:
|
||||
std::size_t unique_id{ 0 };
|
||||
std::map<std::size_t, std::shared_ptr<CalypStream>> m_apcStreamResourcesList;
|
||||
std::map<std::size_t, std::unique_ptr<ResourceWorker>> m_apcStreamResourcesWorkersList;
|
||||
};
|
||||
|
||||
#endif // __RESOURCEHANDLE_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,17 +23,14 @@
|
||||
*/
|
||||
|
||||
#include "SeekStreamDialog.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QSpinBox>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
SeekStreamDialog::SeekStreamDialog( const CalypStream* pcCurrStream, QWidget* parent )
|
||||
SeekStreamDialog::SeekStreamDialog( PlaYUVerStream* pcCurrStream, QWidget* parent )
|
||||
: QDialog( parent, Qt::Dialog | Qt::WindowTitleHint ), m_iSelectedFrameNum()
|
||||
{
|
||||
m_iSelectedFrameNum = pcCurrStream->getCurrFrameNum();
|
||||
@@ -60,7 +57,8 @@ SeekStreamDialog::SeekStreamDialog( const CalypStream* pcCurrStream, QWidget* pa
|
||||
QVBoxLayout* verticalLayout = new QVBoxLayout;
|
||||
QHBoxLayout* horizontalLayout = new QHBoxLayout;
|
||||
horizontalLayout->addWidget( pcLabel );
|
||||
horizontalLayout->addItem( new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
horizontalLayout->addItem(
|
||||
new QSpacerItem( 20, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
|
||||
horizontalLayout->addWidget( m_spinFrameNum );
|
||||
verticalLayout->addLayout( horizontalLayout );
|
||||
verticalLayout->addWidget( dialogButtonOkCancel, Qt::AlignRight );
|
||||
@@ -70,7 +68,7 @@ SeekStreamDialog::SeekStreamDialog( const CalypStream* pcCurrStream, QWidget* pa
|
||||
connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
}
|
||||
|
||||
int SeekStreamDialog::runDialog()
|
||||
Int SeekStreamDialog::runDialog()
|
||||
{
|
||||
m_spinFrameNum->selectAll();
|
||||
if( exec() == QDialog::Rejected )
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,15 +25,12 @@
|
||||
#ifndef __SEEKSTREAMDIALOG_H__
|
||||
#define __SEEKSTREAMDIALOG_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
#include "config.h"
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QSpinBox;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -42,12 +39,12 @@ class SeekStreamDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SeekStreamDialog( const CalypStream* pcCurrStream, QWidget* parent = 0 );
|
||||
int runDialog();
|
||||
SeekStreamDialog( PlaYUVerStream* pcCurrStream, QWidget* parent = 0 );
|
||||
Int runDialog();
|
||||
|
||||
private:
|
||||
QSpinBox* m_spinFrameNum;
|
||||
int m_iSelectedFrameNum;
|
||||
Int m_iSelectedFrameNum;
|
||||
};
|
||||
|
||||
#endif // __MODULEHANDLEOPTDIALOG_H__
|
||||
+15
-29
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,18 +23,14 @@
|
||||
*/
|
||||
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
#include "PlaYUVerMdiSubWindow.h"
|
||||
#include <QCloseEvent>
|
||||
#include <QFocusEvent>
|
||||
#include <QGuiApplication>
|
||||
#include <QHBoxLayout>
|
||||
#include <QIcon>
|
||||
#include <QScreen>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "MdiSubWindow.h"
|
||||
|
||||
SubWindowAbstract::SubWindowAbstract( QWidget* parent, unsigned int category )
|
||||
SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category )
|
||||
: QWidget( parent ), m_cSubWindow( NULL )
|
||||
{
|
||||
setParent( parent );
|
||||
@@ -42,9 +38,9 @@ SubWindowAbstract::SubWindowAbstract( QWidget* parent, unsigned int category )
|
||||
// setFocusPolicy( Qt::WheelFocus );
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
setBackgroundRole( QPalette::Window );
|
||||
setBackgroundRole( QPalette::Background );
|
||||
|
||||
setWindowIcon( QIcon( ":/logos/calyp-icon.png" ) );
|
||||
setWindowIcon( QIcon( ":/images/playuver.png" ) );
|
||||
|
||||
// setWidgetResizable( true );
|
||||
m_pcLayout = NULL;
|
||||
@@ -59,7 +55,7 @@ SubWindowAbstract::~SubWindowAbstract()
|
||||
return;
|
||||
}
|
||||
|
||||
void SubWindowAbstract::setWidget( QWidget* widget )
|
||||
Void SubWindowAbstract::setWidget( QWidget* widget )
|
||||
{
|
||||
QGridLayout* layout = new QGridLayout( this );
|
||||
layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
@@ -71,7 +67,7 @@ void SubWindowAbstract::onDestroyed()
|
||||
return;
|
||||
}
|
||||
|
||||
void SubWindowAbstract::setWindowName( QString name )
|
||||
Void SubWindowAbstract::setWindowName( QString name )
|
||||
{
|
||||
m_cWindowName = name;
|
||||
setWindowTitle( m_cWindowName );
|
||||
@@ -82,43 +78,33 @@ QString SubWindowAbstract::getWindowName()
|
||||
return m_cWindowName;
|
||||
}
|
||||
|
||||
bool SubWindowAbstract::mayClose()
|
||||
Bool SubWindowAbstract::mayClose()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QSize SubWindowAbstract::sizeHint() const
|
||||
{
|
||||
QSize maxSize;
|
||||
QWidget* p = parentWidget();
|
||||
if( p )
|
||||
{
|
||||
maxSize = p->size();
|
||||
}
|
||||
else
|
||||
{
|
||||
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
}
|
||||
return sizeHint( maxSize );
|
||||
return QSize();
|
||||
}
|
||||
|
||||
QSize SubWindowAbstract::sizeHint( const QSize& maxSize ) const
|
||||
QSize SubWindowAbstract::sizeHint( const QSize& ) const
|
||||
{
|
||||
return QSize();
|
||||
}
|
||||
|
||||
void SubWindowAbstract::focusInEvent( QFocusEvent* event )
|
||||
Void SubWindowAbstract::focusInEvent( QFocusEvent* event )
|
||||
{
|
||||
emit aboutToActivate( this );
|
||||
}
|
||||
|
||||
void SubWindowAbstract::closeEvent( QCloseEvent* event )
|
||||
Void SubWindowAbstract::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
emit aboutToClose( this );
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void SubWindowAbstract::closeSubWindow()
|
||||
Void SubWindowAbstract::closeSubWindow()
|
||||
{
|
||||
close();
|
||||
if( m_cSubWindow )
|
||||
|
||||
+30
-31
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -19,14 +19,14 @@
|
||||
|
||||
/**
|
||||
* \file SubWindowAbstract.h
|
||||
* \ingroup CalypApp CalypApp_Subwindow
|
||||
* \ingroup PlaYUVerApp PlaYUVerApp_Subwindow
|
||||
* \brief Abstract class to handle subwindows
|
||||
*
|
||||
* @defgroup CalypApp_Subwindow SubWindow definition
|
||||
* @defgroup PlaYUVerApp_Subwindow SubWindow definition
|
||||
* @{
|
||||
* \ingroup CalypApp
|
||||
* \ingroup PlaYUVerApp
|
||||
*
|
||||
* Different SubWindow may be found in the CalypApp
|
||||
* Different SubWindow may be found in the PlaYUVerApp
|
||||
* Each one provide different functionality and serve
|
||||
* different purposes, ( e.g., displaying a video stream
|
||||
* or displaying a quality plot)
|
||||
@@ -37,19 +37,18 @@
|
||||
#ifndef __SUBWINDOWABSTRACT_H__
|
||||
#define __SUBWINDOWABSTRACT_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include <QPoint>
|
||||
#include <QSize>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QHBoxLayout;
|
||||
class QFocusEvent;
|
||||
class QCloseEvent;
|
||||
|
||||
class MdiSubWindow;
|
||||
class PlaYUVerMdiSubWindow;
|
||||
|
||||
class SubWindowAbstract : public QWidget
|
||||
{
|
||||
@@ -57,10 +56,10 @@ class SubWindowAbstract : public QWidget
|
||||
|
||||
private:
|
||||
QHBoxLayout* m_pcLayout;
|
||||
unsigned int m_uiCategory;
|
||||
UInt m_uiCategory;
|
||||
QString m_cWindowName;
|
||||
|
||||
MdiSubWindow* m_cSubWindow;
|
||||
PlaYUVerMdiSubWindow* m_cSubWindow;
|
||||
|
||||
public:
|
||||
enum SubWindowCategory
|
||||
@@ -73,50 +72,50 @@ public:
|
||||
};
|
||||
Q_DECLARE_FLAGS( SubWindowCategories, SubWindowCategory )
|
||||
|
||||
SubWindowAbstract( QWidget*, unsigned int );
|
||||
SubWindowAbstract( QWidget*, UInt );
|
||||
~SubWindowAbstract();
|
||||
|
||||
/**
|
||||
* Show the image at its original size
|
||||
*/
|
||||
virtual void refreshSubWindow() = 0;
|
||||
virtual Void refreshSubWindow() = 0;
|
||||
|
||||
/**
|
||||
* Show the image at its original size
|
||||
*/
|
||||
virtual void normalSize() = 0;
|
||||
virtual Void normalSize() = 0;
|
||||
/**
|
||||
* Scale the image (zoomed in or out) to fit on the window.
|
||||
*/
|
||||
virtual void zoomToFit() = 0;
|
||||
virtual Void zoomToFit() = 0;
|
||||
/**
|
||||
* Scale the image (zoomed in or out) to speficied absolute zoom value (1.0 =
|
||||
* original size).
|
||||
*/
|
||||
virtual void zoomToFactor( double factor, QPoint center = QPoint() ) = 0;
|
||||
virtual Void zoomToFactor( Double factor, QPoint center = QPoint() ) = 0;
|
||||
/**
|
||||
* Scale the image by a given factor
|
||||
* @param factor factor of scale. Ex: 1.2 scale the image up by 20% and
|
||||
* 0.8 scale the image down by 25%
|
||||
*/
|
||||
virtual void scaleView( double, QPoint center = QPoint() ) = 0;
|
||||
virtual Void scaleView( Double, QPoint center = QPoint() ) = 0;
|
||||
|
||||
virtual double getScaleFactor() = 0;
|
||||
virtual Double getScaleFactor() = 0;
|
||||
|
||||
/**
|
||||
* Size related functions
|
||||
*/
|
||||
virtual QSize sizeHint() const;
|
||||
virtual QSize sizeHint( const QSize& maxSize ) const;
|
||||
virtual QSize sizeHint( const QSize& ) const;
|
||||
|
||||
/**
|
||||
* Window name
|
||||
*/
|
||||
|
||||
void setWindowName( QString );
|
||||
Void setWindowName( QString );
|
||||
QString getWindowName();
|
||||
|
||||
virtual bool mayClose();
|
||||
virtual Bool mayClose();
|
||||
|
||||
/**
|
||||
* Get category of the SubWindow
|
||||
@@ -124,33 +123,33 @@ public:
|
||||
* @note This function should be used with enum SubWindowCategories
|
||||
* with an & operation and it may belong to several categories
|
||||
*/
|
||||
unsigned int getCategory() { return m_uiCategory; }
|
||||
UInt getCategory() { return m_uiCategory; }
|
||||
/**
|
||||
* Check category of the SubWindow
|
||||
* @param checkCateory SubWindow category to check against;
|
||||
* it should be enum SubWindowCategories type
|
||||
* @return true when SubWindow belong to checkCateory
|
||||
*/
|
||||
bool checkCategory( unsigned int checkCateory ) { return m_uiCategory & checkCateory; }
|
||||
void setSubWindow( MdiSubWindow* subWindow ) { m_cSubWindow = subWindow; }
|
||||
void closeSubWindow();
|
||||
Bool checkCategory( UInt checkCateory ) { return m_uiCategory & checkCateory; }
|
||||
Void setSubWindow( PlaYUVerMdiSubWindow* subWindow ) { m_cSubWindow = subWindow; }
|
||||
Void closeSubWindow();
|
||||
|
||||
protected:
|
||||
void focusInEvent( QFocusEvent* event );
|
||||
virtual void closeEvent( QCloseEvent* event );
|
||||
void closeEvent( QCloseEvent* event );
|
||||
|
||||
void setWidget( QWidget* widget );
|
||||
Void setWidget( QWidget* widget );
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
* Notify that zoom factor was changed by internal event (e.g. by mouse wheel)
|
||||
*/
|
||||
void zoomFactorChanged( const double, const QPoint );
|
||||
void zoomFactorChanged_SWindow( const double, const QPoint );
|
||||
/**
|
||||
* Notify that scrollbar position was changed by internal event (e.g. by mouse
|
||||
* panning )
|
||||
*/
|
||||
void scrollBarMoved( const double&, const double& );
|
||||
void scrollBarMoved_SWindow( const QPoint );
|
||||
/**
|
||||
* Update stauts bars
|
||||
*/
|
||||
|
||||
+230
-299
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,53 +23,53 @@
|
||||
*/
|
||||
|
||||
#include "VideoHandle.h"
|
||||
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "FramePropertiesDock.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "SeekStreamDialog.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "WidgetFrameNumber.h"
|
||||
#include <QDockWidget>
|
||||
#include <QElapsedTimer>
|
||||
#include <QLabel>
|
||||
#include <QSignalMapper>
|
||||
#include <QSlider>
|
||||
#include <QTimer>
|
||||
#include <QToolBar>
|
||||
#include <QtGui>
|
||||
#include <memory>
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
#include <QElapsedTimer>
|
||||
#endif
|
||||
|
||||
#include "FrameNumberWidget.h"
|
||||
#include "FramePropertiesDock.h"
|
||||
#include "MainWindow.h"
|
||||
#include "SeekStreamDialog.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoStreamSubWindow.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
VideoHandle::VideoHandle( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: m_pcParent( parent ), m_pcMainWindowManager( windowManager )
|
||||
VideoHandle::VideoHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
m_pcCurrentVideoSubWindow = NULL;
|
||||
m_bIsPlaying = false;
|
||||
m_pcPlayingTimer = new QTimer( this );
|
||||
m_pcFrameRateFeedbackTimer = std::make_unique<QElapsedTimer>();
|
||||
m_pcPlayingTimer->setTimerType( Qt::PreciseTimer );
|
||||
connect( m_pcPlayingTimer, &QTimer::timeout,
|
||||
this, &VideoHandle::playEvent );
|
||||
m_pcPlayingTimer = new QTimer;
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
m_pcPlayingTimer->setTimerType( Qt::CoarseTimer );
|
||||
#endif
|
||||
connect( m_pcPlayingTimer, SIGNAL( timeout() ), this, SLOT( playEvent() ) );
|
||||
m_acPlayingSubWindows.clear();
|
||||
}
|
||||
|
||||
VideoHandle::~VideoHandle() = default;
|
||||
VideoHandle::~VideoHandle() {}
|
||||
|
||||
void VideoHandle::createActions()
|
||||
Void VideoHandle::createActions()
|
||||
{
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
m_arrayActions[PLAY_ACT] = new QAction( "Play", this );
|
||||
m_arrayActions[PLAY_ACT]->setStatusTip( "Play/Pause" );
|
||||
m_arrayActions[PLAY_ACT]->setIcon( QIcon( m_pcParent->style()->standardIcon( QStyle::SP_MediaPlay ) ) );
|
||||
m_arrayActions[PLAY_ACT]->setIcon(
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaPlay ) ) );
|
||||
m_arrayActions[PLAY_ACT]->setShortcut( Qt::Key_Space );
|
||||
connect( m_arrayActions[PLAY_ACT], SIGNAL( triggered() ), this, SLOT( play() ) );
|
||||
|
||||
m_arrayActions[STOP_ACT] = new QAction( "Stop", this );
|
||||
m_arrayActions[STOP_ACT]->setStatusTip( "Stop" );
|
||||
m_arrayActions[STOP_ACT]->setIcon( QIcon( m_pcParent->style()->standardIcon( QStyle::SP_MediaStop ) ) );
|
||||
m_arrayActions[STOP_ACT]->setIcon(
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaStop ) ) );
|
||||
connect( m_arrayActions[STOP_ACT], SIGNAL( triggered() ), this, SLOT( stop() ) );
|
||||
|
||||
m_mapperVideoSeek = new QSignalMapper( this );
|
||||
@@ -78,17 +78,19 @@ void VideoHandle::createActions()
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT] = new QAction( "Video Backward", this );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setStatusTip( "Seek backward" );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setIcon(
|
||||
QIcon( m_pcParent->style()->standardIcon( QStyle::SP_MediaSeekBackward ) ) );
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaSeekBackward ) ) );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setShortcut( Qt::Key_Left );
|
||||
connect( m_arrayActions[VIDEO_BACKWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek, SLOT( map() ) );
|
||||
connect( m_arrayActions[VIDEO_BACKWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek,
|
||||
SLOT( map() ) );
|
||||
m_mapperVideoSeek->setMapping( m_arrayActions[VIDEO_BACKWARD_ACT], 0 );
|
||||
|
||||
m_arrayActions[VIDEO_FORWARD_ACT] = new QAction( "Video Forward", this );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setStatusTip( "Seek forward" );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setIcon(
|
||||
QIcon( m_pcParent->style()->standardIcon( QStyle::SP_MediaSeekForward ) ) );
|
||||
QIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaSeekForward ) ) );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setShortcut( Qt::Key_Right );
|
||||
connect( m_arrayActions[VIDEO_FORWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek, SLOT( map() ) );
|
||||
connect( m_arrayActions[VIDEO_FORWARD_ACT], SIGNAL( triggered() ), m_mapperVideoSeek,
|
||||
SLOT( map() ) );
|
||||
m_mapperVideoSeek->setMapping( m_arrayActions[VIDEO_FORWARD_ACT], 1 );
|
||||
|
||||
m_arrayActions[VIDEO_GOTO_ACT] = new QAction( "Go to", this );
|
||||
@@ -112,19 +114,21 @@ void VideoHandle::createActions()
|
||||
m_arrayActions[VIDEO_LOCK_SELECTION_ACT]->setStatusTip(
|
||||
"Select which windows should be played synchronized. Press Ctrl while "
|
||||
"click to quickly to select all!" );
|
||||
connect( m_arrayActions[VIDEO_LOCK_SELECTION_ACT], SIGNAL( triggered() ), this, SLOT( videoSelectionButtonEvent() ) );
|
||||
connect( m_arrayActions[VIDEO_LOCK_SELECTION_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( videoSelectionButtonEvent() ) );
|
||||
|
||||
m_pcFrameSlider = new QSlider;
|
||||
m_pcFrameSlider->setOrientation( Qt::Horizontal );
|
||||
m_pcFrameSlider->setMaximumWidth( 2000 );
|
||||
m_pcFrameSlider->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ) );
|
||||
m_pcFrameSlider->setSizePolicy(
|
||||
QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ) );
|
||||
m_pcFrameSlider->setEnabled( false );
|
||||
m_pcFrameSlider->setTracking( false );
|
||||
connect( m_pcFrameSlider, SIGNAL( valueChanged( int ) ), this, SLOT( seekSliderEvent( int ) ) );
|
||||
|
||||
// ------------ Image ------------
|
||||
m_actionGroupTools = new QActionGroup( this );
|
||||
m_actionGroupTools->setExclusive( true );
|
||||
// ------------ Tools ------------
|
||||
actionGroupTools = new QActionGroup( this );
|
||||
actionGroupTools->setExclusive( true );
|
||||
|
||||
m_mapperTools = new QSignalMapper( this );
|
||||
connect( m_mapperTools, SIGNAL( mapped( int ) ), this, SLOT( setTool( int ) ) );
|
||||
@@ -135,50 +139,40 @@ void VideoHandle::createActions()
|
||||
m_arrayActions[NAVIGATION_TOOL_ACT]->setCheckable( true );
|
||||
m_arrayActions[NAVIGATION_TOOL_ACT]->setChecked( true );
|
||||
m_arrayActions[NAVIGATION_TOOL_ACT]->setShortcut( Qt::CTRL + Qt::Key_1 );
|
||||
m_actionGroupTools->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
|
||||
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
|
||||
actionGroupTools->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
|
||||
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[NAVIGATION_TOOL_ACT], ViewArea::NavigationView );
|
||||
|
||||
m_arrayActions[SELECTION_TOOL_ACT] = new QAction( "Selection Tool", this );
|
||||
m_arrayActions[SELECTION_TOOL_ACT]->setCheckable( true );
|
||||
m_arrayActions[SELECTION_TOOL_ACT]->setChecked( false );
|
||||
m_arrayActions[SELECTION_TOOL_ACT]->setShortcut( Qt::CTRL + Qt::Key_2 );
|
||||
m_actionGroupTools->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
|
||||
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
|
||||
actionGroupTools->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
|
||||
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[SELECTION_TOOL_ACT], ViewArea::NormalSelectionView );
|
||||
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT] = new QAction( "Block Selection Tool", this );
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT]->setCheckable( true );
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT]->setChecked( false );
|
||||
m_arrayActions[BLOCK_SELECTION_TOOL_ACT]->setShortcut( Qt::CTRL + Qt::Key_3 );
|
||||
m_actionGroupTools->addAction( m_arrayActions[BLOCK_SELECTION_TOOL_ACT] );
|
||||
connect( m_arrayActions[BLOCK_SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[BLOCK_SELECTION_TOOL_ACT], ViewArea::BlockSelectionView );
|
||||
|
||||
m_mapperGrid = new QSignalMapper( this );
|
||||
m_actionGroupGrid = new QActionGroup( this );
|
||||
m_actionGroupGrid->setExclusive( true );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "8x8" ), 8 );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "16x16" ), 16 );
|
||||
m_mapperGrid->setMapping( m_actionGroupGrid->addAction( "64x64" ), 64 );
|
||||
|
||||
for( int i = 0; i < m_actionGroupGrid->actions().size(); i++ )
|
||||
{
|
||||
m_actionGroupGrid->actions().at( i )->setCheckable( true );
|
||||
connect( m_actionGroupGrid->actions().at( i ), SIGNAL( triggered() ), m_mapperGrid, SLOT( map() ) );
|
||||
}
|
||||
m_actionGroupGrid->actions().at( 2 )->setChecked( true );
|
||||
connect( m_mapperGrid, SIGNAL( mapped( int ) ), this, SLOT( setGridSize( int ) ) );
|
||||
actionGroupTools->addAction( m_arrayActions[BLOCK_SELECTION_TOOL_ACT] );
|
||||
connect( m_arrayActions[BLOCK_SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
m_mapperTools->setMapping( m_arrayActions[BLOCK_SELECTION_TOOL_ACT],
|
||||
ViewArea::BlockSelectionView );
|
||||
|
||||
m_arrayActions[SHOW_GRID_ACT] = new QAction( "Show grid", this );
|
||||
m_arrayActions[SHOW_GRID_ACT]->setCheckable( true );
|
||||
m_arrayActions[SHOW_GRID_ACT]->setChecked( false );
|
||||
connect( m_arrayActions[SHOW_GRID_ACT], SIGNAL( toggled( bool ) ), this, SLOT( toggleGrid( bool ) ) );
|
||||
connect( m_arrayActions[SHOW_GRID_ACT], SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( toggleGrid( bool ) ) );
|
||||
}
|
||||
|
||||
QMenu* VideoHandle::createVideoMenu()
|
||||
{
|
||||
m_pcMenuVideo = new QMenu( "Video", m_pcParent );
|
||||
m_pcMenuVideo = new QMenu( "Video", m_pcParet );
|
||||
m_pcMenuVideo->addAction( m_arrayActions[PLAY_ACT] );
|
||||
m_pcMenuVideo->addAction( m_arrayActions[STOP_ACT] );
|
||||
m_pcMenuVideo->addAction( m_arrayActions[VIDEO_BACKWARD_ACT] );
|
||||
@@ -193,14 +187,12 @@ QMenu* VideoHandle::createVideoMenu()
|
||||
|
||||
QMenu* VideoHandle::createImageMenu()
|
||||
{
|
||||
m_pcMenuImage = new QMenu( "Image", m_pcParent );
|
||||
m_pcMenuImage = new QMenu( "Image", m_pcParet );
|
||||
m_pcMenuImage->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
|
||||
m_pcMenuImage->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
|
||||
m_pcMenuImage->addAction( m_arrayActions[BLOCK_SELECTION_TOOL_ACT] );
|
||||
m_pcMenuImage->addSeparator();
|
||||
m_pcMenuImage->addAction( m_arrayActions[SHOW_GRID_ACT] );
|
||||
QMenu* gridSizeMenu = m_pcMenuImage->addMenu( "Grid size" );
|
||||
gridSizeMenu->addActions( m_actionGroupGrid->actions() );
|
||||
return m_pcMenuImage;
|
||||
}
|
||||
|
||||
@@ -220,7 +212,7 @@ QToolBar* VideoHandle::createToolBar()
|
||||
m_toolbarVideo->addWidget( m_pcFrameSlider );
|
||||
m_toolbarVideo->addAction( m_arrayActions[VIDEO_FORWARD_ACT] );
|
||||
m_toolbarVideo->addWidget( new QLabel );
|
||||
m_pcFrameNumInfo = new FrameNumberWidget;
|
||||
m_pcFrameNumInfo = new WidgetFrameNumber;
|
||||
m_toolbarVideo->addWidget( m_pcFrameNumInfo );
|
||||
|
||||
return m_toolbarVideo;
|
||||
@@ -228,8 +220,8 @@ QToolBar* VideoHandle::createToolBar()
|
||||
|
||||
QDockWidget* VideoHandle::createDock()
|
||||
{
|
||||
m_pcFramePropertiesSideBar = new FramePropertiesDock( m_pcParent, &m_bIsPlaying );
|
||||
m_pcFramePropertiesDock = new QDockWidget( tr( "Frame Information" ), m_pcParent );
|
||||
m_pcFramePropertiesSideBar = new FramePropertiesDock( m_pcParet, &m_bIsPlaying );
|
||||
m_pcFramePropertiesDock = new QDockWidget( tr( "Frame Information" ), m_pcParet );
|
||||
m_pcFramePropertiesDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
m_pcFramePropertiesDock->setWidget( m_pcFramePropertiesSideBar );
|
||||
connect( m_pcFramePropertiesDock, SIGNAL( visibilityChanged( bool ) ), this, SLOT( update() ) );
|
||||
@@ -242,12 +234,6 @@ 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 ) );
|
||||
@@ -260,7 +246,6 @@ 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 );
|
||||
@@ -268,22 +253,26 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
return pcStatusBarWidget;
|
||||
}
|
||||
|
||||
void VideoHandle::updateMenus()
|
||||
Void VideoHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
|
||||
bool hasSubWindow = pcSubWindow ? true : false;
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
Bool hasSubWindow = pcSubWindow ? true : false;
|
||||
|
||||
m_arrayActions[PLAY_ACT]->setEnabled( hasSubWindow );
|
||||
// m_arrayActions[PAUSE_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[STOP_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[VIDEO_REPEAT_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[VIDEO_GOTO_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setEnabled( hasSubWindow );
|
||||
m_arrayActions[VIDEO_LOCK_SELECTION_ACT]->setEnabled( hasSubWindow );
|
||||
m_pcFrameSlider->setEnabled( hasSubWindow );
|
||||
if( !hasSubWindow )
|
||||
{
|
||||
disconnect( m_pcFrameSlider, SIGNAL( valueChanged( int ) ), this, SLOT( seekSliderEvent( int ) ) );
|
||||
disconnect( m_pcFrameSlider, SIGNAL( valueChanged( int ) ), this,
|
||||
SLOT( seekSliderEvent( int ) ) );
|
||||
m_pcFrameSlider->setValue( 0 );
|
||||
m_pcFrameNumInfo->clear();
|
||||
}
|
||||
@@ -298,53 +287,49 @@ void VideoHandle::updateMenus()
|
||||
m_arrayActions[SHOW_GRID_ACT]->setEnabled( hasSubWindow );
|
||||
}
|
||||
|
||||
void VideoHandle::readSettings()
|
||||
Void VideoHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_arrayActions[VIDEO_REPEAT_ACT]->setChecked( appSettings.value( "VideoHandle/Repeat", false ).toBool() );
|
||||
m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setChecked( appSettings.value( "VideoHandle/VideoZoomLock", false ).toBool() );
|
||||
m_arrayActions[VIDEO_REPEAT_ACT]->setChecked(
|
||||
appSettings.value( "VideoHandle/Repeat", false ).toBool() );
|
||||
m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setChecked(
|
||||
appSettings.value( "VideoHandle/VideoZoomLock", false ).toBool() );
|
||||
if( !appSettings.value( "VideoHandle/FrameProperties", true ).toBool() )
|
||||
m_pcFramePropertiesDock->close();
|
||||
|
||||
m_uiViewTool = appSettings.value( "VideoHandle/SelectedTool", ViewArea::NavigationView ).toUInt();
|
||||
setTool( m_uiViewTool );
|
||||
|
||||
m_arrayActions[SHOW_GRID_ACT]->setChecked( appSettings.value( "VideoHandle/ShowGrid", false ).toBool() );
|
||||
}
|
||||
|
||||
void VideoHandle::writeSettings()
|
||||
Void VideoHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "VideoHandle/Repeat", m_arrayActions[VIDEO_REPEAT_ACT]->isChecked() );
|
||||
appSettings.setValue( "VideoHandle/VideoZoomLock", m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() );
|
||||
appSettings.setValue( "VideoHandle/VideoZoomLock",
|
||||
m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() );
|
||||
appSettings.setValue( "VideoHandle/FrameProperties", m_pcFramePropertiesSideBar->isVisible() );
|
||||
appSettings.setValue( "VideoHandle/SelectedTool", m_uiViewTool );
|
||||
appSettings.setValue( "VideoHandle/ShowGrid", m_arrayActions[SHOW_GRID_ACT]->isChecked() );
|
||||
}
|
||||
|
||||
void VideoHandle::update()
|
||||
Void VideoHandle::update()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
bool isPlaying{ false };
|
||||
const CalypStream* pcStream{ nullptr };
|
||||
if( auto* videoStreamSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
pcStream = videoStreamSubWindow->getInputStream();
|
||||
isPlaying = videoStreamSubWindow->isPlaying();
|
||||
}
|
||||
auto pcFrame = m_pcCurrentVideoSubWindow->getCurrFrameAsset();
|
||||
PlaYUVerStream* pcStream = m_pcCurrentVideoSubWindow->getInputStream();
|
||||
PlaYUVerFrame* pcFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
|
||||
m_pcVideoFormatLabel->setText( m_pcCurrentVideoSubWindow->getVideoInformation() );
|
||||
Int frame_num = 0;
|
||||
UInt64 total_frame_num = 1;
|
||||
|
||||
m_pcVideoFormatLabel->setText( m_pcCurrentVideoSubWindow->getStreamInformation() );
|
||||
|
||||
QString resolution;
|
||||
if( pcFrame )
|
||||
{
|
||||
resolution.append( QString( "%1x%2" ).arg( pcFrame->getWidth() ).arg( pcFrame->getHeight() ) );
|
||||
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();
|
||||
@@ -359,7 +344,7 @@ void VideoHandle::update()
|
||||
}
|
||||
if( pcStream && pcFrame->getBitsPel() > 8 )
|
||||
{
|
||||
if( pcStream->getEndianess() == CLP_BIG_ENDIAN )
|
||||
if( pcStream->getEndianess() == PLAYUVER_BIG_ENDIAN )
|
||||
{
|
||||
resolution.append( QStringLiteral( " (BE)" ) );
|
||||
}
|
||||
@@ -369,35 +354,29 @@ void VideoHandle::update()
|
||||
}
|
||||
}
|
||||
m_pcResolutionLabel->setText( resolution );
|
||||
m_pcFramePropertiesSideBar->setFrame( pcFrame, isPlaying );
|
||||
|
||||
m_pcFramePropertiesSideBar->setFrame( pcFrame );
|
||||
|
||||
m_pcFrameNumInfo->setTotalFrameNum( total_frame_num );
|
||||
m_pcFrameNumInfo->setCurrFrameNum( frame_num );
|
||||
|
||||
m_pcFrameSlider->blockSignals( true ); // Disable signals otherwise it will loop this function
|
||||
m_pcFrameSlider->setMaximum( total_frame_num - 1 );
|
||||
m_pcFrameSlider->setValue( frame_num );
|
||||
m_pcFrameSlider->blockSignals( false );
|
||||
|
||||
if( m_uiRealAverageFrameRate > 0 )
|
||||
{
|
||||
m_pcPlayingFPSLabel->setText( QString( "%1 fps" ).arg( m_uiRealAverageFrameRate ) );
|
||||
}
|
||||
m_pcFrameNumInfo->setCurrFrameNum( frame_num );
|
||||
m_pcFrameSlider->setValue( frame_num );
|
||||
|
||||
if( m_pcCurrentVideoSubWindow->isPlaying() )
|
||||
{
|
||||
m_arrayActions[PLAY_ACT]->setText( "Pause" );
|
||||
m_arrayActions[PLAY_ACT]->setIcon( m_pcParent->style()->standardIcon( QStyle::SP_MediaPause ) );
|
||||
m_arrayActions[PLAY_ACT]->setIcon(
|
||||
m_pcParet->style()->standardIcon( QStyle::SP_MediaPause ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_arrayActions[PLAY_ACT]->setText( "Play" );
|
||||
m_arrayActions[PLAY_ACT]->setIcon( m_pcParent->style()->standardIcon( QStyle::SP_MediaPlay ) );
|
||||
m_arrayActions[PLAY_ACT]->setIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaPlay ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcPlayingFPSLabel->setText( "" );
|
||||
m_pcVideoFormatLabel->setText( "" );
|
||||
m_pcResolutionLabel->setText( "" );
|
||||
m_pcFramePropertiesSideBar->reset();
|
||||
@@ -406,13 +385,13 @@ void VideoHandle::update()
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::update( VideoSubWindow* currSubWindow )
|
||||
Void VideoHandle::update( VideoSubWindow* currSubWindow )
|
||||
{
|
||||
m_pcCurrentVideoSubWindow = currSubWindow;
|
||||
update();
|
||||
}
|
||||
|
||||
void VideoHandle::updateSelectionArea( QRect area )
|
||||
Void VideoHandle::updateSelectionArea( QRect area )
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
@@ -420,46 +399,33 @@ void VideoHandle::updateSelectionArea( QRect area )
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::addSubWindow( VideoSubWindow* window )
|
||||
Void VideoHandle::openSubWindow( VideoSubWindow* subWindow )
|
||||
{
|
||||
window->zoomToFit();
|
||||
window->getViewArea()->setTool( m_uiViewTool );
|
||||
window->getViewArea()->setGridVisible( m_arrayActions[SHOW_GRID_ACT]->isChecked() );
|
||||
|
||||
connect( window, &SubWindowAbstract::aboutToClose,
|
||||
this, &VideoHandle::closeSubWindow );
|
||||
|
||||
connect( window, &SubWindowAbstract::zoomFactorChanged,
|
||||
this, &VideoHandle::zoomToFactorAll );
|
||||
|
||||
connect( window, &SubWindowAbstract::scrollBarMoved,
|
||||
this, &VideoHandle::moveAllScrollBars );
|
||||
|
||||
connect( window->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectionArea( QRect ) ) );
|
||||
connect( subWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this,
|
||||
SLOT( updateSelectionArea( QRect ) ) );
|
||||
subWindow->getViewArea()->setTool( m_uiViewTool );
|
||||
subWindow->getViewArea()->setGridVisible( m_arrayActions[SHOW_GRID_ACT]->isChecked() );
|
||||
}
|
||||
|
||||
void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow )
|
||||
Void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow )
|
||||
{
|
||||
auto* videoStreamSubWindow = qobject_cast<VideoStreamSubWindow*>( subWindow );
|
||||
VideoSubWindow* videoSubWindow = qobject_cast<VideoSubWindow*>( subWindow );
|
||||
|
||||
if( m_acPlayingSubWindows.contains( videoStreamSubWindow ) )
|
||||
if( m_acPlayingSubWindows.contains( videoSubWindow ) )
|
||||
{
|
||||
int pos = m_acPlayingSubWindows.indexOf( videoStreamSubWindow );
|
||||
Int pos = m_acPlayingSubWindows.indexOf( videoSubWindow );
|
||||
m_acPlayingSubWindows.at( pos )->stop();
|
||||
m_acPlayingSubWindows.remove( pos );
|
||||
if( m_acPlayingSubWindows.size() < 2 )
|
||||
{
|
||||
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( false );
|
||||
}
|
||||
}
|
||||
if( subWindow == m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
m_pcFramePropertiesSideBar->reset();
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::zoomToFactorAll( const double scale, const QPoint center )
|
||||
Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center )
|
||||
{
|
||||
double factor;
|
||||
Double factor;
|
||||
|
||||
if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() )
|
||||
{
|
||||
@@ -468,7 +434,7 @@ void VideoHandle::zoomToFactorAll( const double scale, const QPoint center )
|
||||
SubWindowAbstract* subWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
subWindow = subWindowList.at( i );
|
||||
if( m_pcCurrentVideoSubWindow == subWindow )
|
||||
@@ -481,8 +447,7 @@ void VideoHandle::zoomToFactorAll( const double scale, const QPoint center )
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void VideoHandle::moveAllScrollBars( const QPoint& offset )
|
||||
Void VideoHandle::moveAllScrollBars( const QPoint offset )
|
||||
{
|
||||
QPoint newOffset = offset;
|
||||
if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() && m_pcCurrentVideoSubWindow )
|
||||
@@ -507,7 +472,7 @@ void VideoHandle::moveAllScrollBars( const QPoint& offset )
|
||||
if( scrollBar->value() == scrollBar->minimum() && offset.y() < 0 )
|
||||
newOffset.setY( 0 );
|
||||
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( m_pcCurrentVideoSubWindow == videoSubWindow )
|
||||
@@ -519,61 +484,40 @@ void VideoHandle::moveAllScrollBars( const QPoint& offset )
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
void VideoHandle::moveAllScrollBars( const double& horRatio, const double& verRatio )
|
||||
{
|
||||
if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() && m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
VideoSubWindow* videoSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( m_pcCurrentVideoSubWindow == videoSubWindow )
|
||||
continue;
|
||||
else
|
||||
{
|
||||
videoSubWindow->adjustScrollBarToRatio( horRatio, verRatio );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
unsigned long VideoHandle::getMaxFrameNumber()
|
||||
UInt64 VideoHandle::getMaxFrameNumber()
|
||||
{
|
||||
unsigned long currFrames;
|
||||
unsigned long maxFrames = INT_MAX;
|
||||
UInt currFrames;
|
||||
UInt64 maxFrames = INT_MAX;
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) ) )
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
currFrames = m_acPlayingSubWindows.at( i )->getFrameNum();
|
||||
currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum();
|
||||
if( currFrames < maxFrames )
|
||||
maxFrames = currFrames;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
maxFrames = m_pcCurrentVideoSubWindow->getFrameNum();
|
||||
maxFrames = m_pcCurrentVideoSubWindow->getInputStream()->getFrameNum();
|
||||
}
|
||||
}
|
||||
return maxFrames;
|
||||
}
|
||||
|
||||
void VideoHandle::setTimerStatus()
|
||||
Void VideoHandle::setTimerStatus()
|
||||
{
|
||||
bool status = false;
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
Bool status = false;
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
status |= m_acPlayingSubWindows.at( i )->isPlaying();
|
||||
}
|
||||
if( auto* videoStreamSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
status |= videoStreamSubWindow->isPlaying();
|
||||
status |= m_pcCurrentVideoSubWindow->isPlaying();
|
||||
}
|
||||
if( status )
|
||||
{
|
||||
@@ -581,77 +525,89 @@ void VideoHandle::setTimerStatus()
|
||||
{
|
||||
m_pcPlayingTimer->start();
|
||||
m_bIsPlaying = true;
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
m_uiNumberPlayedFrames = 0;
|
||||
m_pcFrameRateFeedbackTimer->start();
|
||||
m_uiRealAverageFrameRate = 0;
|
||||
m_pcPlayControlTimer = new QElapsedTimer;
|
||||
m_pcPlayControlTimer->start();
|
||||
m_dAverageFps = 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
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()
|
||||
Void VideoHandle::play()
|
||||
{
|
||||
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()
|
||||
{
|
||||
auto* videoStreamSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow );
|
||||
|
||||
if( videoStreamSubWindow == nullptr )
|
||||
if( !m_pcCurrentVideoSubWindow )
|
||||
return;
|
||||
|
||||
if( !videoStreamSubWindow->isPlaying() ) // Not playing
|
||||
if( !m_pcCurrentVideoSubWindow->getInputStream() )
|
||||
return;
|
||||
|
||||
if( !m_pcCurrentVideoSubWindow->isPlaying() ) // Not playing
|
||||
{
|
||||
Double frameRate;
|
||||
UInt timeInterval;
|
||||
if( m_acPlayingSubWindows.size() < 2 )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->pause();
|
||||
}
|
||||
m_acPlayingSubWindows.clear();
|
||||
m_acPlayingSubWindows.append( videoStreamSubWindow );
|
||||
m_acPlayingSubWindows.append( m_pcCurrentVideoSubWindow );
|
||||
}
|
||||
if( m_acPlayingSubWindows.contains( videoStreamSubWindow ) )
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->play();
|
||||
}
|
||||
configureFrameRateTimer();
|
||||
frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate();
|
||||
timeInterval = ( UInt )( 1000.0 / frameRate + 0.5 );
|
||||
m_pcPlayingTimer->setInterval( timeInterval );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( videoStreamSubWindow ) )
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->pause();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
videoStreamSubWindow->pause();
|
||||
m_pcCurrentVideoSubWindow->pause();
|
||||
}
|
||||
}
|
||||
setTimerStatus();
|
||||
emit changed();
|
||||
// update();
|
||||
}
|
||||
|
||||
void VideoHandle::stop()
|
||||
Void VideoHandle::stop()
|
||||
{
|
||||
if( m_acPlayingSubWindows.size() > 0 )
|
||||
{
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
playingSubWindow->stop();
|
||||
m_acPlayingSubWindows.at( i )->stop();
|
||||
}
|
||||
m_acPlayingSubWindows.clear();
|
||||
setTimerStatus();
|
||||
@@ -667,169 +623,149 @@ void VideoHandle::stop()
|
||||
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( false );
|
||||
}
|
||||
|
||||
void VideoHandle::calculateRealFrameRate()
|
||||
Void VideoHandle::playEvent()
|
||||
{
|
||||
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;
|
||||
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_pcFrameRateFeedbackTimer->restart();
|
||||
}
|
||||
|
||||
void VideoHandle::playEvent()
|
||||
{
|
||||
// auto start = std::chrono::steady_clock::now();
|
||||
|
||||
// This value should only be true if it is really needed to refresh the UI after this play event
|
||||
// Lets assume the current window is not playing. Nothing changes in the UI expect the playing windows
|
||||
// So no changed is emmited
|
||||
bool bShouldRefreshUI = false;
|
||||
calculateRealFrameRate();
|
||||
m_pcPlayControlTimer->restart();
|
||||
#endif
|
||||
try
|
||||
{
|
||||
bool bEndOfSequence = false;
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
bEndOfSequence |= playingSubWindow->playEvent();
|
||||
// If the current selected windows is playing then we need to refresh the UI
|
||||
if( playingSubWindow == m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
bShouldRefreshUI = true;
|
||||
}
|
||||
bEndOfSequence |= m_acPlayingSubWindows.at( i )->playEvent();
|
||||
}
|
||||
if( bEndOfSequence )
|
||||
{
|
||||
if( !m_arrayActions[VIDEO_REPEAT_ACT]->isChecked() )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
playingSubWindow->seekAbsoluteEvent( 0 );
|
||||
}
|
||||
}
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( 0 );
|
||||
}
|
||||
}
|
||||
catch( const char* msg )
|
||||
{
|
||||
QString warningMsg = "Error while playing " + m_pcCurrentVideoSubWindow->getWindowName() + " with the following error: \n" + msg;
|
||||
QMessageBox::warning( m_pcParent, QApplication::applicationName(), warningMsg );
|
||||
QString warningMsg = "Error while playing " +
|
||||
QFileInfo( m_pcCurrentVideoSubWindow->getCurrentFileName() ).fileName() +
|
||||
" with the following error: \n" + msg;
|
||||
QMessageBox::warning( m_pcParet, QApplication::applicationName(), warningMsg );
|
||||
qDebug() << warningMsg;
|
||||
stop();
|
||||
m_pcCurrentVideoSubWindow->close();
|
||||
}
|
||||
if( bShouldRefreshUI )
|
||||
emit changed();
|
||||
|
||||
// auto end = std::chrono::steady_clock::now();
|
||||
// std::cout << "Elapsed time going to next frame: "
|
||||
// << std::chrono::duration_cast<std::chrono::milliseconds>( end - start ).count()
|
||||
// << " ms" << std::endl;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void VideoHandle::seekEvent( int direction )
|
||||
Void VideoHandle::seekEvent( Int direction )
|
||||
{
|
||||
if( auto* videoStreamSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( videoStreamSubWindow ) )
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
if( !( (unsigned int)( videoStreamSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >= getMaxFrameNumber() &&
|
||||
if( !( ( UInt )( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >=
|
||||
getMaxFrameNumber() &&
|
||||
direction > 0 ) )
|
||||
{
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
playingSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
m_acPlayingSubWindows.at( i )->seekRelativeEvent( direction > 0 ? true : false );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
videoStreamSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
m_pcCurrentVideoSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
}
|
||||
emit changed();
|
||||
// update();
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::seekVideo()
|
||||
Void VideoHandle::seekVideo()
|
||||
{
|
||||
if( auto* videoStreamSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
SeekStreamDialog* dialogSeekVideo = new SeekStreamDialog( videoStreamSubWindow->getInputStream(), m_pcParent );
|
||||
int newFrameNum = dialogSeekVideo->runDialog();
|
||||
if( newFrameNum >= 0 )
|
||||
if( m_pcCurrentVideoSubWindow->getInputStream() )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( videoStreamSubWindow ) )
|
||||
SeekStreamDialog* dialogSeekVideo =
|
||||
new SeekStreamDialog( m_pcCurrentVideoSubWindow->getInputStream(), m_pcParet );
|
||||
Int newFrameNum = dialogSeekVideo->runDialog();
|
||||
if( newFrameNum >= 0 )
|
||||
{
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
playingSubWindow->seekAbsoluteEvent( (unsigned int)newFrameNum );
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (UInt)newFrameNum );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (UInt)newFrameNum );
|
||||
}
|
||||
emit changed();
|
||||
}
|
||||
else
|
||||
{
|
||||
videoStreamSubWindow->seekAbsoluteEvent( (unsigned int)newFrameNum );
|
||||
}
|
||||
emit changed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::seekSliderEvent( int new_frame_num )
|
||||
Void VideoHandle::seekSliderEvent( Int new_frame_num )
|
||||
{
|
||||
// TODO: Fix this slot
|
||||
if( m_bIsPlaying )
|
||||
return;
|
||||
|
||||
if( auto* videoStreamSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
|
||||
if( m_pcCurrentVideoSubWindow && !m_bIsPlaying ) // TODO: Fix this slot
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( videoStreamSubWindow ) )
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
playingSubWindow->seekAbsoluteEvent( (unsigned int)new_frame_num );
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (UInt)new_frame_num );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
videoStreamSubWindow->seekAbsoluteEvent( (unsigned int)new_frame_num );
|
||||
m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (UInt)new_frame_num );
|
||||
}
|
||||
emit changed();
|
||||
// update();
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::videoSelectionButtonEvent()
|
||||
Void VideoHandle::videoSelectionButtonEvent()
|
||||
{
|
||||
VideoSubWindow* videoSubWindow;
|
||||
|
||||
Qt::KeyboardModifiers keyModifiers = QApplication::keyboardModifiers();
|
||||
if( keyModifiers & Qt::ControlModifier )
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( auto subWindow : subWindowList )
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
auto* videoSubWindow = qobject_cast<VideoStreamSubWindow*>( subWindow );
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
m_acPlayingSubWindows.append( videoSubWindow );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SubWindowSelectorDialog dialogWindowsSelection( m_pcParent, m_pcMainWindowManager,
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParet, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QStringList cWindowListNames;
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
dialogWindowsSelection.selectSubWindow( playingSubWindow );
|
||||
dialogWindowsSelection.selectSubWindow( m_acPlayingSubWindows.at( i ) );
|
||||
}
|
||||
if( dialogWindowsSelection.exec() == QDialog::Accepted )
|
||||
{
|
||||
m_acPlayingSubWindows.clear();
|
||||
|
||||
QList<SubWindowAbstract*> selectedSubWindowList = dialogWindowsSelection.getSelectedWindows();
|
||||
for( auto window : selectedSubWindowList )
|
||||
for( Int i = 0; i < selectedSubWindowList.size(); i++ )
|
||||
{
|
||||
auto* videoSubWindow = qobject_cast<VideoStreamSubWindow*>( window );
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( selectedSubWindowList.at( i ) );
|
||||
m_acPlayingSubWindows.append( videoSubWindow );
|
||||
}
|
||||
}
|
||||
@@ -841,14 +777,14 @@ void VideoHandle::videoSelectionButtonEvent()
|
||||
|
||||
if( m_acPlayingSubWindows.size() > 0 )
|
||||
{
|
||||
m_acPlayingSubWindows.front()->activateWindow();
|
||||
m_acPlayingSubWindows.at( 0 )->activateWindow();
|
||||
if( m_acPlayingSubWindows.size() > 1 )
|
||||
{
|
||||
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( true );
|
||||
}
|
||||
if( m_bIsPlaying )
|
||||
{
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->play();
|
||||
}
|
||||
@@ -860,31 +796,26 @@ void VideoHandle::videoSelectionButtonEvent()
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::setTool( int tool )
|
||||
Void VideoHandle::setTool( Int tool )
|
||||
{
|
||||
m_uiViewTool = tool;
|
||||
m_actionGroupTools->actions().at( m_uiViewTool )->setChecked( true );
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
actionGroupTools->actions().at( m_uiViewTool )->setChecked( true );
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
qobject_cast<VideoSubWindow*>( subWindowList.at( i ) )->getViewArea()->setTool( m_uiViewTool );
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::toggleGrid( bool checked )
|
||||
Void VideoHandle::toggleGrid( Bool checked )
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
qobject_cast<VideoSubWindow*>( subWindowList.at( i ) )->getViewArea()->setGridVisible( checked );
|
||||
}
|
||||
}
|
||||
|
||||
void VideoHandle::setGridSize( int size )
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
qobject_cast<VideoSubWindow*>( subWindowList.at( i ) )->getViewArea()->setGridSize( size );
|
||||
qobject_cast<VideoSubWindow*>( subWindowList.at( i ) )
|
||||
->getViewArea()
|
||||
->setGridVisible( checked );
|
||||
}
|
||||
}
|
||||
+36
-44
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,55 +25,55 @@
|
||||
#ifndef __VIDEOHANDLE_H__
|
||||
#define __VIDEOHANDLE_H__
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QPoint>
|
||||
#include <QThread>
|
||||
#include <QVector>
|
||||
#include <QThread>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "config.h"
|
||||
#define _CONTROL_PLAYING_TIME_ 0
|
||||
|
||||
class QToolBar;
|
||||
class QDockWidget;
|
||||
class QSignalMapper;
|
||||
class QLabel;
|
||||
class QSlider;
|
||||
class QElapsedTimer;
|
||||
|
||||
class SubWindowHandle;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class SubWindowAbstract;
|
||||
class VideoStreamSubWindow;
|
||||
class VideoSubWindow;
|
||||
class FramePropertiesDock;
|
||||
class FrameNumberWidget;
|
||||
class QTimer;
|
||||
class WidgetFrameNumber;
|
||||
|
||||
class VideoHandle : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VideoHandle( QWidget*, SubWindowHandle* );
|
||||
VideoHandle( QWidget*, PlaYUVerSubWindowHandle* );
|
||||
~VideoHandle();
|
||||
|
||||
void createActions();
|
||||
Void createActions();
|
||||
QMenu* createVideoMenu();
|
||||
QMenu* createImageMenu();
|
||||
QToolBar* createToolBar();
|
||||
QDockWidget* createDock();
|
||||
QWidget* createStatusBarMessage();
|
||||
void updateMenus();
|
||||
Void updateMenus();
|
||||
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
|
||||
void update( VideoSubWindow* currSubWindow );
|
||||
Void update( VideoSubWindow* currSubWindow );
|
||||
|
||||
void addSubWindow( VideoSubWindow* subWindow );
|
||||
Void openSubWindow( VideoSubWindow* subWindow );
|
||||
|
||||
private:
|
||||
QWidget* m_pcParent;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
QWidget* m_pcParet;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
enum
|
||||
{
|
||||
PLAY_ACT,
|
||||
@@ -95,16 +95,12 @@ private:
|
||||
QSignalMapper* m_mapperVideoSeek;
|
||||
|
||||
QSlider* m_pcFrameSlider;
|
||||
FrameNumberWidget* m_pcFrameNumInfo;
|
||||
WidgetFrameNumber* m_pcFrameNumInfo;
|
||||
|
||||
// Tools Actions
|
||||
QActionGroup* m_actionGroupTools;
|
||||
// Tools Actions;
|
||||
QActionGroup* actionGroupTools;
|
||||
QSignalMapper* m_mapperTools;
|
||||
unsigned int m_uiViewTool;
|
||||
|
||||
// Grid Actions
|
||||
QSignalMapper* m_mapperGrid;
|
||||
QActionGroup* m_actionGroupGrid;
|
||||
UInt m_uiViewTool;
|
||||
|
||||
QMenu* m_pcMenuVideo;
|
||||
QMenu* m_pcMenuImage;
|
||||
@@ -113,24 +109,23 @@ private:
|
||||
QDockWidget* m_pcFramePropertiesDock;
|
||||
FramePropertiesDock* m_pcFramePropertiesSideBar;
|
||||
|
||||
QLabel* m_pcPlayingFPSLabel;
|
||||
QLabel* m_pcVideoFormatLabel;
|
||||
QLabel* m_pcResolutionLabel;
|
||||
|
||||
QPointer<VideoSubWindow> m_pcCurrentVideoSubWindow;
|
||||
QVector<VideoStreamSubWindow*> m_acPlayingSubWindows;
|
||||
VideoSubWindow* m_pcCurrentVideoSubWindow;
|
||||
QVector<VideoSubWindow*> m_acPlayingSubWindows;
|
||||
|
||||
QTimer* m_pcPlayingTimer;
|
||||
bool m_bIsPlaying;
|
||||
Bool m_bIsPlaying;
|
||||
|
||||
unsigned int m_uiNumberPlayedFrames{ 0 };
|
||||
unsigned int m_uiRealAverageFrameRate{ 0 };
|
||||
std::unique_ptr<QElapsedTimer> m_pcFrameRateFeedbackTimer;
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
UInt m_uiNumberPlayedFrames;
|
||||
Double m_dAverageFps;
|
||||
QElapsedTimer* m_pcPlayControlTimer;
|
||||
#endif
|
||||
|
||||
void configureFrameRateTimer();
|
||||
void calculateRealFrameRate();
|
||||
unsigned long getMaxFrameNumber();
|
||||
void setTimerStatus();
|
||||
UInt64 getMaxFrameNumber();
|
||||
Void setTimerStatus();
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
@@ -140,11 +135,9 @@ private Q_SLOTS:
|
||||
void updateSelectionArea( QRect area );
|
||||
void closeSubWindow( SubWindowAbstract* subWindow );
|
||||
void zoomToFactorAll( const double factor, const QPoint center = QPoint() );
|
||||
void moveAllScrollBars( const double&, const double& );
|
||||
|
||||
void moveAllScrollBars( const QPoint offset );
|
||||
void play();
|
||||
void stop();
|
||||
|
||||
void playEvent();
|
||||
void seekSliderEvent( int new_frame_num );
|
||||
void seekEvent( int direction );
|
||||
@@ -152,7 +145,6 @@ private Q_SLOTS:
|
||||
void videoSelectionButtonEvent();
|
||||
void setTool( int tool );
|
||||
void toggleGrid( bool checked );
|
||||
void setGridSize( int size );
|
||||
};
|
||||
|
||||
#endif // __VIDEOHANDLE_H__
|
||||
@@ -1,604 +0,0 @@
|
||||
/* 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 VideoStreamSubWindow.cpp
|
||||
* \brief Video Sub windows handling
|
||||
*/
|
||||
|
||||
#include "VideoStreamSubWindow.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QSettings>
|
||||
#include <QStaticText>
|
||||
#include <cassert>
|
||||
|
||||
#include "ConfigureFormatDialog.h"
|
||||
#include "ModulesHandle.h"
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
#include "ResourceHandle.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
#define QT_NO_CONCURRENT
|
||||
|
||||
/**
|
||||
* \brief Functions to control data stream from stream information
|
||||
*/
|
||||
|
||||
QDataStream& operator<<( QDataStream& out, const CalypFileInfoVector& array )
|
||||
{
|
||||
CalypFileInfo d;
|
||||
out << array.size();
|
||||
for( int i = 0; i < array.size(); i++ )
|
||||
{
|
||||
d = array.at( i );
|
||||
out << d.m_cFilename << d.m_uiWidth << d.m_uiHeight << d.m_iPelFormat << d.m_uiBitsPelPixel << d.m_iEndianness
|
||||
<< d.m_uiFrameRate << d.m_uiFileSize << d.m_bForceRaw;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream& operator>>( QDataStream& in, CalypFileInfoVector& array )
|
||||
{
|
||||
CalypFileInfo d;
|
||||
int array_size{ 0 };
|
||||
in >> array_size;
|
||||
for( int i = 0; i < array_size; i++ )
|
||||
{
|
||||
in >> d.m_cFilename;
|
||||
in >> d.m_uiWidth;
|
||||
in >> d.m_uiHeight;
|
||||
in >> d.m_iPelFormat;
|
||||
in >> d.m_uiBitsPelPixel;
|
||||
in >> d.m_iEndianness;
|
||||
in >> d.m_uiFrameRate;
|
||||
in >> d.m_uiFileSize;
|
||||
in >> d.m_bForceRaw;
|
||||
array.append( d );
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
auto findCalypStreamInfo( const CalypFileInfoVector& array, const QString& filename ) -> int
|
||||
{
|
||||
for( int i = 0; i < array.size(); i++ )
|
||||
if( array.at( i ).m_cFilename == filename )
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
VideoStreamSubWindow::VideoStreamSubWindow( QWidget* parent )
|
||||
: VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW, parent )
|
||||
, m_pcResourceManager( nullptr )
|
||||
, m_pCurrStream( NULL )
|
||||
, m_bIsPlaying( false )
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
VideoStreamSubWindow::~VideoStreamSubWindow()
|
||||
{
|
||||
if( m_pcResourceManager )
|
||||
m_pcResourceManager->removeResource( m_uiResourceId );
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::resetWindowName()
|
||||
{
|
||||
setWindowName( QFileInfo( m_cFilename ).fileName() );
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::updateVideoWindowInfo()
|
||||
{
|
||||
m_cStreamInformation = "";
|
||||
if( m_pcDisplayModule )
|
||||
{
|
||||
m_cStreamInformation = "Module";
|
||||
const auto& arraySubWindows = m_pcDisplayModule->getSubWindowList();
|
||||
QStringList windowInfoList;
|
||||
if( arraySubWindows.size() > 0 )
|
||||
{
|
||||
for( std::size_t i = 0; i < arraySubWindows.size(); i++ )
|
||||
{
|
||||
if( arraySubWindows[i]->getWindowName() != getWindowName() )
|
||||
{
|
||||
windowInfoList.append( QString( "Input %1 - " + arraySubWindows[i]->getWindowName() ).arg( i + 1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
if( m_pcDisplayModule->getModuleRequirements() & ClpModuleFeature::HasInfo )
|
||||
{
|
||||
QStringList list = QString::fromStdString( m_pcDisplayModule->moduleInfo() ).split( '\n' );
|
||||
windowInfoList.append( list );
|
||||
}
|
||||
if( windowInfoList.size() > 0 )
|
||||
{
|
||||
m_pcVideoInfo->setInformationTopLeft( windowInfoList );
|
||||
}
|
||||
}
|
||||
else if( m_pCurrStream )
|
||||
{
|
||||
QString m_cFormatName = QString::fromStdString( m_pCurrStream->getFormatName() );
|
||||
QString m_cCodedName = QString::fromStdString( m_pCurrStream->getCodecName() );
|
||||
m_cStreamInformation = m_cFormatName + " | " + m_cCodedName;
|
||||
}
|
||||
if( m_pcCurrFrameAsset )
|
||||
{
|
||||
QString m_cPelFmtName = QString::fromStdString( m_pcCurrFrameAsset->getPelFmtName() );
|
||||
if( m_pCurrStream )
|
||||
if( !m_pCurrStream->isNative() )
|
||||
m_cPelFmtName += "*";
|
||||
m_cStreamInformation += " | " + m_cPelFmtName;
|
||||
}
|
||||
if( m_cStreamInformation.isEmpty() )
|
||||
{
|
||||
m_cStreamInformation = " ";
|
||||
}
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::loadAll()
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
m_pCurrStream->loadAll();
|
||||
refreshFrame();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::loadFile( QString cFilename, bool bForceDialog )
|
||||
{
|
||||
assert( m_pcResourceManager != nullptr );
|
||||
|
||||
ConfigureFormatDialog formatDialog( this );
|
||||
unsigned int Width = 0, Height = 0, BitsPel = 8, FrameRate = 30;
|
||||
int Endianness = CLP_LITTLE_ENDIAN;
|
||||
auto InputFormat = ClpPixelFormats::YUV420p;
|
||||
QSettings appSettings;
|
||||
|
||||
if( m_pCurrStream )
|
||||
m_pCurrStream->getFormat( Width, Height, InputFormat, BitsPel, Endianness, FrameRate );
|
||||
else
|
||||
m_uiResourceId = m_pcResourceManager->getResource( nullptr );
|
||||
|
||||
m_pCurrStream = m_pcResourceManager->getResourceAsset( m_uiResourceId );
|
||||
|
||||
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( "VideoStreamSubWindow/LastWidth" ).value<unsigned int>();
|
||||
Height = appSettings.value( "VideoStreamSubWindow/LastHeight" ).value<unsigned int>();
|
||||
BitsPel = appSettings.value( "VideoStreamSubWindow/LastBitsPerPixel" ).value<unsigned int>();
|
||||
}
|
||||
}
|
||||
bool bRet{ false };
|
||||
bool forceRaw{ false };
|
||||
for( int iPass = 0; iPass < 2 && !bRet; iPass++ )
|
||||
{
|
||||
if( iPass || bConfig )
|
||||
{
|
||||
if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel,
|
||||
Endianness, FrameRate ) == QDialog::Rejected )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
bRet = m_pCurrStream->open( cFilename.toStdString(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate, iPass == 1, CalypStream::Type::Input );
|
||||
forceRaw = iPass > 0;
|
||||
}
|
||||
catch( CalypFailure& e )
|
||||
{
|
||||
if( iPass > 0 )
|
||||
throw( e );
|
||||
}
|
||||
}
|
||||
|
||||
if( !bRet )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_sStreamInfo.m_cFilename = cFilename;
|
||||
m_sStreamInfo.m_uiWidth = Width;
|
||||
m_sStreamInfo.m_uiHeight = Height;
|
||||
m_sStreamInfo.m_iPelFormat = static_cast<std::int64_t>( InputFormat );
|
||||
m_sStreamInfo.m_uiBitsPelPixel = BitsPel;
|
||||
m_sStreamInfo.m_iEndianness = Endianness;
|
||||
m_sStreamInfo.m_uiFrameRate = FrameRate;
|
||||
m_sStreamInfo.m_uiFileSize = QFileInfo( cFilename ).size();
|
||||
m_sStreamInfo.m_bForceRaw = forceRaw;
|
||||
|
||||
QVariant var;
|
||||
var.setValue<unsigned int>( Width );
|
||||
appSettings.setValue( "VideoStreamSubWindow/LastWidth", var );
|
||||
var.setValue<unsigned int>( Height );
|
||||
appSettings.setValue( "VideoStreamSubWindow/LastHeight", var );
|
||||
var.setValue<unsigned int>( BitsPel );
|
||||
appSettings.setValue( "VideoStreamSubWindow/LastBitsPerPixel", var );
|
||||
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
m_pcResourceManager->startResourceWorker( m_uiResourceId );
|
||||
#endif
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
refreshFrame();
|
||||
|
||||
m_cFilename = cFilename;
|
||||
|
||||
updateVideoWindowInfo();
|
||||
setWindowName( QFileInfo( m_cFilename ).fileName() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::loadFile( CalypFileInfo streamInfo )
|
||||
{
|
||||
assert( m_pcResourceManager != nullptr );
|
||||
|
||||
m_uiResourceId = m_pcResourceManager->getResource( m_pCurrStream );
|
||||
m_pCurrStream = m_pcResourceManager->getResourceAsset( m_uiResourceId );
|
||||
|
||||
if( !m_pCurrStream->open( streamInfo.m_cFilename.toStdString(), streamInfo.m_uiWidth, streamInfo.m_uiHeight,
|
||||
static_cast<ClpPixelFormats>( streamInfo.m_iPelFormat ), streamInfo.m_uiBitsPelPixel, streamInfo.m_iEndianness,
|
||||
streamInfo.m_uiFrameRate, streamInfo.m_bForceRaw, CalypStream::Type::Input ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_cFilename = streamInfo.m_cFilename;
|
||||
m_sStreamInfo = std::move( streamInfo );
|
||||
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
m_pcResourceManager->startResourceWorker( m_uiResourceId );
|
||||
#endif
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
refreshFrame();
|
||||
|
||||
updateVideoWindowInfo();
|
||||
setWindowName( QFileInfo( m_cFilename ).fileName() );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::guessFormat( const QString& filename, unsigned int& rWidth, unsigned int& rHeight, ClpPixelFormats& rInputFormat, unsigned int& rBitsPerPixel,
|
||||
int& rEndianness, unsigned int& rFrameRate )
|
||||
{
|
||||
std::vector<CalypStandardResolution> stdResList = CalypStream::stdResolutionSizes();
|
||||
bool bGuessed = true;
|
||||
bool bGuessedByFilesize = false;
|
||||
QString FilenameShort = QFileInfo( filename ).fileName();
|
||||
QString fileExtension = QFileInfo( filename ).suffix();
|
||||
|
||||
if( filename.startsWith( "/dev/" ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( !fileExtension.compare( "yuv", Qt::CaseInsensitive ) || !fileExtension.compare( "rgb", Qt::CaseInsensitive ) ||
|
||||
!fileExtension.compare( "gray", Qt::CaseInsensitive ) )
|
||||
{
|
||||
bGuessed = false;
|
||||
// Guess pixel format
|
||||
const auto& formats_list = CalypFrame::supportedPixelFormatListNames();
|
||||
for( const auto& [key, name] : formats_list )
|
||||
{
|
||||
if( FilenameShort.contains( QString::fromStdString( std::string( name ) ), Qt::CaseInsensitive ) )
|
||||
{
|
||||
rInputFormat = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( rWidth == 0 || rHeight == 0 )
|
||||
{
|
||||
// Guess resolution - match resolution name
|
||||
int iMatch = -1;
|
||||
for( unsigned int i = 0; i < stdResList.size(); i++ )
|
||||
{
|
||||
if( FilenameShort.contains( QString::fromStdString( stdResList[i].shortName ) ) )
|
||||
{
|
||||
iMatch = i;
|
||||
}
|
||||
}
|
||||
if( iMatch >= 0 )
|
||||
{
|
||||
rWidth = stdResList[iMatch].uiWidth;
|
||||
rHeight = stdResList[iMatch].uiHeight;
|
||||
}
|
||||
|
||||
// Guess resolution - match %dx%d
|
||||
// QRegularExpressionMatch resolutionMatch = QRegularExpression( "_\\d*x\\d*" ).match( FilenameShort );
|
||||
QRegularExpressionMatch resolutionMatch = QRegularExpression( "_[0-9]+x[0-9]+" ).match( FilenameShort );
|
||||
if( resolutionMatch.hasMatch() )
|
||||
{
|
||||
QString resolutionString = resolutionMatch.captured( resolutionMatch.lastCapturedIndex() );
|
||||
if( resolutionString.startsWith( "_" ) || resolutionString.endsWith( "_" ) )
|
||||
{
|
||||
resolutionString.remove( "_" );
|
||||
QStringList resolutionArgs = resolutionString.split( "x" );
|
||||
if( resolutionArgs.size() == 2 )
|
||||
{
|
||||
rWidth = resolutionArgs.at( 0 ).toUInt();
|
||||
rHeight = resolutionArgs.at( 1 ).toUInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Guess resolution by file size
|
||||
if( rWidth == 0 && rHeight == 0 )
|
||||
{
|
||||
FILE* pF = fopen( filename.toStdString().c_str(), "rb" );
|
||||
if( pF )
|
||||
{
|
||||
fseek( pF, 0, SEEK_END );
|
||||
unsigned long long int uiFileSize = ftell( pF );
|
||||
fclose( pF );
|
||||
|
||||
int count = 0, module, frame_bytes, match;
|
||||
for( unsigned int i = 0; i < stdResList.size(); i++ )
|
||||
{
|
||||
frame_bytes =
|
||||
CalypFrame::getBytesPerFrame( stdResList[i].uiWidth, stdResList[i].uiHeight, rInputFormat, 8 );
|
||||
module = uiFileSize % frame_bytes;
|
||||
if( module == 0 )
|
||||
{
|
||||
match = i;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if( count == 1 )
|
||||
{
|
||||
rWidth = stdResList[match].uiWidth;
|
||||
rHeight = stdResList[match].uiHeight;
|
||||
bGuessedByFilesize = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [.|_]
|
||||
// Guess bits per pixel - match %dbpp
|
||||
QRegularExpressionMatch BppMatch = QRegularExpression( "_[0-9]+bpp" ).match( FilenameShort );
|
||||
if( BppMatch.hasMatch() )
|
||||
{
|
||||
QString matchString = BppMatch.captured( BppMatch.lastCapturedIndex() );
|
||||
matchString.remove( "_" );
|
||||
matchString.remove( "bpp" );
|
||||
rBitsPerPixel = matchString.toUInt();
|
||||
if( !( rBitsPerPixel > 0 && rBitsPerPixel < 16 ) )
|
||||
{
|
||||
rBitsPerPixel = -1;
|
||||
}
|
||||
}
|
||||
QRegularExpressionMatch BppOnlybMatch = QRegularExpression( "_[0-9]+b" ).match( FilenameShort );
|
||||
if( BppOnlybMatch.hasMatch() )
|
||||
{
|
||||
QString matchString = BppOnlybMatch.captured( BppOnlybMatch.lastCapturedIndex() );
|
||||
matchString.remove( "_" );
|
||||
matchString.remove( "b" );
|
||||
rBitsPerPixel = matchString.toUInt();
|
||||
if( !( rBitsPerPixel > 0 && rBitsPerPixel < 16 ) )
|
||||
{
|
||||
rBitsPerPixel = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Guess frame rate - match %dbpp
|
||||
QRegularExpressionMatch FpsMatch = QRegularExpression( "_[0-9]+fps" ).match( FilenameShort );
|
||||
if( FpsMatch.hasMatch() )
|
||||
{
|
||||
QString matchString = FpsMatch.captured( FpsMatch.lastCapturedIndex() );
|
||||
matchString.remove( "_" );
|
||||
matchString.remove( "fps" );
|
||||
rFrameRate = matchString.toUInt();
|
||||
if( rFrameRate < 0 )
|
||||
{
|
||||
rFrameRate = 30;
|
||||
}
|
||||
}
|
||||
|
||||
// Guess Endianness
|
||||
if( FilenameShort.contains( QStringLiteral( "be" ), Qt::CaseInsensitive ) )
|
||||
{
|
||||
rEndianness = CLP_BIG_ENDIAN;
|
||||
}
|
||||
if( FilenameShort.contains( QStringLiteral( "le" ), Qt::CaseInsensitive ) )
|
||||
{
|
||||
rEndianness = CLP_LITTLE_ENDIAN;
|
||||
}
|
||||
|
||||
if( rWidth > 0 && rHeight > 0 && rInputFormat != ClpPixelFormats::Invalid )
|
||||
bGuessed = true && !bGuessedByFilesize;
|
||||
}
|
||||
return !bGuessed;
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::refreshSubWindow()
|
||||
{
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
m_pcResourceManager->stopResourceWorker( m_uiResourceId );
|
||||
#endif
|
||||
if( !m_pCurrStream->reload() )
|
||||
{
|
||||
close();
|
||||
return;
|
||||
}
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
m_pcResourceManager->startResourceWorker( m_uiResourceId );
|
||||
#endif
|
||||
|
||||
updateVideoWindowInfo();
|
||||
refreshFrame();
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::refreshFrame()
|
||||
{
|
||||
bool bSetFrame = true;
|
||||
m_pcCurrFrameAsset = m_pCurrStream->getCurrFrameAsset();
|
||||
|
||||
if( m_pcDisplayModule )
|
||||
{
|
||||
// bool disableThreads = !m_bIsPlaying && hasAssociatedModule();
|
||||
m_pcDisplayModule->apply( m_bIsPlaying, true );
|
||||
bSetFrame = false;
|
||||
}
|
||||
if( bSetFrame )
|
||||
VideoSubWindow::refreshFrame();
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::refreshFrame( bool bThreaded )
|
||||
{
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
m_cRefreshResult.waitForFinished();
|
||||
if( bThreaded )
|
||||
{
|
||||
m_cRefreshResult = QtConcurrent::run( this, &VideoSubWindow::refreshFrame );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
refreshFrame();
|
||||
}
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::goToNextFrame( bool bThreaded )
|
||||
{
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
m_cRefreshResult.waitForFinished();
|
||||
m_cReadResult.waitForFinished();
|
||||
#endif
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
while( !m_pCurrStream->hasNextFrame() && !m_pCurrStream->isEof() )
|
||||
{
|
||||
}
|
||||
#endif
|
||||
bool bEndOfSeq = m_pCurrStream->setNextFrame();
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
bThreaded = false;
|
||||
m_pcResourceManager->wakeResourceWorker( m_uiResourceId );
|
||||
#endif
|
||||
if( !bEndOfSeq )
|
||||
{
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
m_cRefreshResult.waitForFinished();
|
||||
if( bThreaded )
|
||||
{
|
||||
m_cReadResult = QtConcurrent::run( m_pCurrStream, &CalypStream::readNextFrameFillRGBBuffer );
|
||||
refreshFrame( bThreaded );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
refreshFrame( bThreaded );
|
||||
#ifndef CALYP_MANAGED_RESOURCES
|
||||
m_pCurrStream->readNextFrameFillRGBBuffer();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return bEndOfSeq;
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::saveStream( const QString& filename )
|
||||
{
|
||||
bool iRet = false;
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
|
||||
// TODO: implement this
|
||||
QApplication::restoreOverrideCursor();
|
||||
return iRet;
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::isPlaying()
|
||||
{
|
||||
return m_bIsPlaying;
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::play()
|
||||
{
|
||||
bool isPlaying = false;
|
||||
if( m_pCurrStream && m_pCurrStream->getFrameNum() > 1 )
|
||||
{
|
||||
isPlaying = true;
|
||||
}
|
||||
m_bIsPlaying = isPlaying;
|
||||
return m_bIsPlaying;
|
||||
}
|
||||
|
||||
bool VideoStreamSubWindow::playEvent()
|
||||
{
|
||||
bool bEndOfSeq = false;
|
||||
if( m_pCurrStream && m_bIsPlaying )
|
||||
{
|
||||
bEndOfSeq = goToNextFrame( true );
|
||||
}
|
||||
return bEndOfSeq;
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::pause()
|
||||
{
|
||||
m_bIsPlaying = false;
|
||||
refreshFrame();
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::seekAbsoluteEvent( unsigned int new_frame_num )
|
||||
{
|
||||
if( m_pCurrStream )
|
||||
{
|
||||
if( m_pCurrStream->seekInput( new_frame_num ) )
|
||||
refreshFrame();
|
||||
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
m_pcResourceManager->wakeResourceWorker( m_uiResourceId );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::seekRelativeEvent( bool bIsFoward )
|
||||
{
|
||||
if( m_pCurrStream )
|
||||
{
|
||||
if( bIsFoward )
|
||||
{
|
||||
goToNextFrame( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pCurrStream->seekInputRelative( bIsFoward );
|
||||
#ifdef CALYP_MANAGED_RESOURCES
|
||||
m_pcResourceManager->wakeResourceWorker( m_uiResourceId );
|
||||
#endif
|
||||
refreshFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VideoStreamSubWindow::stop()
|
||||
{
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
m_cRefreshResult.waitForFinished();
|
||||
m_cReadResult.waitForFinished();
|
||||
#endif
|
||||
m_bIsPlaying = false;
|
||||
seekAbsoluteEvent( 0 );
|
||||
return;
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
/* 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 VideoStreamSubWindow.h
|
||||
* \brief Video Sub windows handling
|
||||
*/
|
||||
|
||||
#ifndef __VIDEOSTREAMSUBWINDOW_H__
|
||||
#define __VIDEOSTREAMSUBWINDOW_H__
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QFuture>
|
||||
#include <QRect>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <cstdint>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class QScrollArea;
|
||||
|
||||
class VideoInformation;
|
||||
class VideoStreamSubWindow;
|
||||
class ResourceHandle;
|
||||
class CalypAppModuleIf;
|
||||
|
||||
struct CalypFileInfo
|
||||
{
|
||||
QString m_cFilename;
|
||||
unsigned int m_uiWidth;
|
||||
unsigned int m_uiHeight;
|
||||
int m_iPelFormat;
|
||||
unsigned int m_uiBitsPelPixel;
|
||||
int m_iEndianness;
|
||||
unsigned int m_uiFrameRate;
|
||||
unsigned long long int m_uiFileSize;
|
||||
bool m_bForceRaw{ false };
|
||||
};
|
||||
using CalypFileInfoVector = QVector<CalypFileInfo>;
|
||||
|
||||
QDataStream& operator<<( QDataStream& out, const CalypFileInfoVector& d );
|
||||
QDataStream& operator>>( QDataStream& in, CalypFileInfoVector& d );
|
||||
auto findCalypStreamInfo( const CalypFileInfoVector& array, const QString& filename ) -> int;
|
||||
|
||||
class VideoStreamSubWindow : public VideoSubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
VideoStreamSubWindow( QWidget* parent = 0 );
|
||||
~VideoStreamSubWindow();
|
||||
|
||||
void resetWindowName() override;
|
||||
void updateVideoWindowInfo() override;
|
||||
|
||||
bool isPlaying() override;
|
||||
void stop() override;
|
||||
void advanceOneFrame() override { goToNextFrame( true ); }
|
||||
auto getFrameNum() -> std::uint64_t override { return m_pCurrStream->getFrameNum(); }
|
||||
|
||||
void setResourceManaget( ResourceHandle* resourceManager ) { m_pcResourceManager = resourceManager; }
|
||||
|
||||
bool supportsFormatConfiguration() const { return m_pCurrStream->supportsFormatConfiguration(); };
|
||||
|
||||
bool loadFile( QString cFilename, bool bForceDialog = false );
|
||||
bool loadFile( CalypFileInfo streamInfo );
|
||||
void loadAll();
|
||||
bool saveStream( const QString& filename );
|
||||
|
||||
bool play();
|
||||
void pause();
|
||||
bool playEvent();
|
||||
void seekAbsoluteEvent( unsigned int new_frame_num );
|
||||
void seekRelativeEvent( bool bIsFoward );
|
||||
|
||||
CalypFileInfo getStreamInfo() { return m_sStreamInfo; }
|
||||
|
||||
const CalypStream* getInputStream() { return m_pCurrStream; }
|
||||
const CalypStream* getCurrStream() { return m_pCurrStream; }
|
||||
|
||||
QString getCurrentFileName() { return m_cFilename; }
|
||||
|
||||
void refreshSubWindow() override;
|
||||
void refreshFrame();
|
||||
void refreshFrame( bool bThreaded );
|
||||
|
||||
private:
|
||||
bool goToNextFrame( bool bThreaded );
|
||||
|
||||
static bool guessFormat( const QString& filename, unsigned int& rWidth, unsigned int& rHeight, ClpPixelFormats& rInputFormat, unsigned int& rBitsPerPixel,
|
||||
int& rEndianness, unsigned int& rFrameRate );
|
||||
|
||||
private: // NO_LINT
|
||||
ResourceHandle* m_pcResourceManager;
|
||||
|
||||
QString m_cFilename;
|
||||
CalypFileInfo m_sStreamInfo;
|
||||
std::size_t m_uiResourceId;
|
||||
CalypStream* m_pCurrStream;
|
||||
QString m_cCurrFileName;
|
||||
|
||||
bool m_bIsPlaying;
|
||||
|
||||
/**
|
||||
* Threads variables
|
||||
* QtConcurrent
|
||||
*/
|
||||
QFuture<void> m_cRefreshResult;
|
||||
QFuture<void> m_cReadResult;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( CalypFileInfo ) // NOLINT
|
||||
Q_DECLARE_METATYPE( CalypFileInfoVector ) // NOLINT
|
||||
|
||||
#endif // __VIDEOSTREAMSUBWINDOW_H__
|
||||
+746
-316
File diff suppressed because it is too large.
Load diff
+137
-103
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,53 +25,100 @@
|
||||
#ifndef __VIDEOSUBWINDOW_H__
|
||||
#define __VIDEOSUBWINDOW_H__
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QFuture>
|
||||
#include <QRect>
|
||||
#include <QStaticText>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "ViewArea.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypStream.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include <QDataStream>
|
||||
#include <QFuture>
|
||||
#include <QRect>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
class QScrollArea;
|
||||
|
||||
class VideoInformation;
|
||||
class VideoSubWindow;
|
||||
class ResourceHandle;
|
||||
class CalypAppModuleIf;
|
||||
class PlaYUVerAppModuleIf;
|
||||
|
||||
/**
|
||||
* \class VideoInformation
|
||||
* \brief Shows information about video sub window
|
||||
*/
|
||||
class VideoInformation : public QWidget
|
||||
typedef struct
|
||||
{
|
||||
public:
|
||||
VideoInformation( QWidget* parent );
|
||||
void setInformationTopLeft( const QStringList& textLines );
|
||||
void setBusyWindow( bool bFlag );
|
||||
QString m_cFilename;
|
||||
UInt m_uiWidth;
|
||||
UInt m_uiHeight;
|
||||
Int m_iPelFormat;
|
||||
UInt m_uiBitsPelPixel;
|
||||
UInt m_iEndianness;
|
||||
UInt m_uiFrameRate;
|
||||
UInt64 m_uiFileSize;
|
||||
} PlaYUVerStreamInfo;
|
||||
typedef QVector<PlaYUVerStreamInfo> PlaYUVerStreamInfoVector;
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent* event ) override;
|
||||
|
||||
private:
|
||||
QTimer* m_pcRefreshTimer;
|
||||
QList<QStaticText> m_cTopLeftTextList;
|
||||
QFont m_cTopLeftTextFont;
|
||||
QFont m_cCenterTextFont;
|
||||
bool m_bBusyWindow;
|
||||
};
|
||||
QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& d );
|
||||
QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& d );
|
||||
Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename );
|
||||
|
||||
class VideoSubWindow : public SubWindowAbstract
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
Bool m_bWindowBusy;
|
||||
|
||||
QScrollArea* m_pcScrollArea;
|
||||
QPoint m_cLastScroll;
|
||||
QPoint m_cCurrScroll;
|
||||
|
||||
ViewArea* m_cViewArea;
|
||||
|
||||
VideoInformation* m_pcVideoInfo;
|
||||
|
||||
QString m_cFilename;
|
||||
QString m_cStreamInformation;
|
||||
PlaYUVerStreamInfo m_sStreamInfo;
|
||||
PlaYUVerStream* m_pCurrStream;
|
||||
|
||||
PlaYUVerFrame* m_pcCurrFrame;
|
||||
QRect m_cSelectedArea;
|
||||
|
||||
PlaYUVerAppModuleIf* m_pcCurrentDisplayModule;
|
||||
QList<PlaYUVerAppModuleIf*> m_apcCurrentModule;
|
||||
|
||||
VideoSubWindow* m_pcReferenceSubWindow;
|
||||
|
||||
// QString m_cWindowShortName;
|
||||
QString m_cCurrFileName;
|
||||
|
||||
Bool m_bIsPlaying;
|
||||
|
||||
QTimer* m_pcUpdateTimer;
|
||||
/**
|
||||
* Threads variables
|
||||
* QtConcurrent
|
||||
*/
|
||||
QFuture<Void> m_cRefreshResult;
|
||||
QFuture<Void> m_cReadResult;
|
||||
|
||||
Void refreshFrameOperation();
|
||||
Bool goToNextFrame( Bool bThreaded = false );
|
||||
|
||||
static Bool guessFormat( QString filename,
|
||||
UInt& rWidth,
|
||||
UInt& rHeight,
|
||||
Int& rInputFormat,
|
||||
UInt& rBitsPerPixel,
|
||||
Int& rEndianness );
|
||||
|
||||
/**
|
||||
* Private zoom function to handle
|
||||
* zoom to fit
|
||||
*/
|
||||
Void scaleView( const QSize& size, QPoint center = QPoint() );
|
||||
Void updateVideoWindowInfo();
|
||||
|
||||
QSize getScrollSize();
|
||||
|
||||
public:
|
||||
enum VideoSubWindowCategories
|
||||
{
|
||||
@@ -81,108 +128,95 @@ public:
|
||||
VideoSubWindow( enum VideoSubWindowCategories category, QWidget* parent = 0 );
|
||||
~VideoSubWindow();
|
||||
|
||||
virtual void resetWindowName() = 0;
|
||||
virtual void updateVideoWindowInfo() = 0;
|
||||
Bool loadFile( QString cFilename, Bool bForceDialog = false );
|
||||
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
|
||||
Void loadAll();
|
||||
Bool save( QString filename );
|
||||
|
||||
virtual bool isPlaying() = 0;
|
||||
virtual void stop() = 0;
|
||||
virtual void advanceOneFrame() = 0;
|
||||
virtual auto getFrameNum() -> std::uint64_t { return 1; };
|
||||
Void refreshSubWindow();
|
||||
Void refreshFrame( Bool bThreaded = false );
|
||||
|
||||
QString getVideoInformation() { return m_cStreamInformation; }
|
||||
bool save( const QString& filename );
|
||||
Bool play();
|
||||
Void pause();
|
||||
Bool playEvent();
|
||||
Void stop();
|
||||
|
||||
void setCurrFrame( std::shared_ptr<CalypFrame> pcCurrFrame );
|
||||
Bool isPlaying() { return m_bIsPlaying; }
|
||||
Void seekAbsoluteEvent( UInt new_frame_num );
|
||||
Void seekRelativeEvent( Bool bIsFoward );
|
||||
|
||||
auto getCurrFrame() -> CalypFrame* { return m_pcCurrFrameAsset.get(); }
|
||||
auto getCurrFrameAsset() -> std::shared_ptr<CalypFrame> { return m_pcCurrFrameAsset; };
|
||||
auto getViewArea() -> ViewArea* { return m_cViewArea; }
|
||||
Void setCurrFrame( PlaYUVerFrame* pcCurrFrame );
|
||||
|
||||
VideoSubWindow* getRefSubWindow() { return m_pcReferenceSubWindow; }
|
||||
void setRefSubWindow( VideoSubWindow* subWindow )
|
||||
QScrollArea* getScroll() { return m_pcScrollArea; }
|
||||
PlaYUVerStreamInfo getStreamInfo() { return m_sStreamInfo; }
|
||||
QString getStreamInformation() { return m_cStreamInformation; }
|
||||
PlaYUVerStream* getInputStream() { return m_pCurrStream; }
|
||||
PlaYUVerStream* getCurrStream() { return m_pCurrStream; }
|
||||
PlaYUVerFrame* getCurrFrame() { return m_pcCurrFrame; }
|
||||
ViewArea* getViewArea() { return m_cViewArea; }
|
||||
Void setRefSubWindow( VideoSubWindow* subWindow )
|
||||
{
|
||||
m_pcReferenceSubWindow = NULL;
|
||||
if( subWindow )
|
||||
if( m_pcCurrFrameAsset->haveSameFmt( subWindow->getCurrFrame() ) )
|
||||
if( m_pcCurrFrame->haveSameFmt( subWindow->getCurrFrame() ) )
|
||||
m_pcReferenceSubWindow = subWindow;
|
||||
}
|
||||
|
||||
VideoSubWindow* getRefSubWindow() { return m_pcReferenceSubWindow; }
|
||||
/**
|
||||
* Functions to enable a module in the
|
||||
* current SubWindow
|
||||
*/
|
||||
auto hasModules() -> bool { return m_associatedModules.size() > 0; }
|
||||
bool hasAssociatedModule();
|
||||
void setDisplayModule( CalypAppModuleIf* pcModule );
|
||||
void associateModule( std::shared_ptr<CalypAppModuleIf> pcModule );
|
||||
void disableModule( CalypAppModuleIf* pcModule );
|
||||
bool disableAllModules();
|
||||
CalypAppModuleIf* getDisplayModule() { return m_pcDisplayModule; }
|
||||
Void enableModule( PlaYUVerAppModuleIf* pcModule );
|
||||
Void disableModule( PlaYUVerAppModuleIf* pcModule = NULL );
|
||||
Void associateModule( PlaYUVerAppModuleIf* pcModule );
|
||||
|
||||
PlaYUVerAppModuleIf* getDisplayModule() { return m_pcCurrentDisplayModule; }
|
||||
QList<PlaYUVerAppModuleIf*> getModuleArray()
|
||||
{
|
||||
QList<PlaYUVerAppModuleIf*> apcModulesArray;
|
||||
if( m_pcCurrentDisplayModule )
|
||||
apcModulesArray.append( m_pcCurrentDisplayModule );
|
||||
apcModulesArray.append( m_apcCurrentModule );
|
||||
return apcModulesArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Virtual functions from SubWindowAbstract
|
||||
*/
|
||||
void normalSize() override;
|
||||
void zoomToFit() override;
|
||||
void scaleView( double scale, QPoint center = QPoint() ) override;
|
||||
void zoomToFactor( double factor, QPoint center = QPoint() ) override;
|
||||
Void normalSize();
|
||||
Void zoomToFit();
|
||||
Void scaleView( Double scale, QPoint center = QPoint() );
|
||||
Void zoomToFactor( Double factor, QPoint center = QPoint() );
|
||||
|
||||
double getScaleFactor() override { return m_cViewArea->getZoomFactor(); }
|
||||
Double getScaleFactor() { return m_cViewArea->getZoomFactor(); }
|
||||
/**
|
||||
* Size related functions
|
||||
*/
|
||||
QSize sizeHint( const QSize& ) const override;
|
||||
QSize sizeHint() const;
|
||||
QSize sizeHint( const QSize& ) const;
|
||||
|
||||
void setFillWindow( bool bFlag );
|
||||
|
||||
void adjustScrollBarToRatio( const double& horRatio, const double& verRatio );
|
||||
|
||||
private:
|
||||
bool hasRunningModule();
|
||||
|
||||
/**
|
||||
* Private zoom function to handle
|
||||
* zoom to fit
|
||||
*/
|
||||
void scaleView( const QSize& size, QPoint center = QPoint() );
|
||||
|
||||
QSize getScrollSize();
|
||||
QString getCurrentFileName() { return m_cFilename; }
|
||||
Bool getIsModule() { return getCategory() | SubWindowAbstract::MODULE_SUBWINDOW; }
|
||||
Void clearWindowBusy() { m_bWindowBusy = false; }
|
||||
Void setFillWindow( Bool bFlag );
|
||||
|
||||
protected:
|
||||
void refreshFrame();
|
||||
|
||||
void keyPressEvent( QKeyEvent* event ) override;
|
||||
void resizeEvent( QResizeEvent* event ) override;
|
||||
void closeEvent( QCloseEvent* event ) override;
|
||||
Void keyPressEvent( QKeyEvent* event );
|
||||
Void resizeEvent( QResizeEvent* event );
|
||||
// void closeEvent( QCloseEvent *event );
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateWindowOnTimeout();
|
||||
void adjustScrollBarByScale( double scale, QPoint center );
|
||||
void adjustScrollBarByOffset( QPoint Offset );
|
||||
void updateScrollValues();
|
||||
void updateCurScrollValues();
|
||||
void setCurScrollValues();
|
||||
void updateSelectedArea( QRect area );
|
||||
void updatePixelValueStatusBar( const QPoint& pos );
|
||||
|
||||
protected:
|
||||
VideoInformation* m_pcVideoInfo;
|
||||
QString m_cStreamInformation;
|
||||
std::shared_ptr<CalypFrame> m_pcCurrFrameAsset;
|
||||
// bool m_bWindowBusy;
|
||||
// bool m_bIsPlaying;
|
||||
|
||||
std::vector<std::shared_ptr<CalypAppModuleIf>> m_associatedModules;
|
||||
CalypAppModuleIf* m_pcDisplayModule{ nullptr };
|
||||
// bool m_hasAssociatedModules;
|
||||
|
||||
private:
|
||||
QScrollArea* m_pcScrollArea;
|
||||
QPoint m_cCurrScroll;
|
||||
double m_dHorScroll;
|
||||
double m_dVerScroll;
|
||||
ViewArea* m_cViewArea;
|
||||
QRect m_cSelectedArea;
|
||||
VideoSubWindow* m_pcReferenceSubWindow;
|
||||
QTimer* m_pcUpdateTimer;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( PlaYUVerStreamInfo );
|
||||
Q_DECLARE_METATYPE( PlaYUVerStreamInfoVector );
|
||||
|
||||
#endif // __VIDEOSUBWINDOW_H__
|
||||
+290
-282
File diff suppressed because it is too large.
Load diff
+52
-57
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -26,18 +26,17 @@
|
||||
#ifndef __VIEWAREA_H__
|
||||
#define __VIEWAREA_H__
|
||||
|
||||
#include "GridManager.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/PlaYUVerFrame.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;
|
||||
class PlaYUVerStream;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -56,40 +55,38 @@ public:
|
||||
|
||||
ViewArea( QWidget* parent = 0 );
|
||||
|
||||
QImage& image() { return m_image; };
|
||||
void setImage( std::shared_ptr<CalypFrame> frame );
|
||||
Void setImage( PlaYUVerFrame* pcFrame );
|
||||
Void setImage( const QPixmap& pixmap );
|
||||
|
||||
void setMode( int mode );
|
||||
void setMaskColor( const QColor& color = QColor() );
|
||||
Void setMode( Int mode );
|
||||
Void setMaskColor( const QColor& color = QColor() );
|
||||
|
||||
/**
|
||||
* Clears any contents.
|
||||
*/
|
||||
void clear();
|
||||
Void clear();
|
||||
|
||||
/**
|
||||
* Select tool from the menu
|
||||
*/
|
||||
void setTool( unsigned int view );
|
||||
Void setTool( UInt view );
|
||||
|
||||
/**
|
||||
* Grid options
|
||||
*/
|
||||
void setGridVisible( bool enable );
|
||||
void setGridSize( int size );
|
||||
Void setGridVisible( Bool enable );
|
||||
|
||||
/**
|
||||
* Clears any mask content.
|
||||
*/
|
||||
void clearMask();
|
||||
Void clearMask();
|
||||
|
||||
QPixmap image() const { return m_pixmap; }
|
||||
QBitmap mask() const { return m_mask; }
|
||||
QRect selectedArea() const { return m_selectedArea; }
|
||||
GridManager gridManager() const { return m_grid; }
|
||||
QColor maskColor() const { return m_maskColor; }
|
||||
double getZoomFactor() { return m_dZoomFactor; }
|
||||
Double getZoomFactor() { return m_dZoomFactor; }
|
||||
// Scale function. Return used scale value (it may change when it touches the
|
||||
// min or max zoom value)
|
||||
double scaleZoomFactor( double scale, QPoint center, QSize minimumSize );
|
||||
Double scaleZoomFactor( Double scale, QPoint center, QSize minimumSize );
|
||||
|
||||
Q_SIGNALS:
|
||||
void selectionChanged( const QRect& rect );
|
||||
@@ -98,25 +95,25 @@ Q_SIGNALS:
|
||||
void zoomFactorChanged_byWheel( const double factor, const QPoint center );
|
||||
|
||||
public Q_SLOTS:
|
||||
// void setNormalMode();
|
||||
// void setMaskMode();
|
||||
// void setMaskTool();
|
||||
// void setEraserTool();
|
||||
// void setNormalSelectionTool();
|
||||
// void setBlockSelectionTool();
|
||||
// Void setNormalMode();
|
||||
// Void setMaskMode();
|
||||
// Void setMaskTool();
|
||||
// Void setEraserTool();
|
||||
// Void setNormalSelectionTool();
|
||||
// Void setBlockSelectionTool();
|
||||
void setSnapToGrid( bool enable );
|
||||
// void setSelectedArea( QRect &rect );
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent* event );
|
||||
void resizeEvent( QResizeEvent* event );
|
||||
void mousePressEvent( QMouseEvent* event );
|
||||
void mouseMoveEvent( QMouseEvent* event );
|
||||
void mouseReleaseEvent( QMouseEvent* event );
|
||||
void wheelEvent( QWheelEvent* event );
|
||||
Void paintEvent( QPaintEvent* event );
|
||||
Void resizeEvent( QResizeEvent* event );
|
||||
Void mousePressEvent( QMouseEvent* event );
|
||||
Void mouseMoveEvent( QMouseEvent* event );
|
||||
Void mouseReleaseEvent( QMouseEvent* event );
|
||||
Void wheelEvent( QWheelEvent* event );
|
||||
|
||||
void updateSize();
|
||||
void updateOffset();
|
||||
Void updateSize();
|
||||
Void updateOffset();
|
||||
|
||||
private:
|
||||
enum ViewMode
|
||||
@@ -135,12 +132,12 @@ private:
|
||||
|
||||
ViewMode mode() const { return m_mode; }
|
||||
Tool tool() const { return m_eTool; }
|
||||
void initZoomWinRect();
|
||||
void startZoomWinTimer();
|
||||
void setZoomFactor( double );
|
||||
Void initZoomWinRect();
|
||||
Void startZoomWinTimer();
|
||||
Void setZoomFactor( Double );
|
||||
|
||||
bool isPosValid( const QPoint& pos ) const;
|
||||
void updateMask( const QRect& rect );
|
||||
Bool isPosValid( const QPoint& pos ) const;
|
||||
Void updateMask( const QRect& rect );
|
||||
|
||||
QPoint windowToView( const QPoint& pt ) const;
|
||||
QRect windowToView( const QRect& rc ) const;
|
||||
@@ -148,20 +145,18 @@ private:
|
||||
QPoint viewToWindow( const QPoint& pt ) const;
|
||||
QRect viewToWindow( const QRect& rc ) const;
|
||||
|
||||
std::shared_ptr<CalypFrame> m_currFrame;
|
||||
std::shared_ptr<CalypFrame> m_nextFrame;
|
||||
PlaYUVerFrame* m_pcCurrFrame;
|
||||
|
||||
ClpPel m_uiPixelHalfScale;
|
||||
Pel m_uiPixelHalfScale;
|
||||
|
||||
Tool m_eTool;
|
||||
bool m_bGridVisible;
|
||||
Bool m_bGridVisible;
|
||||
|
||||
QTimer m_zoomWinTimer;
|
||||
double m_dZoomWinRatio;
|
||||
double m_dZoomFactor;
|
||||
Double m_dZoomWinRatio;
|
||||
Double m_dZoomFactor;
|
||||
|
||||
QImage m_image;
|
||||
//QPixmap m_pixmap;
|
||||
QPixmap m_pixmap;
|
||||
QBitmap m_mask;
|
||||
QRect m_selectedArea;
|
||||
QPoint m_lastPos;
|
||||
@@ -170,13 +165,13 @@ private:
|
||||
ViewMode m_mode;
|
||||
|
||||
QColor m_maskColor;
|
||||
int m_xOffset;
|
||||
int m_yOffset;
|
||||
bool m_blockTrackEnable;
|
||||
bool m_newShape;
|
||||
bool m_snapToGrid;
|
||||
bool m_cursorInGrid;
|
||||
bool m_visibleZoomRect;
|
||||
Int m_xOffset;
|
||||
Int m_yOffset;
|
||||
Bool m_blockTrackEnable;
|
||||
Bool m_newShape;
|
||||
Bool m_snapToGrid;
|
||||
Bool m_cursorInGrid;
|
||||
Bool m_visibleZoomRect;
|
||||
};
|
||||
|
||||
#endif // __VIEWAREA_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -22,14 +22,16 @@
|
||||
* \brief Frame number widget
|
||||
*/
|
||||
|
||||
#include "FrameNumberWidget.h"
|
||||
#include "config.h"
|
||||
#include <QtCore>
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "WidgetFrameNumber.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
|
||||
FrameNumberWidget::FrameNumberWidget( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
WidgetFrameNumber::WidgetFrameNumber( QWidget* parent ) : QWidget( parent )
|
||||
{
|
||||
QHBoxLayout* mainlayout = new QHBoxLayout;
|
||||
m_pcCurrFrameNumLabel = new QLabel;
|
||||
@@ -49,15 +51,15 @@ FrameNumberWidget::FrameNumberWidget( QWidget* parent )
|
||||
mainlayout->addWidget( m_pcTotalFrameNumLabel );
|
||||
setLayout( mainlayout );
|
||||
}
|
||||
void FrameNumberWidget::setCurrFrameNum( int number )
|
||||
Void WidgetFrameNumber::setCurrFrameNum( Int number )
|
||||
{
|
||||
m_pcCurrFrameNumLabel->setText( QString( tr( "%1" ) ).arg( number ) );
|
||||
}
|
||||
void FrameNumberWidget::setTotalFrameNum( int number )
|
||||
Void WidgetFrameNumber::setTotalFrameNum( Int number )
|
||||
{
|
||||
m_pcTotalFrameNumLabel->setText( QString( tr( "%1" ) ).arg( number ) );
|
||||
}
|
||||
void FrameNumberWidget::clear()
|
||||
Void WidgetFrameNumber::clear()
|
||||
{
|
||||
m_pcCurrFrameNumLabel->setText( "-" );
|
||||
m_pcTotalFrameNumLabel->setText( "-" );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,20 +25,22 @@
|
||||
#ifndef __WIDGETFRAMENUMBER_H__
|
||||
#define __WIDGETFRAMENUMBER_H__
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include <QtCore>
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
|
||||
class QLabel;
|
||||
|
||||
class FrameNumberWidget : public QWidget
|
||||
class WidgetFrameNumber : public QWidget
|
||||
{
|
||||
public:
|
||||
FrameNumberWidget( QWidget* parent = 0 );
|
||||
void setCurrFrameNum( int number );
|
||||
void setTotalFrameNum( int number );
|
||||
void clear();
|
||||
WidgetFrameNumber( QWidget* parent = 0 );
|
||||
Void setCurrFrameNum( Int number );
|
||||
Void setTotalFrameNum( Int number );
|
||||
Void clear();
|
||||
|
||||
private:
|
||||
QLabel* m_pcCurrFrameNumLabel;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
#
|
||||
# CMakeLists for calyp external components
|
||||
#
|
||||
|
||||
ADD_SUBDIRECTORY(qcustomplot)
|
||||
Vendored
+25331
File diff suppressed because it is too large.
Load diff
Vendored
+3958
File diff suppressed because it is too large.
Load diff
-17
@@ -1,17 +0,0 @@
|
||||
#
|
||||
# CMakeLists for qcustomplot
|
||||
#
|
||||
|
||||
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport)
|
||||
|
||||
SET(qcustomplot_SRCS qcustomplot.cpp qcustomplot.h)
|
||||
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-deprecated-enum-enum-conversion")
|
||||
ENDIF()
|
||||
|
||||
ADD_LIBRARY(QCustomPlotLib STATIC ${qcustomplot_SRCS})
|
||||
TARGET_LINK_LIBRARIES(QCustomPlotLib Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport)
|
||||
TARGET_INCLUDE_DIRECTORIES(QCustomPlotLib PUBLIC .)
|
||||
Vendored
-674
@@ -1,674 +0,0 @@
|
||||
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>.
|
||||
-611
@@ -1,611 +0,0 @@
|
||||
#### 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:
|
||||
- Default filling order of QCPLayoutGrid is now foColumnsFirst instead of foRowsFirst, as intended and consistent with QCP1.
|
||||
Note that this also changes the indexing order of e.g. QCustomPlot::axisRect(int index), compared with 2.0.0. You can change
|
||||
the filling and thus indexing order yourself by calling QCPLayoutGrid::setFillOrder.
|
||||
- fixed bug in QCPColorMap, when using alpha in the gradient color stops. Used to draw falsely black data points when the associated data value is exactly
|
||||
on the first or last color stop.
|
||||
- QCPDataSelection::enforceType(stDataRange) would erroneously add an empty data range to the selection, if the selection was already empty.
|
||||
This in turn would cause isEmpty() to erroneously return false.
|
||||
- fixed hypothetical crash when selectTest is called on a QCPItemCurve which has all of its points at the same position
|
||||
|
||||
Other:
|
||||
- Various documentation improvements and clarifications
|
||||
- Prevent conflict with windows.h min/max macros if user forgets to define NOMINMAX
|
||||
- compiling QCP shared libraries with static Qt is now easier
|
||||
- added defines QCUSTOMPLOT_VERSION and QCUSTOMPLOT_VERSION_STR (the same way Qt does) to provide the used QCP version number
|
||||
- added missing Q_DECL_OVERRIDE declarations, thus preventing warnings some compiler settings
|
||||
- QCPAxisTicker and subclasses are no longer copyable by value, as intended
|
||||
- QCPBarsGroup constructor is now explicit, as intended
|
||||
- Qt 5.11 compatibility
|
||||
|
||||
#### Version 2.0.0 released on 04.09.17 ####
|
||||
|
||||
Added major features:
|
||||
- Axis tick and tick label generation was completely refactored and is now handled in the QCPAxisTicker class (also see QCPAxis::setTicker). Available ticker subclasses for special uses cases:
|
||||
QCPAxisTicker, QCPAxisTickerFixed, QCPAxisTickerLog, QCPAxisTickerPi, QCPAxisTickerTime, QCPAxisTickerDateTime, QCPAxisTickerText
|
||||
- Data container is now based on QCPDataContainer template for unified data interface and significantly improved memory footprint and better performance for common use-cases, especially data adding/removing.
|
||||
- New data selection mechanism allows selection of single data points and data ranges for plottables. See special documentation page "data selection mechanism".
|
||||
- Rubber band/selection rect for data point selection and axis zooming is now available, see documentation of QCustomPlot::setSelectionRectMode and QCPSelectionRect. For this purpose, the new default
|
||||
layer "overlay" was introduced, which is now the top layer, and holds the QCustomPlot's QCPSelectionRect instance.
|
||||
- Data sharing between plottables of the same type (see setData methods taking a QSharedPointer)
|
||||
- OpenGL hardware acceleration is now available across all Qt versions (including Qt4) in a unified, simple interface, with QCustomPlot::setOpenGl (experimental)
|
||||
- QCPStatisticalBox can now display a series of statistical boxes instead of only a single one
|
||||
- New QCPErrorBars plottable allows attaching error bars to any one-dimensional plottable (QCPGraph has thus lost its own error-bar capability)
|
||||
- QCPColorMap now supports transparency via alpha in its color gradient stops, and via a dedicated cell-wise alpha map (see QCPColorMapData::setAlpha)
|
||||
- Layers may now be individually replotted (QCPLayer::replot), if the mode (QCPLayer::setMode) is set to lmBuffered. Mutually adjacent lmLogical layers share a single paint buffer to save resources.
|
||||
By default, the new topmost "overlay" layer which contains the selection rect is an lmBuffered layer. Updating the selection rect is thus very fast, independent of the plot contents.
|
||||
- QCPLayerable (and thus practically all objects in QCP) now have virtual methods to receive mouse press/move/release/doubleclick/wheel events. Before, only QCPLayoutElement provided them.
|
||||
this makes it much easier to subclass e.g. items and plottables to provide custom mouse interactions that were cumbersome and awkward with the simpler signal-based interface
|
||||
|
||||
Added minor features:
|
||||
- High-DPI support for Qt versions 5.0 and up, using device pixel ratio detected by Qt (can be changed manually via QCustomPlot::setBufferDevicePixelRatio).
|
||||
- QCPGraph and QCPCurve can now be configured to only display every n'th scatter symbol, see ::setScatterSkip() method
|
||||
- QCPFinancial allows to define bar width in absolute pixels and axis rect ratio, instead of only in plot key coordinates (see QCPFinancial::setWidthType)
|
||||
- Range dragging/zooming can now be configured to affect more than one axis per orientation (see new overloads of QCPAxisRect::setRangeDragAxes/setRangeZoomAxes)
|
||||
- Added QCPTextElement (replaces QCPPlotTitle) for general texts in layouts. Provides clicked and doubleClicked signals, as replacement for the removed QCustomPlot::titleClicked/titleDoubleClicked
|
||||
- Export functions (QCustomPlot::savePng etc.) now support specifying the resolution that will be written to the image file header. This improves operability with other tools which respect metadata.
|
||||
- Replots can now be queued to the next event loop iteration with replot(QCP::rpQueuedReplot). This way you can successively ask for a replot at multiple code locations without causing redundant replots
|
||||
- QCPAxisRect::zoom(...) allows to zoom to a specific rectangular region given in pixel coordinates, either affecting all axes or a specified subset of axes.
|
||||
- QCPRange::bounded returns a bounded range, trying to preserve its size. Works with rangeChanged signal to limit the allowed range (see rangeChanged doc)
|
||||
- Plottable rescaleValueAxis method (and getValueRange) now take parameter inKeyRange, which allows rescaling of the value axis only with respect to data in the currently visible key range
|
||||
- plottableClick and plottableDoubleClick signals now carry the clicked data point index as second parameter
|
||||
- Added QCPAxis::scaleRange overload without "center" argument, which scales around the current axis range center
|
||||
- Added QCPRange::expand/expanded overloads which take only one double parameter
|
||||
- Plottables addToLegend/removeFromLegend methods now have overloads that take any QCPLegend, to make working with non-default legends easier (legends that are not QCustomPlot::legend)
|
||||
- Added QCPStatisticalBox::setWhiskerAntialiased to allow controlling antialiasing state of whiskers independently of quartile box/median line
|
||||
- The virtual method QCPLayoutElement::layoutChanged() now allows subclasses to react on a move of the layout element between logical positions in the parent layout, or between layouts
|
||||
- QCPMarginGroup::commonMargin is now virtual, to facilitate subclassing of QCPMarginGroup
|
||||
- QCPGraph::getPreparedData is now virtual, and thus allows subclasses to easily generate own plotted data, e.g. on-the-fly.
|
||||
- Added QCPRange qDebug stream operator
|
||||
- QCPLayoutGrid (and thus QCPLegend) can now wrap rows or columns at specified row/column counts, see setFillOrder, setWrap and the new addElement overload which doesn't have row/column index
|
||||
Added minor features after beta:
|
||||
- QCPGraph fill now renders separate fill segments when there are gaps in the graph data (created by inserting NaN values)
|
||||
- fractional device pixel ratios are now used, if Qt version >= 5.6
|
||||
- Axes may now be dragged/zoomed individually by starting the drag/zoom on top of the axis (previously, this required additional code)
|
||||
- Manual minimum and maximum layout element sizes (setMinimumSize/setMaximumSize) can now affect the inner or the outer rect, see QCPLayoutElement::setSizeConstraintRect
|
||||
|
||||
Bugfixes [Also backported to 1.3.2]:
|
||||
- Fixed possible crash when having a QCPGraph with scatters only and a non-transparent main/fill brush of the graph
|
||||
- Fixed QCPItemPixmap not updating internally cached scaled pixmap if new pixmap set with same scaled dimensions
|
||||
- When using log axis scale and zooming out as far as possible (~1e-280..1e280), axis doesn't end up in (via mouse) unrecoverable range with strange axis ticks anymore
|
||||
- Axis tick label algorithm for beautifully typeset powers now checks whether "e" in tick label is actually part of a number before converting the exponent to superscript
|
||||
- Fixed QCustomPlot::moveLayer performing incorrect move and possible crash in certain situations
|
||||
- Fixed possible crash on QCustomPlot destruction due to wrong QObject-hierarchy. Only occurs if a QCPAxisRect is removed from the normal QCustomPlot destruction hierarchy by taking it out of its layout
|
||||
- Fixed possible freeze when data values become infinity after coord-to-pixel transformation (e.g. maximally zoomed out log axis), and line style is not solid (e.g. dashed) or phFastPolylines is disabled
|
||||
- Fixed a few missing enums in meta type system, by unifying usage of Q_ENUMS, Q_FLAGS and Q_DECLARE_METATYPE
|
||||
Bugfixes [Not in 1.3.2]:
|
||||
- Fixed QCPItemLine/QCPItemStraightLine not being selectable when defining coords are many orders of magnitude (>1e8) larger than currently viewed range
|
||||
- Fixed/worked around crash due to bug in QPainter::drawPixmap with very large negative x/y pixel coordinates, when drawing sparse pixmap scatters
|
||||
- Fixed possible (but unlikely) int overflow in adaptive sampling algorithm, that could cause plot artifacts when using extremely sparse data (with respect to current key axis range).
|
||||
- Fixed QCPBarsGroup bug which caused stPlotCoords spacing to be wrong with vertical key axes
|
||||
- A QCPBars axis rescale in the main window constructor (i.e. without well-defined plot size) now falls back to a datapoint-tight rescaling instead of doing nothing (because bar width can't be determined)
|
||||
- Improved QCPBars stacking when using bars with very large keys and key separation at limit of double precision
|
||||
Bugfixes after beta:
|
||||
- fixed QCPCurve vertex optimization algorithm not handling log axes correctly
|
||||
- upon removing the inner most axis, the offset of the new inner most axis (previously second axis) is now set to the value of the removed axis, instead of leaving a gap
|
||||
- QCPColorMap now has a default gradient (gpCold) again, instead of an empty and thus black gradient
|
||||
- doc: black QCPColorMap/QCPColorGradient documentation images fixed
|
||||
- scatter styles ssDiamond, ssTriangle and ssTriangleInverted now get proper filling with the specified brush
|
||||
- fixed click signals of plottable/axes/etc. not being emitted properly
|
||||
- fixed uninitialized scatterSkip on QCPCurve, leading to irregular default appearance of scatter skips
|
||||
- fixed device pixel ratio not being implemented correctly in cached tick labels
|
||||
- QCPLayoutElement::setMaximum/setMinimum now is with respect to the inner rect as intended (and documented), instead of the outer rect (and this can now be changed via setSizeConstraintRect)
|
||||
- fixed dllimport issue on template classes when compiling as shared library with MSVC
|
||||
|
||||
|
||||
Summary of backward incompatible changes:
|
||||
Plottable related:
|
||||
- Removed QCustomPlot::addPlottable, not needed anymore as plottables now automatically register in their constructor
|
||||
- Removed QCustomPlot::addItem, not needed anymore as items now automatically register in their constructor
|
||||
- QCPAbstractPlottable::addToLegend/removeFromLegend are not virtual anymore. If your plottable requires a custom legend item, add it to the legend manually.
|
||||
- setData/addData method overloads of plottables have changed to facilitate data sharing and new data container (see documentation)
|
||||
- plottableClick and plottableDoubleClick signals now carry the clicked data point index as second parameter, and the QMouseEvent parameter has moved to third.
|
||||
Check all your usages of those signals, because Qt's connect method only reports problems during runtime!
|
||||
- setSelectable now not only limits what can be selected by the user, but limits also any programmatic selection changes via setSelected.
|
||||
- enum QCPAbstractPlottable::SignDomain has changed namespace to QCP::SignDomain
|
||||
Axis related:
|
||||
- Removed QCPAxis::setAutoTicks, setAutoTickCount, setAutoTickLabels, setAutoTickStep, setAutoSubTicks, setTickLabelType, setDateTimeFormat, setDateTimeSpec,
|
||||
setTickStep, setTickVector, setTickVectorLabels, setSubTickCount in favor of new QCPAxisTicker-based interface
|
||||
- Added QCPAxis::setSubTicks to enable/disable subticks (manually controlling the subtick count needs subclassing of QCPAxisTicker, e.g. QCPAxisTickerText and QCPAxisTickerLog provide setSubTickCount)
|
||||
Item related:
|
||||
- Renamed QCPAbstractItem::rectSelectTest to rectDistance, to prevent confusion with new QCPAbstractPlottable1D::selectTestRect
|
||||
- Renamed QCPItemAnchor::pixelPoint to QCPItemAnchor::pixelPosition (also affects subclass QCPItemPosition)
|
||||
General:
|
||||
- Renamed QCustomPlot::RefreshPriority enums (parameter of the replot() method): rpImmediate to rpImmediateRefresh, rpQueued to rpQueuedRefresh, rpHint to rpRefreshHint
|
||||
- Renamed QCustomPlot::PlottingHint enum phForceRepaint to phImmediateRefresh
|
||||
- Removed QCPPlotTitle layout element (See new QCPTextElement for almost drop-in replacement)
|
||||
- Removed signals QCustomPlot::titleClicked/titleDoubleClicked, replaced by QCPTextElement signals clicked/doubleClicked.
|
||||
- QCustomPlot::savePdf has changed parameters from (fileName, bool noCosmeticPen, width, height,...) to (fileName, width, height, QCP::ExportPen exportPen,...)
|
||||
- Virtual methods QCPLayoutElement::mouseMoveEvent/mouseReleaseEvent (which are now introduced already in the superclass QCPLayerable) have gained an additional parameter const QPointF &startPos.
|
||||
If you have reimplemented these methods, make sure to update your function signatures, otherwise your reimplementations will likely be ignored by the compiler without warning
|
||||
- Creating a new QCPColorGradient without supplying a preset parameter in the constructor now creates an empty gradient, instead of loading the gpCold preset
|
||||
|
||||
Other:
|
||||
- Replaced usage of Qt's QVector2D with own QCPVector2D which uses double precision and offers some convenience functions
|
||||
- Extended relative range to which QCPItemLine/QCPItemStraightLine can be zoomed before vanishing from ~1e9 to ~1e16
|
||||
- Removed QCPItemStraightLine::distToStraightLine (replaced by QCPVector2D::distanceToStraightLine)
|
||||
- Removed QCPAbstractPlottable::distSqrToLine and QCPAbstractItem::distSqrToLine (replaced by QCPVector2D::distanceSquaredToLine)
|
||||
- Qt5.5 compatibility (If you use PDF export, test your outputs, as output dimensions might change when switching Qt versions -- QCP does not try to emulate previous Qt version behaviour here)
|
||||
- QCP now includes <QtPrintSupport/QtPrintSupport> instead of just <QtPrintSupport> because some users had problems with the latter. Please report if you now experience issues due to the new include.
|
||||
- QCPGraph can now use a brush (filled polygon under the graph data) without having a graph line (line style lsNone)
|
||||
- QCPFinancial is now two-colored (setTwoColored(true)) by default, and has green/red as default two-colored brushes and pens
|
||||
- Plottable pixelsToCoords/coordsToPixels methods are now public, and offer transformations from pixel to plot coordinates and vice versa, using the plottable's axes
|
||||
- Plottable getKeyRange/getValueRange methods are now public
|
||||
- QCPBarsGroup now always places the QCPBars that was added to the group first towards lower keys, independent of axis orientation or direction (the ordering used to flip with axis orientation)
|
||||
- Default focus policy for QCustomPlot is now Qt::ClickFocus, instead of Qt::NoFocus.
|
||||
- tweaked QCPLegend and QCPAbstractLegendItem margins: The items have by default zero own margins, and QCPLegend row- and column spacing was increased to compensate. Legend was made slightly denser by default.
|
||||
- Used doxygen version is now 1.8.12, and documentation/postprocessing-scripts were adapted accordingly. Expect minor issues and some warnings when using older doxygen.
|
||||
Other after beta:
|
||||
- Integrated OpenGL support (QCustomPlot::setOpenGl) is experimental for now, due the strong dependency on the system/graphics driver of the current implementation
|
||||
- fixed some plot title font sizes in the example projects that were too small due to switch to QCPTextElement
|
||||
- added missing override specifiers on reimplemented virtual methods
|
||||
- changed to more intuitive defaults for QCPSelectionDecorator scatter style (now doesn't define an own scatter pen by default)
|
||||
|
||||
#### Version 1.3.2 released on 22.12.15 ####
|
||||
|
||||
Bugfixes [Backported from 2.0.0 branch]:
|
||||
- Fixed possible crash when having a QCPGraph with scatters only and a non-transparent main/fill brush of the graph
|
||||
- Fixed QCPItemPixmap not updating internally cached scaled pixmap if new pixmap set with same scaled dimensions
|
||||
- When using log axis scale and zooming out as far as possible (~1e-280..1e280), axis doesn't end up in (via mouse) unrecoverable range with strange axis ticks anymore
|
||||
- Axis tick label algorithm for beautifully typeset powers now checks whether "e" in tick label is actually part of a number before converting the exponent to superscript
|
||||
- Fixed QCustomPlot::moveLayer performing incorrect move and possible crash in certain situations
|
||||
- Fixed possible crash on QCustomPlot destruction due to wrong QObject-hierarchy. Only occurs if a QCPAxisRect is removed from the normal QCustomPlot destruction hierarchy by taking it out of its layout
|
||||
- Fixed possible freeze when data values become infinity after coord-to-pixel transformation (e.g. maximally zoomed out log axis), and line style is not solid (e.g. dashed) or phFastPolylines is disabled
|
||||
|
||||
Other [Backported from 2.0.0 branch]:
|
||||
- A few documentation fixes/improvements
|
||||
- Qt5.5 compatibility (If you use PDF export, test your outputs, as output dimensions might change when switching Qt versions -- QCP does not try to emulate previous Qt version behaviour here)
|
||||
- QCP now includes <QtPrintSupport/QtPrintSupport> instead of just <QtPrintSupport> because some users had problems with the latter. Please report if you now experience issues due to the new include.
|
||||
|
||||
#### Version 1.3.1 released on 25.04.15 ####
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bug that prevented automatic axis rescaling when some graphs/curves had only NaN data points
|
||||
- Improved QCPItemBracket selection boundaries, especially bsCurly and bsCalligraphic
|
||||
- Fixed bug of axis rect and colorscale background shifted downward by one logical pixel (visible in scaled png and pdf export)
|
||||
- Replot upon mouse release is now only performed if a selection change has actually happened (improves responsivity on particularly complex plots)
|
||||
- Fixed bug that allowed scatter-only graphs to be selected by clicking the non-existent line between scatters
|
||||
- Fixed crash when trying to select a scatter-only QCPGraph whose only points in the visible key range are at identical key coordinates and vertically off-screen, with adaptive sampling enabled
|
||||
- Fixed pdf export of QCPColorMap with enabled interpolation (didn't appear interpolated in pdf)
|
||||
- Reduced QCPColorMap jitter of internal cell boundaries for small sized maps when viewed with high zoom, by applying oversampling factors dependant on map size
|
||||
- Fixed bug of QCPColorMap::fill() not causing the buffered internal image map to be updated, and thus the change didn't become visible immediately
|
||||
- Axis labels with size set in pixels (setPixelSize) instead of points now correctly calculate the exponent's font size if beautifully typeset powers are enabled
|
||||
- Fixed QCPColorMap appearing at the wrong position for logarithmic axes and color map spanning larger ranges
|
||||
|
||||
Other:
|
||||
- Pdf export used to embed entire QCPColorMaps, potentially leading to large files. Now only the visible portion of the map is embedded in the pdf
|
||||
- Many documentation fixes and extensions, style modernization
|
||||
- Reduced documentation file size (and thus full package size) by automatically reducing image palettes during package build
|
||||
- Fixed MSVC warning message (at warning level 4) due to temporary QLists in some foreach statements
|
||||
|
||||
#### Version 1.3.0 released on 27.12.14 ####
|
||||
|
||||
Added features:
|
||||
- New plottable class QCPFinancial allows display of candlestick/ohlc data
|
||||
- New class QCPBarsGroup allows horizontal grouping of multiple QCPBars plottables
|
||||
- Added QCPBars feature allowing non-zero base values (see property QCPBars::setBaseValue)
|
||||
- Added QCPBars width type, for more flexible bar widths (see property QCPBars::setWidthType)
|
||||
- New QCPCurve optimization algorithm, fixes bug which caused line flicker at deep zoom into curve segment
|
||||
- Item positions can now have different position types and anchors for their x and y coordinates (QCPItemPosition::setTypeX/Y, setParentAnchorX/Y)
|
||||
- QCPGraph and QCPCurve can now display gaps in their lines, when inserting quiet NaNs as values (std::numeric_limits<double>::quiet_NaN())
|
||||
- QCPAxis now supports placing the tick labels inside the axis rect, for particularly space saving plots (QCPAxis::setTickLabelSide)
|
||||
Added features after beta:
|
||||
- Made code compatible with QT_NO_CAST_FROM_ASCII, QT_NO_CAST_TO_ASCII
|
||||
- Added compatibility with QT_NO_KEYWORDS after sending code files through a simple reg-ex script
|
||||
- Added possibility to inject own QCPAxis(-subclasses) via second, optional QCPAxisRect::addAxis parameter
|
||||
- Added parameter to QCPItemPixmap::setScaled to specify transformation mode
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bug in QCPCurve rendering of very zoomed-in curves (via new optimization algorithm)
|
||||
- Fixed conflict with MSVC-specific keyword "interface" in text-document-integration example
|
||||
- Fixed QCPScatterStyle bug ignoring the specified pen in the custom scatter shape constructor
|
||||
- Fixed bug (possible crash) during QCustomPlot teardown, when a QCPLegend that has no parent layout (i.e. was removed from layout manually) gets deleted
|
||||
Bugfixes after beta:
|
||||
- Fixed bug of QCPColorMap/QCPColorGradient colors being off by one color sampling step (only noticeable in special cases)
|
||||
- Fixed bug of QCPGraph adaptive sampling on vertical key axis, causing staggered look
|
||||
- Fixed low (float) precision in QCPCurve optimization algorithm, by not using QVector2D anymore
|
||||
|
||||
Other:
|
||||
- Qt 5.3 and Qt 5.4 compatibility
|
||||
|
||||
#### Version 1.2.1 released on 07.04.14 ####
|
||||
|
||||
Bugfixes:
|
||||
- Fixed regression which garbled date-time tick labels on axes, if setTickLabelType is ltDateTime and setNumberFormat contains the "b" option
|
||||
|
||||
#### Version 1.2.0 released on 14.03.14 ####
|
||||
|
||||
Added features:
|
||||
- Adaptive Sampling for QCPGraph greatly improves performance for high data densities (see QCPGraph::setAdaptiveSampling)
|
||||
- QCPColorMap plottable with QCPColorScale layout element allows plotting of 2D color maps
|
||||
- QCustomPlot::savePdf now has additional optional parameters pdfCreator and pdfTitle to set according PDF metadata fields
|
||||
- QCustomPlot::replot now allows specifying whether the widget update is immediate (repaint) or queued (update)
|
||||
- QCPRange operators +, -, *, / with double operand for range shifting and scaling, and ==, != for range comparison
|
||||
- Layers now have a visibility property (QCPLayer::setVisible)
|
||||
- static functions QCPAxis::opposite and QCPAxis::orientation now offer more convenience when handling axis types
|
||||
- added notification signals for selectability change (selectableChanged) on all objects that have a selected/selectable property
|
||||
- added notification signal for QCPAxis scaleType property
|
||||
- added notification signal QCPLayerable::layerChanged
|
||||
|
||||
Bugfixes:
|
||||
- Fixed assert halt, when QCPAxis auto tick labels not disabled but nevertheless a custom non-number tick label ending in "e" given
|
||||
- Fixed painting glitches when QCustomPlot resized inside a QMdiArea or under certain conditions inside a QLayout
|
||||
- If changing QCPAxis::scaleType and thus causing range sanitizing and a range modification, rangeChanged wouldn't be emitted
|
||||
- Fixed documentation bug that caused indentation to be lost in code examples
|
||||
Bugfixes after beta:
|
||||
- Fixed bug that caused crash if clicked-on legend item is removed in mousePressEvent.
|
||||
- On some systems, font size defaults to -1, which used to cause a debug output in QCPAxisPainterPrivate::TickLabelDataQCP. Now it's checked before setting values based on the default font size.
|
||||
- When using multiple axes on one side, setting one to invisible didn't properly compress the freed space.
|
||||
- Fixed bug that allowed selection of plottables when clicking in the bottom or top margin of a QCPAxisRect (outside the inner rect)
|
||||
|
||||
Other:
|
||||
- In method QCPAbstractPlottable::getKeyRange/getValueRange, renamed parameter "validRange" to "foundRange", to better reflect its meaning (and contrast it from QCPRange::validRange)
|
||||
- QCPAxis low-level axis painting methods exported to QCPAxisPainterPrivate
|
||||
|
||||
#### Version 1.1.1 released on 09.12.13 ####
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bug causing legends blocking input events from reaching underlying axis rect even if legend is invisible
|
||||
- Added missing Q_PROPERTY for QCPAxis::setDateTimeSpec
|
||||
- Fixed behaviour of QCPAxisRect::setupFullAxesBox (now transfers more properties from bottom/left to top/right axes and sets visibility of bottom/left axes to true)
|
||||
- Made sure PDF export doesn't default to grayscale output on some systems
|
||||
|
||||
Other:
|
||||
- Plotting hint QCP::phForceRepaint is now enabled on all systems (and not only on windows) by default
|
||||
- Documentation improvements
|
||||
|
||||
#### Version 1.1.0 released on 04.11.13 ####
|
||||
|
||||
Added features:
|
||||
- Added QCPRange::expand and QCPRange::expanded
|
||||
- Added QCPAxis::rescale to rescale axis to all associated plottables
|
||||
- Added QCPAxis::setDateTimeSpec/dateTimeSpec to allow axis labels either in UTC or local time
|
||||
- QCPAxis now additionally emits a rangeChanged signal overload that provides the old range as second parameter
|
||||
|
||||
Bugfixes:
|
||||
- Fixed QCustomPlot::rescaleAxes not rescaling properly if first plottable has an empty range
|
||||
- QCPGraph::rescaleAxes/rescaleKeyAxis/rescaleValueAxis are no longer virtual (never were in base class, was a mistake)
|
||||
- Fixed bugs in QCPAxis::items and QCPAxisRect::items not properly returning associated items and potentially stalling
|
||||
|
||||
Other:
|
||||
- Internal change from QWeakPointer to QPointer, thus got rid of deprecated Qt functionality
|
||||
- Qt5.1 and Qt5.2 (beta1) compatibility
|
||||
- Release packages now extract to single subdirectory and don't place multiple files in current working directory
|
||||
|
||||
#### Version 1.0.1 released on 05.09.13 ####
|
||||
|
||||
Bugfixes:
|
||||
- using define flag QCUSTOMPLOT_CHECK_DATA caused debug output when data was correct, instead of invalid (fixed QCP::isInvalidData)
|
||||
- documentation images are now properly shown when viewed with Qt Assistant
|
||||
- fixed various documentation mistakes
|
||||
|
||||
Other:
|
||||
- Adapted documentation style sheet to better match Qt5 documentation
|
||||
|
||||
#### Version 1.0.0 released on 01.08.13 ####
|
||||
|
||||
Quick Summary:
|
||||
- Layout system for multiple axis rects in one plot
|
||||
- Multiple axes per side
|
||||
- Qt5 compatibility
|
||||
- More flexible and consistent scatter configuration with QCPScatterStyle
|
||||
- Various interface cleanups/refactoring
|
||||
- Pixmap-cached axis labels for improved replot performance
|
||||
|
||||
Changes that break backward compatibility:
|
||||
- QCustomPlot::axisRect() changed meaning due to the extensive changes to how axes and axis rects are handled
|
||||
it now returns a pointer to a QCPAxisRect and takes an integer index as parameter.
|
||||
- QCPAxis constructor changed to now take QCPAxisRect* as parent
|
||||
- setAutoMargin, setMarginLeft/Right/Top/Bottom removed due to the axis rect changes (see QCPAxisRect::setMargins/setAutoMargins)
|
||||
- setAxisRect removed due to the axis rect changes
|
||||
- setAxisBackground(-Scaled/-ScaledMode) now moved to QCPAxisRect as setBackground(-Scaled/ScaledMode) (access via QCustomPlot::axisRects())
|
||||
- QCPLegend now is a QCPLayoutElement
|
||||
- QCPAbstractPlottable::drawLegendIcon parameter "rect" changed from QRect to QRectF
|
||||
- QCPAbstractLegendItem::draw second parameter removed (position/size now handled via QCPLayoutElement base class)
|
||||
- removed QCPLegend::setMargin/setMarginLeft/Right/Top/Bottom (now inherits the capability from QCPLayoutElement::setMargins)
|
||||
- removed QCPLegend::setMinimumSize (now inherits the capability from QCPLayoutElement::setMinimumSize)
|
||||
- removed enum QCPLegend::PositionStyle, QCPLegend::positionStyle/setPositionStyle/position/setPosition (replaced by capabilities of QCPLayoutInset)
|
||||
- QCPLegend transformed to work with new layout system (almost everything changed)
|
||||
- removed entire title interface: QCustomPlot::setTitle/setTitleFont/setTitleColor/setTitleSelected/setTitleSelectedFont/setTitleSelectedColor and
|
||||
the QCustomPlot::iSelectTitle interaction flag (all functionality is now given by the layout element "QCPPlotTitle" which can be added to the plot layout)
|
||||
- selectTest functions now take two additional parameters: bool onlySelectable and QVariant *details=0
|
||||
- selectTest functions now ignores visibility of objects and (if parameter onlySelectable is true) does not anymore ignore selectability of the object
|
||||
- moved QCustomPlot::Interaction/Interactions to QCP namespace as QCP::Interaction/Interactions
|
||||
- moved QCustomPlot::setupFullAxesBox() to QCPAxisRect::setupFullAxesBox. Now also accepts parameter to decide whether to connect opposite axis ranges
|
||||
- moved range dragging/zooming interface from QCustomPlot to QCPAxisRect (setRangeDrag, setRangeZoom, setRangeDragAxes, setRangeZoomAxes,...)
|
||||
- rangeDrag/Zoom is now set to Qt::Horizontal|Qt::Vertical instead of 0 by default, on the other hand, iRangeDrag/Zoom is unset in interactions by
|
||||
default (this makes enabling dragging/zooming easier by just adding the interaction flags)
|
||||
- QCPScatterStyle takes over everything related to handling scatters in all plottables
|
||||
- removed setScatterPen/Size on QCPGraph and QCPCurve, removed setOutlierPen/Size on QCPStatisticalBox (now handled via QCPScatterStyle)
|
||||
- modified setScatterStyle on QCPGraph and QCPCurve, and setOutlierStyle on QCPStatisticalBox, to take QCPScatterStyle
|
||||
- axis grid and subgrid are now reachable via the QCPGrid *QCPAxis::grid() method. (e.g. instead of xAxis->setGrid(true), write xAxis->grid()->setVisible(true))
|
||||
|
||||
Added features:
|
||||
- Axis tick labels are now pixmap-cached, thus increasing replot performance (in usual setups by about 24%). See plotting hint phCacheLabels which is set by default
|
||||
- Advanced layout system, including the classes QCPLayoutElement, QCPLayout, QCPLayoutGrid, QCPLayoutInset, QCPAxisRect
|
||||
- QCustomPlot::axisRects() returns all the axis rects in the QCustomPlot.
|
||||
- QCustomPlot::plotLayout() returns the top level layout (initially a QCPLayoutGrid with one QCPAxisRect inside)
|
||||
- QCPAxis now may have an offset to the axis rect (setOffset)
|
||||
- Multiple axes per QCPAxisRect side are now supported (see QCPAxisRect::addAxis)
|
||||
- QCustomPlot::toPixmap renders the plot into a pixmap and returns it
|
||||
- When setting tick label rotation to +90 or -90 degrees on a vertical axis, the labels are now centered vertically on the tick height
|
||||
(This allows space saving vertical tick labels by having the text direction parallel to the axis)
|
||||
- Substantially increased replot performance when using very large manual tick vectors (> 10000 ticks) via QCPAxis::setTickVector
|
||||
- QCPAxis and QCPAxisRect now allow easy access to all plottables(), graphs() and items() that are associated with them
|
||||
- Added QCustomPlot::hasItem method for consistency with plottable interface, hasPlottable
|
||||
- Added QCPAxisRect::setMinimumMargins as replacement for hardcoded minimum axis margin (15 px) when auto margin is enabled
|
||||
- Added Flags type QCPAxis::AxisTypes (from QCPAxis::AxisType), used in QCPAxisRect interface
|
||||
- Automatic margin calculation can now be enabled/disabled on a per-side basis, see QCPAxisRect::setAutoMargins
|
||||
- QCPAxisRect margins of multiple axis rects can be coupled via QCPMarginGroup
|
||||
- Added new default layers "background" and "legend" (QCPAxisRect draws its background on the "background" layer, QCPLegend is on the "legend" layer by default)
|
||||
- Custom scatter style via QCP::ssCustom and respective setCustomScatter functions that take a QPainterPath
|
||||
- Filled scatters via QCPScatterStyle::setBrush
|
||||
Added features after beta:
|
||||
- Added QCustomPlot::toPainter method, to allow rendering with existing painter
|
||||
- QCPItemEllipse now provides a center anchor
|
||||
|
||||
Bugfixes:
|
||||
- Fixed compile error on ARM
|
||||
- Wrong legend icons were displayed if using pixmaps for scatters that are smaller than the legend icon rect
|
||||
- Fixed clipping inaccuracy for rotated tick labels (were hidden too early, because the non-rotated bounding box was used)
|
||||
- Fixed bug that caused wrong clipping of axis ticks and subticks when the ticks were given manually by QCPAxis::setTickVector
|
||||
- Fixed Qt5 crash when dragging graph out of view (iterator out of bounds in QCPGraph::getVisibleDataBounds)
|
||||
- Fixed QCPItemText not scaling properly when using scaled raster export
|
||||
Bugfixes after beta:
|
||||
- Fixed bug that clipped the rightmost pixel column of tick labels when caching activated (only visible on windows for superscript exponents)
|
||||
- Restored compatibility to Qt4.6
|
||||
- Restored support for -no-RTTI compilation
|
||||
- Empty manual tick labels are handled more gracefully (no QPainter qDebug messages anymore)
|
||||
- Fixed type ambiguity in QCPLineEnding::draw causing compile error on ARM
|
||||
- Fixed bug of grid layouts not propagating the minimum size from their child elements to the parent layout correctly
|
||||
- Fixed bug of child elements (e.g. axis rects) of inset layouts not properly receiving mouse events
|
||||
|
||||
Other:
|
||||
- Opened up non-amalgamated project structure to public via git repository
|
||||
|
||||
#### Version released on 09.06.12 ####
|
||||
|
||||
Quick Summary:
|
||||
- Items (arrows, text,...)
|
||||
- Layers (easier control over rendering order)
|
||||
- New antialiasing system (Each objects controls own antialiasing with setAntialiased)
|
||||
- Performance Improvements
|
||||
- improved pixel-precise drawing
|
||||
- easier shared library creation/usage
|
||||
|
||||
Changes that (might) break backward compatibility:
|
||||
- enum QCPGraph::ScatterSymbol was moved to QCP namespace (now QCP::ScatterSymbol).
|
||||
This replace should fix your code: "QCPGraph::ss" -> "QCP::ss"
|
||||
- enum QCustomPlot::AntialiasedElement and flag QCustomPlot::AntialiasedElements was moved to QCP namespace
|
||||
This replace should fix your code: "QCustomPlot::ae" -> "QCP::ae"
|
||||
- the meaning of QCustomPlot::setAntialiasedElements has changed slightly: It is now an override to force elements to be antialiased. If you want to force
|
||||
elements to not be drawn antialiased, use the new setNotAntialiasedElements. If an element is mentioned in neither of those functions, it now controls
|
||||
its antialiasing itself via its "setAntialiased" function(s). (e.g. QCPAxis::setAntialiased(bool), QCPAbstractPlottable::setAntialiased(bool),
|
||||
QCPAbstractPlottable::setAntialiasedScatters(bool), etc.)
|
||||
- QCPAxis::setTickVector and QCPAxis::setTickVectorLabels no longer take a pointer but a const reference of the respective QVector as parameter.
|
||||
(handing over a pointer didn't give any noticeable performance benefits but was inconsistent with the rest of the interface)
|
||||
- Equally QCPAxis::tickVector and QCPAxis::tickVectorLabels don't return by pointer but by value now
|
||||
- QCustomPlot::savePngScaled was removed, its purpose is now included as optional parameter "scale" of savePng.
|
||||
- If you have derived from QCPAbstractPlottable: all selectTest functions now consistently take the argument "const QPointF &pos" which is the test point in pixel coordinates.
|
||||
(the argument there was "double key, double value" in plot coordinates, before).
|
||||
- QCPAbstractPlottable, QCPAxis and QCPLegend now inherit from QCPLayerable
|
||||
- If you have derived from QCPAbstractPlottable: the draw method signature has changed from "draw (..) const" to "draw (..)", i.e. the method
|
||||
is not const anymore. This allows the draw function of your plottable to perform buffering/caching operations, if necessary.
|
||||
|
||||
Added features:
|
||||
- Item system: QCPAbstractItem, QCPItemAnchor, QCPItemPosition, QCPLineEnding. Allows placing of lines, arrows, text, pixmaps etc.
|
||||
- New Items: QCPItemStraightLine, QCPItemLine, QCPItemCurve, QCPItemEllipse, QCPItemRect, QCPItemPixmap, QCPItemText, QCPItemBracket, QCPItemTracer
|
||||
- QCustomPlot::addItem/itemCount/item/removeItem/selectedItems
|
||||
- signals QCustomPlot::itemClicked/itemDoubleClicked
|
||||
- the QCustomPlot interactions property now includes iSelectItems (for selection of QCPAbstractItem)
|
||||
- QCPLineEnding. Represents the different styles a line/curve can end (e.g. different arrows, circle, square, bar, etc.), see e.g. QCPItemCurve::setHead
|
||||
- Layer system: QCPLayerable, QCPLayer. Allows more sophisticated control over drawing order and a kind of grouping.
|
||||
- QCPAbstractPlottable, QCPAbstractItem, QCPAxis, QCPGrid, QCPLegend are layerables and derive from QCPLayerable
|
||||
- QCustomPlot::addLayer/moveLayer/removeLayer/setCurrentLayer/layer/currentLayer/layerCount
|
||||
- Initially there are three layers: "grid", "main", and "axes". The "main" layer is initially empty and set as current layer, so new plottables/items are put there.
|
||||
- QCustomPlot::viewport now makes the previously inaccessible viewport rect read-only-accessible (needed that for item-interface)
|
||||
- PNG export now allows transparent background by calling QCustomPlot::setColor(Qt::transparent) before savePng
|
||||
- QCPStatisticalBox outlier symbols may now be all scatter symbols, not only hardcoded circles.
|
||||
- perfect precision of scatter symbol/error bar drawing and clipping in both antialiased and non-antialiased mode, by introducing QCPPainter
|
||||
that works around some QPainter bugs/inconveniences. Further, more complex symbols like ssCrossSquare used to look crooked, now they look good.
|
||||
- new antialiasing control system: Each drawing element now has its own "setAntialiased" function to control whether it is drawn antialiased.
|
||||
- QCustomPlot::setAntialiasedElements and QCustomPlot::setNotAntialiasedElements can be used to override the individual settings.
|
||||
- Subclasses of QCPAbstractPlottable can now use the convenience functions like applyFillAntialiasingHint or applyScattersAntialiasingHint to
|
||||
easily make their drawing code comply with the overall antialiasing system.
|
||||
- QCustomPlot::setNoAntialiasingOnDrag allows greatly improved performance and responsiveness by temporarily disabling all antialiasing while
|
||||
the user is dragging axis ranges
|
||||
- QCPGraph can now show scatter symbols at data points and hide its line (see QCPGraph::setScatterStyle, setScatterSize, setScatterPixmap, setLineStyle)
|
||||
- Grid drawing code was sourced out from QCPAxis to QCPGrid. QCPGrid is mainly an internal class and every QCPAxis owns one. The grid interface still
|
||||
works through QCPAxis and hasn't changed. The separation allows the grid to be drawn on a different layer as the axes, such that e.g. a graph can
|
||||
be above the grid but below the axes.
|
||||
- QCustomPlot::hasPlottable(plottable), returns whether the QCustomPlot contains the plottable
|
||||
- QCustomPlot::setPlottingHint/setPlottingHints, plotting hints control details about the plotting quality/speed
|
||||
- export to jpg and bmp added (QCustomPlot::saveJpg/saveBmp), as well as control over compression quality for png and jpg
|
||||
- multi-select-modifier may now be specified with QCustomPlot::setMultiSelectModifier and is not fixed to Ctrl anymore
|
||||
|
||||
Bugfixes:
|
||||
- fixed QCustomPlot ignores replot after it had size (0,0) even if size becomes valid again
|
||||
- on Windows, a repaint used to be delayed during dragging/zooming of a complex plot, until the drag operation was done.
|
||||
This was fixed, i.e. repaints are forced after a replot() call. See QCP::phForceRepaint and setPlottingHints.
|
||||
- when using the raster paintengine and exporting to scaled PNG, pen widths are now scaled correctly (QPainter bug workaround via QCPPainter)
|
||||
- PDF export now respects QCustomPlot background color (QCustomPlot::setColor), also Qt::transparent
|
||||
- fixed a bug on QCPBars and QCPStatisticalBox where auto-rescaling of axis would fail when all data is very small (< 1e-11)
|
||||
- fixed mouse event propagation bug that prevented range dragging from working on KDE (GNU/Linux)
|
||||
- fixed a compiler warning on 64-bit systems due to pointer cast to int instead of quintptr in a qDebug output
|
||||
|
||||
Other:
|
||||
- Added support for easier shared library creation (including examples for compiling and using QCustomPlot as shared library)
|
||||
- QCustomPlot now has the Qt::WA_OpaquePaintEvent widget attribute (gives slightly improved performance).
|
||||
- QCP::aeGraphs (enum QCP::AntialiasedElement, previously QCustomPlot::aeGraphs) has been marked deprecated since version 02.02.12 and
|
||||
was now removed. Use QCP::aePlottables instead.
|
||||
- optional performance-quality-tradeoff for solid graph lines (see QCustomPlot::setPlottingHints).
|
||||
- marked data classes and QCPRange as Q_MOVABLE_TYPE
|
||||
- replaced usage of own macro FUNCNAME with Qt macro Q_FUNC_INFO
|
||||
- QCustomPlot now returns a minimum size hint of 50*50
|
||||
|
||||
#### Version released on 31.03.12 ####
|
||||
|
||||
Changes that (might) break backward compatibility:
|
||||
- QCPAbstractLegendItem now inherits from QObject
|
||||
- mousePress, mouseMove and mouseRelease signals are now emitted before and not after any QCustomPlot processing (range dragging, selecting, etc.)
|
||||
|
||||
Added features:
|
||||
- Interaction system: now allows selecting of objects like plottables, axes, legend and plot title, see QCustomPlot::setInteractions documentation
|
||||
- Interaction system for plottables:
|
||||
- setSelectable, setSelected, setSelectedPen, setSelectedBrush, selectTest on QCPAbstractPlottable and all derived plottables
|
||||
- setSelectionTolerance on QCustomPlot
|
||||
- selectedPlottables and selectedGraphs on QCustomPlot (returns the list of currently selected plottables/graphs)
|
||||
- Interaction system for axes:
|
||||
- setSelectable, setSelected, setSelectedBasePen, setSelectedTickPen, setSelectedSubTickPen, setSelectedLabelFont, setSelectedTickLabelFont,
|
||||
setSelectedLabelColor, setSelectedTickLabelColor, selectTest on QCPAxis
|
||||
- selectedAxes on QCustomPlot (returns a list of the axes that currently have selected parts)
|
||||
- Interaction system for legend:
|
||||
- setSelectable, setSelected, setSelectedBorderPen, setSelectedIconBorderPen, setSelectedBrush, setSelectedFont, setSelectedTextColor, selectedItems on QCPLegend
|
||||
- setSelectedFont, setSelectedTextColor, setSelectable, setSelected on QCPAbstractLegendItem
|
||||
- selectedLegends on QCustomPlot
|
||||
- Interaction system for title:
|
||||
- setSelectedTitleFont, setSelectedTitleColor, setTitleSelected on QCustomPlot
|
||||
- new signals in accordance with the interaction system:
|
||||
- selectionChangedByUser on QCustomPlot
|
||||
- selectionChanged on QCPAbstractPlottable
|
||||
- selectionChanged on QCPAxis
|
||||
- selectionChanged on QCPLegend and QCPAbstractLegendItem
|
||||
- plottableClick, legendClick, axisClick, titleClick, plottableDoubleClick, legendDoubleClick, axisDoubleClick, titleDoubleClick on QCustomPlot
|
||||
- QCustomPlot::deselectAll (deselects everything, i.e. axes and plottables)
|
||||
- QCPAbstractPlottable::pixelsToCoords (inverse function to the already existing coordsToPixels function)
|
||||
- QCPRange::contains(double value)
|
||||
- QCPAxis::setLabelColor and setTickLabelColor
|
||||
- QCustomPlot::setTitleColor
|
||||
- QCustomPlot now emits beforeReplot and afterReplot signals. Note that it is safe to make two customPlots mutually call eachothers replot functions
|
||||
in one of these slots, it will not cause an infinite loop. (usefull for synchronizing axes ranges between two customPlots, because setRange alone doesn't replot)
|
||||
- If the Qt version is 4.7 or greater, the tick label strings in date-time-mode now support sub-second accuracy (e.g. with format like "hh:mm:ss.zzz").
|
||||
|
||||
Bugfixes:
|
||||
- tick labels/margins should no longer oscillate by one pixel when dragging range or replotting repeatedly while changing e.g. data. This
|
||||
was caused by a bug in Qt's QFontMetrics::boundingRect function when the font has an integer point size (probably some rounding problem).
|
||||
The fix hence consists of creating a temporary font (only for bounding-box calculation) which is 0.05pt larger and thus avoiding the
|
||||
jittering rounding outcome.
|
||||
- tick label, axis label and plot title colors used to be undefined. This was fixed by providing explicit color properties.
|
||||
|
||||
Other:
|
||||
- fixed some glitches in the documentation
|
||||
- QCustomPlot::replot and QCustomPlot::rescaleAxes are now slots
|
||||
|
||||
#### Version released on 02.02.12 ####
|
||||
|
||||
Changes that break backward compatibility:
|
||||
- renamed all secondary classes from QCustomPlot[...] to QCP[...]:
|
||||
QCustomPlotAxis -> QCPAxis
|
||||
QCustomPlotGraph -> QCPGraph
|
||||
QCustomPlotRange -> QCPRange
|
||||
QCustomPlotData -> QCPData
|
||||
QCustomPlotDataMap -> QCPDataMap
|
||||
QCustomPlotLegend -> QCPLegend
|
||||
QCustomPlotDataMapIterator -> QCPDataMapIterator
|
||||
QCustomPlotDataMutableMapIterator -> QCPDataMutableMapIterator
|
||||
A simple search and replace on all code files should make your code run again, e.g. consider the regex "QCustomPlot(?=[AGRDL])" -> "QCP".
|
||||
Make sure not to just replace "QCustomPlot" with "QCP" because the main class QCustomPlot hasn't changed to QCP.
|
||||
This change was necessary because class names became unhandy, pardon my bad naming decision in the beginning.
|
||||
- QCPAxis::tickLength() and QCPAxis::subTickLength() now each split into two functions for inward and outward ticks (tickLengthIn/tickLengthOut).
|
||||
- QCPLegend now uses QCPAbstractLegendItem to carry item data (before, the legend was passed QCPGraphs directly)
|
||||
- QCustomPlot::addGraph() now doesn't return the index of the created graph anymore, but a pointer to the created QCPGraph.
|
||||
- QCustomPlot::setAutoAddGraphToLegend is replaced by setAutoAddPlottableToLegend
|
||||
|
||||
Added features:
|
||||
- Reversed axis range with QCPAxis::setRangeReversed(bool)
|
||||
- Tick labels are now only drawn if not clipped by the viewport (widget border) on the sides (e.g. left and right on a horizontal axis).
|
||||
- Zerolines. Like grid lines only with a separate pen (QCPAxis::setZeroLinePen), at tick position zero.
|
||||
- Outward ticks. QCPAxis::setTickLength/setSubTickLength now accepts two arguments for inward and outward tick length. This doesn't break
|
||||
backward compatibility because the second argument (outward) has default value zero and thereby a call with one argument hasn't changed its meaning.
|
||||
- QCPGraph now inherits from QCPAbstractPlottable
|
||||
- QCustomPlot::addPlottable/plottable/removePlottable/clearPlottables added to interface with the new QCPAbstractPlottable-based system. The simpler interface
|
||||
which only acts on QCPGraphs (addGraph, graph, removeGraph, etc.) was adapted internally and is kept for backward compatibility and ease of use.
|
||||
- QCPLegend items for plottables (e.g. graphs) can automatically wrap their texts to fit the widths, see QCPLegend::setMinimumSize and QCPPlottableLegendItem::setTextWrap.
|
||||
- QCustomPlot::rescaleAxes. Adapts axis ranges to show all plottables/graphs, by calling QCPAbstractPlottable::rescaleAxes on all plottables in the plot.
|
||||
- QCPCurve. For plotting of parametric curves.
|
||||
- QCPBars. For plotting of bar charts.
|
||||
- QCPStatisticalBox. For statistical box plots.
|
||||
|
||||
Bugfixes:
|
||||
- Fixed QCustomPlot::removeGraph(int) not being able to remove graph index 0
|
||||
- made QCustomPlot::replot() abort painting when painter initialization fails (e.g. because width/height of QCustomPlot is zero)
|
||||
- The distance of the axis label from the axis ignored the tick label padding, this could have caused overlapping axis labels and tick labels
|
||||
- fixed memory leak in QCustomPlot (dtor didn't delete legend)
|
||||
- fixed bug that prevented QCPAxis::setRangeLower/Upper from setting the value to exactly 0.
|
||||
|
||||
Other:
|
||||
- Changed default error bar handle size (QCustomPlotGraph::setErrorBarSize) from 4 to 6.
|
||||
- Removed QCustomPlotDataFetcher. Was deprecated and not used class.
|
||||
- Extended documentation, especially class descriptions.
|
||||
|
||||
#### Version released on 15.01.12 ####
|
||||
|
||||
Changes that (might) break backward compatibility:
|
||||
- QCustomPlotGraph now inherits from QObject
|
||||
|
||||
Added features:
|
||||
- Added axis background pixmap (QCustomPlot::setAxisBackground, setAxisBackgroundScaled, setAxisBackgroundScaledMode)
|
||||
- Added width and height parameter on PDF export function QCustomPlot::savePdf(). This now allows PDF export to
|
||||
have arbitrary dimensions, independent of the current geometry of the QCustomPlot.
|
||||
- Added overload of QCustomPlot::removeGraph that takes QCustomPlotGraph* as parameter, instead the index of the graph
|
||||
- Added all enums to the Qt meta system via Q_ENUMS(). The enums can now be transformed
|
||||
to QString values easily with the Qt meta system, which makes saving state e.g. as XML
|
||||
significantly nicer.
|
||||
- added typedef QMapIterator<double,QCustomPlotData> QCustomPlotDataMapIterator
|
||||
and typedef QMutableMapIterator<double,QCustomPlotData> QCustomPlotDataMutableMapIterator
|
||||
for improved information hiding, when using iterators outside QCustomPlot code
|
||||
|
||||
Bugfixes:
|
||||
- Fixed savePngScaled. Axis/label drawing functions used to reset the painter transform
|
||||
and thereby break savePngScaled. Now they buffer the current transform and restore it afterwards.
|
||||
- Fixed some glitches in the doxygen comments (affects documentation only)
|
||||
|
||||
Other:
|
||||
- Changed the default tickLabelPadding of top axis from 3 to 6 pixels. Looks better.
|
||||
- Changed the default QCustomPlot::setAntialiasedElements setting: Graph fills are now antialiased
|
||||
by default. That's a bit slower, but makes fill borders look better.
|
||||
|
||||
#### Version released on 19.11.11 ####
|
||||
|
||||
Changes that break backward compatibility:
|
||||
- QCustomPlotAxis: tickFont and setTickFont renamed to tickLabelFont and setTickLabelFont (for naming consistency)
|
||||
|
||||
Other:
|
||||
- QCustomPlotAxis: Added rotated tick labels, see setTickLabelRotation
|
||||
|
||||
-36118
File diff suppressed because it is too large.
Load diff
-8027
File diff suppressed because it is too large.
Load diff
+62
-66
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -22,16 +22,15 @@
|
||||
* \brief main file
|
||||
*/
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "ConfigureFormatDialog.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "config.h"
|
||||
#ifdef USE_QTDBUS
|
||||
#include "DBusAppAdaptor.h"
|
||||
#endif
|
||||
#include <QApplication>
|
||||
#include <QStyleFactory>
|
||||
#ifdef USE_QTDBUS
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
#endif
|
||||
#ifdef USE_FERVOR
|
||||
#include "fvupdater.h"
|
||||
#endif
|
||||
@@ -42,32 +41,29 @@
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
qRegisterMetaType<CalypFileInfoVector>();
|
||||
qRegisterMetaTypeStreamOperators<CalypFileInfoVector>();
|
||||
qRegisterMetaType<CalypStandardResolutionVector>();
|
||||
qRegisterMetaTypeStreamOperators<CalypStandardResolutionVector>();
|
||||
qRegisterMetaType<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaType<PlaYUVerStdResolutionVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStdResolutionVector>();
|
||||
|
||||
QApplication application( argc, argv );
|
||||
QApplication::setApplicationName( QStringLiteral( "Calyp" ) );
|
||||
QApplication::setApplicationVersion( QStringLiteral( CALYP_VERSION_STRING ) );
|
||||
QApplication::setOrganizationName( QStringLiteral( "PixLRA" ) );
|
||||
|
||||
#if _WIN32
|
||||
application.setStyle( QStyleFactory::create( "Fusion" ) );
|
||||
#endif
|
||||
QApplication::setApplicationName( "PlaYUVer" );
|
||||
QApplication::setApplicationVersion( PLAYUVER_VERSION_STRING );
|
||||
QApplication::setOrganizationName( "PixLRA" );
|
||||
|
||||
#ifdef USE_QTDBUS
|
||||
/**
|
||||
* use dbus, if available
|
||||
* allows for resuse of running Calyp instances
|
||||
* allows for resuse of running Kate instances
|
||||
*/
|
||||
if( QDBusConnectionInterface* const sessionBusinterface = QDBusConnection::sessionBus().interface() )
|
||||
if( QDBusConnectionInterface* const sessionBusInterface =
|
||||
QDBusConnection::sessionBus().interface() )
|
||||
{
|
||||
bool force_new = false;
|
||||
Bool force_new = false;
|
||||
QStringList filenameList;
|
||||
for( int i = 1; i < argc; i++ )
|
||||
for( Int i = 1; i < argc; i++ )
|
||||
{
|
||||
filenameList.append( QFileInfo( QLatin1String( argv[i] ) ).absoluteFilePath() );
|
||||
filenameList.append( QFileInfo( QString( argv[i] ) ).absoluteFilePath() );
|
||||
}
|
||||
if( filenameList.isEmpty() )
|
||||
{
|
||||
@@ -78,66 +74,65 @@ int main( int argc, char* argv[] )
|
||||
bool foundRunningService = false;
|
||||
if( !force_new )
|
||||
{
|
||||
QDBusReply<bool> there = sessionBusinterface->isServiceRegistered( QStringLiteral( CALYP_DBUS_SESSION_NAME ) );
|
||||
QDBusReply<bool> there =
|
||||
sessionBusInterface->isServiceRegistered( PLAYUVER_DBUS_SESSION_NAME );
|
||||
foundRunningService = there.isValid() && there.value();
|
||||
}
|
||||
|
||||
if( foundRunningService )
|
||||
if( foundRunningService )
|
||||
{
|
||||
// open given session
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(
|
||||
PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "activate" ) );
|
||||
|
||||
QDBusConnection::sessionBus().call( m );
|
||||
|
||||
// only block, if files to open there....
|
||||
bool needToBlock = false;
|
||||
|
||||
QStringList tokens;
|
||||
|
||||
// open given files...
|
||||
foreach( const QString& file, filenameList )
|
||||
{
|
||||
qInfo() << "Found running instance... Re-using";
|
||||
|
||||
// open given session
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(
|
||||
QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( CALYP_DBUS_PATH ),
|
||||
QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( "activate" ) );
|
||||
PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "loadFile" ) );
|
||||
|
||||
QDBusConnection::sessionBus().call( m );
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments( dbusargs );
|
||||
|
||||
// only block, if files to open there....
|
||||
bool needToBlock = false;
|
||||
|
||||
QStringList tokens;
|
||||
|
||||
// open given files...
|
||||
foreach( const QString& file, filenameList )
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call( m );
|
||||
if( res.type() == QDBusMessage::ReplyMessage )
|
||||
{
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(
|
||||
QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( CALYP_DBUS_PATH ),
|
||||
QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( "loadFile" ) );
|
||||
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments( dbusargs );
|
||||
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call( m );
|
||||
if( res.type() == QDBusMessage::ReplyMessage )
|
||||
if( res.arguments().count() == 1 )
|
||||
{
|
||||
if( res.arguments().count() == 1 )
|
||||
QVariant v = res.arguments()[0];
|
||||
if( v.isValid() )
|
||||
{
|
||||
QVariant v = res.arguments()[0];
|
||||
if( v.isValid() )
|
||||
QString s = v.toString();
|
||||
if( ( !s.isEmpty() ) && ( s != QStringLiteral( "ERROR" ) ) )
|
||||
{
|
||||
QString s = v.toString();
|
||||
if( ( !s.isEmpty() ) && ( s != QStringLiteral( "ERROR" ) ) )
|
||||
{
|
||||
tokens << s;
|
||||
}
|
||||
tokens << s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// this will wait until exiting is emitted by the used instance, if
|
||||
// wanted...
|
||||
return needToBlock ? application.exec() : 0;
|
||||
}
|
||||
// this will wait until exiting is emitted by the used instance, if
|
||||
// wanted...
|
||||
return needToBlock ? application.exec() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* if we arrive here, we need to start a new calyp instance!
|
||||
* if we arrive here, we need to start a new playuver instance!
|
||||
*/
|
||||
QDBusConnection::sessionBus().registerService( QStringLiteral( CALYP_DBUS_SESSION_NAME ) );
|
||||
QDBusConnection::sessionBus().registerService( PLAYUVER_DBUS_SESSION_NAME );
|
||||
#endif
|
||||
MainWindow mainwindow;
|
||||
PlaYUVerApp mainwindow;
|
||||
mainwindow.show();
|
||||
if( mainwindow.parseArgs( argc, argv ) )
|
||||
{
|
||||
@@ -145,8 +140,9 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
|
||||
#ifdef USE_FERVOR
|
||||
FvUpdater::sharedUpdater()->SetFeedURL( "http://192.168.96.201/share/CalypProject/"
|
||||
"CalypUpdate-" UPDATE_CHANNEL ".xml" );
|
||||
FvUpdater::sharedUpdater()->SetFeedURL(
|
||||
"http://192.168.96.201/share/PlaYUVerProject/"
|
||||
"PlaYUVerUpdate-" UPDATE_CHANNEL ".xml" );
|
||||
FvUpdater::sharedUpdater()->SetDependencies( "ALL" );
|
||||
#endif
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 125 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 91 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 179 KiB |
@@ -1 +0,0 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "calyp.ico"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env xdg-open
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Calyp
|
||||
Exec=calyp %U
|
||||
Icon=calyp
|
||||
Name=PlaYUVer
|
||||
Exec=playuver %U
|
||||
Icon=playuver
|
||||
Terminal=false
|
||||
MimeType=video/x-raw;image/jpeg;image/png;image/bmp;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap
|
||||
Categories=AudioVideo;Video;Player;
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 170 KiB |
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
@@ -1,22 +1,22 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<file alias="logos/calyp-logo.png">calyp-logo.png</file>
|
||||
<file alias="logos/calyp-icon.png">calyp.png</file>
|
||||
<file alias="images/playuver.png">playuver.png</file>
|
||||
<file alias="images/playuver-backgroud-logo.png">playuver-background-logo.png</file>
|
||||
|
||||
<file alias="images/open.png">icons/open.png</file>
|
||||
<file alias="images/save.png">icons/save.png</file>
|
||||
<file alias="images/close.png">icons/close.png</file>
|
||||
<file alias="images/exit.png">icons/exit.png</file>
|
||||
<file alias="images/configuredialog.png">icons/configuredialog.png</file>
|
||||
|
||||
|
||||
<file alias="images/windowstile.png">icons/windowstile.png</file>
|
||||
<file alias="images/windowscascade.png">icons/windowscascade.png</file>
|
||||
|
||||
|
||||
<file alias="images/zoomin.png">icons/zoomin.png</file>
|
||||
<file alias="images/zoomout.png">icons/zoomout.png</file>
|
||||
<file alias="images/zoomtonormal.png">icons/zoomtonormal.png</file>
|
||||
<file alias="images/fittowindow.png">icons/fittowindow.png</file>
|
||||
|
||||
|
||||
<file alias="images/histogram-log.png">icons/histogram-log.png</file>
|
||||
<file alias="images/histogram-lin.png">icons/histogram-lin.png</file>
|
||||
<file alias="images/image-selection.png">icons/image-selection.png</file>
|
||||
@@ -27,7 +27,7 @@
|
||||
<file alias="images/channel-green.png">icons/channel-green-16.png</file>
|
||||
<file alias="images/channel-blue.png">icons/channel-blue-16.png</file>
|
||||
<file alias="images/channel-all.png">icons/channel-all-16.png</file>
|
||||
|
||||
|
||||
<file alias="images/copy.png">icons/copy.png</file>
|
||||
<file alias="images/paste.png">icons/paste.png</file>
|
||||
<file alias="images/saveas.png">icons/saveas.png</file>
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "playuver.ico"
|
||||
File renamed without changes.
+102
-94
@@ -1,139 +1,147 @@
|
||||
# * 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(
|
||||
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
|
||||
${_component}_LIBRARIES
|
||||
NAMES ${_library}
|
||||
HINTS ${PC_LIB${_component}_LIBDIR} ${PC_LIB${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
${_component}_DEFINITIONS
|
||||
${_component}_VERSION)
|
||||
|
||||
SET(${_component}_DEFINITIONS
|
||||
${PC_${_component}_CFLAGS_OTHER}
|
||||
CACHE STRING "The ${_component} CFLAGS."
|
||||
)
|
||||
SET(${_component}_VERSION
|
||||
${PC_${_component}_VERSION}
|
||||
CACHE STRING "The ${_component} version number."
|
||||
)
|
||||
endmacro()
|
||||
|
||||
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(SWRESAMPLE libswresample swresample libswresample/swresample.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(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})
|
||||
+50
-54
@@ -1,68 +1,64 @@
|
||||
# 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}.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)
|
||||
|
||||
|
||||
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 plaYUver_Mod_SRCS ${file} )
|
||||
LIST(APPEND MODULES_LIST_NAME ${name} )
|
||||
LIST(APPEND MODULES_LIST_FILES ${file} )
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${file}.h\"\n")
|
||||
endif()
|
||||
unset(__modulename)
|
||||
ENDMACRO()
|
||||
|
||||
# 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)
|
||||
|
||||
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})
|
||||
#
|
||||
|
||||
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})
|
||||
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 "\n#endif // __MODULESLISTHEADER_H__\n" )
|
||||
|
||||
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "\n#endif // __MODULESLISTHEADER_H__\n")
|
||||
ENDMACRO()
|
||||
+38
-68
@@ -1,81 +1,51 @@
|
||||
# ####################################################################################################################################################
|
||||
#####################################################################################
|
||||
# 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(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()
|
||||
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/libGLESv2${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/libEGL${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/icudt${QT_ICU_VERSION}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/icuin${QT_ICU_VERSION}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/icuuc${QT_ICU_VERSION}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qminimal.dll DESTINATION bin/platforms )
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qoffscreen.dll DESTINATION bin/platforms )
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qwindows.dll DESTINATION bin/platforms )
|
||||
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")
|
||||
FOREACH(opencv_module IN LISTS OPENCV_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(DIRECTORY ${FFMPEG_DIR}/bin/ DESTINATION bin)
|
||||
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/swresample-1.dll DESTINATION bin )
|
||||
ENDIF()
|
||||
+24
-15
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -17,26 +17,37 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* \file config.h.in
|
||||
* \brief definition of the building options
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_CALYP_H__
|
||||
#define __CONFIG_CALYP_H__
|
||||
|
||||
#ifndef __CONFIG_PLAYUVER_H__
|
||||
#define __CONFIG_PLAYUVER_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_STRING "@CALYP_VERSION_STRING@"
|
||||
#define PLAYUVER_VERSION_MAJOR @PLAYUVER_VERSION_MAJOR@
|
||||
#define PLAYUVER_VERSION_MINOR @PLAYUVER_VERSION_MINOR@
|
||||
#define PLAYUVER_VERSION_PATCH @PLAYUVER_VERSION_PATCH@
|
||||
#define PLAYUVER_VERSION @PLAYUVER_VERSION@
|
||||
#define PLAYUVER_VERSION_STRING "@PLAYUVER_VERSION_STRING@"
|
||||
|
||||
#define UPDATE_CHANNEL "@UPDATE_CHANNEL@"
|
||||
|
||||
/* CPU features */
|
||||
#cmakedefine USE_SSE
|
||||
|
||||
/* QT definition */
|
||||
#cmakedefine USE_QT4
|
||||
|
||||
#undef QT_VERSION_PLAYUVER
|
||||
#ifndef USE_QT4
|
||||
#define QT_VERSION_PLAYUVER 5
|
||||
#else
|
||||
#define QT_VERSION_PLAYUVER 4
|
||||
#endif
|
||||
|
||||
/* QtDBus */
|
||||
#cmakedefine USE_QTDBUS
|
||||
|
||||
@@ -44,7 +55,7 @@
|
||||
#cmakedefine USE_DYNLOAD
|
||||
|
||||
/* Use modules in a different thread */
|
||||
#cmakedefine CALYP_THREADED_MODULES
|
||||
#cmakedefine PLAYUVER_THREADED_MODULES
|
||||
|
||||
/* OpenCV */
|
||||
#cmakedefine USE_OPENCV
|
||||
@@ -55,7 +66,5 @@
|
||||
/* Fervor update lib */
|
||||
#cmakedefine USE_FERVOR
|
||||
|
||||
/* Use a resource manager to manage streams in different threads */
|
||||
#cmakedefine CALYP_MANAGED_RESOURCES
|
||||
|
||||
#endif // __CONFIG_CALYP_H__
|
||||
#endif // __CONFIG_PLAYUVER_H__
|
||||
@@ -1,6 +1,7 @@
|
||||
#
|
||||
# CMakeLists for examples
|
||||
#
|
||||
###
|
||||
### CMakeLists for examples
|
||||
###
|
||||
|
||||
|
||||
ADD_SUBDIRECTORY( modules )
|
||||
|
||||
ADD_SUBDIRECTORY(modules)
|
||||
ADD_SUBDIRECTORY(stream)
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
#include "AbsoluteFrameDifferenceExample.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
REGISTER_CLASS_MAKER( AbsoluteFrameDifferenceExample )
|
||||
@@ -31,46 +30,46 @@ REGISTER_CLASS_MAKER( AbsoluteFrameDifferenceExample )
|
||||
AbsoluteFrameDifferenceExample::AbsoluteFrameDifferenceExample()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = CLP_MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = ClpModuleType::FrameProcessing; // Apply module to the frames or to the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "AbsoluteDifferenceExample"; // Name
|
||||
m_pchModuleLongName = "Absolute Difference Example"; // Name
|
||||
m_pchModuleTooltip = "Measure the absolute difference " // Description
|
||||
"between two images (Y plane), e. g., abs( Y1 - Y2 )";
|
||||
m_uiNumberOfFrames = 2; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = ClpModuleFeature::NewWindow; // Module requirements (check CalypModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_iModuleAPI = MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to the whole sequence.
|
||||
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
|
||||
m_pchModuleName = "AbsoluteFrameDifferenceExampleExample"; // Name
|
||||
m_pchModuleTooltip =
|
||||
"Measure the absolute difference " // Description
|
||||
"between two images (Y plane), e. g., abs( Y1 - Y2 )";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW; // Module requirements (check PlaYUVerModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
bool AbsoluteFrameDifferenceExample::create( std::vector<CalypFrame*> apcFrameList )
|
||||
Bool AbsoluteFrameDifferenceExample::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
|
||||
for( unsigned int i = 1; i < apcFrameList.size(); i++ )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], CalypFrame::MATCH_COLOR_SPACE |
|
||||
CalypFrame::MATCH_RESOLUTION |
|
||||
CalypFrame::MATCH_BITS ) )
|
||||
for( UInt i = 1; i < apcFrameList.size(); i++ )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE |
|
||||
PlaYUVerFrame::MATCH_RESOLUTION |
|
||||
PlaYUVerFrame::MATCH_BITS ) )
|
||||
return false;
|
||||
|
||||
m_pcFrameDifference =
|
||||
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), ClpPixelFormats::Gray );
|
||||
new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
return true;
|
||||
}
|
||||
|
||||
CalypFrame* AbsoluteFrameDifferenceExample::process( std::vector<CalypFrame*> apcFrameList )
|
||||
PlaYUVerFrame* AbsoluteFrameDifferenceExample::process( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
CalypFrame* Input1 = apcFrameList[0];
|
||||
CalypFrame* Input2 = apcFrameList[1];
|
||||
ClpPel* pInput1PelYUV = Input1->getPelBufferYUV()[0][0];
|
||||
ClpPel* pInput2PelYUV = Input2->getPelBufferYUV()[0][0];
|
||||
ClpPel* pOutputPelYUV = m_pcFrameDifference->getPelBufferYUV()[0][0];
|
||||
int aux_pel_1, aux_pel_2;
|
||||
PlaYUVerFrame* Input1 = apcFrameList[0];
|
||||
PlaYUVerFrame* Input2 = apcFrameList[1];
|
||||
Pel* pInput1PelYUV = Input1->getPelBufferYUV()[0][0];
|
||||
Pel* pInput2PelYUV = Input2->getPelBufferYUV()[0][0];
|
||||
Pel* pOutputPelYUV = m_pcFrameDifference->getPelBufferYUV()[0][0];
|
||||
Int aux_pel_1, aux_pel_2;
|
||||
|
||||
for( unsigned int y = 0; y < m_pcFrameDifference->getHeight(); y++ )
|
||||
for( unsigned int x = 0; x < m_pcFrameDifference->getWidth(); x++ )
|
||||
for( UInt y = 0; y < m_pcFrameDifference->getHeight(); y++ )
|
||||
for( UInt x = 0; x < m_pcFrameDifference->getWidth(); x++ )
|
||||
{
|
||||
aux_pel_1 = *pInput1PelYUV++;
|
||||
aux_pel_2 = *pInput2PelYUV++;
|
||||
@@ -79,7 +78,7 @@ CalypFrame* AbsoluteFrameDifferenceExample::process( std::vector<CalypFrame*> ap
|
||||
return m_pcFrameDifference;
|
||||
}
|
||||
|
||||
void AbsoluteFrameDifferenceExample::destroy()
|
||||
Void AbsoluteFrameDifferenceExample::destroy()
|
||||
{
|
||||
if( m_pcFrameDifference )
|
||||
delete m_pcFrameDifference;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@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
|
||||
@@ -25,23 +25,23 @@
|
||||
#ifndef __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
#define __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
|
||||
#include "PlaYUVerModuleIf.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "CalypModuleIf.h"
|
||||
|
||||
class AbsoluteFrameDifferenceExample : public CalypModuleIf
|
||||
class AbsoluteFrameDifferenceExample : public PlaYUVerModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( AbsoluteFrameDifferenceExample )
|
||||
|
||||
private:
|
||||
CalypFrame* m_pcFrameDifference;
|
||||
private:
|
||||
PlaYUVerFrame* m_pcFrameDifference;
|
||||
|
||||
public:
|
||||
public:
|
||||
AbsoluteFrameDifferenceExample();
|
||||
virtual ~AbsoluteFrameDifferenceExample() {}
|
||||
bool create( std::vector<CalypFrame*> apcFrameList );
|
||||
CalypFrame* process( std::vector<CalypFrame*> apcFrameList );
|
||||
void destroy();
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
};
|
||||
|
||||
#endif // __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
@@ -1,16 +1,19 @@
|
||||
#
|
||||
# CMakeLists for modules_example
|
||||
#
|
||||
###
|
||||
### CMakeLists for modules_example
|
||||
###
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
|
||||
|
||||
PROJECT("modules_example")
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.9 )
|
||||
|
||||
# THIS FIND_PACKAGE( Calyp ) INCLUDE_DIRECTORIES( ${CALYP_INCLUDE_DIRS} ) OR
|
||||
INCLUDE_DIRECTORIES(../../lib)
|
||||
PROJECT( "modules_example" )
|
||||
|
||||
ADD_LIBRARY(FrameBinarizationAPIv1 SHARED FrameBinarizationAPIv1.cpp)
|
||||
TARGET_LINK_LIBRARIES(FrameBinarizationAPIv1 ${PROJECT_LIBRARY})
|
||||
# FIND_PACKAGE( PlaYUVer )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${PLAYUVER_INCLUDE_DIRS} )
|
||||
|
||||
ADD_LIBRARY(FrameBinarization SHARED FrameBinarization_APIv1.cpp)
|
||||
TARGET_LINK_LIBRARIES( FrameBinarization ${PLAYUVER_LINKER_LIBS} )
|
||||
|
||||
ADD_LIBRARY(AbsoluteFrameDifferenceExample SHARED AbsoluteFrameDifferenceExample.cpp)
|
||||
TARGET_LINK_LIBRARIES(AbsoluteFrameDifferenceExample ${PROJECT_LIBRARY})
|
||||
TARGET_LINK_LIBRARIES( AbsoluteFrameDifferenceExample ${PLAYUVER_LINKER_LIBS} )
|
||||
|
||||
Loaded 100 of 231 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user