Compare commits
315
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaa9987314 | ||
|
|
2a1b0abb2f | ||
|
|
cad1f6d7a6 | ||
|
|
d330ecfd0d | ||
|
|
7b5e5d5694 | ||
|
|
f2a636baa1 | ||
|
|
9e3fb9c0a0 | ||
|
|
420aeb89a6 | ||
|
|
a1b44895b8 | ||
|
|
e1e5c4eb3c | ||
|
|
206613d08a | ||
|
|
b7e8087163 | ||
|
|
f4cf81b63c | ||
|
|
47504ff46f | ||
|
|
bdc5317ccc | ||
|
|
1dfddcf7fb | ||
|
|
cea720f8e9 | ||
|
|
48907ef614 | ||
|
|
cdff468904 | ||
|
|
dea3dd93d5 | ||
|
|
3745a687cb | ||
|
|
a1ebf62e21 | ||
|
|
3c85c96769 | ||
|
|
e7e1a8534b | ||
|
|
8807c14b59 | ||
|
|
039887f2e6 | ||
|
|
4c6a4aba65 | ||
|
|
910ab8024e | ||
|
|
6b0f7f6de3 | ||
|
|
6b8b4cbb6a | ||
|
|
0a70267ab7 | ||
|
|
4a4f985ac1 | ||
|
|
58424b8f4e | ||
|
|
3bbbf81ca2 | ||
|
|
7ea1db3202 | ||
|
|
0e26fd8964 | ||
|
|
27ecd818e8 | ||
|
|
d5d21a458f | ||
|
|
1066aaa73c | ||
|
|
ddd5eeb6b9 | ||
|
|
876e1ba9e3 | ||
|
|
47dd2ad3f9 | ||
|
|
e77e0a82fa | ||
|
|
2181fd6add | ||
|
|
eda28d1380 | ||
|
|
1599a80d46 | ||
|
|
42c4e3b388 | ||
|
|
d86ed3508b | ||
|
|
cd18227b8b | ||
|
|
fc913fdc08 | ||
|
|
f90c681788 | ||
|
|
44f7a9b02e | ||
|
|
624612d49b | ||
|
|
70db70a7cf | ||
|
|
33bf02ba0f | ||
|
|
864c3253f1 | ||
|
|
a2d452fd64 | ||
|
|
3732810f9e | ||
|
|
56fc2e45bb | ||
|
|
7ff939c33a | ||
|
|
fa23256955 | ||
|
|
ffe0c38427 | ||
|
|
12bd1a4c2c | ||
|
|
b830b700ca | ||
|
|
3109250471 | ||
|
|
c6b43ac7fa | ||
|
|
beed955e3f | ||
|
|
1f003ec2ac | ||
|
|
c718d01700 | ||
|
|
847f4f06b9 | ||
|
|
344188234b | ||
|
|
5439fd1af5 | ||
|
|
2f434d269b | ||
|
|
a72208f0e6 | ||
|
|
c3c4e229d8 | ||
|
|
fedcb2e03a | ||
|
|
e755608b02 | ||
|
|
2debe78ed8 | ||
|
|
4d1730f928 | ||
|
|
521e56202c | ||
|
|
d0933f43c9 | ||
|
|
1674ec4061 | ||
|
|
ab58ca44f2 | ||
|
|
11bf3f6bfd | ||
|
|
669f3db250 | ||
|
|
3c6e0555bc | ||
|
|
fca79a7992 | ||
|
|
b507b61ce4 | ||
|
|
72bfaf6796 | ||
|
|
0998d98375 | ||
|
|
3afa6eeb6f | ||
|
|
41c65dcac4 | ||
|
|
25d40cadbe | ||
|
|
ca68f5a78f | ||
|
|
f2e1e4bfc7 | ||
|
|
b5edc60794 | ||
|
|
6b084c1a7e | ||
|
|
7b712bb232 | ||
|
|
684cecd632 | ||
|
|
f6cc0ffd29 | ||
|
|
c1cef58de1 | ||
|
|
f9e62c73ac | ||
|
|
6486104db2 | ||
|
|
31f7e46e94 | ||
|
|
aaa5a0fde4 | ||
|
|
f2c8697ace | ||
|
|
3ed8b0916f | ||
|
|
ce82d0a17d | ||
|
|
81972c9ded | ||
|
|
115c4b0476 | ||
|
|
fd5dcc0e1a | ||
|
|
56f1df4a56 | ||
|
|
d4dddda2c2 | ||
|
|
753c4cca3f | ||
|
|
67b0406f86 | ||
|
|
abff4f3aa7 | ||
|
|
7d83009f4b | ||
|
|
2933269ea4 | ||
|
|
20b6edd667 | ||
|
|
64153e572f | ||
|
|
19cc7002e6 | ||
|
|
115a5edec2 | ||
|
|
50b4ef20ce | ||
|
|
5f28b90811 | ||
|
|
9fb445288c | ||
|
|
08d9fd1d5d | ||
|
|
3e186e9685 | ||
|
|
c26e7c2265 | ||
|
|
b10a593e01 | ||
|
|
63442d58b9 | ||
|
|
b36bbeef7a | ||
|
|
2adfd28e48 | ||
|
|
d76d2082ca | ||
|
|
10dec18118 | ||
|
|
39618ca7d5 | ||
|
|
833bd5f1c9 | ||
|
|
937669d3c9 | ||
|
|
63a9e2d22d | ||
|
|
14bd963046 | ||
|
|
d6676b3eaf | ||
|
|
8152e82129 | ||
|
|
a8ead5dcf6 | ||
|
|
35dcb020e6 | ||
|
|
68faafc9ed | ||
|
|
0989810e1f | ||
|
|
8620e3ddf2 | ||
|
|
b5c5c837e8 | ||
|
|
291b0b3890 | ||
|
|
9a24ba2236 | ||
|
|
f502dcc70a | ||
|
|
cf2109e016 | ||
|
|
eff57f2fec | ||
|
|
608cc20508 | ||
|
|
e4e4994f25 | ||
|
|
a8a8043ced | ||
|
|
e42f0d02bb | ||
|
|
97c2fccf1a | ||
|
|
2d1af68418 | ||
|
|
9b82ed0e88 | ||
|
|
9a05fa3e62 | ||
|
|
57c82be827 | ||
|
|
3bcc61780b | ||
|
|
5b633f7bda | ||
|
|
777f39ff9d | ||
|
|
518cd558e3 | ||
|
|
6bebaf0e2e | ||
|
|
2eead20ef0 | ||
|
|
cff796a4b7 | ||
|
|
432d2c6cad | ||
|
|
183052148e | ||
|
|
fda7e0f0c6 | ||
|
|
75f16c2b34 | ||
|
|
0013190d27 | ||
|
|
ea613e097f | ||
|
|
a0fa4364e3 | ||
|
|
df38f3d832 | ||
|
|
be0c5dca74 | ||
|
|
f24adede0f | ||
|
|
b671596a24 | ||
|
|
805cee6fbc | ||
|
|
b3340bb13b | ||
|
|
2eec03b23f | ||
|
|
2b00cceb09 | ||
|
|
b20d5aef49 | ||
|
|
1dfbc06d7f | ||
|
|
bad10649e3 | ||
|
|
c47192f5f3 | ||
|
|
ca562ae9f4 | ||
|
|
00ec0485f4 | ||
|
|
b5a5bb90f9 | ||
|
|
2129d05e6e | ||
|
|
710731db55 | ||
|
|
f2d8b06db2 | ||
|
|
37e14ff1bb | ||
|
|
c0b0388b02 | ||
|
|
40d1189275 | ||
|
|
17dbd59338 | ||
|
|
088c1955e0 | ||
|
|
8ed4dc81dd | ||
|
|
cac909c35e | ||
|
|
59c6d797f6 | ||
|
|
a473abc498 | ||
|
|
8408b7ba2b | ||
|
|
1ea65cabf0 | ||
|
|
57721f5d1a | ||
|
|
a26bd74b0d | ||
|
|
5cea952d32 | ||
|
|
f219ee1b3e | ||
|
|
4e67dd0adf | ||
|
|
1810be9489 | ||
|
|
6657a738b8 | ||
|
|
aa87bda65c | ||
|
|
322ddfb7da | ||
|
|
76b0e01d4c | ||
|
|
ac996ea577 | ||
|
|
def17102e5 | ||
|
|
58e975a681 | ||
|
|
34e01b59f5 | ||
|
|
f770266250 | ||
|
|
1ef70c485d | ||
|
|
a133fabe9e | ||
|
|
0654f4260d | ||
|
|
412cd8ccb7 | ||
|
|
bd0e1296b4 | ||
|
|
bcba3c7368 | ||
|
|
6ce6b95b30 | ||
|
|
7470bc1ffd | ||
|
|
6a708a00ac | ||
|
|
7f8b8c6ee3 | ||
|
|
eed59123d5 | ||
|
|
5d44227a0f | ||
|
|
3a43289fa1 | ||
|
|
b5d97c1831 | ||
|
|
0b429a0c34 | ||
|
|
5a701c83e7 | ||
|
|
014fd2f28b | ||
|
|
ee5b07e558 | ||
|
|
8ba512f4d0 | ||
|
|
2d6ba03d4a | ||
|
|
d735df75fd | ||
|
|
e9e8db92b5 | ||
|
|
ec1679a2e7 | ||
|
|
ee24e5a7d3 | ||
|
|
5b91c91b90 | ||
|
|
0b1e4574e6 | ||
|
|
8bfe88e4f4 | ||
|
|
2bc89dcc68 | ||
|
|
2958c03249 | ||
|
|
50cc22cb46 | ||
|
|
a29c269f74 | ||
|
|
5863c3c48d | ||
|
|
2dfb3f0ecd | ||
|
|
777073cc23 | ||
|
|
e69f405c9c | ||
|
|
0fa65ed836 | ||
|
|
fb0e654d74 | ||
|
|
ed5876bbc3 | ||
|
|
a55806a4d5 | ||
|
|
65582eea4c | ||
|
|
0a8a31bce8 | ||
|
|
87156f24b8 | ||
|
|
6e418f6b71 | ||
|
|
6cce568791 | ||
|
|
d021ceefeb | ||
|
|
2f21f7322c | ||
|
|
7230adfe2e | ||
|
|
cd233e30ca | ||
|
|
eea084d4a2 | ||
|
|
e9b1717699 | ||
|
|
c3039f1bd4 | ||
|
|
6043e2791b | ||
|
|
706f21066b | ||
|
|
0b1a537071 | ||
|
|
06cdda6d8a | ||
|
|
bc5258a94d | ||
|
|
7e44308626 | ||
|
|
c560449fbf | ||
|
|
25a4e9765f | ||
|
|
fe50d8fa6e | ||
|
|
0339e90e54 | ||
|
|
3f4b1d8a58 | ||
|
|
86dec9e98e | ||
|
|
430bdc09cd | ||
|
|
73d843abf5 | ||
|
|
e788a84c11 | ||
|
|
86feb437df | ||
|
|
7280d26fab | ||
|
|
e5825b602f | ||
|
|
af55ce11e3 | ||
|
|
6ba5da0365 | ||
|
|
601d25fec6 | ||
|
|
e5102114f7 | ||
|
|
f772b1c569 | ||
|
|
4bb15c0efd | ||
|
|
61386825c8 | ||
|
|
7feb3e0bcc | ||
|
|
e70c0259f4 | ||
|
|
6fe8a0f69e | ||
|
|
327f5921f5 | ||
|
|
485ba41b55 | ||
|
|
cf9219716e | ||
|
|
96be33fc7c | ||
|
|
cb26fb92ae | ||
|
|
1d192abcd7 | ||
|
|
b0d5c32099 | ||
|
|
e99935fe28 | ||
|
|
a4cf934c76 | ||
|
|
67f11592b9 | ||
|
|
11c60cb659 | ||
|
|
4ffd0c6ea4 | ||
|
|
cf920cdde7 | ||
|
|
f4c4a4e8e2 | ||
|
|
6e7aa9be5e | ||
|
|
168f56fe08 | ||
|
|
4544affd59 |
No files matched your search
@@ -0,0 +1,46 @@
|
||||
image: Visual Studio 2017
|
||||
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\2017\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\msvc2017_64" -DQt5_DIR="C:\Qt\latest\msvc2017_64\lib\cmake\Qt5" -DUSE_QTDBUS=OFF -DAVFORMAT_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avformat.lib -DAVFORMAT_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVCODEC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avcodec.lib -DAVCODEC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVUTIL_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avutil.lib -DAVUTIL_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DSWSCALE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swscale.lib -DSWSCALE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVDEVICE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avdevice.lib -DAVDEVICE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DPOSTPROC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/postproc.lib -DPOSTPROC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DFFMPEG_DIR=C:\Projects\ffmpeg_libraries -DSWRESAMPLE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swresample.lib -DSWRESAMPLE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -G "Visual Studio 15 2017 Win64" C:\Projects\calyp-deployment\cmake-helper
|
||||
- cmake --build . --target ALL_BUILD -- /p:Configuration=Release > log_build
|
||||
- cmake --build . --target INSTALL -- /p:Configuration=Release > log_install
|
||||
- cmake --build . --target PACKAGE -- /p:Configuration=Release > log_pkg
|
||||
|
||||
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'))
|
||||
|
||||
+20
-21
@@ -1,7 +1,7 @@
|
||||
---
|
||||
BasedOnStyle: Google
|
||||
Language: Cpp
|
||||
# BasedOnStyle: Chromium
|
||||
ColumnLimit: 100
|
||||
ColumnLimit: 0
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
@@ -15,31 +15,29 @@ AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
BinPackArguments: true
|
||||
BinPackParameters: false
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
AfterNamespace: true
|
||||
AfterClass: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterControlStatement: true
|
||||
AfterObjCDeclaration: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeBinaryOperators: None
|
||||
#BreakBeforeBraces: Attach
|
||||
BreakBeforeBraces: Allman
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
@@ -89,10 +87,11 @@ SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SortIncludes: true
|
||||
SpacesInParentheses: true
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Auto
|
||||
TabWidth: 8
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# ----------------------------------
|
||||
# Options affecting listfile parsing
|
||||
# ----------------------------------
|
||||
with section("parse"):
|
||||
|
||||
# Specify structure for custom cmake functions
|
||||
additional_commands = { 'foo': { 'flags': ['BAR', 'BAZ'],
|
||||
'kwargs': {'DEPENDS': '*', 'HEADERS': '*', 'SOURCES': '*'}}}
|
||||
|
||||
## Override configurations per-command where available
|
||||
#override_spec = {}
|
||||
|
||||
# Specify variable tags.
|
||||
vartags = []
|
||||
|
||||
# Specify property tags.
|
||||
proptags = []
|
||||
|
||||
# -----------------------------
|
||||
# Options affecting formatting.
|
||||
# -----------------------------
|
||||
with section("format"):
|
||||
|
||||
# How wide to allow formatted cmake files
|
||||
line_width = 150
|
||||
|
||||
# How many spaces to tab for indent
|
||||
tab_size = 2
|
||||
|
||||
# If an argument group contains more than this many sub-groups (parg or kwarg
|
||||
# groups) then force it to a vertical layout.
|
||||
max_subgroups_hwrap = 2
|
||||
|
||||
# If a positional argument group contains more than this many arguments, then
|
||||
# force it to a vertical layout.
|
||||
max_pargs_hwrap = 6
|
||||
|
||||
dangle_parens = True
|
||||
|
||||
# Format command names consistently as 'lower' or 'upper' case
|
||||
command_case = 'upper'
|
||||
|
||||
# Format keywords consistently as 'lower' or 'upper' case
|
||||
keyword_case = 'upper'
|
||||
|
||||
|
||||
# ----------------------------
|
||||
# Options affecting the linter
|
||||
# ----------------------------
|
||||
with section("lint"):
|
||||
|
||||
# a list of lint codes to disable
|
||||
disabled_codes = ["C0103"]
|
||||
|
||||
# regular expression pattern describing valid function names
|
||||
function_pattern = '[0-9a-z_]+'
|
||||
|
||||
# regular expression pattern describing valid macro names
|
||||
macro_pattern = '[0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for variables with global
|
||||
# (cache) scope
|
||||
global_var_pattern = '[A-Z][0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for variables with global
|
||||
# scope (but internal semantic)
|
||||
internal_var_pattern = '_[A-Z][0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for variables with local
|
||||
# scope
|
||||
local_var_pattern = '[a-z][a-z0-9_]+'
|
||||
|
||||
# regular expression pattern describing valid names for privatedirectory
|
||||
# variables
|
||||
private_var_pattern = '_[0-9a-z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for public directory
|
||||
# variables
|
||||
public_var_pattern = '[A-Z][0-9A-Z_]+'
|
||||
|
||||
# regular expression pattern describing valid names for function/macro
|
||||
# arguments and loop variables.
|
||||
argument_var_pattern = '[a-z][a-z0-9_]+'
|
||||
|
||||
# regular expression pattern describing valid names for keywords used in
|
||||
# functions or macros
|
||||
keyword_pattern = '[A-Z][0-9A-Z_]+'
|
||||
|
||||
# In the heuristic for C0201, how many conditionals to match within a loop in
|
||||
# before considering the loop a parser.
|
||||
max_conditionals_custom_parser = 2
|
||||
|
||||
# Require at least this many newlines between statements
|
||||
min_statement_spacing = 1
|
||||
|
||||
# Require no more than this many newlines between statements
|
||||
max_statement_spacing = 2
|
||||
max_returns = 6
|
||||
max_branches = 12
|
||||
max_arguments = 5
|
||||
max_localvars = 15
|
||||
max_statements = 50
|
||||
|
||||
# -------------------------------
|
||||
# Options affecting file encoding
|
||||
# -------------------------------
|
||||
with section("encode"):
|
||||
|
||||
# If true, emit the unicode byte-order mark (BOM) at the start of the file
|
||||
emit_byteorder_mark = False
|
||||
|
||||
# Specify the encoding of the input file. Defaults to utf-8
|
||||
input_encoding = 'utf-8'
|
||||
|
||||
# Specify the encoding of the output file. Defaults to utf-8. Note that cmake
|
||||
# only claims to support utf-8 so be careful when using anything else
|
||||
output_encoding = 'utf-8'
|
||||
@@ -0,0 +1,31 @@
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- devel
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
run: sudo apt-get install cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev
|
||||
|
||||
- name: Build CMake
|
||||
uses: ashutoshvarma/action-cmake-build@v1
|
||||
with:
|
||||
build-dir: ${{ runner.workspace }}/build
|
||||
# will set the CC & CXX for cmake
|
||||
cc: gcc
|
||||
cxx: g++
|
||||
build-type: Release
|
||||
# Extra options pass to cmake while configuring project
|
||||
configure-options: -DBUILD_TESTS=ON -DUSE_WERROR=ON
|
||||
run-test: true
|
||||
#ctest-options: -R mytest
|
||||
# install the build using cmake --install
|
||||
install-build: true
|
||||
# run build using '-j [parallel]' to use multiple threads to build
|
||||
parallel: 14
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
# 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
|
||||
@@ -0,0 +1,29 @@
|
||||
fail_fast: false
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
||||
rev: v0.6.10
|
||||
hooks:
|
||||
- id: cmake-format
|
||||
- id: cmake-lint
|
||||
|
||||
- repo: https://github.com/pocc/pre-commit-hooks
|
||||
rev: v1.1.1
|
||||
hooks:
|
||||
- id: clang-format
|
||||
args: [--style=file, -i]
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: cmake-configure
|
||||
name: Cmake Configure
|
||||
entry: cmake -B build
|
||||
pass_filenames: false
|
||||
language: system
|
||||
- id: cmake-build
|
||||
name: Cmake Build
|
||||
entry: cmake --build build
|
||||
pass_filenames: false
|
||||
language: system
|
||||
|
||||
|
||||
+3
-2
@@ -2,5 +2,6 @@ language: cpp
|
||||
dist: xenial
|
||||
before_install:
|
||||
- sudo apt-get -qq update
|
||||
- sudo apt-get install build-essential cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev
|
||||
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 libopencv-contrib-dev libgtest-dev
|
||||
script:
|
||||
- mkdir -p build && cd build && cmake .. && make && cd ..
|
||||
+236
-145
@@ -1,201 +1,292 @@
|
||||
###
|
||||
### CMakeLists for playuver
|
||||
###
|
||||
#
|
||||
# CMakeLists for calyp
|
||||
#
|
||||
|
||||
cmake_minimum_required( VERSION 3.2.0 )
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Project Definition
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(PROJECT_NAME
|
||||
"calyp"
|
||||
CACHE INTERNAL "" FORCE
|
||||
)
|
||||
SET(PROJECT_LIBRARY
|
||||
"Calyp"
|
||||
CACHE INTERNAL "" FORCE
|
||||
)
|
||||
|
||||
SET(CALYP_VERSION_MAJOR "1")
|
||||
SET(CALYP_VERSION_MINOR "2")
|
||||
SET(CALYP_VERSION_PATCH "1")
|
||||
SET(CALYP_VERSION
|
||||
"${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}"
|
||||
CACHE INTERNAL "" FORCE
|
||||
)
|
||||
|
||||
PROJECT(
|
||||
${PROJECT_NAME}
|
||||
VERSION ${CALYP_VERSION}
|
||||
LANGUAGES "CXX"
|
||||
)
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# CMake functions
|
||||
######################################################################################
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
|
||||
INCLUDE( cmake/ModulesFct.cmake )
|
||||
# ####################################################################################################################################################
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
INCLUDE(cmake/ModulesFct.cmake)
|
||||
INCLUDE(FeatureSummary)
|
||||
INCLUDE(GNUInstallDirs)
|
||||
|
||||
######################################################################################
|
||||
# Project Definition
|
||||
######################################################################################
|
||||
|
||||
set( PROJECT_NAME "playuver" CACHE INTERNAL "" FORCE )
|
||||
|
||||
PROJECT( ${PROJECT_NAME} )
|
||||
SET( PLAYUVER_VERSION_MAJOR "0" )
|
||||
SET( PLAYUVER_VERSION_MINOR "14" )
|
||||
SET( PLAYUVER_VERSION_PATCH "0" )
|
||||
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 Google Tests" ON )
|
||||
OPTION(BUILD_APP "Build GUI Application" ON)
|
||||
OPTION(BUILD_TOOLS "Build Command Line Application" ON)
|
||||
OPTION(BUILD_EXAMPLES "Build Examples" OFF)
|
||||
OPTION(BUILD_DOC "Build Documentation" OFF)
|
||||
OPTION(BUILD_TESTS "Build Google Tests" OFF)
|
||||
OPTION(BUILD_TESTS_CATCH2 "Build Catch2 Tests" OFF)
|
||||
|
||||
OPTION( USE_FERVOR "Add Fervor support" OFF )
|
||||
OPTION(USE_FERVOR "Add Fervor support" OFF)
|
||||
|
||||
OPTION( USE_DYNLOAD "Use dynamic load of modules" ON )
|
||||
OPTION( USE_SSE "Build with SSE support" OFF )
|
||||
OPTION( USE_WERROR "Warnings as errors" OFF )
|
||||
OPTION( USE_STATIC "Use static libs" OFF )
|
||||
OPTION(USE_DYNLOAD "Use dynamic load of modules" ON)
|
||||
OPTION(USE_SSE "Build with SSE support" OFF)
|
||||
OPTION(USE_WERROR "Warnings as errors" OFF)
|
||||
OPTION(USE_STATIC "Use static libs" OFF)
|
||||
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# Release configuration
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
# To be switched on when releasing.
|
||||
OPTION(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON)
|
||||
|
||||
# Get current version.
|
||||
set(PLAYUVER_VERSION_STRING "${PLAYUVER_VERSION}")
|
||||
if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
SET(CALYP_VERSION_STRING "${CALYP_VERSION}")
|
||||
IF(NOT RELEASE_BUILD AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
# Probably a Git workspace; determine the revision.
|
||||
FIND_PACKAGE(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
IF(GIT_FOUND)
|
||||
EXEC_PROGRAM(
|
||||
${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ARGS "describe --tags"
|
||||
OUTPUT_VARIABLE PLAYUVER_GIT_REVISION
|
||||
OUTPUT_VARIABLE CALYP_GIT_REVISION
|
||||
RETURN_VALUE TAG_RESULT
|
||||
)
|
||||
# git describe --tags failed; maybe the repository was checked with depth=1.
|
||||
if(NOT ${TAG_RESULT} EQUAL 0)
|
||||
exec_program(${GIT_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
IF(NOT ${TAG_RESULT} EQUAL 0)
|
||||
EXEC_PROGRAM(
|
||||
${GIT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ARGS "describe --always"
|
||||
OUTPUT_VARIABLE PLAYUVER_GIT_REVISION
|
||||
OUTPUT_VARIABLE CALYP_GIT_REVISION
|
||||
)
|
||||
endif()
|
||||
message(STATUS "PlaYUVer Git revision: ${PLAYUVER_GIT_REVISION}")
|
||||
set(PLAYUVER_VERSION_STRING "${PLAYUVER_VERSION} (rev. ${PLAYUVER_GIT_REVISION})")
|
||||
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}/PlaYUVerUpdate.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PlaYUVerUpdate-${UPDATE_CHANNEL}.xml )
|
||||
|
||||
|
||||
######################################################################################
|
||||
# Dependencies
|
||||
######################################################################################
|
||||
|
||||
IF( BUILD_DOC )
|
||||
FIND_PACKAGE(Doxygen)
|
||||
SET( BUILD_DOC ${Doxygen_FOUND} )
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(Doxygen PROPERTIES URL "http://www.doxygen.org/" DESCRIPTION "Doxygen" TYPE OPTIONAL)
|
||||
|
||||
|
||||
IF( BUILD_TESTS )
|
||||
FIND_PACKAGE(GTest)
|
||||
SET( BUILD_DOC ${GTEST_FOUND} )
|
||||
IF( GTEST_FOUND )
|
||||
ENABLE_TESTING()
|
||||
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
|
||||
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()
|
||||
|
||||
OPTION( USE_OPENCV "Add OpenCV support" ON )
|
||||
SET( OPENCV_OPTFLOW_FOUND OFF )
|
||||
IF( USE_OPENCV )
|
||||
LIST(APPEND OPENCV_MODULES core highgui imgproc video videoio )
|
||||
FIND_PACKAGE( OpenCV COMPONENTS ${OPENCV_MODULES} )
|
||||
SET(USE_OPENCV ${OpenCV_FOUND})
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(OpenCV PROPERTIES URL "http://opencv.willowgarage.com" DESCRIPTION "OpenCV library support in PlaYUVerFrame" TYPE OPTIONAL)
|
||||
SET(UPDATE_CHANNEL
|
||||
"stable"
|
||||
CACHE STRING "Update channel"
|
||||
)
|
||||
# CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/CalypUpdate.xml.in ${CMAKE_CURRENT_BINARY_DIR}/CalypUpdate-${UPDATE_CHANNEL}.xml )
|
||||
|
||||
OPTION( USE_FFMPEG "Add FFMPEG support" ON )
|
||||
IF( USE_FFMPEG )
|
||||
FIND_PACKAGE( FFmpeg )
|
||||
# ####################################################################################################################################################
|
||||
# Dependencies
|
||||
# ####################################################################################################################################################
|
||||
|
||||
IF(BUILD_DOC)
|
||||
FIND_PACKAGE(Doxygen)
|
||||
SET(BUILD_DOC ${Doxygen_FOUND})
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
Doxygen PROPERTIES
|
||||
URL "http://www.doxygen.org/"
|
||||
DESCRIPTION "Doxygen"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
INCLUDE(FetchContent)
|
||||
|
||||
IF(BUILD_TESTS)
|
||||
FETCHCONTENT_DECLARE(googletest URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip)
|
||||
# For Windows: Prevent overriding the parent project's compiler/linker settings
|
||||
SET(gtest_force_shared_crt
|
||||
ON
|
||||
CACHE BOOL "" FORCE
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(googletest)
|
||||
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
googletest PROPERTIES
|
||||
URL "https://github.com/google/googletest"
|
||||
DESCRIPTION "Google unit tests"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
SET(CALYP_TEST_DATA_DIR
|
||||
"CALYP_TEST_DATA_DIR"
|
||||
CACHE PATH "Location of video information for testing"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
IF(BUILD_TESTS_CATCH2)
|
||||
|
||||
FETCHCONTENT_DECLARE(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v2.13.1
|
||||
)
|
||||
FETCHCONTENT_MAKEAVAILABLE(Catch2)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
Catch2 PROPERTIES
|
||||
URL "https://github.com/catchorg/Catch2"
|
||||
DESCRIPTION "Catch2 unit tests"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/_deps/catch2-src/contrib/Catch.cmake)
|
||||
ENABLE_TESTING()
|
||||
ENDIF()
|
||||
|
||||
OPTION(USE_OPENCV "Add OpenCV support" ON)
|
||||
IF(USE_OPENCV)
|
||||
|
||||
FIND_PACKAGE(OpenCV COMPONENTS core highgui imgproc video)
|
||||
IF(${OpenCV_FOUND})
|
||||
SET(USE_OPENCV TRUE)
|
||||
LIST(APPEND OPENCV_MODULES core highgui imgproc video)
|
||||
FIND_PACKAGE(OpenCV COMPONENTS videoio photo)
|
||||
IF(${OPENCV_VIDEOIO_FOUND})
|
||||
LIST(APPEND OPENCV_MODULES videoio)
|
||||
ENDIF()
|
||||
IF(${OPENCV_PHOTO_FOUND})
|
||||
LIST(APPEND OPENCV_MODULES photo)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(USE_OPENCV FALSE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
OpenCV PROPERTIES
|
||||
URL "http://opencv.willowgarage.com"
|
||||
DESCRIPTION "OpenCV library support in CalypFrame"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
OPTION(USE_FFMPEG "Add FFMPEG support" ON)
|
||||
IF(USE_FFMPEG)
|
||||
FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
|
||||
SET(USE_FFMPEG ${FFMPEG_FOUND})
|
||||
ENDIF()
|
||||
SET_PACKAGE_PROPERTIES(FFmpeg PROPERTIES URL "http://ffmpeg.org/" DESCRIPTION "Libav library support in PlaYUVerStream" TYPE OPTIONAL)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
FFmpeg PROPERTIES
|
||||
URL "http://ffmpeg.org/"
|
||||
DESCRIPTION "Libav library support in CalypStream"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
ADD_FEATURE_INFO(DynLoad USE_DYNLOAD "Support for dynamic module load" )
|
||||
ADD_FEATURE_INFO(SSE USE_SSE "SSE instructions support" )
|
||||
ADD_FEATURE_INFO(WErrors USE_WERROR "Warnings as errors" )
|
||||
|
||||
|
||||
IF( WIN32 )
|
||||
SET( USE_STATIC ON )
|
||||
INCLUDE( cmake/Win32.cmake )
|
||||
IF(WIN32)
|
||||
SET(USE_STATIC ON)
|
||||
INCLUDE(cmake/Win32.cmake)
|
||||
ENDIF()
|
||||
|
||||
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# CMake Defin1itions
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
INCLUDE(FeatureSummary)
|
||||
|
||||
# must go before the project command
|
||||
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
||||
SET(CMAKE_CONFIGURATION_TYPES
|
||||
"Debug;Release"
|
||||
CACHE STRING "Configs" FORCE
|
||||
)
|
||||
IF(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
|
||||
SET_PROPERTY( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
|
||||
ENDIF()
|
||||
SET( CMAKE_CXX_FLAGS "" )
|
||||
SET(CMAKE_CXX_FLAGS "")
|
||||
|
||||
######################################################################################
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Compiler options
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 20)
|
||||
ADD_DEFINITIONS(-std=gnu++20)
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
MESSAGE(STATUS "No build type selected, default to Release")
|
||||
SET(CMAKE_BUILD_TYPE "Release")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -ftree-vectorizer-verbose")
|
||||
|
||||
ADD_DEFINITIONS(
|
||||
-DQT_NO_CAST_TO_ASCII
|
||||
# -DQT_NO_CAST_FROM_ASCII
|
||||
-DQT_NO_URL_CAST_FROM_STRING
|
||||
-DQT_NO_CAST_FROM_BYTEARRAY
|
||||
# -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_USE_QSTRINGBUILDER
|
||||
)
|
||||
|
||||
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") endif()
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op")
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
||||
ENDIF()
|
||||
|
||||
IF(USE_WERROR)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||
|
||||
# ####################################################################################################################################################
|
||||
# Configure targets
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 14)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ADD_DEFINITIONS(-std=gnu++0x)
|
||||
endif()
|
||||
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")
|
||||
|
||||
IF (NOT CMAKE_BUILD_TYPE )
|
||||
MESSAGE(STATUS "No build type selected, default to Release")
|
||||
SET(CMAKE_BUILD_TYPE "Release")
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
ADD_SUBDIRECTORY(modules)
|
||||
|
||||
IF(${BUILD_TOOLS})
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
ENDIF()
|
||||
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
|
||||
|
||||
IF( USE_WERROR )
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
|
||||
IF(${BUILD_APP})
|
||||
ADD_SUBDIRECTORY(app)
|
||||
ENDIF()
|
||||
|
||||
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0" )
|
||||
SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
|
||||
|
||||
|
||||
ADD_FEATURE_INFO(PlaYUVerApp BUILD_APP "Build Graphical Interface")
|
||||
ADD_FEATURE_INFO(PlaYUVerTools BUILD_TOOLS "Build Command line tool" )
|
||||
|
||||
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 )
|
||||
IF(${BUILD_EXAMPLES})
|
||||
ADD_SUBDIRECTORY(examples)
|
||||
ENDIF()
|
||||
|
||||
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: " "${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}" )
|
||||
MESSAGE(STATUS "${PROJECT_NAME} INFORMATION")
|
||||
MESSAGE(STATUS "Version: " "${CALYP_VERSION_STRING}")
|
||||
MESSAGE(STATUS "Configuration:")
|
||||
MESSAGE(STATUS " Static libs: " "${USE_STATIC}")
|
||||
MESSAGE(STATUS " Build type: " "${CMAKE_BUILD_TYPE}")
|
||||
MESSAGE(STATUS " Build flags: " "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
FEATURE_SUMMARY(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
@@ -32,26 +32,26 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# title of most generated pages and in a few other places.
|
||||
# The default value is: My Project.
|
||||
|
||||
PROJECT_NAME = PlaYUVer
|
||||
PROJECT_NAME = Calyp
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER =
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
# quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF =
|
||||
PROJECT_BRIEF =
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
|
||||
# the logo to the output directory.
|
||||
|
||||
PROJECT_LOGO = /home/joaoc/Programming/PlaYUVerDev/playuver/app/resources/playuver.ico
|
||||
PROJECT_LOGO = app/resources/calyp.ico
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||
# into which the generated documentation will be written. If a relative path is
|
||||
@@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES
|
||||
# will be relative from the directory where doxygen is started.
|
||||
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
|
||||
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_PATH =
|
||||
|
||||
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
|
||||
# path mentioned in the documentation of a class, which tells the reader which
|
||||
@@ -171,7 +171,7 @@ STRIP_FROM_PATH =
|
||||
# specify the list of include paths that are normally passed to the compiler
|
||||
# using the -I flag.
|
||||
|
||||
STRIP_FROM_INC_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
|
||||
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
|
||||
# less readable) file names. This can be useful is your file systems doesn't
|
||||
@@ -244,7 +244,7 @@ ALIASES = "returns=\"\par Returns\" "
|
||||
# A mapping has the form "name=value". For example adding "class=itcl::class"
|
||||
# will allow you to use the command class in the itcl::class meaning.
|
||||
|
||||
TCL_SUBST =
|
||||
TCL_SUBST =
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C. For
|
||||
@@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
|
||||
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
|
||||
# the files are not read by doxygen.
|
||||
|
||||
EXTENSION_MAPPING =
|
||||
EXTENSION_MAPPING =
|
||||
|
||||
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
|
||||
# according to the Markdown format, which allows for more readable
|
||||
@@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES
|
||||
# sections, marked by \if <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
|
||||
|
||||
+29
-49
@@ -1,9 +1,9 @@
|
||||
/** @mainpage PlaYUVer Project
|
||||
/** @mainpage Calyp Project
|
||||
|
||||
Description
|
||||
----------------------------------------------------------------
|
||||
|
||||
PlaYUVer is an open-source video player with the following features:
|
||||
Calyp is an open-source video player with the following features:
|
||||
- Support for libavformat and libavcodec;
|
||||
- Support for wide range of raw video formats;
|
||||
- Support up to 16 bits per pixel
|
||||
@@ -12,81 +12,61 @@ PlaYUVer is an open-source video player with the following features:
|
||||
- Synchronized zoom across several videos (perfect for comparison operations)
|
||||
- Useful information in status bar, *e.g.*, pixel information
|
||||
Useful sidebars with frame information, *e.g.*, frame histogram
|
||||
- Constant growing libs for stream and frame processing (PlaYUVerStream and PlaYUVerFrame)
|
||||
- Constant growing libs for stream and frame processing (CalypStream and CalypFrame)
|
||||
- Advanced API for frame/video processing algorithms
|
||||
- Frame level quality measurement API based on the PlaYUVerFrame class
|
||||
- Frame level quality measurement API based on the CalypFrame class
|
||||
- Powefull command-line tool for quality and frame processing algorithms (uses the referred APIs)
|
||||
|
||||
Modules
|
||||
----------------------------------------------------------------
|
||||
- PlaYUVerLib: Low level library
|
||||
- PlaYUVerModules: Abstract interface for frame processing modules
|
||||
- PlaYUVerApp: High level graphical interface
|
||||
- PlaYUVerTools: High level command line interface
|
||||
- CalypLib: Low level library
|
||||
- CalypModules: Abstract interface for frame processing modules
|
||||
- Calyp: High level graphical interface
|
||||
- CalypTools: High level command line interface
|
||||
|
||||
|
||||
Supported Quality Metrics
|
||||
----------------------------------------------------------------
|
||||
- PSNR
|
||||
- SSIM
|
||||
- MSE
|
||||
- Peak Signal-to-Noise Ratio (PSNR)
|
||||
- Structural SIMilarity (SSIM)
|
||||
- Mean Square Error (MSE)
|
||||
- Weighted Spherical PSNR (WS-PSNR)
|
||||
|
||||
|
||||
Frame Processing Modules
|
||||
----------------------------------------------------------------
|
||||
- Component filtering
|
||||
- Frame difference, crop, shift, binarization
|
||||
- Frame difference, crop, shift, binarization and rotation
|
||||
- Sub-sampling operations
|
||||
- Measuring modules
|
||||
- Modules based on opencv:
|
||||
* Disparity estimation
|
||||
* Motion estimation
|
||||
- Disparity estimation
|
||||
- Motion estimation
|
||||
|
||||
Supported Formats
|
||||
----------------------------------------------------------------
|
||||
- Supports for the following pixel formats:
|
||||
* YUV: 420, 44, 422, 400
|
||||
* YUV: 444, 420, 422
|
||||
* RGB
|
||||
* Gray
|
||||
- Support containers:
|
||||
* Raw video (yuv,rgb,gray)
|
||||
* Portable Network Graphics (png)
|
||||
- Supported formats:
|
||||
* Raw video:
|
||||
* YUV: 444, 420, 422
|
||||
* RGB
|
||||
* Gray
|
||||
* Joint Photographic Experts Group (jpeg)
|
||||
* Portable Map (ppm, pgm)
|
||||
- Partially supported formats:
|
||||
* Portable Network Graphics (png)
|
||||
* Windows Bitmap (bmp)
|
||||
* Tagged Image File Format (tiff)
|
||||
* Portable Map (ppm,pgm,pbm)
|
||||
|
||||
Developers
|
||||
----------------------------------------------------------------
|
||||
|
||||
- Joao Carreira (jfmcarreira@gmail.com)
|
||||
- Luis Lucas (luisfrlucas@gmail.com)
|
||||
|
||||
Builds
|
||||
----------------------------------------------------------------
|
||||
Download update build for windows and linux from our <a href="https://sourceforge.net/projects/playuver/">SourceForge project page</a>
|
||||
|
||||
|
||||
Build/Install using cmake
|
||||
----------------------------------------------------------------
|
||||
|
||||
1. The following are required for compilation:
|
||||
- an ordinary C++ development environment (g++, make, C++ libraries and headers, ...)
|
||||
- cmake
|
||||
- a Qt development environment (libraries, headers, qmake, ...): only QtCore, QtGui and QtWidgets are required, at least in version 4
|
||||
|
||||
2. Optional Dependencies:
|
||||
- QtDBus
|
||||
- OpenCv
|
||||
- FFmpeg
|
||||
|
||||
3. Run the following commands: (this will create an executable named playuver)
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DUSE_QT4=OFF -DUSE_FFMPEG=ON -DUSE_OPENCV=ON .. (for FFmpeg and OpenCV support)
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
- [**Joao Carreira**](https://github.com/jfmcarreira) (Founder, Main Developer)
|
||||
- [**Luis Lucas** ](https://github.com/lfrlucas) (Founder, Developer)
|
||||
- [**Joao Santos** ](https://github.com/jpataias) (Contributor)
|
||||
- [**JNSFilipe** ](https://github.com/JNSFilipe) (Contributor)
|
||||
|
||||
*/
|
||||
@@ -1,49 +0,0 @@
|
||||
<?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,6 +1,12 @@
|
||||
# [PlaYUVer](https://github.com/pixlra/playuver)
|
||||
# Calyp
|
||||
## Enhanced YUV video player based on Qt focusing on image/video analysis
|
||||
|
||||
## Build Status
|
||||
|
||||
Master branch | Development branch
|
||||
------------ | -------------
|
||||
[](https://travis-ci.org/pixlra/calyp.svg?branch=master) [](https://ci.appveyor.com/project/jfmcarreira/calyp/branch/master) | Comming soon!
|
||||
|
||||
|
||||
## Features
|
||||
- Support for libavformat and libavcodec;
|
||||
@@ -11,25 +17,26 @@
|
||||
- Synchronized zoom across several videos (perfect for comparison operations)
|
||||
- Useful information in status bar, *e.g.*, pixel information
|
||||
Useful sidebars with frame information, *e.g.*, frame histogram
|
||||
- Constant growing libs for stream and frame processing (PlaYUVerStream and PlaYUVerFrame)
|
||||
- Constant growing libs for stream and frame processing (CalypStream and CalypFrame)
|
||||
- Advanced API for frame/video processing algorithms
|
||||
- Frame level quality measurement API based on the PlaYUVerFrame class
|
||||
- Frame level quality measurement API based on the CalypFrame class
|
||||
- Powefull command-line tool for quality and frame processing algorithms (uses the referred APIs)
|
||||
|
||||
## Modules
|
||||
- PlaYUVerLib: Low level library
|
||||
- PlaYUVerModules: Abstract interface for frame processing modules
|
||||
- PlaYUVerApp: High level graphical interface
|
||||
- PlaYUVerTools: High level command line interface
|
||||
- CalypLib: Low level library
|
||||
- CalypModules: Abstract interface for frame processing modules
|
||||
- Calyp: High level graphical interface
|
||||
- CalypTools: High level command line interface
|
||||
|
||||
## Supported Quality Metrics
|
||||
- PSNR
|
||||
- SSIM
|
||||
- MSE
|
||||
- Peak Signal-to-Noise Ratio (PSNR)
|
||||
- Structural SIMilarity (SSIM)
|
||||
- Mean Square Error (MSE)
|
||||
- Weighted Spherical PSNR (WS-PSNR)
|
||||
|
||||
## Frame Processing Modules
|
||||
- Component filtering
|
||||
- Frame difference, crop, shift, binarization
|
||||
- Frame difference, crop, shift, binarization and rotation
|
||||
- Sub-sampling operations
|
||||
- Measuring modules
|
||||
- Modules based on opencv:
|
||||
@@ -38,24 +45,31 @@
|
||||
|
||||
## Supported Formats
|
||||
- Supports for the following pixel formats:
|
||||
* YUV: 420, 44, 422, 400
|
||||
* YUV: 444, 420, 422
|
||||
* RGB
|
||||
* Gray
|
||||
- Support containers:
|
||||
* Raw video (yuv,rgb,gray)
|
||||
* Portable Network Graphics (png)
|
||||
- Supported formats:
|
||||
* Raw video:
|
||||
* YUV: 444, 420, 422
|
||||
* RGB
|
||||
* Gray
|
||||
* Joint Photographic Experts Group (jpeg)
|
||||
* Portable Map (ppm, pgm)
|
||||
- Partially supported formats:
|
||||
* Portable Network Graphics (png)
|
||||
* Windows Bitmap (bmp)
|
||||
* Tagged Image File Format (tiff)
|
||||
* Portable Map (ppm,pgm,pbm)
|
||||
|
||||
## Developers
|
||||
- **Joao Carreira** (jfmcarreira@gmail.com)
|
||||
- **Luis Lucas** (luisfrlucas@gmail.com)
|
||||
## 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)
|
||||
|
||||
|
||||
### Binaries and Build
|
||||
* **Daily builds** available for Windows and Linux in our [SourceForge page](https://sourceforge.net/projects/playuver/)
|
||||
* 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)
|
||||
* **Dependencies**
|
||||
1. an ordinary C++ development environment (g++, make, C++ libraries and headers, ...)
|
||||
2. cmake
|
||||
|
||||
+113
-133
@@ -1,184 +1,164 @@
|
||||
###
|
||||
### CMakeLists for playuver app component
|
||||
###
|
||||
#
|
||||
# CMakeLists for calyp app component
|
||||
#
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/external )
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/dialog ${CMAKE_CURRENT_SOURCE_DIR}/docks
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/widgets
|
||||
)
|
||||
|
||||
OPTION( USE_QT4 "Build with Qt4" OFF )
|
||||
OPTION( USE_QTDBUS "Build with QtDBus" ON )
|
||||
OPTION( USE_FERVOR "Add Fervor support" OFF )
|
||||
OPTION(USE_QTDBUS "Build with QtDBus" ON)
|
||||
OPTION(USE_FERVOR "Add Fervor support" OFF)
|
||||
|
||||
#####################################################################################
|
||||
# Qt library
|
||||
######################################################################################
|
||||
ADD_SUBDIRECTORY(external)
|
||||
|
||||
IF( USE_QT4 )
|
||||
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Gui Widgets Concurrent)
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent)
|
||||
LIST(APPEND QT_MODULES Core Gui Widgets Concurrent)
|
||||
|
||||
FIND_PACKAGE( 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} )
|
||||
IF(USE_QTDBUS)
|
||||
FIND_PACKAGE(Qt5DBus)
|
||||
SET_PACKAGE_PROPERTIES(
|
||||
Qt5DBus PROPERTIES
|
||||
DESCRIPTION "Support for Qt5 DBus messages between instances"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
IF(${Qt5DBus_FOUND})
|
||||
SET(USE_QTDBUS ${Qt5DBus_FOUND}) # TODO: fix this stupid variable
|
||||
SET(USE_QTDBUS
|
||||
${Qt5DBus_FOUND}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::DBus)
|
||||
LIST(APPEND QT_MODULES DBus)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
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 )
|
||||
|
||||
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()
|
||||
|
||||
ENDIF()
|
||||
|
||||
set(plaYUVer_App_SRCS
|
||||
# Main
|
||||
SET(Calyp_App_SRCS
|
||||
# Main
|
||||
main.cpp
|
||||
PlaYUVerApp.cpp
|
||||
PlaYUVerSubWindowHandle.cpp
|
||||
PlaYUVerMdiSubWindow.cpp
|
||||
MainWindow.cpp
|
||||
# Module SubWindow
|
||||
SubWindowHandle.cpp
|
||||
MdiSubWindow.cpp
|
||||
SubWindowAbstract.cpp
|
||||
# Module Video
|
||||
# Module Video
|
||||
VideoHandle.cpp
|
||||
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
|
||||
# Module Quality
|
||||
QualityHandle.cpp
|
||||
PlotSubWindow.cpp
|
||||
external/qcustomplot/qcustomplot.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
|
||||
)
|
||||
|
||||
IF( USE_QTDBUS )
|
||||
LIST( APPEND plaYUVer_App_SRCS PlaYUVerAppAdaptor.cpp )
|
||||
IF(USE_QTDBUS)
|
||||
LIST(APPEND Calyp_App_SRCS DBusAppAdaptor.cpp)
|
||||
ENDIF()
|
||||
|
||||
SET(Calyp_App_UI "")
|
||||
|
||||
set(PlaYUVer_App_UI "" )
|
||||
SET(Calyp_App_RCC resources/${PROJECT_NAME}.qrc)
|
||||
|
||||
set(PlaYUVer_App_RCC
|
||||
resources/playuver.qrc
|
||||
)
|
||||
IF(USE_FERVOR)
|
||||
|
||||
SET(FERVOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/fervor)
|
||||
|
||||
IF(EXISTS ${FERVOR_DIR})
|
||||
|
||||
SET(FERVOR_APP_NAME ${PROJECT_NAME})
|
||||
SET(FERVOR_APP_VERSION ${CALYP_VERSION_STRING})
|
||||
|
||||
IF( USE_FERVOR )
|
||||
ADD_SUBDIRECTORY(${FERVOR_DIR})
|
||||
|
||||
SET( FERVOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/fervor )
|
||||
INCLUDE_DIRECTORIES(${FERVOR_DIR})
|
||||
|
||||
IF(EXISTS ${FERVOR_DIR} )
|
||||
LIST(APPEND APP_LINKER_LIBS Fervor)
|
||||
|
||||
SET( FERVOR_APP_NAME ${PROJECT_NAME} )
|
||||
SET( FERVOR_APP_VERSION ${PLAYUVER_VERSION_STRING} )
|
||||
FIND_PACKAGE(Qt5 REQUIRED Network WebKit WebKitWidgets)
|
||||
|
||||
ADD_SUBDIRECTORY( ${FERVOR_DIR} )
|
||||
LIST(APPEND QT_LINKER_LIBS Qt5::Network Qt5::WebKit Qt5::WebKitWidgets)
|
||||
LIST(APPEND QT_MODULES Network WebKit WebKitWidgets)
|
||||
|
||||
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} )
|
||||
# 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.")
|
||||
|
||||
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()
|
||||
QT5_WRAP_UI(Calyp_App_UI_Wrap ${Calyp_App_UI})
|
||||
QT5_ADD_RESOURCES(Calyp_App_RCC ${Calyp_App_RCC})
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
SET( CMAKE_AUTOMOC ON )
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
|
||||
# Windows application icon
|
||||
IF( WIN32 )
|
||||
set(WINDOWS_RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/resources.obj)
|
||||
IF( MSVC )
|
||||
add_custom_command(OUTPUT ${WINDOWS_RES_FILE}
|
||||
COMMAND rc.exe /fo ${WINDOWS_RES_FILE} playuver.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} ${PROJECT_NAME}.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 playuver.rc ${WINDOWS_RES_FILE}
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${WINDOWS_RES_FILE}
|
||||
COMMAND windres.exe ${PROJECT_NAME}.rc ${WINDOWS_RES_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources
|
||||
COMMENT "Add icon on windows platform"
|
||||
)
|
||||
ENDIF()
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} ${Calyp_App_SRCS} ${HEADERS_MOC_FILES} ${Calyp_App_UI_Wrap} ${Calyp_App_RCC} ${WINDOWS_RES_FILE})
|
||||
ELSEIF(CMAKE_HOST_APPLE)
|
||||
SET(CMAKE_MACOSX_BUNDLE ON)
|
||||
SET(MACOSX_BUNDLE_EXECUTABLE_NAME ${PROJECT_NAME})
|
||||
SET(MACOSX_BUNDLE_ICON_FILE Contents/Resources/calyp.icns)
|
||||
SET(MACOSX_BUNDLE_BUNDLE_NAME Calyp)
|
||||
SET(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/resources/calyp.icns)
|
||||
SET_SOURCE_FILES_PROPERTIES(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} MACOSX_BUNDLE ${Calyp_App_SRCS} ${HEADERS_MOC_FILES} ${Calyp_App_UI_Wrap} ${Calyp_App_RCC} ${APP_ICON_MACOSX})
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(${PROJECT_NAME} ${Calyp_App_SRCS} ${HEADERS_MOC_FILES} ${Calyp_App_UI_Wrap} ${Calyp_App_RCC})
|
||||
ENDIF()
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PROJECT_LIBRARY} CalypModules ${APP_LINKER_LIBS} ${QT_LINKER_LIBS} QCustomPlotLib)
|
||||
|
||||
# QT5_USE_MODULES( ${PROJECT_NAME} ${QT_MODULES} )
|
||||
|
||||
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 )
|
||||
|
||||
|
||||
|
||||
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
INSTALL(FILES resources/calyp.desktop DESTINATION share/applications)
|
||||
INSTALL(FILES resources/calyp.png DESTINATION share/pixmaps)
|
||||
INSTALL(FILES resources/calyp.xml DESTINATION share/mime/packages)
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,17 +18,19 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerAppModuleIf.cpp
|
||||
* \brief PlaYUVer modules interface
|
||||
* \file CalypAppModuleIf.cpp
|
||||
* \brief Calyp modules interface
|
||||
*/
|
||||
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "CalypAppModuleIf.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent,
|
||||
QAction* action,
|
||||
PlaYUVerModuleIf* module )
|
||||
CalypAppModuleIf::CalypAppModuleIf( QObject* parent, QAction* action, CalypModuleIf* module )
|
||||
: m_bIsRunning( false )
|
||||
, m_pcModuleAction( action )
|
||||
, m_pcModule( module )
|
||||
@@ -40,13 +42,13 @@ PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent,
|
||||
, m_dMeasurementResult( 0 )
|
||||
{
|
||||
setParent( parent );
|
||||
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
|
||||
for( int i = 0; i < CLP_MODULE_MAX_NUM_FRAMES; i++ )
|
||||
{
|
||||
m_pcSubWindow[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::update()
|
||||
void CalypAppModuleIf::update( bool isPlaying )
|
||||
{
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
@@ -54,16 +56,25 @@ Void PlaYUVerAppModuleIf::update()
|
||||
}
|
||||
else
|
||||
{
|
||||
apply();
|
||||
apply( isPlaying );
|
||||
}
|
||||
}
|
||||
|
||||
Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads )
|
||||
bool CalypAppModuleIf::isRunning()
|
||||
{
|
||||
Bool bRet = false;
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
return QThread::isRunning();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CalypAppModuleIf::apply( bool isPlaying, bool disableThreads )
|
||||
{
|
||||
bool bRet = false;
|
||||
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
if( m_pcModule->m_iModuleType == CLP_FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
@@ -74,9 +85,9 @@ Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads )
|
||||
m_pcSubWindow[0]->setFillWindow( true );
|
||||
}
|
||||
}
|
||||
if( !( isPlaying && ( m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_SKIP_WHILE_PLAY ) ) )
|
||||
if( !( isPlaying && ( m_pcModule->m_uiModuleRequirements & CLP_MODULE_REQUIRES_SKIP_WHILE_PLAY ) ) )
|
||||
{
|
||||
#ifdef PLAYUVER_THREADED_MODULES
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
if( !disableThreads )
|
||||
{
|
||||
wait();
|
||||
@@ -89,7 +100,7 @@ Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads )
|
||||
show();
|
||||
}
|
||||
|
||||
if( m_pcDisplaySubWindow || m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
|
||||
if( m_pcDisplaySubWindow || m_pcModule->m_iModuleType == CLP_FRAME_MEASUREMENT_MODULE )
|
||||
{
|
||||
bRet = true;
|
||||
}
|
||||
@@ -102,19 +113,19 @@ Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads )
|
||||
return bRet;
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::run()
|
||||
void CalypAppModuleIf::run()
|
||||
{
|
||||
m_bIsRunning = true;
|
||||
m_bSuccess = false;
|
||||
std::vector<PlaYUVerFrame*> apcFrameList;
|
||||
for( UInt i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ )
|
||||
std::vector<CalypFrame*> apcFrameList;
|
||||
for( unsigned int i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ )
|
||||
{
|
||||
apcFrameList.push_back( m_pcSubWindow[i]->getCurrFrame() );
|
||||
}
|
||||
|
||||
if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
if( m_pcModule->m_iModuleType == CLP_FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
if( m_pcModule->m_iModuleAPI == MODULE_API_2 )
|
||||
if( m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
|
||||
{
|
||||
m_pcProcessedFrame = m_pcModule->process( apcFrameList );
|
||||
}
|
||||
@@ -123,9 +134,9 @@ Void PlaYUVerAppModuleIf::run()
|
||||
m_pcProcessedFrame = m_pcModule->process( m_pcSubWindow[0]->getCurrFrame() );
|
||||
}
|
||||
}
|
||||
else if( m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
|
||||
else if( m_pcModule->m_iModuleType == CLP_FRAME_MEASUREMENT_MODULE )
|
||||
{
|
||||
if( m_pcModule->m_iModuleAPI == MODULE_API_2 )
|
||||
if( m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
|
||||
{
|
||||
m_dMeasurementResult = m_pcModule->measure( apcFrameList );
|
||||
}
|
||||
@@ -140,7 +151,7 @@ Void PlaYUVerAppModuleIf::run()
|
||||
}
|
||||
m_bSuccess = true;
|
||||
m_bIsRunning = false;
|
||||
#ifdef PLAYUVER_THREADED_MODULES
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
EventData* eventData = new EventData( m_bSuccess, this );
|
||||
if( parent() )
|
||||
QCoreApplication::postEvent( parent(), eventData );
|
||||
@@ -148,31 +159,29 @@ Void PlaYUVerAppModuleIf::run()
|
||||
return;
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::show()
|
||||
void CalypAppModuleIf::show()
|
||||
{
|
||||
switch( m_pcModule->m_iModuleType )
|
||||
{
|
||||
case FRAME_PROCESSING_MODULE:
|
||||
case CLP_FRAME_PROCESSING_MODULE:
|
||||
if( m_pcDisplaySubWindow )
|
||||
{
|
||||
m_pcDisplaySubWindow->setCurrFrame( m_pcProcessedFrame );
|
||||
m_pcDisplaySubWindow->setFillWindow( false );
|
||||
m_pcDisplaySubWindow->clearWindowBusy();
|
||||
m_pcDisplaySubWindow->setFillWindow( isRunning() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcSubWindow[0]->setCurrFrame( m_pcProcessedFrame );
|
||||
m_pcSubWindow[0]->setFillWindow( false );
|
||||
m_pcSubWindow[0]->clearWindowBusy();
|
||||
m_pcSubWindow[0]->setFillWindow( isRunning() );
|
||||
}
|
||||
break;
|
||||
case FRAME_MEASUREMENT_MODULE:
|
||||
case CLP_FRAME_MEASUREMENT_MODULE:
|
||||
m_pcModuleDock->setModulueReturnValue( m_dMeasurementResult );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerAppModuleIf::destroy()
|
||||
void CalypAppModuleIf::destroy()
|
||||
{
|
||||
if( m_bIsRunning )
|
||||
{
|
||||
@@ -196,7 +205,7 @@ Void PlaYUVerAppModuleIf::destroy()
|
||||
m_pcDisplaySubWindow->closeSubWindow();
|
||||
m_pcDisplaySubWindow = NULL;
|
||||
|
||||
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
|
||||
for( int i = 0; i < CLP_MODULE_MAX_NUM_FRAMES; i++ )
|
||||
{
|
||||
if( m_pcSubWindow[i] )
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,31 +18,39 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerAppModuleIf.h
|
||||
* \brief PlaYUVer App modules interface
|
||||
* \file CalypAppModuleIf.h
|
||||
* \brief Calyp App modules interface
|
||||
*/
|
||||
|
||||
#ifndef __PLAYUVERAPPMODULESIF_H__
|
||||
#define __PLAYUVERAPPMODULESIF_H__
|
||||
#ifndef __CALYPAPPMODULESIF_H__
|
||||
#define __CALYPAPPMODULESIF_H__
|
||||
|
||||
#include "ModuleHandleDock.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
#include "lib/PlaYUVerModuleIf.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include <QEvent>
|
||||
#include <QVector>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
class QAction;
|
||||
#include "config.h"
|
||||
|
||||
//#define PLAYUVER_THREADED_MODULES
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
#include <QThread>
|
||||
#endif
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "ModuleHandleDock.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypModuleIf.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class QAction;
|
||||
class QDockWidget;
|
||||
|
||||
#define CLP_MODULE_MAX_NUM_FRAMES 5
|
||||
|
||||
class VideoSubWindow;
|
||||
|
||||
class PlaYUVerAppModuleIf
|
||||
#ifdef PLAYUVER_THREADED_MODULES
|
||||
class CalypAppModuleIf
|
||||
#ifdef CALYP_THREADED_MODULES
|
||||
: public QThread
|
||||
#else
|
||||
: public QObject
|
||||
@@ -53,56 +61,59 @@ class PlaYUVerAppModuleIf
|
||||
friend class ModulesHandleOptDialog;
|
||||
|
||||
private:
|
||||
Bool m_bIsRunning;
|
||||
Bool m_bSuccess;
|
||||
bool m_bIsRunning;
|
||||
bool m_bSuccess;
|
||||
|
||||
QAction* m_pcModuleAction;
|
||||
PlaYUVerModuleIf* m_pcModule;
|
||||
CalypModuleIf* m_pcModule;
|
||||
|
||||
VideoSubWindow* m_pcSubWindow[MODULE_REQUIRES_MAX_NUM_FRAMES];
|
||||
VideoSubWindow* m_pcSubWindow[CLP_MODULE_MAX_NUM_FRAMES];
|
||||
|
||||
VideoSubWindow* m_pcDisplaySubWindow;
|
||||
|
||||
QDockWidget* m_pcDockWidget;
|
||||
ModuleHandleDock* m_pcModuleDock;
|
||||
|
||||
PlaYUVerStream* m_pcModuleStream;
|
||||
PlaYUVerFrame* m_pcProcessedFrame;
|
||||
Double m_dMeasurementResult;
|
||||
CalypStream* m_pcModuleStream;
|
||||
CalypFrame* m_pcProcessedFrame;
|
||||
double m_dMeasurementResult;
|
||||
|
||||
public:
|
||||
class EventData : public QEvent
|
||||
{
|
||||
public:
|
||||
EventData( bool success, PlaYUVerAppModuleIf* module ) : QEvent( QEvent::User )
|
||||
EventData( bool success, CalypAppModuleIf* module )
|
||||
: QEvent( QEvent::User )
|
||||
{
|
||||
m_bSuccess = success;
|
||||
m_pcModule = module;
|
||||
}
|
||||
Bool m_bSuccess;
|
||||
PlaYUVerAppModuleIf* m_pcModule;
|
||||
bool m_bSuccess;
|
||||
CalypAppModuleIf* m_pcModule;
|
||||
};
|
||||
|
||||
PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaYUVerModuleIf* module );
|
||||
virtual ~PlaYUVerAppModuleIf() {}
|
||||
CalypAppModuleIf( QObject* parent, QAction* action, CalypModuleIf* module );
|
||||
virtual ~CalypAppModuleIf() {}
|
||||
QList<VideoSubWindow*> getSubWindowList()
|
||||
{
|
||||
QList<VideoSubWindow*> arraySubWindows;
|
||||
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
|
||||
for( int i = 0; i < CLP_MODULE_MAX_NUM_FRAMES; i++ )
|
||||
if( m_pcSubWindow[i] )
|
||||
arraySubWindows.append( m_pcSubWindow[i] );
|
||||
return arraySubWindows;
|
||||
}
|
||||
|
||||
PlaYUVerModuleIf* getModule() { return m_pcModule; }
|
||||
UInt getModuleRequirements() { return m_pcModule->m_uiModuleRequirements; }
|
||||
Void update();
|
||||
Bool apply( Bool isPlaying = false, Bool disableThreads = false );
|
||||
Void show();
|
||||
Void destroy();
|
||||
CalypModuleIf* getModule() { return m_pcModule; }
|
||||
unsigned int getModuleRequirements() { return m_pcModule->m_uiModuleRequirements; }
|
||||
ClpString moduleInfo() { return m_pcModule->moduleInfo(); }
|
||||
void update( bool isPlaying );
|
||||
bool apply( bool isPlaying = false, bool disableThreads = false );
|
||||
bool isRunning();
|
||||
void show();
|
||||
void destroy();
|
||||
|
||||
protected:
|
||||
virtual void run();
|
||||
};
|
||||
|
||||
#endif // __PLAYUVERAPPMODULESIF_H__
|
||||
#endif // __CALYPAPPMODULESIF_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,14 +18,14 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerAppDefs.h
|
||||
* \brief Define types for PlaYUVerApp
|
||||
* \file CommonDefs.h
|
||||
* \brief Define common types
|
||||
*/
|
||||
|
||||
#ifndef __PLAYUVERAPPDEFS_H__
|
||||
#define __PLAYUVERAPPDEFS_H__
|
||||
#ifndef __COMMONDEFS_H__
|
||||
#define __COMMONDEFS_H__
|
||||
|
||||
#include "lib/PlaYUVerDefs.h"
|
||||
#include "lib/CalypDefs.h"
|
||||
|
||||
// ====================================================================================================================
|
||||
// Qt compatibility redefinition
|
||||
@@ -38,4 +38,4 @@
|
||||
#define QStringLiteral( str ) QString::fromUtf8( "" str "", sizeof( str ) - 1 )
|
||||
#endif
|
||||
|
||||
#endif // __PLAYUVERAPPDEFS_H__
|
||||
#endif // __COMMONDEFS_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,30 +18,35 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerAppAdaptor.h
|
||||
* \file DBusAppAdaptor.cpp
|
||||
* \brief Define function to manage the interface in DBus
|
||||
*/
|
||||
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include <QDBusAbstractAdaptor>
|
||||
#include "DBusAppAdaptor.h"
|
||||
|
||||
PlaYUVerAppAdaptor::PlaYUVerAppAdaptor( PlaYUVerApp* app )
|
||||
#include "MainWindow.h"
|
||||
|
||||
//#include <QDBusConnectioninterface>
|
||||
//#include <QDBusinterface>
|
||||
#include <QDBusMessage>
|
||||
#include <QDBusReply>
|
||||
|
||||
DBusAppAdaptor::DBusAppAdaptor( MainWindow* app )
|
||||
: QDBusAbstractAdaptor( app ), m_app( app )
|
||||
{
|
||||
// application dbus interface
|
||||
Bool isRegistered = QDBusConnection::sessionBus().registerObject(
|
||||
QStringLiteral( PLAYUVER_DBUS_PATH ), this, QDBusConnection::ExportAllSlots );
|
||||
bool isRegistered = QDBusConnection::sessionBus().registerObject( QStringLiteral( CALYP_DBUS_PATH ), QStringLiteral( CALYP_DBUS_SESSION_NAME ),
|
||||
this, QDBusConnection::ExportAllSlots );
|
||||
|
||||
Q_ASSERT( isRegistered == true );
|
||||
}
|
||||
|
||||
PlaYUVerAppAdaptor::~PlaYUVerAppAdaptor()
|
||||
DBusAppAdaptor::~DBusAppAdaptor()
|
||||
{
|
||||
QDBusConnection::sessionBus().unregisterObject( QStringLiteral( PLAYUVER_DBUS_PATH ) );
|
||||
QDBusConnection::sessionBus().unregisterObject( QStringLiteral( CALYP_DBUS_PATH ) );
|
||||
}
|
||||
|
||||
void PlaYUVerAppAdaptor::activate()
|
||||
void DBusAppAdaptor::activate()
|
||||
{
|
||||
if( !m_app )
|
||||
{
|
||||
@@ -50,13 +55,13 @@ void PlaYUVerAppAdaptor::activate()
|
||||
m_app->raise();
|
||||
}
|
||||
|
||||
QString PlaYUVerAppAdaptor::activeSession()
|
||||
QString DBusAppAdaptor::activeSession()
|
||||
{
|
||||
// return m_app->sessionManager()->activeSession()->name();
|
||||
return QString( "PlaYUVer" );
|
||||
return QString( "Calyp" );
|
||||
}
|
||||
|
||||
bool PlaYUVerAppAdaptor::loadFile( const QString& filename )
|
||||
bool DBusAppAdaptor::loadFile( const QString& filename )
|
||||
{
|
||||
m_app->loadFile( filename );
|
||||
return true;
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,33 +18,31 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerAppAdaptor.h
|
||||
* \file DBusAppAdaptor.h
|
||||
* \brief Define function to manage the interface in DBus
|
||||
*/
|
||||
|
||||
#ifndef __PlaYUVerAppAdaptor_H__
|
||||
#define __PlaYUVerAppAdaptor_H__
|
||||
#ifndef __DBUSAPPADAPTOR_H__
|
||||
#define __DBUSAPPADAPTOR_H__
|
||||
|
||||
#include <QDBusAbstractAdaptor>
|
||||
#include <QDBusConnectionInterface>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusMessage>
|
||||
#include <QDBusReply>
|
||||
#include <QtCore>
|
||||
#include <QtDBus>
|
||||
|
||||
#define PLAYUVER_DBUS_SESSION_NAME "org.pixlra.PlaYUVer.application"
|
||||
#define PLAYUVER_DBUS_PATH "/"
|
||||
#define CALYP_DBUS_SESSION_NAME "org.pixlra.Calyp.application"
|
||||
#define CALYP_DBUS_PATH "/"
|
||||
|
||||
class PlaYUVerApp;
|
||||
class MainWindow;
|
||||
|
||||
class PlaYUVerAppAdaptor : public QDBusAbstractAdaptor
|
||||
class DBusAppAdaptor : public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO( "D-Bus Interface", PLAYUVER_DBUS_SESSION_NAME )
|
||||
Q_CLASSINFO( "D-Bus interface", CALYP_DBUS_SESSION_NAME )
|
||||
Q_PROPERTY( QString activeSession READ activeSession )
|
||||
public:
|
||||
PlaYUVerAppAdaptor( PlaYUVerApp* app );
|
||||
~PlaYUVerAppAdaptor();
|
||||
DBusAppAdaptor( MainWindow* app );
|
||||
~DBusAppAdaptor();
|
||||
/**
|
||||
* emit the exiting signal
|
||||
*/
|
||||
@@ -77,7 +75,7 @@ public:
|
||||
QString activeSession();
|
||||
|
||||
private:
|
||||
PlaYUVerApp* m_app;
|
||||
MainWindow* m_app;
|
||||
};
|
||||
|
||||
#endif // __PlaYUVerAppAdaptor_H__
|
||||
#endif // __DBUSAPPADAPTOR_H__
|
||||
+14
-11
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,6 +23,8 @@
|
||||
* Based on the work of Ricardo N. Rocha Sardo in SCode project
|
||||
*/
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
#include <QBitmap>
|
||||
#include <QColor>
|
||||
#include <QDebug>
|
||||
@@ -32,8 +34,6 @@
|
||||
#include <QRect>
|
||||
#include <QRectF>
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -44,6 +44,11 @@ GridManager::GridManager()
|
||||
m_cGridColor = QColor( Qt::white );
|
||||
}
|
||||
|
||||
void GridManager::setGridSize( int newsize )
|
||||
{
|
||||
m_uiHSpace = m_uiVSpace = newsize;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Grid Drawer
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -65,9 +70,8 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter
|
||||
style = Solid;
|
||||
switch( style )
|
||||
{
|
||||
case IntersectionDot:
|
||||
case IntersectionCross:
|
||||
{
|
||||
case intersectionDot:
|
||||
case intersectionCross: {
|
||||
painter->setPen( mainPen );
|
||||
// Draw crosses or dots on intersections
|
||||
for( int x = offsetx; x <= area.right(); x += hSpacing )
|
||||
@@ -82,7 +86,7 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter
|
||||
|
||||
if( x >= area.x() && y >= area.y() )
|
||||
{
|
||||
if( style == IntersectionDot )
|
||||
if( style == intersectionDot )
|
||||
painter->drawPoint( x, y ); // Dot
|
||||
else
|
||||
{ // Crosses:
|
||||
@@ -94,8 +98,7 @@ void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Dashed:
|
||||
{
|
||||
case Dashed: {
|
||||
// Change pen to the dashed line
|
||||
mainPen.setStyle( Qt::DashLine );
|
||||
}
|
||||
|
||||
+12
-9
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -26,12 +26,13 @@
|
||||
#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;
|
||||
@@ -44,14 +45,16 @@ class GridManager
|
||||
public:
|
||||
enum Style
|
||||
{
|
||||
IntersectionDot = 0,
|
||||
IntersectionCross,
|
||||
intersectionDot = 0,
|
||||
intersectionCross,
|
||||
Dashed,
|
||||
Solid
|
||||
};
|
||||
|
||||
GridManager();
|
||||
|
||||
void setGridSize( int newsize );
|
||||
|
||||
void drawGrid( QPixmap& image, const QRect& area, QPainter* painter );
|
||||
|
||||
/**
|
||||
@@ -93,8 +96,8 @@ public:
|
||||
QPoint nearPos( int x = -1, int y = -1 );
|
||||
|
||||
private:
|
||||
UInt m_uiHSpace;
|
||||
UInt m_uiVSpace;
|
||||
unsigned int m_uiHSpace;
|
||||
unsigned int m_uiVSpace;
|
||||
QColor m_cGridColor;
|
||||
Style m_eGridStyle;
|
||||
QPoint m_nearPos;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,11 +19,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerApp.cpp
|
||||
* \brief Main definition of the PlaYUVerApp app
|
||||
* \file MainWindow.cpp
|
||||
* \brief Definition of the main window
|
||||
*/
|
||||
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QCloseEvent>
|
||||
@@ -31,33 +33,32 @@
|
||||
#include <QDropEvent>
|
||||
#include <QSignalMapper>
|
||||
#include <QtDebug>
|
||||
|
||||
#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"
|
||||
|
||||
#define SYNCHRONISED_ZOON 1
|
||||
|
||||
PlaYUVerApp::PlaYUVerApp()
|
||||
MainWindow::MainWindow()
|
||||
: m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), m_pcAboutDialog( NULL )
|
||||
{
|
||||
setWindowModality( Qt::ApplicationModal );
|
||||
setWindowModality( Qt::NonModal );
|
||||
|
||||
// DBus
|
||||
// DBus
|
||||
#ifdef USE_QTDBUS
|
||||
m_pDBusAdaptor = new PlaYUVerAppAdaptor( this );
|
||||
m_pDBusAdaptor = new DBusAppAdaptor( this );
|
||||
#endif
|
||||
|
||||
m_pcWindowHandle = new PlaYUVerSubWindowHandle( this );
|
||||
m_pcWindowHandle = new SubWindowHandle( this );
|
||||
|
||||
m_appModuleVideo = new VideoHandle( this, m_pcWindowHandle );
|
||||
m_appModuleQuality = new QualityHandle( this, m_pcWindowHandle );
|
||||
@@ -73,7 +74,7 @@ PlaYUVerApp::PlaYUVerApp()
|
||||
readSettings();
|
||||
|
||||
setWindowTitle( QApplication::applicationName() );
|
||||
setWindowIcon( QIcon( ":/images/playuver.png" ) );
|
||||
setWindowIcon( QIcon( ":logos/calyp-icon.png" ) );
|
||||
setUnifiedTitleAndToolBarOnMac( true );
|
||||
setCentralWidget( m_pcWindowHandle );
|
||||
setAcceptDrops( true );
|
||||
@@ -86,21 +87,21 @@ PlaYUVerApp::PlaYUVerApp()
|
||||
connect( m_appModuleExtensions, SIGNAL( changed() ), this, SLOT( update() ) );
|
||||
}
|
||||
|
||||
Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] )
|
||||
bool MainWindow::parseArgs( int argc, char* argv[] )
|
||||
{
|
||||
Bool bRet = false;
|
||||
PlaYUVerOptions pcCmdParser;
|
||||
bool bRet = false;
|
||||
CalypOptions pcCmdParser;
|
||||
|
||||
std::vector<String> m_apcInputs;
|
||||
String strResolution( "" );
|
||||
String strPelFmt( "" );
|
||||
std::vector<ClpString> m_apcInputs;
|
||||
ClpString strResolution( "" );
|
||||
ClpString strPelFmt( "" );
|
||||
|
||||
pcCmdParser.addOptions() /**/
|
||||
( "input,i", m_apcInputs, "input file" ) /**/
|
||||
( "size,s", strResolution, "size (WxH)" ) /**/
|
||||
( "pel_fmt", strPelFmt, "pixel format" );
|
||||
|
||||
if( !pcCmdParser.parse( argc, argv ) )
|
||||
if( pcCmdParser.parse( argc, argv ) < 0 )
|
||||
{
|
||||
bRet |= true;
|
||||
}
|
||||
@@ -113,14 +114,13 @@ Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] )
|
||||
}
|
||||
if( pcCmdParser.hasOpt( "input" ) )
|
||||
{
|
||||
for( UInt i = 1; i < m_apcInputs.size(); i++ )
|
||||
for( unsigned int i = 1; i < m_apcInputs.size(); i++ )
|
||||
{
|
||||
loadFile( QString::fromStdString( m_apcInputs[i] ) );
|
||||
}
|
||||
}
|
||||
std::list<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 ) );
|
||||
}
|
||||
@@ -129,22 +129,22 @@ Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] )
|
||||
return bRet;
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::about()
|
||||
void MainWindow::about()
|
||||
{
|
||||
if( !m_pcAboutDialog )
|
||||
m_pcAboutDialog = new AboutDialog( this );
|
||||
m_pcAboutDialog->exec();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::closeEvent( QCloseEvent* event )
|
||||
void MainWindow::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
Int mayCloseAll = true;
|
||||
Int msgBoxCloseRet = QMessageBox::Yes;
|
||||
int mayCloseAll = true;
|
||||
int msgBoxCloseRet = QMessageBox::Yes;
|
||||
|
||||
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow();
|
||||
if( subWindowList.size() >= 1 )
|
||||
{
|
||||
QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!",
|
||||
QMessageBox msgBoxClose( QMessageBox::Question, "Calyp", "There are open files!",
|
||||
QMessageBox::Yes | QMessageBox::No, this );
|
||||
msgBoxClose.setDefaultButton( QMessageBox::No );
|
||||
msgBoxClose.setInformativeText( "Close all?" );
|
||||
@@ -154,7 +154,7 @@ Void PlaYUVerApp::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
case QMessageBox::Yes:
|
||||
mayCloseAll = true;
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
mayCloseAll &= subWindowList.at( i )->mayClose();
|
||||
}
|
||||
@@ -177,37 +177,34 @@ Void PlaYUVerApp::closeEvent( QCloseEvent* event )
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::closeAll()
|
||||
void MainWindow::closeAll()
|
||||
{
|
||||
m_pcWindowHandle->removeAllSubWindow();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
void MainWindow::loadFile( QString fileName, CalypFileInfo* pStreamInfo )
|
||||
{
|
||||
if( !QFileInfo( fileName ).exists() )
|
||||
{
|
||||
printMessage( "File " + fileName + " do not exist!", LOG_ERROR );
|
||||
printMessage( "File " + fileName + " do not exist!", CLP_LOG_ERROR );
|
||||
return;
|
||||
}
|
||||
VideoSubWindow* videoSubWindow =
|
||||
PlaYUVerApp::findVideoStreamSubWindow( m_pcWindowHandle, fileName );
|
||||
VideoSubWindow* videoSubWindow = MainWindow::findVideoStreamSubWindow( m_pcWindowHandle, fileName );
|
||||
if( videoSubWindow )
|
||||
{
|
||||
m_pcWindowHandle->setActiveSubWindow( videoSubWindow );
|
||||
return;
|
||||
}
|
||||
videoSubWindow =
|
||||
new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); // createSubWindow();
|
||||
SubWindowAbstract* subWindow = videoSubWindow;
|
||||
videoSubWindow = new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); // createSubWindow();
|
||||
if( !pStreamInfo )
|
||||
{
|
||||
Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName );
|
||||
pStreamInfo = (PlaYUVerStreamInfo*)( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL );
|
||||
int idx = findCalypStreamInfo( m_aRecentFileStreamInfo, fileName );
|
||||
pStreamInfo = (CalypFileInfo*)( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Bool opened = false;
|
||||
bool opened = false;
|
||||
|
||||
if( !pStreamInfo )
|
||||
opened = videoSubWindow->loadFile( fileName );
|
||||
@@ -216,25 +213,17 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
|
||||
if( opened )
|
||||
{
|
||||
printMessage( "Loading file...", LOG_INFO );
|
||||
printMessage( "Loading file...", CLP_LOG_INFO );
|
||||
m_pcWindowHandle->addSubWindow( videoSubWindow );
|
||||
videoSubWindow->show();
|
||||
|
||||
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 ) ) );
|
||||
m_appModuleVideo->addSubWindow( videoSubWindow );
|
||||
|
||||
videoSubWindow->zoomToFit();
|
||||
updateZoomFactorSBox();
|
||||
|
||||
m_appModuleVideo->openSubWindow( videoSubWindow );
|
||||
|
||||
addStreamInfoToRecentList( videoSubWindow->getStreamInfo() );
|
||||
|
||||
printMessage( "File loaded", LOG_INFO );
|
||||
printMessage( "File loaded", CLP_LOG_INFO );
|
||||
m_cLastOpenPath = QFileInfo( fileName ).path();
|
||||
}
|
||||
else
|
||||
@@ -242,34 +231,43 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
|
||||
videoSubWindow->close();
|
||||
}
|
||||
}
|
||||
catch( PlaYUVerFailure& e )
|
||||
catch( CalypFailure& e )
|
||||
{
|
||||
videoSubWindow->close();
|
||||
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QString warningMsg =
|
||||
"Cannot open file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
printMessage( warningMsg, CLP_LOG_ERROR );
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------- File Functions -----------------------
|
||||
|
||||
Void PlaYUVerApp::open()
|
||||
QStringList MainWindow::showFileDialog( bool bRead )
|
||||
{
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedReadFormats();
|
||||
std::vector<CalypStreamFormat> supportedFmts;
|
||||
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
if( bRead )
|
||||
supportedFmts = CalypStream::supportedReadFormats();
|
||||
else
|
||||
supportedFmts = CalypStream::supportedWriteFormats();
|
||||
|
||||
for( unsigned int i = 0; i < supportedFmts.size(); i++ )
|
||||
{
|
||||
if( supportedFmts[i].formatExt != "" )
|
||||
std::vector<ClpString> arrayExt = supportedFmts[i].getExts();
|
||||
if( arrayExt.size() > 0 )
|
||||
{
|
||||
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 ) );
|
||||
QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (" );
|
||||
for( std::vector<ClpString>::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;
|
||||
}
|
||||
@@ -279,10 +277,25 @@ Void PlaYUVerApp::open()
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QStringList fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ),
|
||||
m_cLastOpenPath, filter.join( ";;" ) );
|
||||
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;
|
||||
}
|
||||
|
||||
for( Int i = 0; i < fileNameList.size(); i++ )
|
||||
void MainWindow::open()
|
||||
{
|
||||
QStringList fileNameList = showFileDialog( true );
|
||||
for( int i = 0; i < fileNameList.size(); i++ )
|
||||
{
|
||||
if( !fileNameList.at( i ).isEmpty() )
|
||||
{
|
||||
@@ -291,68 +304,76 @@ Void PlaYUVerApp::open()
|
||||
}
|
||||
}
|
||||
|
||||
// Void PlaYUVerApp::openDevice()
|
||||
// void CalypApp::openDevice()
|
||||
//{
|
||||
// loadFile( "/dev/video0", NULL );
|
||||
//}
|
||||
|
||||
Void PlaYUVerApp::openRecent()
|
||||
void MainWindow::openRecent()
|
||||
{
|
||||
QAction* action = qobject_cast<QAction*>( sender() );
|
||||
PlaYUVerStreamInfo recentFile = action->data().value<PlaYUVerStreamInfo>();
|
||||
CalypFileInfo recentFile = action->data().value<CalypFileInfo>();
|
||||
if( action )
|
||||
loadFile( recentFile.m_cFilename, &recentFile );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::save()
|
||||
void MainWindow::saveFrame()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
VideoSubWindow* saveWindow = m_pcCurrentVideoSubWindow;
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
|
||||
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() )
|
||||
QStringList fileNameList = showFileDialog( false );
|
||||
if( fileNameList.size() == 1 )
|
||||
{
|
||||
QString fileName = fileNameList[0];
|
||||
m_cLastOpenPath = QFileInfo( fileName ).path();
|
||||
try
|
||||
{
|
||||
saveWindow->save( fileName );
|
||||
}
|
||||
catch( PlaYUVerFailure& e )
|
||||
catch( CalypFailure& e )
|
||||
{
|
||||
QApplication::restoreOverrideCursor();
|
||||
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() +
|
||||
" with the following error: \n" + e.what();
|
||||
QString warningMsg =
|
||||
"Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
|
||||
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
|
||||
printMessage( warningMsg, LOG_ERROR );
|
||||
printMessage( warningMsg, CLP_LOG_ERROR );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::format()
|
||||
void MainWindow::saveStream()
|
||||
{
|
||||
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( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
@@ -364,13 +385,12 @@ Void PlaYUVerApp::format()
|
||||
addStreamInfoToRecentList( pcVideoSubWindow->getStreamInfo() );
|
||||
}
|
||||
}
|
||||
catch( PlaYUVerFailure& e )
|
||||
catch( CalypFailure& 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, LOG_ERROR );
|
||||
printMessage( warningMsg, CLP_LOG_ERROR );
|
||||
qDebug() << warningMsg;
|
||||
m_pcCurrentSubWindow->close();
|
||||
}
|
||||
@@ -379,7 +399,7 @@ Void PlaYUVerApp::format()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::reload()
|
||||
void MainWindow::reload()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
@@ -389,19 +409,18 @@ Void PlaYUVerApp::reload()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::reloadAll()
|
||||
void MainWindow::reloadAll()
|
||||
{
|
||||
UInt windowCategoryOrder[] = {
|
||||
unsigned int windowCategoryOrder[] = {
|
||||
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW,
|
||||
SubWindowAbstract::MODULE_SUBWINDOW,
|
||||
SubWindowAbstract::MODULE_SUBWINDOW,
|
||||
};
|
||||
|
||||
for( UInt c = 0; c < 3; c++ )
|
||||
for( unsigned int c = 0; c < 3; c++ )
|
||||
{
|
||||
QList<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();
|
||||
}
|
||||
@@ -410,19 +429,19 @@ Void PlaYUVerApp::reloadAll()
|
||||
update();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::loadAll()
|
||||
void MainWindow::loadAll()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
printMessage( "Loading file into memory...", LOG_INFO );
|
||||
printMessage( "Loading file into memory...", CLP_LOG_INFO );
|
||||
m_pcCurrentVideoSubWindow->loadAll();
|
||||
printMessage( "File loaded", LOG_INFO );
|
||||
printMessage( "File loaded", CLP_LOG_INFO );
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------- Zoom Functions -----------------------
|
||||
|
||||
Void PlaYUVerApp::normalSize()
|
||||
void MainWindow::normalSize()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
@@ -431,7 +450,7 @@ Void PlaYUVerApp::normalSize()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::zoomToFit()
|
||||
void MainWindow::zoomToFit()
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
@@ -440,12 +459,11 @@ Void PlaYUVerApp::zoomToFit()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::zoomToFitAll()
|
||||
void MainWindow::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();
|
||||
@@ -454,28 +472,28 @@ Void PlaYUVerApp::zoomToFitAll()
|
||||
updateZoomFactorSBox();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::scaleFrame( int ratio )
|
||||
void MainWindow::scaleFrame( int ratio )
|
||||
{
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
m_pcCurrentSubWindow->scaleView( ( Double )( ratio ) / 100.0 );
|
||||
m_pcCurrentSubWindow->scaleView( (double)( ratio ) / 100.0 );
|
||||
updateZoomFactorSBox();
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::zoomFromSBox( double zoom )
|
||||
void MainWindow::zoomFromSBox( double zoom )
|
||||
{
|
||||
SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow();
|
||||
Double factor = zoom / 100;
|
||||
double factor = zoom / 100;
|
||||
if( activeSubWindow )
|
||||
{
|
||||
activeSubWindow->zoomToFactor( factor );
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::updateZoomFactorSBox()
|
||||
void MainWindow::updateZoomFactorSBox()
|
||||
{
|
||||
Double factor;
|
||||
double factor;
|
||||
if( m_pcCurrentSubWindow )
|
||||
{
|
||||
factor = m_pcCurrentSubWindow->getScaleFactor();
|
||||
@@ -485,14 +503,14 @@ Void PlaYUVerApp::updateZoomFactorSBox()
|
||||
|
||||
// ----------------------- Drag and drop functions ----------------------
|
||||
|
||||
Void PlaYUVerApp::dragEnterEvent( QDragEnterEvent* event )
|
||||
void MainWindow::dragEnterEvent( QDragEnterEvent* event )
|
||||
{
|
||||
// setText(tr("<drop content>"));
|
||||
// mdiArea->setBackgroundRole( QPalette::Highlight );
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::dropEvent( QDropEvent* event )
|
||||
void MainWindow::dropEvent( QDropEvent* event )
|
||||
{
|
||||
const QMimeData* mimeData = event->mimeData();
|
||||
QList<QUrl> urlList = mimeData->urls();
|
||||
@@ -506,14 +524,13 @@ Void PlaYUVerApp::dropEvent( QDropEvent* event )
|
||||
|
||||
// ----------------------- Sub Window Functions -----------------------
|
||||
|
||||
VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
|
||||
const QString& fileName )
|
||||
VideoSubWindow* MainWindow::findVideoStreamSubWindow( const SubWindowHandle* windowManager,
|
||||
const QString& fileName )
|
||||
{
|
||||
QString canonicalFilePath = QFileInfo( fileName ).canonicalFilePath();
|
||||
VideoSubWindow* pcSubWindow;
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
QList<SubWindowAbstract*> subWindowList = windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
if( pcSubWindow->getCurrentFileName() == canonicalFilePath )
|
||||
@@ -524,7 +541,7 @@ VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHa
|
||||
|
||||
// ----------------------- Update Functions -----------------------
|
||||
|
||||
Void PlaYUVerApp::update()
|
||||
void MainWindow::update()
|
||||
{
|
||||
SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow();
|
||||
QCoreApplication::processEvents();
|
||||
@@ -557,28 +574,28 @@ Void PlaYUVerApp::update()
|
||||
updateMenus();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::printMessage( const QString& msg )
|
||||
void MainWindow::printMessage( const QString& msg )
|
||||
{
|
||||
printMessage( msg, 0 );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::printMessage( const QString& msg, UInt logLevel )
|
||||
void MainWindow::printMessage( const QString& msg, unsigned int logLevel )
|
||||
{
|
||||
if( !msg.isEmpty() )
|
||||
{
|
||||
statusBar()->showMessage( msg, 10000 );
|
||||
if( logLevel >= LOG_INFO )
|
||||
if( logLevel >= CLP_LOG_INFO )
|
||||
{
|
||||
m_pcWindowHandle->processLogMsg( msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::updateMenus()
|
||||
void MainWindow::updateMenus()
|
||||
{
|
||||
Bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 );
|
||||
bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 );
|
||||
|
||||
Bool hasVideoStreamSubWindow = false;
|
||||
bool hasVideoStreamSubWindow = false;
|
||||
if( m_pcCurrentSubWindow )
|
||||
if( m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW )
|
||||
hasVideoStreamSubWindow = true;
|
||||
@@ -608,38 +625,44 @@ Void PlaYUVerApp::updateMenus()
|
||||
|
||||
// ----------------------- Create Functions -----------------------
|
||||
|
||||
Void PlaYUVerApp::createActions()
|
||||
void MainWindow::createActions()
|
||||
{
|
||||
m_arrayActions.resize( TOTAL_ACT );
|
||||
|
||||
// ------------ File ------------
|
||||
m_arrayActions[OPEN_ACT] = new QAction( QIcon( ":/images/open.png" ), tr( "&Open" ), this );
|
||||
m_arrayActions[OPEN_ACT] = new QAction( 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( QIcon( ":/images/save.png" ), tr( "&Save Frame" ), this );
|
||||
m_arrayActions[SAVE_ACT] = new QAction( 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( save() ) );
|
||||
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() ) );
|
||||
|
||||
m_arrayActions[FORMAT_ACT] = new QAction( tr( "&Format" ), this );
|
||||
m_arrayActions[FORMAT_ACT]->setIcon(
|
||||
QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
|
||||
m_arrayActions[FORMAT_ACT]->setIcon( QIcon::fromTheme( "transform-scale" ) );
|
||||
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() ) );
|
||||
@@ -663,13 +686,11 @@ Void PlaYUVerApp::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 );
|
||||
@@ -681,31 +702,27 @@ Void PlaYUVerApp::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", QIcon( ":/images/zoomin.png" ) ) );
|
||||
m_arrayActions[ZOOM_IN_ACT]->setIcon( QIcon::fromTheme( "zoom-in" ) );
|
||||
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", QIcon( ":/images/zoomout.png" ) ) );
|
||||
m_arrayActions[ZOOM_OUT_ACT]->setIcon( QIcon::fromTheme( "zoom-out" ) );
|
||||
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", QIcon( ":/images/zoomtonormal.png" ) ) );
|
||||
m_arrayActions[ZOOM_NORMAL_ACT]->setIcon( QIcon::fromTheme( "zoom-original" ) );
|
||||
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", QIcon( ":/images/fittowindow.png" ) ) );
|
||||
m_arrayActions[ZOOM_FIT_ACT]->setIcon( QIcon::fromTheme( "zoom-fit-best" ) );
|
||||
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() ) );
|
||||
|
||||
@@ -731,6 +748,7 @@ Void PlaYUVerApp::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() ) );
|
||||
|
||||
@@ -740,7 +758,7 @@ Void PlaYUVerApp::createActions()
|
||||
connect( m_arrayActions[ABOUTQT_ACT], SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::createMenus()
|
||||
void MainWindow::createMenus()
|
||||
{
|
||||
m_arrayMenu.resize( TOTAL_MENUS );
|
||||
|
||||
@@ -748,12 +766,13 @@ Void PlaYUVerApp::createMenus()
|
||||
m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[OPEN_ACT] );
|
||||
// m_arrayMenu[FILE_MENU]->addAction( m_arrayActions[OPEN_DEVICE_ACT] );
|
||||
m_arrayMenu[RECENT_MENU] = m_arrayMenu[FILE_MENU]->addMenu( tr( "Open Recent" ) );
|
||||
for( Int i = 0; i < MAX_RECENT_FILES; ++i )
|
||||
for( int i = 0; i < MAX_RECENT_FILES; ++i )
|
||||
{
|
||||
m_arrayMenu[RECENT_MENU]->addAction( m_arrayRecentFilesActions[i] );
|
||||
}
|
||||
|
||||
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] );
|
||||
@@ -801,7 +820,7 @@ Void PlaYUVerApp::createMenus()
|
||||
m_arrayMenu[ABOUT_MENU]->addAction( m_arrayActions[ABOUTQT_ACT] );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::createToolBars()
|
||||
void MainWindow::createToolBars()
|
||||
{
|
||||
m_arrayToolBars.resize( TOTAL_TOOLBAR );
|
||||
|
||||
@@ -822,8 +841,7 @@ Void PlaYUVerApp::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] );
|
||||
@@ -836,7 +854,7 @@ Void PlaYUVerApp::createToolBars()
|
||||
addToolBar( Qt::TopToolBarArea, m_appModuleVideo->createToolBar() );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::createDockWidgets()
|
||||
void MainWindow::createDockWidgets()
|
||||
{
|
||||
// Properties Dock Window
|
||||
m_arraySideBars.resize( TOTAL_DOCK );
|
||||
@@ -844,16 +862,16 @@ Void PlaYUVerApp::createDockWidgets()
|
||||
addDockWidget( Qt::RightDockWidgetArea, m_appModuleQuality->createDock() );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::createStatusBar()
|
||||
void MainWindow::createStatusBar()
|
||||
{
|
||||
//! Warning: the following widget cannot change size too much
|
||||
statusBar()->addPermanentWidget( m_appModuleVideo->createStatusBarMessage() );
|
||||
printMessage( "Ready!", LOG_INFO );
|
||||
printMessage( "Ready!", CLP_LOG_INFO );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo )
|
||||
void MainWindow::addStreamInfoToRecentList( CalypFileInfo streamInfo )
|
||||
{
|
||||
Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, streamInfo.m_cFilename );
|
||||
int idx = findCalypStreamInfo( m_aRecentFileStreamInfo, streamInfo.m_cFilename );
|
||||
if( idx >= 0 )
|
||||
m_aRecentFileStreamInfo.remove( idx );
|
||||
m_aRecentFileStreamInfo.prepend( streamInfo );
|
||||
@@ -862,11 +880,11 @@ Void PlaYUVerApp::addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo )
|
||||
updateRecentFileActions();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::updateRecentFileActions()
|
||||
void MainWindow::updateRecentFileActions()
|
||||
{
|
||||
Int numRecentFiles = m_aRecentFileStreamInfo.size();
|
||||
int numRecentFiles = m_aRecentFileStreamInfo.size();
|
||||
numRecentFiles = qMin( numRecentFiles, MAX_RECENT_FILES );
|
||||
Int actionIdx = 0;
|
||||
int actionIdx = 0;
|
||||
while( actionIdx < numRecentFiles )
|
||||
{
|
||||
QString text = m_aRecentFileStreamInfo.at( actionIdx ).m_cFilename;
|
||||
@@ -886,9 +904,9 @@ Void PlaYUVerApp::updateRecentFileActions()
|
||||
m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false );
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::checkRecentFileActions()
|
||||
void MainWindow::checkRecentFileActions()
|
||||
{
|
||||
Int i = 0;
|
||||
int i = 0;
|
||||
while( i < m_aRecentFileStreamInfo.size() )
|
||||
{
|
||||
if( !QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).exists() )
|
||||
@@ -898,7 +916,7 @@ Void PlaYUVerApp::checkRecentFileActions()
|
||||
}
|
||||
else
|
||||
{
|
||||
UInt64 fileSize = QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).size();
|
||||
unsigned long long int fileSize = QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).size();
|
||||
if( m_aRecentFileStreamInfo.at( i ).m_uiFileSize != fileSize )
|
||||
{
|
||||
m_aRecentFileStreamInfo.remove( i );
|
||||
@@ -909,7 +927,7 @@ Void PlaYUVerApp::checkRecentFileActions()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::readSettings()
|
||||
void MainWindow::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
|
||||
@@ -921,7 +939,7 @@ Void PlaYUVerApp::readSettings()
|
||||
m_cLastOpenPath = appSettings.value( "MainWindow/LastOpenPath", QDir::homePath() ).toString();
|
||||
|
||||
QVariant value = appSettings.value( "MainWindow/RecentFileList" );
|
||||
m_aRecentFileStreamInfo = value.value<PlaYUVerStreamInfoVector>();
|
||||
m_aRecentFileStreamInfo = value.value<CalypFileInfoVector>();
|
||||
checkRecentFileActions();
|
||||
updateRecentFileActions();
|
||||
|
||||
@@ -931,7 +949,7 @@ Void PlaYUVerApp::readSettings()
|
||||
m_pcWindowHandle->readSettings();
|
||||
}
|
||||
|
||||
Void PlaYUVerApp::writeSettings()
|
||||
void MainWindow::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
|
||||
@@ -940,7 +958,7 @@ Void PlaYUVerApp::writeSettings()
|
||||
appSettings.setValue( "MainWindow/LastOpenPath", m_cLastOpenPath );
|
||||
|
||||
QVariant var;
|
||||
var.setValue<PlaYUVerStreamInfoVector>( m_aRecentFileStreamInfo );
|
||||
var.setValue<CalypFileInfoVector>( m_aRecentFileStreamInfo );
|
||||
appSettings.setValue( "MainWindow/RecentFileList", var );
|
||||
|
||||
m_appModuleVideo->writeSettings();
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,14 +18,14 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerApp.h
|
||||
* \ingroup PlaYUVerApp
|
||||
* \brief Main definition of the PlaYUVerApp app
|
||||
* \file MainWindow.cpp
|
||||
* \brief Definition of the main window
|
||||
* \ingroup CalypApp
|
||||
*
|
||||
* @defgroup PlaYUVerApp PlaYUVer App (GUI)
|
||||
* @defgroup CalypApp Calyp App (GUI)
|
||||
* @{
|
||||
*
|
||||
* PlaYUVerApp is an high level interface providing a GUI
|
||||
* CalypApp is an high level interface providing a GUI
|
||||
* based on the Qt libs in order to display provide important
|
||||
* information about video streams.
|
||||
*
|
||||
@@ -33,18 +33,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __PLAYUVERAPP_H__
|
||||
#define __PLAYUVERAPP_H__
|
||||
#ifndef __MAINWINDOW_H__
|
||||
#define __MAINWINDOW_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "config.h"
|
||||
#ifdef USE_QTDBUS
|
||||
#include "DBusAppAdaptor.h"
|
||||
#endif
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#ifdef USE_QTDBUS
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
#endif
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
class QCloseEvent;
|
||||
class QDragEnterEvent;
|
||||
@@ -54,32 +55,32 @@ class QActionGroup;
|
||||
class QAction;
|
||||
class QSignalMapper;
|
||||
|
||||
class PlaYUVerOptions;
|
||||
class PlaYUVerStream;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class CalypOptions;
|
||||
class CalypStream;
|
||||
class SubWindowHandle;
|
||||
class VideoHandle;
|
||||
class QualityHandle;
|
||||
class ModulesHandle;
|
||||
class PlaYUVerAppAdaptor;
|
||||
class DBusAppAdaptor;
|
||||
class VideoSubWindow;
|
||||
class SubWindowAbstract;
|
||||
class AboutDialog;
|
||||
|
||||
class PlaYUVerApp : public QMainWindow
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PlaYUVerApp();
|
||||
Bool parseArgs( Int argc, Char* argv[] );
|
||||
Void loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo = NULL );
|
||||
MainWindow();
|
||||
bool parseArgs( int argc, char* argv[] );
|
||||
void loadFile( QString fileName, CalypFileInfo* pStreamInfo = NULL );
|
||||
|
||||
public Q_SLOTS:
|
||||
void printMessage( const QString& msg );
|
||||
void printMessage( const QString& msg, UInt logLevel );
|
||||
void printMessage( const QString& msg, unsigned int logLevel );
|
||||
|
||||
protected:
|
||||
Void closeEvent( QCloseEvent* event );
|
||||
void closeEvent( QCloseEvent* event );
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -91,7 +92,8 @@ private Q_SLOTS:
|
||||
void open();
|
||||
// void openDevice();
|
||||
void openRecent();
|
||||
void save();
|
||||
void saveFrame();
|
||||
void saveStream();
|
||||
void format();
|
||||
void reload();
|
||||
void reloadAll();
|
||||
@@ -116,8 +118,8 @@ private Q_SLOTS:
|
||||
void updateZoomFactorSBox();
|
||||
|
||||
private:
|
||||
PlaYUVerAppAdaptor* m_pDBusAdaptor;
|
||||
PlaYUVerOptions* m_pcCmdParser;
|
||||
DBusAppAdaptor* m_pDBusAdaptor;
|
||||
CalypOptions* m_pcCmdParser;
|
||||
/**
|
||||
* Save the current subwindow for every category
|
||||
*/
|
||||
@@ -125,24 +127,25 @@ private:
|
||||
VideoSubWindow* m_pcCurrentVideoSubWindow;
|
||||
|
||||
QString m_cLastOpenPath;
|
||||
QStringList showFileDialog( bool bRead );
|
||||
|
||||
static VideoSubWindow* findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
|
||||
static VideoSubWindow* findVideoStreamSubWindow( const SubWindowHandle* windowManager,
|
||||
const QString& fileName );
|
||||
|
||||
Void updateMenus();
|
||||
void updateMenus();
|
||||
|
||||
Void createActions();
|
||||
Void createMenus();
|
||||
Void createToolBars();
|
||||
Void createDockWidgets();
|
||||
Void createStatusBar();
|
||||
void createActions();
|
||||
void createMenus();
|
||||
void createToolBars();
|
||||
void createDockWidgets();
|
||||
void createStatusBar();
|
||||
|
||||
Void addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo );
|
||||
Void updateRecentFileActions();
|
||||
Void checkRecentFileActions();
|
||||
void addStreamInfoToRecentList( CalypFileInfo streamInfo );
|
||||
void updateRecentFileActions();
|
||||
void checkRecentFileActions();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
QDoubleSpinBox* m_pcZoomFactorSBox;
|
||||
|
||||
@@ -158,7 +161,7 @@ private:
|
||||
VideoHandle* m_appModuleVideo;
|
||||
QualityHandle* m_appModuleQuality;
|
||||
ModulesHandle* m_appModuleExtensions;
|
||||
PlaYUVerSubWindowHandle* m_pcWindowHandle;
|
||||
SubWindowHandle* m_pcWindowHandle;
|
||||
|
||||
/**
|
||||
* Array of menus for the main app
|
||||
@@ -210,6 +213,7 @@ private:
|
||||
OPEN_ACT = 0,
|
||||
OPEN_DEVICE_ACT,
|
||||
SAVE_ACT,
|
||||
SAVE_STREAM_ACT,
|
||||
FORMAT_ACT,
|
||||
RELOAD_ACT,
|
||||
RELOAD_ALL_ACT,
|
||||
@@ -231,9 +235,9 @@ private:
|
||||
|
||||
#define MAX_RECENT_FILES 20
|
||||
QVector<QAction*> m_arrayRecentFilesActions;
|
||||
PlaYUVerStreamInfoVector m_aRecentFileStreamInfo;
|
||||
CalypFileInfoVector m_aRecentFileStreamInfo;
|
||||
|
||||
AboutDialog* m_pcAboutDialog;
|
||||
};
|
||||
|
||||
#endif // __PLAYUVERAPP_H__
|
||||
#endif // __MAINWINDOW_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,21 +18,24 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerMdiSubWindow.cpp
|
||||
* \file MdiSubWindow.cpp
|
||||
* \brief Re-implementation QMdiSubWindow
|
||||
*/
|
||||
|
||||
#include "PlaYUVerMdiSubWindow.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "MdiSubWindow.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
|
||||
PlaYUVerMdiSubWindow::PlaYUVerMdiSubWindow( QWidget* parent ) : QMdiSubWindow( parent )
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
MdiSubWindow::MdiSubWindow( QWidget* parent )
|
||||
: QMdiSubWindow( parent )
|
||||
{
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
setBackgroundRole( QPalette::Background );
|
||||
}
|
||||
|
||||
QSize PlaYUVerMdiSubWindow::sizeHint() const
|
||||
QSize MdiSubWindow::sizeHint() const
|
||||
{
|
||||
QSize maxSize;
|
||||
if( parent() )
|
||||
@@ -41,7 +44,7 @@ QSize PlaYUVerMdiSubWindow::sizeHint() const
|
||||
return sizeHint;
|
||||
}
|
||||
|
||||
Void PlaYUVerMdiSubWindow::closeEvent( QCloseEvent* event )
|
||||
void MdiSubWindow::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
emit aboutToClose( this );
|
||||
event->accept();
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,30 +18,31 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerMdiSubWindow.h
|
||||
* \file MdiSubWindow.h
|
||||
* \brief Re-implementation QMdiSubWindow
|
||||
*/
|
||||
|
||||
#ifndef __PLAYUVERMDISUBWINDOW_H__
|
||||
#define __PLAYUVERMDISUBWINDOW_H__
|
||||
#ifndef __MDISUBWINDOW_H_
|
||||
#define __MDISUBWINDOW_H_
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#include <QMdiSubWindow>
|
||||
|
||||
class PlaYUVerMdiSubWindow : public QMdiSubWindow
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class MdiSubWindow : public QMdiSubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PlaYUVerMdiSubWindow( QWidget* parent = 0 );
|
||||
MdiSubWindow( QWidget* parent = 0 );
|
||||
|
||||
Q_SIGNALS:
|
||||
void aboutToClose( PlaYUVerMdiSubWindow* );
|
||||
void aboutToClose( MdiSubWindow* );
|
||||
|
||||
protected:
|
||||
QSize sizeHint() const;
|
||||
void closeEvent( QCloseEvent* event );
|
||||
};
|
||||
|
||||
#endif // __PLAYUVERMDISUBWINDOW_H__
|
||||
#endif // __MDISUBWINDOW_H_
|
||||
+173
-186
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -19,33 +19,30 @@
|
||||
|
||||
/**
|
||||
* \file ModulesHandle.cpp
|
||||
* \brief PlaYUVer modules handle
|
||||
* \brief Calyp modules handle
|
||||
*/
|
||||
|
||||
#include "ModulesHandle.h"
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "ModulesHandleOptDialog.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "VideoHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "modules/PlaYUVerModuleFactory.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
ModulesHandle::ModulesHandle( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager,
|
||||
VideoHandle* moduleVideo )
|
||||
: QWidget( parent )
|
||||
, m_pcParent( parent )
|
||||
, m_pcMainWindowManager( windowManager )
|
||||
, m_appModuleVideo( moduleVideo )
|
||||
#include "MainWindow.h"
|
||||
#include "ModulesHandleOptDialog.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "modules/CalypModulesFactory.h"
|
||||
|
||||
ModulesHandle::ModulesHandle( QWidget* parent, SubWindowHandle* 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 );
|
||||
|
||||
@@ -60,8 +57,7 @@ Void ModulesHandle::createActions()
|
||||
|
||||
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], SIGNAL( triggered() ), this,
|
||||
SLOT( loadExternalModule() ) );
|
||||
connect( m_arrayActions[LOAD_EXTERNAL_ACT], SIGNAL( triggered() ), this, SLOT( loadExternalModule() ) );
|
||||
|
||||
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" );
|
||||
@@ -70,17 +66,14 @@ Void ModulesHandle::createActions()
|
||||
|
||||
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", parent() );
|
||||
connect( m_arrayActions[DISABLE_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( destroyWindowModules() ) );
|
||||
connect( m_arrayActions[DISABLE_ACT], SIGNAL( triggered() ), this, SLOT( destroyWindowModules() ) );
|
||||
|
||||
m_arrayActions[DISABLE_ALL_ACT] = new QAction( "Disable All Modules", parent() );
|
||||
connect( m_arrayActions[DISABLE_ALL_ACT], SIGNAL( triggered() ), this,
|
||||
SLOT( destroyAllModulesIf() ) );
|
||||
connect( m_arrayActions[DISABLE_ALL_ACT], SIGNAL( triggered() ), this, SLOT( destroyAllModulesIf() ) );
|
||||
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT] = new QAction( "Use New Window", parent() );
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setStatusTip(
|
||||
@@ -96,14 +89,14 @@ QMenu* ModulesHandle::createMenu()
|
||||
return m_pcModulesMenu;
|
||||
}
|
||||
|
||||
Void ModulesHandle::buildMenu()
|
||||
void ModulesHandle::buildMenu()
|
||||
{
|
||||
PlaYUVerModuleIf* pcCurrModuleIf;
|
||||
QString ModuleIfInternalName;
|
||||
CalypModuleIf* pcCurrModuleIf;
|
||||
QString ModuleIfinternalName;
|
||||
QAction* currAction;
|
||||
QMenu* currSubMenu;
|
||||
|
||||
for( Int i = 0; i < m_arrayModulesActions.size(); i++ )
|
||||
for( int i = 0; i < m_arrayModulesActions.size(); i++ )
|
||||
{
|
||||
delete m_arrayModulesActions.at( i );
|
||||
}
|
||||
@@ -111,35 +104,41 @@ Void ModulesHandle::buildMenu()
|
||||
m_pcModulesMenu->clear();
|
||||
m_pcModulesSubMenuList.clear();
|
||||
|
||||
PlaYUVerModuleFactoryMap& PlaYUVerModuleFactoryMap = PlaYUVerModuleFactory::Get()->getMap();
|
||||
PlaYUVerModuleFactoryMap::iterator it = PlaYUVerModuleFactoryMap.begin();
|
||||
for( ; it != PlaYUVerModuleFactoryMap.end(); ++it )
|
||||
CalypModulesFactoryMap& moduleFactoryMap = CalypModulesFactory::Get()->getMap();
|
||||
CalypModulesFactoryMap::iterator it = moduleFactoryMap.begin();
|
||||
for( ; it != moduleFactoryMap.end(); ++it )
|
||||
{
|
||||
pcCurrModuleIf = it->second();
|
||||
ModuleIfInternalName = QString::fromLocal8Bit( it->first );
|
||||
ModuleIfinternalName = QString::fromLocal8Bit( it->first );
|
||||
|
||||
currSubMenu = NULL;
|
||||
if( pcCurrModuleIf->m_pchModuleCategory )
|
||||
if( pcCurrModuleIf->m_iModuleAPI <= CLP_MODULE_API_2 )
|
||||
{
|
||||
for( Int j = 0; j < m_pcModulesSubMenuList.size(); j++ )
|
||||
if( pcCurrModuleIf->m_pchModuleCategory )
|
||||
{
|
||||
if( m_pcModulesSubMenuList.at( j )->title() ==
|
||||
QString( pcCurrModuleIf->m_pchModuleCategory ) )
|
||||
for( int j = 0; j < m_pcModulesSubMenuList.size(); j++ )
|
||||
{
|
||||
currSubMenu = m_pcModulesSubMenuList.at( j );
|
||||
break;
|
||||
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 );
|
||||
}
|
||||
}
|
||||
if( !currSubMenu )
|
||||
{
|
||||
currSubMenu = m_pcModulesMenu->addMenu( pcCurrModuleIf->m_pchModuleCategory );
|
||||
m_pcModulesSubMenuList.append( currSubMenu );
|
||||
}
|
||||
}
|
||||
|
||||
currAction = new QAction( pcCurrModuleIf->m_pchModuleName, parent() );
|
||||
currAction->setStatusTip( pcCurrModuleIf->m_pchModuleTooltip );
|
||||
currAction->setData( ModuleIfInternalName );
|
||||
currAction = new QAction( pcCurrModuleIf->getModuleLongName(), parent() );
|
||||
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->setCheckable( false );
|
||||
connect( currAction, SIGNAL( triggered() ), this, SLOT( activateModule() ) );
|
||||
m_arrayModulesActions.append( currAction );
|
||||
@@ -161,42 +160,41 @@ Void ModulesHandle::buildMenu()
|
||||
m_pcModulesMenu->addAction( m_arrayActions[FORCE_NEW_WINDOW_ACT] );
|
||||
}
|
||||
|
||||
Void ModulesHandle::updateMenus()
|
||||
void ModulesHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
Bool hasSubWindow = pcSubWindow ? true : false;
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
bool hasSubWindow = pcSubWindow ? true : false;
|
||||
QAction* currModuleAction;
|
||||
|
||||
for( Int i = 0; i < m_arrayModulesActions.size(); i++ )
|
||||
for( int i = 0; i < m_arrayModulesActions.size(); i++ )
|
||||
{
|
||||
currModuleAction = m_arrayModulesActions.at( i );
|
||||
currModuleAction->setEnabled( hasSubWindow );
|
||||
//currModuleAction->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( m_pcPlaYUVerAppModuleIfList.size() > 0 );
|
||||
m_arrayActions[DISABLE_ALL_ACT]->setEnabled( m_pcCalypAppModuleIfList.size() > 0 );
|
||||
|
||||
if( pcSubWindow )
|
||||
{
|
||||
QList<PlaYUVerAppModuleIf*> apcCurrentModule = pcSubWindow->getModuleArray();
|
||||
QList<CalypAppModuleIf*> apcCurrentModule = pcSubWindow->getModuleArray();
|
||||
m_arrayActions[DISABLE_ACT]->setEnabled( apcCurrentModule.size() > 0 );
|
||||
if( pcSubWindow->getDisplayModule() )
|
||||
{
|
||||
m_arrayActions[APPLY_ALL_ACT]->setEnabled( true );
|
||||
m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true );
|
||||
}
|
||||
for( Int i = 0; i < apcCurrentModule.size(); i++ )
|
||||
for( int i = 0; i < apcCurrentModule.size(); i++ )
|
||||
{
|
||||
currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction;
|
||||
currModuleAction->setChecked( true );
|
||||
@@ -204,30 +202,27 @@ Void ModulesHandle::updateMenus()
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::readSettings()
|
||||
void ModulesHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked(
|
||||
appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() );
|
||||
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 =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
PlaYUVerAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
|
||||
CalypAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
|
||||
if( pcCurrentModule )
|
||||
{
|
||||
PlaYUVerAppModuleIf* pcCurrModule = pcCurrentModule;
|
||||
CalypAppModuleIf* pcCurrModule = pcCurrentModule;
|
||||
switch( index )
|
||||
{
|
||||
case INVALID_OPT:
|
||||
@@ -246,70 +241,65 @@ 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 |= PlaYUVerModuleFactory::Get()->RegisterDl( fileNames.at( i ).toStdString().data() );
|
||||
bUpdate |= CalypModulesFactory::Get()->RegisterDl( fileNames.at( i ).toStdString().data() );
|
||||
}
|
||||
if( bUpdate )
|
||||
buildMenu();
|
||||
}
|
||||
|
||||
Void ModulesHandle::activateModule()
|
||||
void ModulesHandle::activateModule()
|
||||
{
|
||||
QAction* pcAction = qobject_cast<QAction*>( sender() );
|
||||
Qt::KeyboardModifiers keyModifiers = QApplication::keyboardModifiers();
|
||||
Bool bTmpForceNewWindow = false;
|
||||
bool bTmpForceNewWindow = false;
|
||||
|
||||
VideoSubWindow* pcVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
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();
|
||||
PlaYUVerModuleIf* pcCurrModuleIf =
|
||||
PlaYUVerModuleFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() );
|
||||
PlaYUVerAppModuleIf* pcCurrAppModuleIf =
|
||||
new PlaYUVerAppModuleIf( this, pcAction, pcCurrModuleIf );
|
||||
CalypModuleIf* pcCurrModuleIf =
|
||||
CalypModulesFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() );
|
||||
CalypAppModuleIf* pcCurrAppModuleIf = new CalypAppModuleIf( this, pcAction, pcCurrModuleIf );
|
||||
|
||||
QList<VideoSubWindow*> videoSubWindowList;
|
||||
Int numberOfFrames = pcCurrAppModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME ) // Show dialog to select sub windows
|
||||
int numberOfFrames = pcCurrAppModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
if( numberOfFrames > 1 ) // Show dialog to select sub windows
|
||||
{
|
||||
Int minNumFrames = numberOfFrames;
|
||||
Int maxNumFrames = numberOfFrames;
|
||||
if( numberOfFrames == MODULE_REQUIRES_SEVERAL_FRAMES )
|
||||
int minNumFrames = numberOfFrames;
|
||||
int maxNumFrames = numberOfFrames;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & CLP_MODULES_VARIABLE_NUM_FRAMES )
|
||||
{
|
||||
minNumFrames = 0;
|
||||
minNumFrames = numberOfFrames;
|
||||
maxNumFrames = 255;
|
||||
}
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_SUBWINDOW,
|
||||
minNumFrames, maxNumFrames );
|
||||
QList<SubWindowAbstract*> windowsList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
SubWindowSelectorDialog 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 ) ) );
|
||||
}
|
||||
@@ -318,7 +308,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 ) );
|
||||
}
|
||||
@@ -331,24 +321,22 @@ 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 == MODULE_API_1 )
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == CLP_MODULE_API_1 )
|
||||
{
|
||||
// Check for same fmt in more than one frame modules
|
||||
for( Int i = 1; i < videoSubWindowList.size(); i++ )
|
||||
for( int i = 1; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
if( !videoSubWindowList.at( i )->getCurrFrame()->haveSameFmt(
|
||||
videoSubWindowList.at( 0 )->getCurrFrame() ) )
|
||||
if( !videoSubWindowList.at( i )->getCurrFrame()->haveSameFmt( videoSubWindowList.at( 0 )->getCurrFrame() ) )
|
||||
{
|
||||
videoSubWindowList.clear();
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! Incompatible frames", LOG_ERROR );
|
||||
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Error! Incompatible frames", CLP_LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
@@ -362,55 +350,50 @@ Void ModulesHandle::activateModule()
|
||||
|
||||
if( videoSubWindowList.size() == 0 )
|
||||
{
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! There is no windows to apply the module", LOG_ERROR );
|
||||
qobject_cast<MainWindow*>( m_pcParent )
|
||||
->printMessage( "Error! There is no windows to apply the module", CLP_LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
|
||||
for( Int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
for( int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcSubWindow[i] = videoSubWindowList.at( i );
|
||||
}
|
||||
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_OPTIONS )
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & CLP_MODULE_REQUIRES_OPTIONS )
|
||||
{
|
||||
ModulesHandleOptDialog moduleOptDialog( m_pcParent, pcCurrAppModuleIf );
|
||||
if( moduleOptDialog.runConfiguration() == QDialog::Rejected )
|
||||
{
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Module canceled by user!", LOG_WARNINGS );
|
||||
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Module canceled by user!", CLP_LOG_WARNINGS );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Bool bShowModulesNewWindow =
|
||||
m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow;
|
||||
bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow;
|
||||
|
||||
QString windowName;
|
||||
|
||||
VideoSubWindow* pcModuleSubWindow = NULL;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == CLP_FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) ||
|
||||
bShowModulesNewWindow )
|
||||
if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & CLP_MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow )
|
||||
{
|
||||
pcModuleSubWindow = new VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW );
|
||||
windowName.append( QStringLiteral( "Module " ) );
|
||||
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 ) ) );
|
||||
|
||||
windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleLongName );
|
||||
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 if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
|
||||
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == CLP_FRAME_MEASUREMENT_MODULE )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcDisplaySubWindow = NULL;
|
||||
pcCurrAppModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent, pcCurrAppModuleIf );
|
||||
@@ -418,10 +401,8 @@ Void ModulesHandle::activateModule()
|
||||
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 );
|
||||
@@ -436,24 +417,24 @@ Void ModulesHandle::activateModule()
|
||||
{
|
||||
if( pcCurrAppModuleIf->m_pcDisplaySubWindow )
|
||||
pcCurrAppModuleIf->m_pcDisplaySubWindow->enableModule( pcCurrAppModuleIf );
|
||||
for( Int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
for( int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcSubWindow[i]->associateModule( pcCurrAppModuleIf );
|
||||
}
|
||||
}
|
||||
|
||||
// Create Module
|
||||
Bool moduleCreated = false;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_2 )
|
||||
bool moduleCreated = false;
|
||||
if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
|
||||
{
|
||||
std::vector<PlaYUVerFrame*> apcFrameList;
|
||||
for( Int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
std::vector<CalypFrame*> apcFrameList;
|
||||
for( int i = 0; i < videoSubWindowList.size(); i++ )
|
||||
{
|
||||
apcFrameList.push_back( pcCurrAppModuleIf->m_pcSubWindow[i]->getCurrFrame() );
|
||||
}
|
||||
moduleCreated = pcCurrAppModuleIf->m_pcModule->create( apcFrameList );
|
||||
}
|
||||
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == MODULE_API_1 )
|
||||
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleAPI == CLP_MODULE_API_1 )
|
||||
{
|
||||
pcCurrAppModuleIf->m_pcModule->create( pcCurrAppModuleIf->m_pcSubWindow[0]->getCurrFrame() );
|
||||
moduleCreated = true;
|
||||
@@ -461,8 +442,7 @@ Void ModulesHandle::activateModule()
|
||||
|
||||
if( !moduleCreated )
|
||||
{
|
||||
qobject_cast<PlaYUVerApp*>( m_pcParent )
|
||||
->printMessage( "Error! Module cannot be created", LOG_ERROR );
|
||||
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Error! Module cannot be created", CLP_LOG_ERROR );
|
||||
destroyModuleIf( pcCurrAppModuleIf );
|
||||
return;
|
||||
}
|
||||
@@ -475,6 +455,7 @@ Void ModulesHandle::activateModule()
|
||||
pcModuleSubWindow->setWindowName( windowName );
|
||||
m_pcMainWindowManager->addSubWindow( pcModuleSubWindow );
|
||||
pcModuleSubWindow->show();
|
||||
m_appModuleVideo->addSubWindow( pcModuleSubWindow );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -484,12 +465,12 @@ Void ModulesHandle::activateModule()
|
||||
videoSubWindowList.at( 0 )->setWindowName( windowName );
|
||||
}
|
||||
|
||||
m_pcPlaYUVerAppModuleIfList.append( pcCurrAppModuleIf );
|
||||
m_pcCalypAppModuleIfList.append( pcCurrAppModuleIf );
|
||||
|
||||
emit changed();
|
||||
}
|
||||
|
||||
Void ModulesHandle::destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
void ModulesHandle::destroyModuleIf( CalypAppModuleIf* pcCurrModuleIf )
|
||||
{
|
||||
if( pcCurrModuleIf )
|
||||
{
|
||||
@@ -497,10 +478,9 @@ Void ModulesHandle::destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::destroyWindowModules()
|
||||
void ModulesHandle::destroyWindowModules()
|
||||
{
|
||||
VideoSubWindow* pcVideoSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcVideoSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcVideoSubWindow )
|
||||
{
|
||||
pcVideoSubWindow->disableModule();
|
||||
@@ -508,67 +488,73 @@ Void ModulesHandle::destroyWindowModules()
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::destroyAllModulesIf()
|
||||
void ModulesHandle::destroyAllModulesIf()
|
||||
{
|
||||
for( Int i = 0; i < m_pcPlaYUVerAppModuleIfList.size(); i++ )
|
||||
for( int i = 0; i < m_pcCalypAppModuleIfList.size(); i++ )
|
||||
{
|
||||
destroyModuleIf( m_pcPlaYUVerAppModuleIfList.at( i ) );
|
||||
destroyModuleIf( m_pcCalypAppModuleIfList.at( i ) );
|
||||
}
|
||||
emit changed();
|
||||
}
|
||||
|
||||
Void ModulesHandle::applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
|
||||
Bool isPlaying,
|
||||
Bool disableThreads )
|
||||
void ModulesHandle::applyModuleIf( QList<CalypAppModuleIf*> pcCurrModuleIfList, bool isPlaying, bool disableThreads )
|
||||
{
|
||||
for( Int i = 0; i < pcCurrModuleIfList.size() && !isPlaying; i++ )
|
||||
for( int i = 0; i < pcCurrModuleIfList.size() && !isPlaying; i++ )
|
||||
{
|
||||
pcCurrModuleIfList.at( i )->apply( isPlaying, disableThreads );
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
void ModulesHandle::applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf )
|
||||
{
|
||||
if( pcCurrModuleIf )
|
||||
{
|
||||
if( !pcCurrModuleIf->m_pcModuleStream )
|
||||
{
|
||||
UInt Width = 0, Height = 0, FrameRate = 30;
|
||||
Int BitsPixel, InputFormat = -1;
|
||||
unsigned int Width = 0, Height = 0, FrameRate = 30;
|
||||
int BitsPixel, InputFormat = -1;
|
||||
|
||||
QString supported = tr( "Supported Files (" );
|
||||
QStringList formatsList;
|
||||
std::vector<CalypStreamFormat> supportedFmts = CalypStream::supportedWriteFormats();
|
||||
|
||||
std::vector<PlaYUVerSupportedFormat> supportedFmts = PlaYUVerStream::supportedWriteFormats();
|
||||
for( UInt i = 0; i < supportedFmts.size(); i++ )
|
||||
for( unsigned int 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;
|
||||
std::vector<ClpString> arrayExt = supportedFmts[i].getExts();
|
||||
if( arrayExt.size() > 0 )
|
||||
{
|
||||
QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) );
|
||||
currFmt.append( " (" );
|
||||
for( std::vector<ClpString>::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;
|
||||
}
|
||||
}
|
||||
supported.append( " )" );
|
||||
|
||||
QStringList filter;
|
||||
filter << supported << formatsList << tr( "All Files (*)" );
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(),
|
||||
filter.join( ";;" ) );
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(), filter.join( ";;" ) );
|
||||
if( fileName.isEmpty() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
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 = new CalypStream;
|
||||
if( !pcCurrModuleIf->m_pcModuleStream->open( fileName.toStdString(), Width, Height, InputFormat, BitsPixel,
|
||||
CLP_LITTLE_ENDIAN, FrameRate, false ) )
|
||||
{
|
||||
delete pcCurrModuleIf->m_pcModuleStream;
|
||||
pcCurrModuleIf->m_pcModuleStream = NULL;
|
||||
@@ -578,10 +564,10 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
}
|
||||
if( pcCurrModuleIf->m_pcModuleStream )
|
||||
{
|
||||
UInt numberOfWindows = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
UInt64 currFrames = 0;
|
||||
UInt64 numberOfFrames = INT_MAX;
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
unsigned int numberOfWindows = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames;
|
||||
ClpULong currFrames = 0;
|
||||
ClpULong numberOfFrames = -1;
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
currFrames = pcCurrModuleIf->m_pcSubWindow[i]->getInputStream()->getFrameNum();
|
||||
if( currFrames < numberOfFrames )
|
||||
@@ -589,18 +575,18 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->stop();
|
||||
}
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
for( UInt f = 1; f < numberOfFrames; f++ )
|
||||
for( unsigned int f = 1; f < numberOfFrames; f++ )
|
||||
{
|
||||
pcCurrModuleIf->apply( false, true );
|
||||
QCoreApplication::processEvents();
|
||||
pcCurrModuleIf->m_pcModuleStream->writeFrame( pcCurrModuleIf->m_pcProcessedFrame );
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->play();
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->playEvent();
|
||||
}
|
||||
}
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->stop();
|
||||
}
|
||||
@@ -608,24 +594,25 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::swapModulesWindowsIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
void ModulesHandle::swapModulesWindowsIf( CalypAppModuleIf* pcCurrModuleIf )
|
||||
{
|
||||
if( pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames == MODULE_REQUIRES_TWO_FRAMES )
|
||||
if( pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames == 2 )
|
||||
{
|
||||
VideoSubWindow* auxWindowHandle = pcCurrModuleIf->m_pcSubWindow[0];
|
||||
pcCurrModuleIf->m_pcSubWindow[0] = pcCurrModuleIf->m_pcSubWindow[1];
|
||||
pcCurrModuleIf->m_pcSubWindow[1] = auxWindowHandle;
|
||||
pcCurrModuleIf->m_pcDisplaySubWindow->updateVideoWindowInfo();
|
||||
pcCurrModuleIf->apply();
|
||||
}
|
||||
}
|
||||
|
||||
Void ModulesHandle::customEvent( QEvent* event )
|
||||
void ModulesHandle::customEvent( QEvent* event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
return;
|
||||
}
|
||||
PlaYUVerAppModuleIf::EventData* eventData = (PlaYUVerAppModuleIf::EventData*)event;
|
||||
CalypAppModuleIf::EventData* eventData = (CalypAppModuleIf::EventData*)event;
|
||||
if( eventData->m_bSuccess )
|
||||
{
|
||||
eventData->m_pcModule->show();
|
||||
|
||||
+27
-33
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,56 +18,50 @@
|
||||
*/
|
||||
/**
|
||||
* \file ModulesHandle.h
|
||||
* \brief PlaYUVer modules handle
|
||||
* \brief Calyp modules handle
|
||||
*/
|
||||
|
||||
#ifndef __MODULESHANDLE_H__
|
||||
#define __MODULESHANDLE_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
#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"
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
class VideoHandle;
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class PlaYUVerAppModuleIf;
|
||||
class SubWindowHandle;
|
||||
class CalypAppModuleIf;
|
||||
class SubWindowHandle;
|
||||
|
||||
class ModulesHandle : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ModulesHandle( QWidget*, PlaYUVerSubWindowHandle*, VideoHandle* );
|
||||
ModulesHandle( QWidget*, SubWindowHandle*, VideoHandle* );
|
||||
~ModulesHandle();
|
||||
|
||||
Void createActions();
|
||||
void createActions();
|
||||
QMenu* createMenu();
|
||||
// QDockWidget* createDock();
|
||||
Void buildMenu();
|
||||
Void updateMenus();
|
||||
void buildMenu();
|
||||
void updateMenus();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
static Void destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
static Void applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
|
||||
Bool isPlaying = false,
|
||||
Bool disableThreads = false );
|
||||
static void destroyModuleIf( CalypAppModuleIf* pcCurrModuleIf );
|
||||
static void applyModuleIf( QList<CalypAppModuleIf*> pcCurrModuleIfList, bool isPlaying = false,
|
||||
bool disableThreads = false );
|
||||
|
||||
private:
|
||||
QWidget* m_pcParent;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
VideoHandle* m_appModuleVideo;
|
||||
|
||||
enum
|
||||
@@ -79,7 +73,7 @@ private:
|
||||
|
||||
QMenu* m_pcModulesMenu;
|
||||
QList<QMenu*> m_pcModulesSubMenuList;
|
||||
QList<PlaYUVerAppModuleIf*> m_pcPlaYUVerAppModuleIfList;
|
||||
QList<CalypAppModuleIf*> m_pcCalypAppModuleIfList;
|
||||
|
||||
QVector<QAction*> m_arrayModulesActions;
|
||||
|
||||
@@ -97,11 +91,11 @@ private:
|
||||
QVector<QAction*> m_arrayActions;
|
||||
QSignalMapper* m_pcActionMapper;
|
||||
|
||||
Void enableModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
Void applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
Void swapModulesWindowsIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
void enableModuleIf( CalypAppModuleIf* pcCurrModuleIf );
|
||||
void applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf );
|
||||
void swapModulesWindowsIf( CalypAppModuleIf* pcCurrModuleIf );
|
||||
|
||||
Void customEvent( QEvent* event );
|
||||
void customEvent( QEvent* event );
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
|
||||
+57
-41
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,9 +23,15 @@
|
||||
*/
|
||||
|
||||
#include "PlotSubWindow.h"
|
||||
#include "qcustomplot.h"
|
||||
|
||||
Void PlotSubWindow::definePlotColors()
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QSize>
|
||||
|
||||
#include "qcustomplot.h"
|
||||
//#include "external/qcustomplot/qcustomplot.h"
|
||||
|
||||
void PlotSubWindow::definePlotColors()
|
||||
{
|
||||
m_arrayColorList.append( Qt::blue );
|
||||
m_arrayColorList.append( Qt::red );
|
||||
@@ -94,18 +100,15 @@ 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
|
||||
@@ -115,6 +118,11 @@ 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()
|
||||
@@ -122,22 +130,22 @@ PlotSubWindow::~PlotSubWindow()
|
||||
delete m_cPlotArea;
|
||||
}
|
||||
|
||||
Void PlotSubWindow::normalSize()
|
||||
void PlotSubWindow::normalSize()
|
||||
{
|
||||
m_cPlotArea->xAxis->setRange( m_aAxisRange[HORIZONTAL][0], m_aAxisRange[HORIZONTAL][1] );
|
||||
m_cPlotArea->yAxis->setRange( m_aAxisRange[VERTICAL][0], m_aAxisRange[VERTICAL][1] );
|
||||
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->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;
|
||||
@@ -145,9 +153,9 @@ Void PlotSubWindow::scaleView( Double scale, QPoint center )
|
||||
|
||||
m_dScaleFactor *= scale;
|
||||
//
|
||||
// UInt aNewAxisRange[2][2];
|
||||
// for( UInt axis = 0; axis < 2; axis++ )
|
||||
// for( UInt dim = 0; dim < 2; dim++ )
|
||||
// unsigned int aNewAxisRange[2][2];
|
||||
// for( unsigned int axis = 0; axis < 2; axis++ )
|
||||
// for( unsigned int dim = 0; dim < 2; dim++ )
|
||||
// aNewAxisRange[axis][dim] = m_aAxisRange[axis][dim] / m_dScaleFactor;
|
||||
//
|
||||
// m_cPlotArea->xAxis->setRange( aNewAxisRange[HORIZONTAL][0],
|
||||
@@ -170,7 +178,7 @@ QSize PlotSubWindow::sizeHint() const
|
||||
}
|
||||
else
|
||||
{
|
||||
maxSize = QApplication::desktop()->availableGeometry().size();
|
||||
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
}
|
||||
return sizeHint( maxSize );
|
||||
}
|
||||
@@ -180,42 +188,52 @@ QSize PlotSubWindow::sizeHint( const QSize& maxSize ) const
|
||||
return maxSize * 2 / 3;
|
||||
}
|
||||
|
||||
Void PlotSubWindow::setAxisName( const QString& nameAxisX, const QString& nameAxisY )
|
||||
void PlotSubWindow::setAxisName( const QString& nameAxisX, const QString& nameAxisY )
|
||||
{
|
||||
m_cPlotArea->xAxis->setLabel( nameAxisX );
|
||||
m_cPlotArea->yAxis->setLabel( nameAxisY );
|
||||
}
|
||||
|
||||
Void PlotSubWindow::setAxisRange( const QLine& axisLimits )
|
||||
void PlotSubWindow::setAxisRange( const QLine& axisLimits )
|
||||
{
|
||||
setAxisRange( HORIZONTAL, axisLimits.x1(), axisLimits.x2() );
|
||||
setAxisRange( VERTICAL, axisLimits.y1(), axisLimits.y2() );
|
||||
setAxisRange( AXIS_HORIZONTAL, axisLimits.x1(), axisLimits.x2() );
|
||||
setAxisRange( AXIS_VERTICAL, axisLimits.y1(), axisLimits.y2() );
|
||||
}
|
||||
|
||||
Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis,
|
||||
const Int& axisStart,
|
||||
const Int& axisEnd )
|
||||
void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd )
|
||||
{
|
||||
if( eAxis == HORIZONTAL )
|
||||
if( eAxis == AXIS_HORIZONTAL )
|
||||
{
|
||||
m_cPlotArea->xAxis->setRange( axisStart, axisEnd );
|
||||
// horizontalScrollBar()->setRange( axisStart * 100, axisEnd * 100 );
|
||||
m_aAxisRange[HORIZONTAL][0] = axisStart;
|
||||
m_aAxisRange[HORIZONTAL][1] = axisEnd;
|
||||
m_aAxisRange[AXIS_HORIZONTAL][0] = axisStart;
|
||||
m_aAxisRange[AXIS_HORIZONTAL][1] = axisEnd;
|
||||
}
|
||||
if( eAxis == VERTICAL )
|
||||
if( eAxis == AXIS_VERTICAL )
|
||||
{
|
||||
m_cPlotArea->yAxis->setRange( axisStart, axisEnd );
|
||||
// verticalScrollBar()->setRange( axisStart * 100, axisEnd * 100 );
|
||||
m_aAxisRange[VERTICAL][0] = axisStart;
|
||||
m_aAxisRange[VERTICAL][1] = axisEnd;
|
||||
m_aAxisRange[AXIS_VERTICAL][0] = axisStart;
|
||||
m_aAxisRange[AXIS_VERTICAL][1] = axisEnd;
|
||||
}
|
||||
m_cPlotArea->replot();
|
||||
}
|
||||
|
||||
Void PlotSubWindow::addPlot( const QVector<Double>& arrayX,
|
||||
const QVector<Double>& arrayY,
|
||||
const QString& key )
|
||||
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 )
|
||||
{
|
||||
QCPGraph* newPlot = m_cPlotArea->addGraph();
|
||||
QColor plotColor = m_arrayColorList.at( 0 );
|
||||
@@ -237,10 +255,8 @@ Void PlotSubWindow::addPlot( const QVector<Double>& arrayX,
|
||||
newPlot->setName( key );
|
||||
}
|
||||
|
||||
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;
|
||||
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_iNumberPlots++;
|
||||
}
|
||||
+24
-28
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,14 +25,11 @@
|
||||
#ifndef __PLOTWINDOWHANDLE_H__
|
||||
#define __PLOTWINDOWHANDLE_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "config.h"
|
||||
|
||||
class QCustomPlot;
|
||||
|
||||
@@ -48,45 +45,44 @@ private:
|
||||
|
||||
enum Axis
|
||||
{
|
||||
HORIZONTAL,
|
||||
VERTICAL,
|
||||
AXIS_HORIZONTAL,
|
||||
AXIS_VERTICAL,
|
||||
};
|
||||
Double m_aAxisRange[2][2];
|
||||
Double m_dScaleFactor;
|
||||
Int m_iNumberPlots;
|
||||
double m_aAxisRange[2][2];
|
||||
double m_dScaleFactor;
|
||||
int m_iNumberPlots;
|
||||
|
||||
public:
|
||||
PlotSubWindow( const QString& windowTitle, QWidget* parent = NULL );
|
||||
~PlotSubWindow();
|
||||
|
||||
Void definePlotColors();
|
||||
void definePlotColors();
|
||||
|
||||
Void refreshSubWindow() {}
|
||||
void refreshSubWindow() {}
|
||||
/**
|
||||
* Virtual functions from SubWindowAbstract
|
||||
*/
|
||||
Void normalSize();
|
||||
Void zoomToFit();
|
||||
Void zoomToFactor( Double factor, QPoint center = QPoint() );
|
||||
Void scaleView( Double scale, QPoint center = QPoint() );
|
||||
void normalSize();
|
||||
void zoomToFit();
|
||||
void zoomToFactor( double factor, QPoint center = QPoint() );
|
||||
void scaleView( double scale, QPoint center = QPoint() );
|
||||
|
||||
Double getScaleFactor() { return m_dScaleFactor; }
|
||||
double getScaleFactor() { return m_dScaleFactor; }
|
||||
/**
|
||||
* Size related functions
|
||||
*/
|
||||
QSize sizeHint() const;
|
||||
QSize sizeHint( const QSize& ) const;
|
||||
|
||||
Void setAxisName( const QString& nameAxisX, const QString& nameAxisY );
|
||||
void setAxisName( const QString& nameAxisX, const QString& nameAxisY );
|
||||
|
||||
Void setAxisRange( const QLine& axisLimits );
|
||||
Void setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd );
|
||||
void setAxisRange( const QLine& axisLimits );
|
||||
void setAxisRange( PlotSubWindow::Axis eAxis, const int& axisStart, const int& axisEnd );
|
||||
void appendAxisLimit( 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__
|
||||
+67
-73
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,25 +23,25 @@
|
||||
*/
|
||||
|
||||
#include "QualityHandle.h"
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include "PlotSubWindow.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "lib/LibMemory.h"
|
||||
#include <QtGui>
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include "QtConcurrent/qtconcurrentrun.h"
|
||||
#endif
|
||||
|
||||
QualityHandle::QualityHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
|
||||
QualityHandle::QualityHandle( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
}
|
||||
|
||||
QualityHandle::~QualityHandle() {}
|
||||
|
||||
Void QualityHandle::createActions()
|
||||
void QualityHandle::createActions()
|
||||
{
|
||||
m_actionGroupQualityMetric = new QActionGroup( this );
|
||||
m_actionGroupQualityMetric->setExclusive( true );
|
||||
@@ -49,9 +49,9 @@ Void QualityHandle::createActions()
|
||||
m_mapperQualityMetric = new QSignalMapper( this );
|
||||
|
||||
QAction* currAction;
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
currAction = new QAction( PlaYUVerFrame::supportedQualityMetricsList()[i].c_str(), this );
|
||||
currAction = new QAction( CalypFrame::supportedQualityMetricsList()[i].c_str(), this );
|
||||
currAction->setCheckable( true );
|
||||
m_actionGroupQualityMetric->addAction( currAction );
|
||||
connect( currAction, SIGNAL( triggered() ), m_mapperQualityMetric, SLOT( map() ) );
|
||||
@@ -61,15 +61,12 @@ 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()
|
||||
@@ -93,21 +90,19 @@ QDockWidget* QualityHandle::createDock()
|
||||
|
||||
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 =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
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 )
|
||||
{
|
||||
@@ -117,7 +112,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 )
|
||||
@@ -138,36 +133,35 @@ 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 )
|
||||
{
|
||||
QVector<Double>* padQualityValues;
|
||||
UInt numberOfWindows = apcWindowList.size();
|
||||
UInt64 currFrames = 0;
|
||||
UInt64 numberOfFrames = INT_MAX;
|
||||
unsigned numberOfWindows = apcWindowList.size();
|
||||
ClpULong currFrames = 0;
|
||||
ClpULong numberOfFrames = -1;
|
||||
|
||||
//! Check reference window
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
for( unsigned i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
if( !apcWindowList.at( i )->getRefSubWindow() )
|
||||
{
|
||||
@@ -177,7 +171,7 @@ Void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
VideoSubWindow* pcReferenceWindow = apcWindowList.at( 0 )->getRefSubWindow();
|
||||
|
||||
numberOfFrames = pcReferenceWindow->getInputStream()->getFrameNum();
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
for( unsigned i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
currFrames = apcWindowList.at( i )->getInputStream()->getFrameNum();
|
||||
if( currFrames < numberOfFrames )
|
||||
@@ -188,52 +182,55 @@ Void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
|
||||
|
||||
ProgressBar* pcProgressBar = new ProgressBar( m_pcParet, numberOfFrames );
|
||||
|
||||
padQualityValues = new QVector<Double>[numberOfWindows + 1];
|
||||
QVector<double>* padQualityValues = new QVector<double>[numberOfWindows + 1];
|
||||
double* padAverageQuality = new double[numberOfWindows + 1];
|
||||
double dCurrentQuality;
|
||||
|
||||
PlaYUVerFrame* pcReferenceFrame;
|
||||
PlaYUVerFrame* pcCurrFrame;
|
||||
for( UInt f = 0; f < numberOfFrames; f++ )
|
||||
for( unsigned i = 0; i < numberOfWindows + 1; i++ )
|
||||
{
|
||||
padAverageQuality[i] = 0;
|
||||
}
|
||||
|
||||
CalypFrame* pcReferenceFrame;
|
||||
CalypFrame* pcCurrFrame;
|
||||
for( unsigned int f = 0; f < numberOfFrames; f++ )
|
||||
{
|
||||
padQualityValues[0].append( f );
|
||||
pcReferenceFrame = pcReferenceWindow->getCurrFrame();
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
pcCurrFrame = apcWindowList.at( i )->getCurrFrame();
|
||||
padQualityValues[i + 1].append(
|
||||
pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, LUMA ) );
|
||||
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 )->seekRelativeEvent( true );
|
||||
}
|
||||
pcReferenceWindow->seekRelativeEvent( true );
|
||||
pcProgressBar->incrementProgress( 1 );
|
||||
}
|
||||
for( UInt i = 0; i < numberOfWindows; i++ )
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
apcWindowList.at( i )->stop();
|
||||
}
|
||||
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::fromStdString( PlaYUVerFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) );
|
||||
pcPlotWindow->setAxisName( "Frame Number", QString( "%1 [%2]" ).arg( qualityName ).arg( qualityUnits ) );
|
||||
|
||||
if( apcWindowList.size() > 1 )
|
||||
QString key;
|
||||
for( unsigned int i = 0; i < numberOfWindows; i++ )
|
||||
{
|
||||
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] );
|
||||
key = apcWindowList.at( i )->getWindowName();
|
||||
key = QString( "[%1 %2] " ).arg( padAverageQuality[i + 1] ).arg( qualityUnits ) + key;
|
||||
pcPlotWindow->addPlot( padQualityValues[0], padQualityValues[i + 1], key );
|
||||
}
|
||||
|
||||
m_pcMainWindowManager->addSubWindow( pcPlotWindow );
|
||||
@@ -242,7 +239,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 );
|
||||
@@ -250,16 +247,15 @@ Void QualityHandle::slotQualityMetricChanged( Int idx )
|
||||
m_iQualityMetricIdx = idx;
|
||||
}
|
||||
|
||||
Void QualityHandle::slotSelectCurrentAsReference()
|
||||
void QualityHandle::slotSelectCurrentAsReference()
|
||||
{
|
||||
VideoSubWindow* pcRefSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
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 )
|
||||
@@ -271,10 +267,9 @@ Void QualityHandle::slotSelectCurrentAsReference()
|
||||
}
|
||||
}
|
||||
|
||||
Void QualityHandle::slotPlotQualitySingle()
|
||||
void QualityHandle::slotPlotQualitySingle()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
if( pcSubWindow->getRefSubWindow() )
|
||||
@@ -296,10 +291,9 @@ Void QualityHandle::slotPlotQualitySingle()
|
||||
}
|
||||
}
|
||||
|
||||
Void QualityHandle::slotPlotQualitySeveral()
|
||||
void QualityHandle::slotPlotQualitySeveral()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
VideoSubWindow* pcSubWindow = qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
if( pcSubWindow )
|
||||
{
|
||||
QVector<VideoSubWindow*> apcWindowList;
|
||||
@@ -313,7 +307,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 )
|
||||
|
||||
+17
-20
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,40 +25,37 @@
|
||||
#ifndef __QUALITYMEASUREMENT_H__
|
||||
#define __QUALITYMEASUREMENT_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 "CommonDefs.h"
|
||||
#include "QFuture"
|
||||
#include "QualityMeasurementSidebar.h"
|
||||
#include "config.h"
|
||||
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class SubWindowHandle;
|
||||
class VideoSubWindow;
|
||||
|
||||
class QualityHandle : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QualityHandle( QWidget*, PlaYUVerSubWindowHandle* );
|
||||
QualityHandle( QWidget*, SubWindowHandle* );
|
||||
~QualityHandle();
|
||||
|
||||
Void createActions();
|
||||
void createActions();
|
||||
QMenu* createMenu();
|
||||
QDockWidget* createDock();
|
||||
Void updateMenus();
|
||||
void updateMenus();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
Void update( VideoSubWindow* currSubWindow );
|
||||
void update( VideoSubWindow* currSubWindow );
|
||||
|
||||
private:
|
||||
QWidget* m_pcParet;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -70,7 +67,7 @@ private:
|
||||
QVector<QAction*> m_arrayActions;
|
||||
QActionGroup* m_actionGroupQualityMetric;
|
||||
QSignalMapper* m_mapperQualityMetric;
|
||||
Int m_iQualityMetricIdx;
|
||||
int m_iQualityMetricIdx;
|
||||
|
||||
QMenu* m_pcMenuQuality;
|
||||
QMenu* m_pcSubMenuQualityMetrics;
|
||||
@@ -78,8 +75,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();
|
||||
|
||||
+14
-12
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,14 +23,16 @@
|
||||
*/
|
||||
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "PlaYUVerMdiSubWindow.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QFocusEvent>
|
||||
#include <QHBoxLayout>
|
||||
#include <QIcon>
|
||||
#include <QScrollBar>
|
||||
|
||||
SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category )
|
||||
#include "MdiSubWindow.h"
|
||||
|
||||
SubWindowAbstract::SubWindowAbstract( QWidget* parent, unsigned int category )
|
||||
: QWidget( parent ), m_cSubWindow( NULL )
|
||||
{
|
||||
setParent( parent );
|
||||
@@ -40,7 +42,7 @@ SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category )
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
setBackgroundRole( QPalette::Background );
|
||||
|
||||
setWindowIcon( QIcon( ":/images/playuver.png" ) );
|
||||
setWindowIcon( QIcon( ":/logos/calyp-icon.png" ) );
|
||||
|
||||
// setWidgetResizable( true );
|
||||
m_pcLayout = NULL;
|
||||
@@ -55,7 +57,7 @@ SubWindowAbstract::~SubWindowAbstract()
|
||||
return;
|
||||
}
|
||||
|
||||
Void SubWindowAbstract::setWidget( QWidget* widget )
|
||||
void SubWindowAbstract::setWidget( QWidget* widget )
|
||||
{
|
||||
QGridLayout* layout = new QGridLayout( this );
|
||||
layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
@@ -67,7 +69,7 @@ void SubWindowAbstract::onDestroyed()
|
||||
return;
|
||||
}
|
||||
|
||||
Void SubWindowAbstract::setWindowName( QString name )
|
||||
void SubWindowAbstract::setWindowName( QString name )
|
||||
{
|
||||
m_cWindowName = name;
|
||||
setWindowTitle( m_cWindowName );
|
||||
@@ -78,7 +80,7 @@ QString SubWindowAbstract::getWindowName()
|
||||
return m_cWindowName;
|
||||
}
|
||||
|
||||
Bool SubWindowAbstract::mayClose()
|
||||
bool SubWindowAbstract::mayClose()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -93,18 +95,18 @@ QSize SubWindowAbstract::sizeHint( const QSize& ) const
|
||||
return QSize();
|
||||
}
|
||||
|
||||
Void SubWindowAbstract::focusInEvent( QFocusEvent* event )
|
||||
void SubWindowAbstract::focusInEvent( QFocusEvent* event )
|
||||
{
|
||||
emit aboutToActivate( this );
|
||||
}
|
||||
|
||||
Void SubWindowAbstract::closeEvent( QCloseEvent* event )
|
||||
void SubWindowAbstract::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
emit aboutToClose( this );
|
||||
event->accept();
|
||||
}
|
||||
|
||||
Void SubWindowAbstract::closeSubWindow()
|
||||
void SubWindowAbstract::closeSubWindow()
|
||||
{
|
||||
close();
|
||||
if( m_cSubWindow )
|
||||
|
||||
+30
-29
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -19,14 +19,14 @@
|
||||
|
||||
/**
|
||||
* \file SubWindowAbstract.h
|
||||
* \ingroup PlaYUVerApp PlaYUVerApp_Subwindow
|
||||
* \ingroup CalypApp CalypApp_Subwindow
|
||||
* \brief Abstract class to handle subwindows
|
||||
*
|
||||
* @defgroup PlaYUVerApp_Subwindow SubWindow definition
|
||||
* @defgroup CalypApp_Subwindow SubWindow definition
|
||||
* @{
|
||||
* \ingroup PlaYUVerApp
|
||||
* \ingroup CalypApp
|
||||
*
|
||||
* Different SubWindow may be found in the PlaYUVerApp
|
||||
* Different SubWindow may be found in the CalypApp
|
||||
* Each one provide different functionality and serve
|
||||
* different purposes, ( e.g., displaying a video stream
|
||||
* or displaying a quality plot)
|
||||
@@ -37,18 +37,19 @@
|
||||
#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 PlaYUVerMdiSubWindow;
|
||||
class MdiSubWindow;
|
||||
|
||||
class SubWindowAbstract : public QWidget
|
||||
{
|
||||
@@ -56,10 +57,10 @@ class SubWindowAbstract : public QWidget
|
||||
|
||||
private:
|
||||
QHBoxLayout* m_pcLayout;
|
||||
UInt m_uiCategory;
|
||||
unsigned int m_uiCategory;
|
||||
QString m_cWindowName;
|
||||
|
||||
PlaYUVerMdiSubWindow* m_cSubWindow;
|
||||
MdiSubWindow* m_cSubWindow;
|
||||
|
||||
public:
|
||||
enum SubWindowCategory
|
||||
@@ -72,35 +73,35 @@ public:
|
||||
};
|
||||
Q_DECLARE_FLAGS( SubWindowCategories, SubWindowCategory )
|
||||
|
||||
SubWindowAbstract( QWidget*, UInt );
|
||||
SubWindowAbstract( QWidget*, unsigned int );
|
||||
~SubWindowAbstract();
|
||||
|
||||
/**
|
||||
* Show the image at its original size
|
||||
*/
|
||||
virtual Void refreshSubWindow() = 0;
|
||||
virtual void refreshSubWindow() = 0;
|
||||
|
||||
/**
|
||||
* Show the image at its original size
|
||||
*/
|
||||
virtual Void normalSize() = 0;
|
||||
virtual void normalSize() = 0;
|
||||
/**
|
||||
* Scale the image (zoomed in or out) to fit on the window.
|
||||
*/
|
||||
virtual Void zoomToFit() = 0;
|
||||
virtual void zoomToFit() = 0;
|
||||
/**
|
||||
* Scale the image (zoomed in or out) to speficied absolute zoom value (1.0 =
|
||||
* original size).
|
||||
*/
|
||||
virtual Void zoomToFactor( Double factor, QPoint center = QPoint() ) = 0;
|
||||
virtual void zoomToFactor( double factor, QPoint center = QPoint() ) = 0;
|
||||
/**
|
||||
* Scale the image by a given factor
|
||||
* @param factor factor of scale. Ex: 1.2 scale the image up by 20% and
|
||||
* 0.8 scale the image down by 25%
|
||||
*/
|
||||
virtual Void scaleView( Double, QPoint center = QPoint() ) = 0;
|
||||
virtual void scaleView( double, QPoint center = QPoint() ) = 0;
|
||||
|
||||
virtual Double getScaleFactor() = 0;
|
||||
virtual double getScaleFactor() = 0;
|
||||
|
||||
/**
|
||||
* Size related functions
|
||||
@@ -112,10 +113,10 @@ public:
|
||||
* Window name
|
||||
*/
|
||||
|
||||
Void setWindowName( QString );
|
||||
void setWindowName( QString );
|
||||
QString getWindowName();
|
||||
|
||||
virtual Bool mayClose();
|
||||
virtual bool mayClose();
|
||||
|
||||
/**
|
||||
* Get category of the SubWindow
|
||||
@@ -123,33 +124,33 @@ public:
|
||||
* @note This function should be used with enum SubWindowCategories
|
||||
* with an & operation and it may belong to several categories
|
||||
*/
|
||||
UInt getCategory() { return m_uiCategory; }
|
||||
unsigned int getCategory() { return m_uiCategory; }
|
||||
/**
|
||||
* Check category of the SubWindow
|
||||
* @param checkCateory SubWindow category to check against;
|
||||
* it should be enum SubWindowCategories type
|
||||
* @return true when SubWindow belong to checkCateory
|
||||
*/
|
||||
Bool checkCategory( UInt checkCateory ) { return m_uiCategory & checkCateory; }
|
||||
Void setSubWindow( PlaYUVerMdiSubWindow* subWindow ) { m_cSubWindow = subWindow; }
|
||||
Void closeSubWindow();
|
||||
bool checkCategory( unsigned int checkCateory ) { return m_uiCategory & checkCateory; }
|
||||
void setSubWindow( MdiSubWindow* subWindow ) { m_cSubWindow = subWindow; }
|
||||
void closeSubWindow();
|
||||
|
||||
protected:
|
||||
void focusInEvent( QFocusEvent* event );
|
||||
void closeEvent( QCloseEvent* event );
|
||||
virtual 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_SWindow( const double, const QPoint );
|
||||
void zoomFactorChanged( const double, const QPoint );
|
||||
/**
|
||||
* Notify that scrollbar position was changed by internal event (e.g. by mouse
|
||||
* panning )
|
||||
*/
|
||||
void scrollBarMoved_SWindow( const QPoint );
|
||||
void scrollBarMoved( const double&, const double& );
|
||||
/**
|
||||
* Update stauts bars
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,38 +19,40 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerSubWindowHandle.cpp
|
||||
* \file SubWindowHandle.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 "PlaYUVerSubWindowHandle.h"
|
||||
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerMdiSubWindow.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MdiSubWindow.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
|
||||
class PlaYUVerMdiArea : public QMdiArea
|
||||
class MdiArea : public QMdiArea
|
||||
{
|
||||
public:
|
||||
PlaYUVerMdiArea( QWidget* parent = 0 )
|
||||
: QMdiArea( parent ), m_pixmapLogo( ":/images/playuver-backgroud-logo.png" )
|
||||
MdiArea( QWidget* parent = 0 )
|
||||
: QMdiArea( parent ), m_pixmapLogo( ":/logos/calyp-logo.png" )
|
||||
{
|
||||
setBackgroundRole( QPalette::Background );
|
||||
}
|
||||
|
||||
Void appendLogMessage( const QString& msg )
|
||||
void appendLogMessage( const QString& msg )
|
||||
{
|
||||
m_acLogMessages.push_front( msg );
|
||||
if( m_acLogMessages.size() > 5 )
|
||||
@@ -62,13 +65,13 @@ protected:
|
||||
{
|
||||
QMdiArea::paintEvent( event );
|
||||
QPainter painter( viewport() );
|
||||
QPixmap pixFinalLogo = m_pixmapLogo.scaled( 2 * size() / 3, Qt::KeepAspectRatio );
|
||||
QPixmap pixFinalLogo = m_pixmapLogo.scaled( 2 * size() / 5, Qt::KeepAspectRatio );
|
||||
// Calculate the logo position - the bottom right corner of the mdi area.
|
||||
int x = width() / 2 - pixFinalLogo.width() / 2;
|
||||
int y = height() / 2 - pixFinalLogo.height() / 2;
|
||||
painter.drawPixmap( x, y, pixFinalLogo );
|
||||
|
||||
// for( Int i = 0; i < m_acLogMessages.size(); i++ )
|
||||
// for( int i = 0; i < m_acLogMessages.size(); i++ )
|
||||
// {
|
||||
// painter.drawText( 5, height() - 5 - i * 15, m_acLogMessages.at( i )
|
||||
// );
|
||||
@@ -81,7 +84,8 @@ private:
|
||||
QPixmap m_pixmapLogo;
|
||||
};
|
||||
|
||||
PlaYUVerSubWindowHandle::PlaYUVerSubWindowHandle( QWidget* parent ) : QWidget( parent )
|
||||
SubWindowHandle::SubWindowHandle( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
m_iWindowMode = -1;
|
||||
m_pcWindowManagerLayout = NULL;
|
||||
@@ -90,12 +94,12 @@ PlaYUVerSubWindowHandle::PlaYUVerSubWindowHandle( QWidget* parent ) : QWidget( p
|
||||
m_apcSubWindowList.clear();
|
||||
m_apcMdiSubWindowList.clear();
|
||||
|
||||
m_pcApp = qobject_cast<PlaYUVerApp*>( parentWidget() );
|
||||
m_pcApp = qobject_cast<MainWindow*>( parentWidget() );
|
||||
// setWindowMode( DETACHEDSUBWINDOWMODE );
|
||||
setWindowMode( MDISUBWINDOWMODE );
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::processLogMsg( const QString& msg )
|
||||
void SubWindowHandle::processLogMsg( const QString& msg )
|
||||
{
|
||||
if( m_pcMdiArea )
|
||||
{
|
||||
@@ -103,7 +107,7 @@ Void PlaYUVerSubWindowHandle::processLogMsg( const QString& msg )
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::resetWindowMode()
|
||||
void SubWindowHandle::resetWindowMode()
|
||||
{
|
||||
QList<SubWindowAbstract*> apcSubWindowList = m_apcSubWindowList;
|
||||
|
||||
@@ -114,14 +118,14 @@ Void PlaYUVerSubWindowHandle::resetWindowMode()
|
||||
{
|
||||
m_cMdiModeWindowPosition = m_pcApp->pos();
|
||||
m_cMdiModeWindowSize = m_pcApp->size();
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
m_apcSubWindowList.at( i )->setParent( NULL );
|
||||
}
|
||||
for( Int i = 0; i < m_apcMdiSubWindowList.size(); i++ )
|
||||
for( int i = 0; i < m_apcMdiSubWindowList.size(); i++ )
|
||||
{
|
||||
disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ),
|
||||
this, SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
disconnect( m_apcMdiSubWindowList.at( i ), SIGNAL( aboutToClose( MdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( MdiSubWindow* ) ) );
|
||||
m_apcMdiSubWindowList.at( i )->close();
|
||||
}
|
||||
m_apcMdiSubWindowList.clear();
|
||||
@@ -133,7 +137,7 @@ Void PlaYUVerSubWindowHandle::resetWindowMode()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
void SubWindowHandle::setWindowMode( int iWindowMode )
|
||||
{
|
||||
if( m_iWindowMode == iWindowMode )
|
||||
return;
|
||||
@@ -142,7 +146,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
|
||||
if( iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
m_apcSubWindowList.at( i )->setParent( NULL );
|
||||
m_apcSubWindowList.at( i )->resize( m_apcSubWindowList.at( i )->sizeHint() );
|
||||
@@ -152,7 +156,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
parentWidget()->update();
|
||||
m_pcApp->showNormal();
|
||||
qApp->processEvents();
|
||||
QSize screenSize = QApplication::desktop()->availableGeometry().size();
|
||||
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
m_pcApp->move( 0, 0 );
|
||||
m_pcApp->resize( screenSize.width(), 5 );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() );
|
||||
@@ -161,14 +165,13 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
if( iWindowMode == MDISUBWINDOWMODE )
|
||||
{
|
||||
setVisible( true );
|
||||
m_pcMdiArea = new PlaYUVerMdiArea;
|
||||
m_pcMdiArea = new MdiArea;
|
||||
m_pcMdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
|
||||
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this,
|
||||
SLOT( updateActiveSubWindow() ) );
|
||||
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( updateActiveSubWindow() ) );
|
||||
m_pcWindowManagerLayout = new QHBoxLayout( this );
|
||||
m_pcWindowManagerLayout->addWidget( m_pcMdiArea );
|
||||
setLayout( m_pcWindowManagerLayout );
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
addMdiSubWindow( m_apcSubWindowList.at( i ) );
|
||||
m_apcSubWindowList.at( i )->resize( m_apcSubWindowList.at( i )->sizeHint() );
|
||||
@@ -177,8 +180,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
// m_pcApp->resize( m_cMdiModeWindowSize );
|
||||
if( m_pcActiveWindow )
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() +
|
||||
" :: " + m_pcActiveWindow->getWindowName() );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
}
|
||||
m_iWindowMode = iWindowMode;
|
||||
@@ -187,7 +189,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
|
||||
// qApp->processEvents();
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
void SubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
@@ -205,8 +207,7 @@ Void PlaYUVerSubWindowHandle::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 );
|
||||
@@ -215,31 +216,30 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
|
||||
}
|
||||
if( m_pcActiveWindow )
|
||||
{
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() +
|
||||
" :: " + m_pcActiveWindow->getWindowName() );
|
||||
m_pcApp->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
|
||||
void SubWindowHandle::addMdiSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
PlaYUVerMdiSubWindow* mdiSubWindow = new PlaYUVerMdiSubWindow;
|
||||
MdiSubWindow* mdiSubWindow = new MdiSubWindow;
|
||||
mdiSubWindow->setWidget( window );
|
||||
m_pcMdiArea->addSubWindow( mdiSubWindow );
|
||||
m_apcMdiSubWindowList.append( mdiSubWindow );
|
||||
window->setSubWindow( mdiSubWindow );
|
||||
connect( mdiSubWindow, SIGNAL( aboutToClose( PlaYUVerMdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( PlaYUVerMdiSubWindow* ) ) );
|
||||
connect( mdiSubWindow, SIGNAL( aboutToClose( MdiSubWindow* ) ), this,
|
||||
SLOT( removeMdiSubWindow( MdiSubWindow* ) ) );
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::WindowFlags flags )
|
||||
void SubWindowHandle::addSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
if( window )
|
||||
{
|
||||
connect( window, SIGNAL( updateStatusBar( const QString& ) ), m_pcApp,
|
||||
SLOT( printMessage( const QString& ) ) );
|
||||
connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_pcApp,
|
||||
SLOT( updateZoomFactorSBox() ) );
|
||||
SLOT( printMessage( const QString& ) ) );
|
||||
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp,
|
||||
SLOT( updateZoomFactorSBox() ) );
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
connect( window, SIGNAL( aboutToActivate( SubWindowAbstract* ) ), this,
|
||||
@@ -255,7 +255,7 @@ Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::Windo
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx )
|
||||
void SubWindowHandle::removeSubWindow( int windowIdx )
|
||||
{
|
||||
if( windowIdx >= 0 )
|
||||
{
|
||||
@@ -267,7 +267,7 @@ Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx )
|
||||
}
|
||||
if( m_iWindowMode == MDISUBWINDOWMODE )
|
||||
{
|
||||
PlaYUVerMdiSubWindow* mdiSubWindow = m_apcMdiSubWindowList.at( windowIdx );
|
||||
MdiSubWindow* mdiSubWindow = m_apcMdiSubWindowList.at( windowIdx );
|
||||
m_apcMdiSubWindowList.removeAt( windowIdx );
|
||||
m_pcMdiArea->removeSubWindow( m_apcSubWindowList.at( windowIdx ) );
|
||||
m_apcSubWindowList.at( windowIdx )->close();
|
||||
@@ -284,17 +284,17 @@ Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx )
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::removeSubWindow( SubWindowAbstract* window )
|
||||
void SubWindowHandle::removeSubWindow( SubWindowAbstract* window )
|
||||
{
|
||||
removeSubWindow( m_apcSubWindowList.indexOf( window ) );
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::removeMdiSubWindow( PlaYUVerMdiSubWindow* window )
|
||||
void SubWindowHandle::removeMdiSubWindow( MdiSubWindow* window )
|
||||
{
|
||||
removeSubWindow( m_apcMdiSubWindowList.indexOf( window ) );
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::removeAllSubWindow()
|
||||
void SubWindowHandle::removeAllSubWindow()
|
||||
{
|
||||
while( m_apcSubWindowList.size() > 0 )
|
||||
{
|
||||
@@ -302,17 +302,17 @@ Void PlaYUVerSubWindowHandle::removeAllSubWindow()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::removeActiveSubWindow()
|
||||
void SubWindowHandle::removeActiveSubWindow()
|
||||
{
|
||||
removeSubWindow( m_pcActiveWindow );
|
||||
}
|
||||
|
||||
SubWindowAbstract* PlaYUVerSubWindowHandle::activeSubWindow() const
|
||||
SubWindowAbstract* SubWindowHandle::activeSubWindow() const
|
||||
{
|
||||
return m_pcActiveWindow;
|
||||
}
|
||||
|
||||
QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const
|
||||
QList<SubWindowAbstract*> SubWindowHandle::findSubWindow( const unsigned int uiCategory ) const
|
||||
{
|
||||
QList<SubWindowAbstract*> apcSubWindowList;
|
||||
if( uiCategory == 0 )
|
||||
@@ -321,7 +321,7 @@ QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const UInt uiC
|
||||
}
|
||||
else
|
||||
{
|
||||
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
|
||||
{
|
||||
if( m_apcSubWindowList.at( i )->getCategory() & uiCategory )
|
||||
apcSubWindowList.append( m_apcSubWindowList.at( i ) );
|
||||
@@ -330,14 +330,14 @@ QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const UInt uiC
|
||||
return apcSubWindowList;
|
||||
}
|
||||
|
||||
QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const QString& windowName,
|
||||
const UInt uiCategory ) const
|
||||
QList<SubWindowAbstract*> SubWindowHandle::findSubWindow( const QString& windowName,
|
||||
const unsigned int 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 ) );
|
||||
@@ -346,11 +346,10 @@ QList<SubWindowAbstract*> PlaYUVerSubWindowHandle::findSubWindow( const QString&
|
||||
return apcSubWindowList;
|
||||
}
|
||||
|
||||
SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow(
|
||||
const SubWindowAbstract* subWindow ) const
|
||||
SubWindowAbstract* SubWindowHandle::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 );
|
||||
@@ -358,7 +357,7 @@ SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow(
|
||||
return 0;
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::setActiveSubWindow( QWidget* window )
|
||||
void SubWindowHandle::setActiveSubWindow( QWidget* window )
|
||||
{
|
||||
if( !window )
|
||||
return;
|
||||
@@ -375,16 +374,16 @@ Void PlaYUVerSubWindowHandle::setActiveSubWindow( QWidget* window )
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::tileSubWindows()
|
||||
void SubWindowHandle::tileSubWindows()
|
||||
{
|
||||
UInt numberOfWindows = m_apcSubWindowList.size();
|
||||
unsigned int numberOfWindows = m_apcSubWindowList.size();
|
||||
if( numberOfWindows == 0 )
|
||||
return;
|
||||
|
||||
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
|
||||
{
|
||||
QSize screenSize = QApplication::desktop()->availableGeometry().size();
|
||||
UInt minWindowsInRow = 1;
|
||||
QSize screenSize = QGuiApplication::screens()[0]->availableGeometry().size();
|
||||
unsigned int minWindowsInRow = 1;
|
||||
while( ( screenSize.width() / minWindowsInRow ) > 500 )
|
||||
{
|
||||
minWindowsInRow++;
|
||||
@@ -401,12 +400,12 @@ Void PlaYUVerSubWindowHandle::tileSubWindows()
|
||||
{
|
||||
numberOfWindows++;
|
||||
}
|
||||
UInt numberTillingRows = 1;
|
||||
UInt numberTillingColumns;
|
||||
unsigned int numberTillingRows = 1;
|
||||
unsigned int numberTillingColumns;
|
||||
if( numberOfWindows > minWindowsInRow )
|
||||
{
|
||||
numberTillingColumns = minWindowsInRow;
|
||||
for( Int i = numberOfWindows; i > 0; )
|
||||
for( int i = numberOfWindows; i > 0; )
|
||||
{
|
||||
numberTillingRows = ( numberOfWindows + numberTillingColumns - 1 ) / numberTillingColumns;
|
||||
if( numberTillingColumns > numberTillingRows )
|
||||
@@ -426,10 +425,9 @@ Void PlaYUVerSubWindowHandle::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() );
|
||||
@@ -443,7 +441,7 @@ Void PlaYUVerSubWindowHandle::tileSubWindows()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::cascadeSubWindows()
|
||||
void SubWindowHandle::cascadeSubWindows()
|
||||
{
|
||||
if( m_iWindowMode == MDISUBWINDOWMODE )
|
||||
{
|
||||
@@ -451,11 +449,10 @@ Void PlaYUVerSubWindowHandle::cascadeSubWindows()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::createActions()
|
||||
void SubWindowHandle::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 );
|
||||
|
||||
@@ -469,16 +466,13 @@ Void PlaYUVerSubWindowHandle::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 );
|
||||
@@ -486,19 +480,16 @@ Void PlaYUVerSubWindowHandle::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() ), 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( 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" ) );
|
||||
@@ -506,29 +497,24 @@ Void PlaYUVerSubWindowHandle::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( 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( 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() ) );
|
||||
|
||||
@@ -536,7 +522,7 @@ Void PlaYUVerSubWindowHandle::createActions()
|
||||
m_arrayActions[SEPARATOR_ACT]->setSeparator( true );
|
||||
}
|
||||
|
||||
QMenu* PlaYUVerSubWindowHandle::createMenu()
|
||||
QMenu* SubWindowHandle::createMenu()
|
||||
{
|
||||
m_pcMenuWindow = new QMenu( "&Window", this );
|
||||
updateMenu();
|
||||
@@ -544,7 +530,7 @@ QMenu* PlaYUVerSubWindowHandle::createMenu()
|
||||
return m_pcMenuWindow;
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::updateMenu()
|
||||
void SubWindowHandle::updateMenu()
|
||||
{
|
||||
m_pcMenuWindow->clear();
|
||||
m_pcMenuWindow->addAction( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] );
|
||||
@@ -560,7 +546,7 @@ Void PlaYUVerSubWindowHandle::updateMenu()
|
||||
// m_pcMenuWindow->addAction( m_arrayActions[PREVIOUS_WINDOWS_ACT] );
|
||||
// m_pcMenuWindow->addSeparator();
|
||||
|
||||
Int number_windows = m_apcSubWindowList.size();
|
||||
int number_windows = m_apcSubWindowList.size();
|
||||
if( number_windows > 1 )
|
||||
{
|
||||
m_arrayActions[NEXT_WINDOWS_ACT]->setEnabled( true );
|
||||
@@ -574,7 +560,7 @@ Void PlaYUVerSubWindowHandle::updateMenu()
|
||||
|
||||
m_arrayActions[SEPARATOR_ACT]->setVisible( number_windows > 0 );
|
||||
|
||||
for( Int i = 0; i < number_windows; ++i )
|
||||
for( int i = 0; i < number_windows; ++i )
|
||||
{
|
||||
SubWindowAbstract* subWindow = m_apcSubWindowList.at( i );
|
||||
|
||||
@@ -595,19 +581,17 @@ Void PlaYUVerSubWindowHandle::updateMenu()
|
||||
}
|
||||
}
|
||||
|
||||
Void PlaYUVerSubWindowHandle::readSettings()
|
||||
void SubWindowHandle::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
m_cMdiModeWindowPosition =
|
||||
appSettings.value( "SubWindowManager/LastMdiPosition", QPoint( 200, 200 ) ).toPoint();
|
||||
m_cMdiModeWindowSize =
|
||||
appSettings.value( "SubWindowManager/LastMdiSize", QSize( 500, 400 ) ).toSize();
|
||||
Int iWindowMode = appSettings.value( "SubWindowManager/SubWindowMode", MDISUBWINDOWMODE ).toInt();
|
||||
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 PlaYUVerSubWindowHandle::writeSettings()
|
||||
void SubWindowHandle::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
appSettings.setValue( "SubWindowManager/LastMdiPosition", m_cMdiModeWindowPosition );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -18,18 +18,18 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file PlaYUVerSubWindowHandle.h
|
||||
* \file SubWindowHandle.h
|
||||
* \brief Handle multiple sub-windows
|
||||
*/
|
||||
|
||||
#ifndef __PLAYUVERSUBWINDOWHANDLE_H__
|
||||
#define __PLAYUVERSUBWINDOWHANDLE_H__
|
||||
#ifndef __SUBWINDOWHANDLE_H__
|
||||
#define __SUBWINDOWHANDLE_H__
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "CommonDefs.h"
|
||||
|
||||
class QAction;
|
||||
class QActionGroup;
|
||||
@@ -37,33 +37,33 @@ class QHBoxLayout;
|
||||
class QMenu;
|
||||
class QSignalMapper;
|
||||
|
||||
class PlaYUVerApp;
|
||||
class MainWindow;
|
||||
class SubWindowAbstract;
|
||||
class PlaYUVerMdiArea;
|
||||
class PlaYUVerMdiSubWindow;
|
||||
class MdiArea;
|
||||
class MdiSubWindow;
|
||||
|
||||
class PlaYUVerSubWindowHandle : public QWidget
|
||||
class SubWindowHandle : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PlaYUVerSubWindowHandle( QWidget* parent );
|
||||
SubWindowHandle( QWidget* parent );
|
||||
|
||||
Void processLogMsg( const QString& msg );
|
||||
void processLogMsg( const QString& msg );
|
||||
|
||||
Void addSubWindow( SubWindowAbstract* widget, Qt::WindowFlags flags = 0 );
|
||||
void addSubWindow( SubWindowAbstract* widget );
|
||||
|
||||
SubWindowAbstract* activeSubWindow() const;
|
||||
|
||||
QList<SubWindowAbstract*> findSubWindow( const UInt uiCategory = 0 ) const;
|
||||
QList<SubWindowAbstract*> findSubWindow( const QString& aName, const UInt uiCategory = 0 ) const;
|
||||
QList<SubWindowAbstract*> findSubWindow( const unsigned int uiCategory = 0 ) const;
|
||||
QList<SubWindowAbstract*> findSubWindow( const QString& aName, const unsigned int uiCategory = 0 ) const;
|
||||
SubWindowAbstract* findSubWindow( const SubWindowAbstract* subWindow ) const;
|
||||
|
||||
Void createActions();
|
||||
void createActions();
|
||||
QMenu* createMenu();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
enum WindowMode
|
||||
{
|
||||
@@ -72,13 +72,13 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
PlaYUVerApp* m_pcApp;
|
||||
Int m_iWindowMode;
|
||||
MainWindow* m_pcApp;
|
||||
int m_iWindowMode;
|
||||
QList<SubWindowAbstract*> m_apcSubWindowList;
|
||||
|
||||
QHBoxLayout* m_pcWindowManagerLayout;
|
||||
PlaYUVerMdiArea* m_pcMdiArea;
|
||||
QList<PlaYUVerMdiSubWindow*> m_apcMdiSubWindowList;
|
||||
MdiArea* m_pcMdiArea;
|
||||
QList<MdiSubWindow*> m_apcMdiSubWindowList;
|
||||
|
||||
SubWindowAbstract* m_pcActiveWindow;
|
||||
|
||||
@@ -105,18 +105,18 @@ private:
|
||||
QMenu* m_pcMenuWindow;
|
||||
|
||||
/**
|
||||
* Internal functions
|
||||
* internal functions
|
||||
*/
|
||||
Void addMdiSubWindow( SubWindowAbstract* window );
|
||||
Void resetWindowMode();
|
||||
Void removeSubWindow( Int windowIdx );
|
||||
void addMdiSubWindow( SubWindowAbstract* window );
|
||||
void resetWindowMode();
|
||||
void removeSubWindow( int windowIdx );
|
||||
|
||||
public Q_SLOTS:
|
||||
void setWindowMode( int iWindowMode );
|
||||
void updateActiveSubWindow( SubWindowAbstract* window = 0 );
|
||||
void setActiveSubWindow( QWidget* window );
|
||||
void removeSubWindow( SubWindowAbstract* window );
|
||||
void removeMdiSubWindow( PlaYUVerMdiSubWindow* window );
|
||||
void removeMdiSubWindow( MdiSubWindow* window );
|
||||
void removeActiveSubWindow();
|
||||
void removeAllSubWindow();
|
||||
void tileSubWindows();
|
||||
@@ -128,4 +128,4 @@ Q_SIGNALS:
|
||||
void windowActivated();
|
||||
};
|
||||
|
||||
#endif // __PLAYUVERSUBWINDOWHANDLE_H__
|
||||
#endif // __SUBWINDOWHANDLE_H__
|
||||
+238
-178
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,13 +23,7 @@
|
||||
*/
|
||||
|
||||
#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>
|
||||
@@ -37,39 +31,45 @@
|
||||
#include <QSlider>
|
||||
#include <QToolBar>
|
||||
#include <QtGui>
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
#include <QElapsedTimer>
|
||||
#endif
|
||||
|
||||
VideoHandle::VideoHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
|
||||
#include "FrameNumberWidget.h"
|
||||
#include "FramePropertiesDock.h"
|
||||
#include "MainWindow.h"
|
||||
#include "SeekStreamDialog.h"
|
||||
#include "SubWindowHandle.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
VideoHandle::VideoHandle( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
|
||||
{
|
||||
m_pcCurrentVideoSubWindow = NULL;
|
||||
m_bIsPlaying = false;
|
||||
m_pcPlayingTimer = new QTimer;
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
m_pcPlayingTimer->setTimerType( Qt::CoarseTimer );
|
||||
#endif
|
||||
m_pcFrameRateFeedbackTimer = new QElapsedTimer;
|
||||
m_pcPlayingTimer->setTimerType( Qt::PreciseTimer );
|
||||
connect( m_pcPlayingTimer, SIGNAL( timeout() ), this, SLOT( playEvent() ) );
|
||||
m_acPlayingSubWindows.clear();
|
||||
}
|
||||
|
||||
VideoHandle::~VideoHandle() {}
|
||||
VideoHandle::~VideoHandle()
|
||||
{
|
||||
delete m_pcPlayingTimer;
|
||||
delete m_pcFrameRateFeedbackTimer;
|
||||
}
|
||||
|
||||
Void VideoHandle::createActions()
|
||||
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_pcParet->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_pcParet->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 );
|
||||
@@ -80,8 +80,7 @@ Void VideoHandle::createActions()
|
||||
m_arrayActions[VIDEO_BACKWARD_ACT]->setIcon(
|
||||
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 );
|
||||
@@ -89,8 +88,7 @@ Void VideoHandle::createActions()
|
||||
m_arrayActions[VIDEO_FORWARD_ACT]->setIcon(
|
||||
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 );
|
||||
@@ -114,21 +112,19 @@ 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 ) ) );
|
||||
|
||||
// ------------ Tools ------------
|
||||
actionGroupTools = new QActionGroup( this );
|
||||
actionGroupTools->setExclusive( true );
|
||||
// ------------ Image ------------
|
||||
m_actionGroupTools = new QActionGroup( this );
|
||||
m_actionGroupTools->setExclusive( true );
|
||||
|
||||
m_mapperTools = new QSignalMapper( this );
|
||||
connect( m_mapperTools, SIGNAL( mapped( int ) ), this, SLOT( setTool( int ) ) );
|
||||
@@ -139,35 +135,45 @@ 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 );
|
||||
actionGroupTools->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
|
||||
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
m_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 );
|
||||
actionGroupTools->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
|
||||
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools,
|
||||
SLOT( map() ) );
|
||||
m_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 );
|
||||
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_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 ) ) );
|
||||
|
||||
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()
|
||||
@@ -193,6 +199,8 @@ QMenu* VideoHandle::createImageMenu()
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -212,7 +220,7 @@ QToolBar* VideoHandle::createToolBar()
|
||||
m_toolbarVideo->addWidget( m_pcFrameSlider );
|
||||
m_toolbarVideo->addAction( m_arrayActions[VIDEO_FORWARD_ACT] );
|
||||
m_toolbarVideo->addWidget( new QLabel );
|
||||
m_pcFrameNumInfo = new WidgetFrameNumber;
|
||||
m_pcFrameNumInfo = new FrameNumberWidget;
|
||||
m_toolbarVideo->addWidget( m_pcFrameNumInfo );
|
||||
|
||||
return m_toolbarVideo;
|
||||
@@ -234,6 +242,12 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
QWidget* pcStatusBarWidget = new QWidget;
|
||||
QHBoxLayout* mainlayout = new QHBoxLayout;
|
||||
|
||||
m_pcPlayingFPSLabel = new QLabel;
|
||||
m_pcPlayingFPSLabel->setText( " " );
|
||||
m_pcPlayingFPSLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
|
||||
m_pcPlayingFPSLabel->setMinimumWidth( 150 );
|
||||
m_pcPlayingFPSLabel->setAlignment( Qt::AlignCenter );
|
||||
|
||||
m_pcVideoFormatLabel = new QLabel;
|
||||
m_pcVideoFormatLabel->setText( " " );
|
||||
m_pcVideoFormatLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
|
||||
@@ -246,6 +260,7 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
m_pcResolutionLabel->setMinimumWidth( 90 );
|
||||
m_pcResolutionLabel->setAlignment( Qt::AlignCenter );
|
||||
|
||||
mainlayout->addWidget( m_pcPlayingFPSLabel );
|
||||
mainlayout->addWidget( m_pcVideoFormatLabel );
|
||||
mainlayout->addWidget( m_pcResolutionLabel );
|
||||
pcStatusBarWidget->setLayout( mainlayout );
|
||||
@@ -253,26 +268,22 @@ QWidget* VideoHandle::createStatusBarMessage()
|
||||
return pcStatusBarWidget;
|
||||
}
|
||||
|
||||
Void VideoHandle::updateMenus()
|
||||
void VideoHandle::updateMenus()
|
||||
{
|
||||
VideoSubWindow* pcSubWindow =
|
||||
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
|
||||
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();
|
||||
}
|
||||
@@ -287,49 +298,47 @@ 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 )
|
||||
{
|
||||
PlaYUVerStream* pcStream = m_pcCurrentVideoSubWindow->getInputStream();
|
||||
PlaYUVerFrame* pcFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
|
||||
Int frame_num = 0;
|
||||
UInt64 total_frame_num = 1;
|
||||
CalypStream* pcStream = m_pcCurrentVideoSubWindow->getInputStream();
|
||||
CalypFrame* pcFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
|
||||
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();
|
||||
@@ -344,7 +353,7 @@ Void VideoHandle::update()
|
||||
}
|
||||
if( pcStream && pcFrame->getBitsPel() > 8 )
|
||||
{
|
||||
if( pcStream->getEndianess() == PLAYUVER_BIG_ENDIAN )
|
||||
if( pcStream->getEndianess() == CLP_BIG_ENDIAN )
|
||||
{
|
||||
resolution.append( QStringLiteral( " (BE)" ) );
|
||||
}
|
||||
@@ -355,19 +364,25 @@ Void VideoHandle::update()
|
||||
}
|
||||
m_pcResolutionLabel->setText( resolution );
|
||||
|
||||
m_pcFramePropertiesSideBar->setFrame( pcFrame );
|
||||
m_pcFramePropertiesSideBar->setFrame( pcFrame, m_pcCurrentVideoSubWindow->isPlaying() );
|
||||
|
||||
m_pcFrameNumInfo->setTotalFrameNum( total_frame_num );
|
||||
m_pcFrameSlider->setMaximum( total_frame_num - 1 );
|
||||
|
||||
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 ) );
|
||||
}
|
||||
|
||||
if( m_pcCurrentVideoSubWindow->isPlaying() )
|
||||
{
|
||||
m_arrayActions[PLAY_ACT]->setText( "Pause" );
|
||||
m_arrayActions[PLAY_ACT]->setIcon(
|
||||
m_pcParet->style()->standardIcon( QStyle::SP_MediaPause ) );
|
||||
m_arrayActions[PLAY_ACT]->setIcon( m_pcParet->style()->standardIcon( QStyle::SP_MediaPause ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -377,6 +392,7 @@ Void VideoHandle::update()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcPlayingFPSLabel->setText( "" );
|
||||
m_pcVideoFormatLabel->setText( "" );
|
||||
m_pcResolutionLabel->setText( "" );
|
||||
m_pcFramePropertiesSideBar->reset();
|
||||
@@ -385,13 +401,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 )
|
||||
{
|
||||
@@ -399,21 +415,31 @@ Void VideoHandle::updateSelectionArea( QRect area )
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::openSubWindow( VideoSubWindow* subWindow )
|
||||
void VideoHandle::addSubWindow( VideoSubWindow* window )
|
||||
{
|
||||
connect( subWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this,
|
||||
SLOT( updateSelectionArea( QRect ) ) );
|
||||
subWindow->getViewArea()->setTool( m_uiViewTool );
|
||||
subWindow->getViewArea()->setGridVisible( m_arrayActions[SHOW_GRID_ACT]->isChecked() );
|
||||
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 ) ) );
|
||||
}
|
||||
|
||||
Void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow )
|
||||
void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow )
|
||||
{
|
||||
VideoSubWindow* videoSubWindow = qobject_cast<VideoSubWindow*>( subWindow );
|
||||
|
||||
if( m_acPlayingSubWindows.contains( videoSubWindow ) )
|
||||
{
|
||||
Int pos = m_acPlayingSubWindows.indexOf( videoSubWindow );
|
||||
int pos = m_acPlayingSubWindows.indexOf( videoSubWindow );
|
||||
m_acPlayingSubWindows.at( pos )->stop();
|
||||
m_acPlayingSubWindows.remove( pos );
|
||||
if( m_acPlayingSubWindows.size() < 2 )
|
||||
@@ -423,9 +449,9 @@ Void VideoHandle::closeSubWindow( SubWindowAbstract* subWindow )
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center )
|
||||
void VideoHandle::zoomToFactorAll( const double scale, const QPoint center )
|
||||
{
|
||||
Double factor;
|
||||
double factor;
|
||||
|
||||
if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() )
|
||||
{
|
||||
@@ -434,7 +460,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 )
|
||||
@@ -447,7 +473,8 @@ Void VideoHandle::zoomToFactorAll( const Double scale, const QPoint center )
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::moveAllScrollBars( const QPoint offset )
|
||||
#if 0
|
||||
void VideoHandle::moveAllScrollBars( const QPoint& offset )
|
||||
{
|
||||
QPoint newOffset = offset;
|
||||
if( m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->isChecked() && m_pcCurrentVideoSubWindow )
|
||||
@@ -472,7 +499,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 )
|
||||
@@ -484,16 +511,37 @@ Void VideoHandle::moveAllScrollBars( const QPoint offset )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UInt64 VideoHandle::getMaxFrameNumber()
|
||||
#else
|
||||
void VideoHandle::moveAllScrollBars( const double& horRatio, const double& verRatio )
|
||||
{
|
||||
UInt currFrames;
|
||||
UInt64 maxFrames = INT_MAX;
|
||||
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()
|
||||
{
|
||||
unsigned long currFrames;
|
||||
unsigned long maxFrames = INT_MAX;
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum();
|
||||
if( currFrames < maxFrames )
|
||||
@@ -508,10 +556,10 @@ UInt64 VideoHandle::getMaxFrameNumber()
|
||||
return maxFrames;
|
||||
}
|
||||
|
||||
Void VideoHandle::setTimerStatus()
|
||||
void VideoHandle::setTimerStatus()
|
||||
{
|
||||
Bool status = false;
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
bool status = false;
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
status |= m_acPlayingSubWindows.at( i )->isPlaying();
|
||||
}
|
||||
@@ -525,32 +573,26 @@ Void VideoHandle::setTimerStatus()
|
||||
{
|
||||
m_pcPlayingTimer->start();
|
||||
m_bIsPlaying = true;
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
m_uiNumberPlayedFrames = 0;
|
||||
m_pcPlayControlTimer = new QElapsedTimer;
|
||||
m_pcPlayControlTimer->start();
|
||||
m_dAverageFps = 0;
|
||||
#endif
|
||||
m_pcFrameRateFeedbackTimer->start();
|
||||
m_uiRealAverageFrameRate = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
if( m_pcPlayControlTimer && m_pcPlayingTimer->interval() > 0 )
|
||||
{
|
||||
qDebug() << "Desired Fps: " << 1000 / m_pcPlayingTimer->interval()
|
||||
<< "Real Fps: " << 1000 / m_dAverageFps;
|
||||
|
||||
delete m_pcPlayControlTimer;
|
||||
m_pcPlayControlTimer = NULL;
|
||||
}
|
||||
#endif
|
||||
m_pcPlayingTimer->stop();
|
||||
m_bIsPlaying = false;
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::play()
|
||||
void VideoHandle::configureFrameRateTimer()
|
||||
{
|
||||
double frame_rate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate();
|
||||
unsigned int time_ms = (unsigned int)( 1000.0 / frame_rate + 0.5 );
|
||||
m_pcPlayingTimer->setInterval( time_ms );
|
||||
}
|
||||
|
||||
void VideoHandle::play()
|
||||
{
|
||||
if( !m_pcCurrentVideoSubWindow )
|
||||
return;
|
||||
@@ -560,11 +602,9 @@ Void VideoHandle::play()
|
||||
|
||||
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();
|
||||
}
|
||||
@@ -573,20 +613,18 @@ Void VideoHandle::play()
|
||||
}
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->play();
|
||||
}
|
||||
frameRate = m_acPlayingSubWindows.at( 0 )->getInputStream()->getFrameRate();
|
||||
timeInterval = ( UInt )( 1000.0 / frameRate + 0.5 );
|
||||
m_pcPlayingTimer->setInterval( timeInterval );
|
||||
configureFrameRateTimer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->pause();
|
||||
}
|
||||
@@ -601,13 +639,13 @@ Void VideoHandle::play()
|
||||
// update();
|
||||
}
|
||||
|
||||
Void VideoHandle::stop()
|
||||
void VideoHandle::stop()
|
||||
{
|
||||
if( m_acPlayingSubWindows.size() > 0 )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->stop();
|
||||
playingSubWindow->stop();
|
||||
}
|
||||
m_acPlayingSubWindows.clear();
|
||||
setTimerStatus();
|
||||
@@ -623,29 +661,48 @@ Void VideoHandle::stop()
|
||||
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( false );
|
||||
}
|
||||
|
||||
Void VideoHandle::playEvent()
|
||||
void VideoHandle::calculateRealFrameRate()
|
||||
{
|
||||
Bool bEndOfSequence = false;
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
m_dAverageFps =
|
||||
Double( m_dAverageFps * m_uiNumberPlayedFrames + m_pcPlayControlTimer->elapsed() ) /
|
||||
Double( m_uiNumberPlayedFrames + 1 );
|
||||
double average_time_between_frames_ms = m_uiNumberPlayedFrames > 0 ? 1000.0 / m_uiRealAverageFrameRate : 0;
|
||||
double time_elapsed_since_last_frame_ms = m_pcFrameRateFeedbackTimer->elapsed();
|
||||
average_time_between_frames_ms = double( average_time_between_frames_ms * m_uiNumberPlayedFrames + time_elapsed_since_last_frame_ms ) / double( m_uiNumberPlayedFrames + 1 );
|
||||
m_uiRealAverageFrameRate = 1000.0 / average_time_between_frames_ms;
|
||||
m_uiNumberPlayedFrames++;
|
||||
m_pcPlayControlTimer->restart();
|
||||
#endif
|
||||
m_pcFrameRateFeedbackTimer->restart();
|
||||
}
|
||||
|
||||
void VideoHandle::playEvent()
|
||||
{
|
||||
// This value should only be true if it is really needed to refresh the UI after this play event
|
||||
// Lets assum the current window is not playing. Nothing changes in the UI expect the playing windows
|
||||
// So no changed is emmited
|
||||
bool bShouldRefreshUI = false;
|
||||
calculateRealFrameRate();
|
||||
try
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
bool bEndOfSequence = false;
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
bEndOfSequence |= m_acPlayingSubWindows.at( i )->playEvent();
|
||||
bEndOfSequence |= playingSubWindow->playEvent();
|
||||
// If the current selected windows is playing then we need to refresh the UI
|
||||
if( playingSubWindow == m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
bShouldRefreshUI = true;
|
||||
}
|
||||
}
|
||||
if( bEndOfSequence )
|
||||
{
|
||||
if( !m_arrayActions[VIDEO_REPEAT_ACT]->isChecked() )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
else
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( 0 );
|
||||
{
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
playingSubWindow->seekAbsoluteEvent( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( const char* msg )
|
||||
@@ -658,22 +715,22 @@ Void VideoHandle::playEvent()
|
||||
stop();
|
||||
m_pcCurrentVideoSubWindow->close();
|
||||
}
|
||||
emit changed();
|
||||
if( bShouldRefreshUI )
|
||||
emit changed();
|
||||
}
|
||||
|
||||
Void VideoHandle::seekEvent( Int direction )
|
||||
void VideoHandle::seekEvent( int direction )
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
if( !( ( UInt )( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >=
|
||||
getMaxFrameNumber() &&
|
||||
if( !( (unsigned int)( m_pcCurrentVideoSubWindow->getInputStream()->getCurrFrameNum() + 1 ) >= getMaxFrameNumber() &&
|
||||
direction > 0 ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->seekRelativeEvent( direction > 0 ? true : false );
|
||||
playingSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -682,11 +739,10 @@ Void VideoHandle::seekEvent( Int direction )
|
||||
m_pcCurrentVideoSubWindow->seekRelativeEvent( direction > 0 ? true : false );
|
||||
}
|
||||
emit changed();
|
||||
// update();
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::seekVideo()
|
||||
void VideoHandle::seekVideo()
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
@@ -694,19 +750,19 @@ Void VideoHandle::seekVideo()
|
||||
{
|
||||
SeekStreamDialog* dialogSeekVideo =
|
||||
new SeekStreamDialog( m_pcCurrentVideoSubWindow->getInputStream(), m_pcParet );
|
||||
Int newFrameNum = dialogSeekVideo->runDialog();
|
||||
int newFrameNum = dialogSeekVideo->runDialog();
|
||||
if( newFrameNum >= 0 )
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (UInt)newFrameNum );
|
||||
playingSubWindow->seekAbsoluteEvent( (unsigned int)newFrameNum );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (UInt)newFrameNum );
|
||||
m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (unsigned int)newFrameNum );
|
||||
}
|
||||
emit changed();
|
||||
}
|
||||
@@ -714,27 +770,26 @@ Void VideoHandle::seekVideo()
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::seekSliderEvent( Int new_frame_num )
|
||||
void VideoHandle::seekSliderEvent( int new_frame_num )
|
||||
{
|
||||
if( m_pcCurrentVideoSubWindow && !m_bIsPlaying ) // TODO: Fix this slot
|
||||
{
|
||||
if( m_acPlayingSubWindows.contains( m_pcCurrentVideoSubWindow ) )
|
||||
{
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
m_acPlayingSubWindows.at( i )->seekAbsoluteEvent( (UInt)new_frame_num );
|
||||
playingSubWindow->seekAbsoluteEvent( (unsigned int)new_frame_num );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (UInt)new_frame_num );
|
||||
m_pcCurrentVideoSubWindow->seekAbsoluteEvent( (unsigned int)new_frame_num );
|
||||
}
|
||||
emit changed();
|
||||
// update();
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::videoSelectionButtonEvent()
|
||||
void VideoHandle::videoSelectionButtonEvent()
|
||||
{
|
||||
VideoSubWindow* videoSubWindow;
|
||||
|
||||
@@ -743,29 +798,29 @@ Void VideoHandle::videoSelectionButtonEvent()
|
||||
{
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
for( auto subWindow : subWindowList )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindow );
|
||||
m_acPlayingSubWindows.append( videoSubWindow );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParet, m_pcMainWindowManager,
|
||||
SubWindowSelectorDialog dialogWindowsSelection( m_pcParet, m_pcMainWindowManager,
|
||||
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
|
||||
QStringList cWindowListNames;
|
||||
for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ )
|
||||
for( auto playingSubWindow : m_acPlayingSubWindows )
|
||||
{
|
||||
dialogWindowsSelection.selectSubWindow( m_acPlayingSubWindows.at( i ) );
|
||||
dialogWindowsSelection.selectSubWindow( playingSubWindow );
|
||||
}
|
||||
if( dialogWindowsSelection.exec() == QDialog::Accepted )
|
||||
{
|
||||
m_acPlayingSubWindows.clear();
|
||||
|
||||
QList<SubWindowAbstract*> selectedSubWindowList = dialogWindowsSelection.getSelectedWindows();
|
||||
for( Int i = 0; i < selectedSubWindowList.size(); i++ )
|
||||
for( auto window : selectedSubWindowList )
|
||||
{
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( selectedSubWindowList.at( i ) );
|
||||
videoSubWindow = qobject_cast<VideoSubWindow*>( window );
|
||||
m_acPlayingSubWindows.append( videoSubWindow );
|
||||
}
|
||||
}
|
||||
@@ -777,14 +832,14 @@ Void VideoHandle::videoSelectionButtonEvent()
|
||||
|
||||
if( m_acPlayingSubWindows.size() > 0 )
|
||||
{
|
||||
m_acPlayingSubWindows.at( 0 )->activateWindow();
|
||||
m_acPlayingSubWindows.front()->activateWindow();
|
||||
if( m_acPlayingSubWindows.size() > 1 )
|
||||
{
|
||||
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( true );
|
||||
}
|
||||
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();
|
||||
}
|
||||
@@ -796,26 +851,31 @@ Void VideoHandle::videoSelectionButtonEvent()
|
||||
}
|
||||
}
|
||||
|
||||
Void VideoHandle::setTool( Int tool )
|
||||
void VideoHandle::setTool( int tool )
|
||||
{
|
||||
m_uiViewTool = tool;
|
||||
actionGroupTools->actions().at( m_uiViewTool )->setChecked( true );
|
||||
QList<SubWindowAbstract*> subWindowList =
|
||||
m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
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++ )
|
||||
{
|
||||
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 );
|
||||
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 );
|
||||
}
|
||||
}
|
||||
+37
-31
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,16 +25,14 @@
|
||||
#ifndef __VIDEOHANDLE_H__
|
||||
#define __VIDEOHANDLE_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QPoint>
|
||||
#include <QVector>
|
||||
#include <QThread>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#define _CONTROL_PLAYING_TIME_ 0
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QToolBar;
|
||||
class QDockWidget;
|
||||
@@ -43,37 +41,37 @@ class QLabel;
|
||||
class QSlider;
|
||||
class QElapsedTimer;
|
||||
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class SubWindowHandle;
|
||||
class SubWindowAbstract;
|
||||
class VideoSubWindow;
|
||||
class FramePropertiesDock;
|
||||
class WidgetFrameNumber;
|
||||
class FrameNumberWidget;
|
||||
|
||||
class VideoHandle : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VideoHandle( QWidget*, PlaYUVerSubWindowHandle* );
|
||||
VideoHandle( QWidget*, SubWindowHandle* );
|
||||
~VideoHandle();
|
||||
|
||||
Void createActions();
|
||||
void createActions();
|
||||
QMenu* createVideoMenu();
|
||||
QMenu* createImageMenu();
|
||||
QToolBar* createToolBar();
|
||||
QDockWidget* createDock();
|
||||
QWidget* createStatusBarMessage();
|
||||
Void updateMenus();
|
||||
void updateMenus();
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
Void update( VideoSubWindow* currSubWindow );
|
||||
void update( VideoSubWindow* currSubWindow );
|
||||
|
||||
Void openSubWindow( VideoSubWindow* subWindow );
|
||||
void addSubWindow( VideoSubWindow* subWindow );
|
||||
|
||||
private:
|
||||
QWidget* m_pcParet;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
enum
|
||||
{
|
||||
PLAY_ACT,
|
||||
@@ -95,12 +93,16 @@ private:
|
||||
QSignalMapper* m_mapperVideoSeek;
|
||||
|
||||
QSlider* m_pcFrameSlider;
|
||||
WidgetFrameNumber* m_pcFrameNumInfo;
|
||||
FrameNumberWidget* m_pcFrameNumInfo;
|
||||
|
||||
// Tools Actions;
|
||||
QActionGroup* actionGroupTools;
|
||||
// Tools Actions
|
||||
QActionGroup* m_actionGroupTools;
|
||||
QSignalMapper* m_mapperTools;
|
||||
UInt m_uiViewTool;
|
||||
unsigned int m_uiViewTool;
|
||||
|
||||
// Grid Actions
|
||||
QSignalMapper* m_mapperGrid;
|
||||
QActionGroup* m_actionGroupGrid;
|
||||
|
||||
QMenu* m_pcMenuVideo;
|
||||
QMenu* m_pcMenuImage;
|
||||
@@ -109,6 +111,7 @@ private:
|
||||
QDockWidget* m_pcFramePropertiesDock;
|
||||
FramePropertiesDock* m_pcFramePropertiesSideBar;
|
||||
|
||||
QLabel* m_pcPlayingFPSLabel;
|
||||
QLabel* m_pcVideoFormatLabel;
|
||||
QLabel* m_pcResolutionLabel;
|
||||
|
||||
@@ -116,16 +119,16 @@ private:
|
||||
QVector<VideoSubWindow*> m_acPlayingSubWindows;
|
||||
|
||||
QTimer* m_pcPlayingTimer;
|
||||
Bool m_bIsPlaying;
|
||||
bool m_bIsPlaying;
|
||||
|
||||
#if( _CONTROL_PLAYING_TIME_ == 1 )
|
||||
UInt m_uiNumberPlayedFrames;
|
||||
Double m_dAverageFps;
|
||||
QElapsedTimer* m_pcPlayControlTimer;
|
||||
#endif
|
||||
unsigned int m_uiNumberPlayedFrames;
|
||||
unsigned int m_uiRealAverageFrameRate;
|
||||
QElapsedTimer* m_pcFrameRateFeedbackTimer;
|
||||
|
||||
UInt64 getMaxFrameNumber();
|
||||
Void setTimerStatus();
|
||||
void configureFrameRateTimer();
|
||||
void calculateRealFrameRate();
|
||||
unsigned long getMaxFrameNumber();
|
||||
void setTimerStatus();
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
@@ -135,9 +138,11 @@ private Q_SLOTS:
|
||||
void updateSelectionArea( QRect area );
|
||||
void closeSubWindow( SubWindowAbstract* subWindow );
|
||||
void zoomToFactorAll( const double factor, const QPoint center = QPoint() );
|
||||
void moveAllScrollBars( const QPoint offset );
|
||||
void moveAllScrollBars( const double&, const double& );
|
||||
|
||||
void play();
|
||||
void stop();
|
||||
|
||||
void playEvent();
|
||||
void seekSliderEvent( int new_frame_num );
|
||||
void seekEvent( int direction );
|
||||
@@ -145,6 +150,7 @@ private Q_SLOTS:
|
||||
void videoSelectionButtonEvent();
|
||||
void setTool( int tool );
|
||||
void toggleGrid( bool checked );
|
||||
void setGridSize( int size );
|
||||
};
|
||||
|
||||
#endif // __VIDEOHANDLE_H__
|
||||
+350
-254
File diff suppressed because it is too large.
Load diff
+93
-91
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,50 +25,52 @@
|
||||
#ifndef __VIDEOSUBWINDOW_H__
|
||||
#define __VIDEOSUBWINDOW_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "ViewArea.h"
|
||||
#include "config.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include <QDataStream>
|
||||
#include <QFuture>
|
||||
#include <QRect>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "SubWindowAbstract.h"
|
||||
#include "ViewArea.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class QScrollArea;
|
||||
|
||||
class VideoInformation;
|
||||
class VideoSubWindow;
|
||||
class PlaYUVerAppModuleIf;
|
||||
class CalypAppModuleIf;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
QString m_cFilename;
|
||||
UInt m_uiWidth;
|
||||
UInt m_uiHeight;
|
||||
Int m_iPelFormat;
|
||||
UInt m_uiBitsPelPixel;
|
||||
UInt m_iEndianness;
|
||||
UInt m_uiFrameRate;
|
||||
UInt64 m_uiFileSize;
|
||||
} PlaYUVerStreamInfo;
|
||||
typedef QVector<PlaYUVerStreamInfo> PlaYUVerStreamInfoVector;
|
||||
unsigned int m_uiWidth;
|
||||
unsigned int m_uiHeight;
|
||||
int m_iPelFormat;
|
||||
unsigned int m_uiBitsPelPixel;
|
||||
unsigned int m_iEndianness;
|
||||
unsigned int m_uiFrameRate;
|
||||
unsigned long long int m_uiFileSize;
|
||||
} CalypFileInfo;
|
||||
typedef QVector<CalypFileInfo> CalypFileInfoVector;
|
||||
|
||||
QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& d );
|
||||
QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& d );
|
||||
Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename );
|
||||
QDataStream& operator<<( QDataStream& out, const CalypFileInfoVector& d );
|
||||
QDataStream& operator>>( QDataStream& in, CalypFileInfoVector& d );
|
||||
int findCalypStreamInfo( CalypFileInfoVector array, QString filename );
|
||||
|
||||
class VideoSubWindow : public SubWindowAbstract
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
Bool m_bWindowBusy;
|
||||
bool m_bWindowBusy;
|
||||
|
||||
QScrollArea* m_pcScrollArea;
|
||||
QPoint m_cLastScroll;
|
||||
QPoint m_cCurrScroll;
|
||||
double m_dHorScroll;
|
||||
double m_dVerScroll;
|
||||
|
||||
ViewArea* m_cViewArea;
|
||||
|
||||
@@ -76,48 +78,29 @@ private:
|
||||
|
||||
QString m_cFilename;
|
||||
QString m_cStreamInformation;
|
||||
PlaYUVerStreamInfo m_sStreamInfo;
|
||||
PlaYUVerStream* m_pCurrStream;
|
||||
CalypFileInfo m_sStreamInfo;
|
||||
CalypStream* m_pCurrStream;
|
||||
|
||||
PlaYUVerFrame* m_pcCurrFrame;
|
||||
CalypFrame* m_pcCurrFrame;
|
||||
QRect m_cSelectedArea;
|
||||
|
||||
PlaYUVerAppModuleIf* m_pcCurrentDisplayModule;
|
||||
QList<PlaYUVerAppModuleIf*> m_apcCurrentModule;
|
||||
CalypAppModuleIf* m_pcCurrentDisplayModule;
|
||||
QList<CalypAppModuleIf*> m_apcCurrentModule;
|
||||
|
||||
VideoSubWindow* m_pcReferenceSubWindow;
|
||||
|
||||
// QString m_cWindowShortName;
|
||||
QString m_cCurrFileName;
|
||||
|
||||
Bool m_bIsPlaying;
|
||||
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();
|
||||
QFuture<void> m_cRefreshResult;
|
||||
QFuture<void> m_cReadResult;
|
||||
|
||||
public:
|
||||
enum VideoSubWindowCategories
|
||||
@@ -128,33 +111,35 @@ public:
|
||||
VideoSubWindow( enum VideoSubWindowCategories category, QWidget* parent = 0 );
|
||||
~VideoSubWindow();
|
||||
|
||||
Bool loadFile( QString cFilename, Bool bForceDialog = false );
|
||||
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
|
||||
Void loadAll();
|
||||
Bool save( QString filename );
|
||||
void updateVideoWindowInfo();
|
||||
|
||||
Void refreshSubWindow();
|
||||
Void refreshFrame( Bool bThreaded = false );
|
||||
bool loadFile( QString cFilename, bool bForceDialog = false );
|
||||
bool loadFile( CalypFileInfo* streamInfo );
|
||||
void loadAll();
|
||||
bool save( QString filename );
|
||||
bool saveStream( QString filename );
|
||||
|
||||
Bool play();
|
||||
Void pause();
|
||||
Bool playEvent();
|
||||
Void stop();
|
||||
void refreshSubWindow();
|
||||
void refreshFrame( bool bThreaded = false );
|
||||
|
||||
Bool isPlaying() { return m_bIsPlaying; }
|
||||
Void seekAbsoluteEvent( UInt new_frame_num );
|
||||
Void seekRelativeEvent( Bool bIsFoward );
|
||||
bool play();
|
||||
void pause();
|
||||
bool playEvent();
|
||||
void stop();
|
||||
|
||||
Void setCurrFrame( PlaYUVerFrame* pcCurrFrame );
|
||||
bool isPlaying();
|
||||
void seekAbsoluteEvent( unsigned int new_frame_num );
|
||||
void seekRelativeEvent( bool bIsFoward );
|
||||
|
||||
QScrollArea* getScroll() { return m_pcScrollArea; }
|
||||
PlaYUVerStreamInfo getStreamInfo() { return m_sStreamInfo; }
|
||||
void setCurrFrame( CalypFrame* pcCurrFrame );
|
||||
|
||||
CalypFileInfo getStreamInfo() { return m_sStreamInfo; }
|
||||
QString getStreamInformation() { return m_cStreamInformation; }
|
||||
PlaYUVerStream* getInputStream() { return m_pCurrStream; }
|
||||
PlaYUVerStream* getCurrStream() { return m_pCurrStream; }
|
||||
PlaYUVerFrame* getCurrFrame() { return m_pcCurrFrame; }
|
||||
CalypStream* getInputStream() { return m_pCurrStream; }
|
||||
CalypStream* getCurrStream() { return m_pCurrStream; }
|
||||
CalypFrame* getCurrFrame() { return m_pcCurrFrame; }
|
||||
ViewArea* getViewArea() { return m_cViewArea; }
|
||||
Void setRefSubWindow( VideoSubWindow* subWindow )
|
||||
void setRefSubWindow( VideoSubWindow* subWindow )
|
||||
{
|
||||
m_pcReferenceSubWindow = NULL;
|
||||
if( subWindow )
|
||||
@@ -167,14 +152,14 @@ public:
|
||||
* Functions to enable a module in the
|
||||
* current SubWindow
|
||||
*/
|
||||
Void enableModule( PlaYUVerAppModuleIf* pcModule );
|
||||
Void disableModule( PlaYUVerAppModuleIf* pcModule = NULL );
|
||||
Void associateModule( PlaYUVerAppModuleIf* pcModule );
|
||||
void enableModule( CalypAppModuleIf* pcModule );
|
||||
void disableModule( CalypAppModuleIf* pcModule = NULL );
|
||||
void associateModule( CalypAppModuleIf* pcModule );
|
||||
|
||||
PlaYUVerAppModuleIf* getDisplayModule() { return m_pcCurrentDisplayModule; }
|
||||
QList<PlaYUVerAppModuleIf*> getModuleArray()
|
||||
CalypAppModuleIf* getDisplayModule() { return m_pcCurrentDisplayModule; }
|
||||
QList<CalypAppModuleIf*> getModuleArray()
|
||||
{
|
||||
QList<PlaYUVerAppModuleIf*> apcModulesArray;
|
||||
QList<CalypAppModuleIf*> apcModulesArray;
|
||||
if( m_pcCurrentDisplayModule )
|
||||
apcModulesArray.append( m_pcCurrentDisplayModule );
|
||||
apcModulesArray.append( m_apcCurrentModule );
|
||||
@@ -184,12 +169,12 @@ public:
|
||||
/**
|
||||
* Virtual functions from SubWindowAbstract
|
||||
*/
|
||||
Void normalSize();
|
||||
Void zoomToFit();
|
||||
Void scaleView( Double scale, QPoint center = QPoint() );
|
||||
Void zoomToFactor( Double factor, QPoint center = QPoint() );
|
||||
void normalSize();
|
||||
void zoomToFit();
|
||||
void scaleView( double scale, QPoint center = QPoint() );
|
||||
void zoomToFactor( double factor, QPoint center = QPoint() );
|
||||
|
||||
Double getScaleFactor() { return m_cViewArea->getZoomFactor(); }
|
||||
double getScaleFactor() { return m_cViewArea->getZoomFactor(); }
|
||||
/**
|
||||
* Size related functions
|
||||
*/
|
||||
@@ -197,26 +182,43 @@ public:
|
||||
QSize sizeHint( const QSize& ) const;
|
||||
|
||||
QString getCurrentFileName() { return m_cFilename; }
|
||||
Bool getIsModule() { return getCategory() | SubWindowAbstract::MODULE_SUBWINDOW; }
|
||||
Void clearWindowBusy() { m_bWindowBusy = false; }
|
||||
Void setFillWindow( Bool bFlag );
|
||||
void clearWindowBusy() { m_bWindowBusy = false; }
|
||||
void setFillWindow( bool bFlag );
|
||||
|
||||
void adjustScrollBarToRatio( const double& horRatio, const double& verRatio );
|
||||
|
||||
private:
|
||||
void refreshFrameOperation();
|
||||
bool goToNextFrame( bool bThreaded = false );
|
||||
|
||||
static bool guessFormat( QString filename, unsigned int& rWidth, unsigned int& rHeight, int& rInputFormat, unsigned int& rBitsPerPixel,
|
||||
int& rEndianness, unsigned int& rFrameRate );
|
||||
|
||||
bool hasRunningModule();
|
||||
|
||||
/**
|
||||
* Private zoom function to handle
|
||||
* zoom to fit
|
||||
*/
|
||||
void scaleView( const QSize& size, QPoint center = QPoint() );
|
||||
|
||||
QSize getScrollSize();
|
||||
|
||||
protected:
|
||||
Void keyPressEvent( QKeyEvent* event );
|
||||
Void resizeEvent( QResizeEvent* event );
|
||||
// void closeEvent( QCloseEvent *event );
|
||||
void keyPressEvent( QKeyEvent* event );
|
||||
void resizeEvent( QResizeEvent* event );
|
||||
void closeEvent( QCloseEvent* event );
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateWindowOnTimeout();
|
||||
void adjustScrollBarByScale( double scale, QPoint center );
|
||||
void adjustScrollBarByOffset( QPoint Offset );
|
||||
void updateCurScrollValues();
|
||||
void setCurScrollValues();
|
||||
void updateScrollValues();
|
||||
void updateSelectedArea( QRect area );
|
||||
void updatePixelValueStatusBar( const QPoint& pos );
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( PlaYUVerStreamInfo );
|
||||
Q_DECLARE_METATYPE( PlaYUVerStreamInfoVector );
|
||||
Q_DECLARE_METATYPE( CalypFileInfo )
|
||||
Q_DECLARE_METATYPE( CalypFileInfoVector )
|
||||
|
||||
#endif // __VIDEOSUBWINDOW_H__
|
||||
+240
-247
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,10 +23,8 @@
|
||||
* Based on the work of Ricardo N. Rocha Sardo in SCode project
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "GridManager.h"
|
||||
#include "ViewArea.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
@@ -38,12 +36,16 @@
|
||||
#include <QRectF>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include <cmath>
|
||||
|
||||
#include "GridManager.h"
|
||||
|
||||
static const QColor selectionColor = Qt::cyan;
|
||||
static const QColor imageMaskColor = Qt::green;
|
||||
static const QColor eraserColor = Qt::red;
|
||||
|
||||
ViewArea::ViewArea( QWidget* parent ) : QWidget( parent )
|
||||
ViewArea::ViewArea( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
setMouseTracking( true );
|
||||
|
||||
@@ -67,17 +69,17 @@ ViewArea::ViewArea( QWidget* parent ) : QWidget( parent )
|
||||
connect( &m_zoomWinTimer, SIGNAL( timeout() ), this, SLOT( update() ) );
|
||||
}
|
||||
|
||||
Void ViewArea::setImage( PlaYUVerFrame* pcFrame )
|
||||
void ViewArea::setImage( CalypFrame* pcFrame )
|
||||
{
|
||||
m_pcCurrFrame = pcFrame;
|
||||
m_uiPixelHalfScale = 1 << ( m_pcCurrFrame->getBitsPel() - 1 );
|
||||
m_pcCurrFrame->fillRGBBuffer();
|
||||
QImage qimg = QImage( m_pcCurrFrame->getRGBBuffer(), m_pcCurrFrame->getWidth(),
|
||||
m_pcCurrFrame->getHeight(), QImage::Format_RGB32 );
|
||||
QImage qimg = QImage( m_pcCurrFrame->getRGBBuffer(), m_pcCurrFrame->getWidth(), m_pcCurrFrame->getHeight(),
|
||||
QImage::Format_ARGB32 );
|
||||
setImage( QPixmap::fromImage( qimg ) );
|
||||
}
|
||||
|
||||
Void ViewArea::setImage( const QPixmap& pixmap )
|
||||
void ViewArea::setImage( const QPixmap& pixmap )
|
||||
{
|
||||
m_pixmap = pixmap;
|
||||
m_mask = QBitmap( pixmap.width(), pixmap.height() );
|
||||
@@ -89,7 +91,7 @@ Void ViewArea::setImage( const QPixmap& pixmap )
|
||||
initZoomWinRect();
|
||||
}
|
||||
|
||||
Void ViewArea::clear()
|
||||
void ViewArea::clear()
|
||||
{
|
||||
m_pixmap = QPixmap();
|
||||
m_mask = QBitmap();
|
||||
@@ -99,7 +101,7 @@ Void ViewArea::clear()
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
Void ViewArea::setTool( UInt view )
|
||||
void ViewArea::setTool( unsigned int view )
|
||||
{
|
||||
switch( view )
|
||||
{
|
||||
@@ -128,13 +130,19 @@ Void ViewArea::setTool( UInt view )
|
||||
update();
|
||||
}
|
||||
|
||||
Void ViewArea::setGridVisible( Bool enable )
|
||||
void ViewArea::setGridVisible( bool enable )
|
||||
{
|
||||
m_bGridVisible = enable;
|
||||
update();
|
||||
}
|
||||
|
||||
Void ViewArea::clearMask()
|
||||
void ViewArea::setGridSize( int size )
|
||||
{
|
||||
m_grid.setGridSize( size );
|
||||
update();
|
||||
}
|
||||
|
||||
void ViewArea::clearMask()
|
||||
{
|
||||
m_mask.clear();
|
||||
}
|
||||
@@ -142,12 +150,12 @@ Void ViewArea::clearMask()
|
||||
/**
|
||||
* Zoom related function
|
||||
*/
|
||||
Void ViewArea::startZoomWinTimer()
|
||||
void ViewArea::startZoomWinTimer()
|
||||
{
|
||||
m_zoomWinTimer.start();
|
||||
}
|
||||
|
||||
Void ViewArea::setZoomFactor( Double f )
|
||||
void ViewArea::setZoomFactor( double f )
|
||||
{
|
||||
m_dZoomFactor = f;
|
||||
|
||||
@@ -156,11 +164,11 @@ Void ViewArea::setZoomFactor( Double f )
|
||||
update();
|
||||
}
|
||||
|
||||
Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize )
|
||||
double ViewArea::scaleZoomFactor( double scale, QPoint center, QSize minimumSize )
|
||||
{
|
||||
Double maxZoom = 100.0;
|
||||
Double minZoom = 0.01; //( 1.0 / m_pixmap.width() );
|
||||
Double new_scale = 1.0;
|
||||
double maxZoom = 100.0;
|
||||
double minZoom = 0.01; //( 1.0 / m_pixmap.width() );
|
||||
double new_scale = 1.0;
|
||||
|
||||
if( ( m_dZoomFactor == minZoom ) && ( scale < 1 ) )
|
||||
return new_scale;
|
||||
@@ -168,19 +176,19 @@ Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize
|
||||
if( ( m_dZoomFactor == maxZoom ) && ( scale > 1 ) )
|
||||
return new_scale;
|
||||
|
||||
Double zoomFactor = m_dZoomFactor * scale * 100.0;
|
||||
zoomFactor = round( zoomFactor );
|
||||
zoomFactor = zoomFactor / 100.0;
|
||||
scale = zoomFactor / m_dZoomFactor;
|
||||
double newZoomFactor = m_dZoomFactor * scale * 100.0;
|
||||
newZoomFactor = round( newZoomFactor );
|
||||
newZoomFactor = newZoomFactor / 100.0;
|
||||
scale = newZoomFactor / m_dZoomFactor;
|
||||
|
||||
if( !minimumSize.isNull() )
|
||||
{
|
||||
Double cw = m_pixmap.width() * m_dZoomFactor;
|
||||
Double ch = m_pixmap.height() * m_dZoomFactor;
|
||||
Double fw = m_pixmap.width() * zoomFactor;
|
||||
Double fh = m_pixmap.height() * zoomFactor;
|
||||
Double mw = minimumSize.width();
|
||||
Double mh = minimumSize.height();
|
||||
double cw = m_pixmap.width() * m_dZoomFactor;
|
||||
double ch = m_pixmap.height() * m_dZoomFactor;
|
||||
double fw = m_pixmap.width() * newZoomFactor;
|
||||
double fh = m_pixmap.height() * newZoomFactor;
|
||||
double mw = minimumSize.width();
|
||||
double mh = minimumSize.height();
|
||||
|
||||
if( ( cw < mw ) && ( ch < mh ) && ( scale < 1 ) )
|
||||
{
|
||||
@@ -189,43 +197,43 @@ Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize
|
||||
|
||||
if( ( fw < mw ) && ( fh < mh ) && ( scale < 1 ) )
|
||||
{
|
||||
Double wfactor = mw / fw;
|
||||
Double hfactor = mh / fh;
|
||||
double wfactor = mw / fw;
|
||||
double hfactor = mh / fh;
|
||||
|
||||
if( wfactor < hfactor )
|
||||
scale = wfactor;
|
||||
else
|
||||
scale = hfactor;
|
||||
|
||||
zoomFactor = zoomFactor * scale * 100.0;
|
||||
zoomFactor = floor( zoomFactor );
|
||||
zoomFactor = zoomFactor / 100.0;
|
||||
scale = zoomFactor / m_dZoomFactor;
|
||||
newZoomFactor = newZoomFactor * scale * 100.0;
|
||||
newZoomFactor = floor( newZoomFactor );
|
||||
newZoomFactor = newZoomFactor / 100.0;
|
||||
scale = newZoomFactor / m_dZoomFactor;
|
||||
}
|
||||
}
|
||||
|
||||
new_scale = scale;
|
||||
|
||||
if( zoomFactor < minZoom )
|
||||
if( newZoomFactor < minZoom )
|
||||
{
|
||||
zoomFactor = minZoom;
|
||||
new_scale = zoomFactor / m_dZoomFactor;
|
||||
newZoomFactor = minZoom;
|
||||
new_scale = newZoomFactor / m_dZoomFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( zoomFactor > maxZoom )
|
||||
if( newZoomFactor > maxZoom )
|
||||
{
|
||||
zoomFactor = maxZoom;
|
||||
new_scale = zoomFactor / m_dZoomFactor;
|
||||
newZoomFactor = maxZoom;
|
||||
new_scale = newZoomFactor / m_dZoomFactor;
|
||||
}
|
||||
}
|
||||
|
||||
setZoomFactor( zoomFactor );
|
||||
setZoomFactor( newZoomFactor );
|
||||
|
||||
return new_scale;
|
||||
}
|
||||
|
||||
// Void ViewArea::setMode( Int mode )
|
||||
// void ViewArea::setMode( int mode )
|
||||
//{
|
||||
// if( m_mode == mode )
|
||||
// return;
|
||||
@@ -234,56 +242,56 @@ Double ViewArea::scaleZoomFactor( Double scale, QPoint center, QSize minimumSize
|
||||
// update();
|
||||
//}
|
||||
//
|
||||
// Void ViewArea::setNormalMode()
|
||||
// void ViewArea::setNormalMode()
|
||||
//{
|
||||
// setMode( NormalMode );
|
||||
//}
|
||||
//
|
||||
// Void ViewArea::setMaskMode()
|
||||
// void ViewArea::setMaskMode()
|
||||
//{
|
||||
// setMode( MaskMode );
|
||||
//}
|
||||
//
|
||||
// Void ViewArea::setMaskColor( const QColor &color )
|
||||
// void ViewArea::setMaskColor( const QColor &color )
|
||||
//{
|
||||
// m_maskColor = color;
|
||||
// update();
|
||||
//}
|
||||
//
|
||||
// Void ViewArea::setMaskTool()
|
||||
// void ViewArea::setMaskTool()
|
||||
//{
|
||||
// setMode( MaskMode );
|
||||
// setTool( MaskTool );
|
||||
// m_blockTrackEnable = true;
|
||||
//}
|
||||
//
|
||||
// Void ViewArea::setEraserTool()
|
||||
// void ViewArea::setEraserTool()
|
||||
//{
|
||||
// setMode( MaskMode );
|
||||
// setTool( EraserTool );
|
||||
// m_blockTrackEnable = true;
|
||||
//}
|
||||
//
|
||||
// Void ViewArea::setSelectionTool()
|
||||
// void ViewArea::setSelectionTool()
|
||||
//{
|
||||
// setMode( NormalMode );
|
||||
// setTool( SelectionTool );
|
||||
// m_blockTrackEnable = false;
|
||||
//}
|
||||
//
|
||||
// Void ViewArea::setBlockSelectionTool()
|
||||
// void ViewArea::setBlockSelectionTool()
|
||||
//{
|
||||
// setMode( NormalMode );
|
||||
// setTool( BlockSelectionTool );
|
||||
// m_blockTrackEnable = true;
|
||||
//}
|
||||
|
||||
Void ViewArea::setSnapToGrid( Bool enable )
|
||||
void ViewArea::setSnapToGrid( bool enable )
|
||||
{
|
||||
m_snapToGrid = enable;
|
||||
}
|
||||
|
||||
// Void ViewArea::setSelectedArea( QRect &rect )
|
||||
// void ViewArea::setSelectedArea( QRect &rect )
|
||||
//{
|
||||
// if( rect.isNull() )
|
||||
// {
|
||||
@@ -309,17 +317,17 @@ Void ViewArea::setSnapToGrid( Bool enable )
|
||||
// update( updateRect.normalized() );
|
||||
//}
|
||||
|
||||
Void ViewArea::initZoomWinRect()
|
||||
void ViewArea::initZoomWinRect()
|
||||
{
|
||||
Int iMinX = 80;
|
||||
Int iMinY = 80;
|
||||
int iMinX = 80;
|
||||
int iMinY = 80;
|
||||
|
||||
Int iMaxX = iMinX * 5;
|
||||
Int iMaxY = iMinY * 5;
|
||||
int iMaxX = iMinX * 5;
|
||||
int iMaxY = iMinY * 5;
|
||||
|
||||
double dSizeRatio, dWinZoomRatio;
|
||||
|
||||
Int iHorizontalImg = ( m_pixmap.width() > m_pixmap.height() ) ? 1 : 0;
|
||||
int iHorizontalImg = ( m_pixmap.width() > m_pixmap.height() ) ? 1 : 0;
|
||||
|
||||
if( iHorizontalImg )
|
||||
{
|
||||
@@ -359,10 +367,10 @@ Void ViewArea::initZoomWinRect()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Geometry Updates
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Void ViewArea::updateSize()
|
||||
void ViewArea::updateSize()
|
||||
{
|
||||
Int w = m_pixmap.width() * m_dZoomFactor;
|
||||
Int h = m_pixmap.height() * m_dZoomFactor;
|
||||
int w = m_pixmap.width() * m_dZoomFactor;
|
||||
int h = m_pixmap.height() * m_dZoomFactor;
|
||||
setMinimumSize( w, h );
|
||||
|
||||
QWidget* p = parentWidget();
|
||||
@@ -378,7 +386,7 @@ Void ViewArea::updateSize()
|
||||
updateOffset();
|
||||
}
|
||||
|
||||
Void ViewArea::updateOffset()
|
||||
void ViewArea::updateOffset()
|
||||
{
|
||||
if( width() > m_pixmap.width() * m_dZoomFactor )
|
||||
{
|
||||
@@ -401,7 +409,7 @@ Void ViewArea::updateOffset()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Resize Event
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Void ViewArea::resizeEvent( QResizeEvent* event )
|
||||
void ViewArea::resizeEvent( QResizeEvent* event )
|
||||
{
|
||||
if( size().isEmpty() || m_pixmap.isNull() )
|
||||
return;
|
||||
@@ -411,10 +419,10 @@ Void ViewArea::resizeEvent( QResizeEvent* event )
|
||||
update();
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// PaInt Event
|
||||
// Paint Event
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
void ViewArea::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
QRect winRect = event->rect();
|
||||
|
||||
@@ -424,32 +432,32 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
if( size().isEmpty() || m_pixmap.isNull() )
|
||||
return;
|
||||
|
||||
QPainter paInter( this );
|
||||
QSize windowSize = parentWidget()->size();
|
||||
QPainter painter( this );
|
||||
|
||||
// Save the actual paInter properties and scales the coordinate system.
|
||||
paInter.save();
|
||||
paInter.translate( m_xOffset, m_yOffset );
|
||||
paInter.scale( m_dZoomFactor, m_dZoomFactor );
|
||||
// Save the actual painter properties and scales the coordinate system.
|
||||
painter.save();
|
||||
painter.translate( m_xOffset, m_yOffset );
|
||||
painter.scale( m_dZoomFactor, m_dZoomFactor );
|
||||
|
||||
// This line is for fast paiting. Only visible area of the image is paInted.
|
||||
// This line is for fast paiting. Only visible area of the image is painted.
|
||||
// We take the exposed rect from the event (that gives us scroll/expose
|
||||
// optimizations for free – no need
|
||||
// to draw the whole pixmap if your widget is only partially exposed), and
|
||||
// reverse map it with the paInter matrix.
|
||||
// reverse map it with the painter matrix.
|
||||
// That gives us the part of the pixmap that has actually been exposed.
|
||||
// See:
|
||||
// http://blog.qt.digia.com/blog/2006/05/13/fast-transformed-pixmapimage-drawing/
|
||||
QRect exposedRect =
|
||||
paInter.worldTransform().inverted().mapRect( event->rect() ).adjusted( -1, -1, 1, 1 );
|
||||
QRect exposedRect = painter.worldTransform().inverted().mapRect( event->rect() ).adjusted( -1, -1, 1, 1 );
|
||||
// Draw the pixmap.
|
||||
paInter.drawPixmap( exposedRect, m_pixmap, exposedRect );
|
||||
painter.drawPixmap( exposedRect, m_pixmap, exposedRect );
|
||||
|
||||
// Draw the Grid if it's visible.
|
||||
if( m_bGridVisible )
|
||||
{
|
||||
// Do we need to draw the whole grid?
|
||||
// To know that, we need to perform a transformation of the rectangle
|
||||
// area that the paInter needs to update - transform the windows
|
||||
// area that the painter needs to update - transform the windows
|
||||
// coordinates (origin at the top-left corner of the widget), to the
|
||||
// relatives coordinates of the image at it's original size (origin at
|
||||
// the top-left corner of the image).
|
||||
@@ -458,161 +466,148 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
// Now we have the (to update) rectangle area on a coordinates system
|
||||
// that has it's origin at the top-left corner of the image. That
|
||||
// is, is referenced to the not scaled image.
|
||||
// To know what image area we need to update, just Intersects the
|
||||
// To know what image area we need to update, just intersects the
|
||||
// rectangle area with the image area.
|
||||
vr &= QRect( 0, 0, m_pixmap.width(), m_pixmap.height() );
|
||||
|
||||
// Set up for the grid drawer.
|
||||
paInter.setRenderHint( QPainter::Antialiasing );
|
||||
painter.setRenderHint( QPainter::Antialiasing );
|
||||
|
||||
// Draw grid.
|
||||
m_grid.drawGrid( m_pixmap, vr, &paInter );
|
||||
m_grid.drawGrid( m_pixmap, vr, &painter );
|
||||
}
|
||||
|
||||
paInter.restore();
|
||||
painter.restore();
|
||||
|
||||
// Draw a border around the image.
|
||||
/* if( m_xOffset || m_yOffset )
|
||||
{
|
||||
paInter.setPen( Qt::black );
|
||||
paInter.drawRect( m_xOffset - 1, m_yOffset - 1, m_pixmap.width() *
|
||||
m_dZoomFactor + 1, m_pixmap.height() *
|
||||
m_dZoomFactor + 1 );
|
||||
}*/
|
||||
{
|
||||
painter.setPen( Qt::black );
|
||||
painter.drawRect( m_xOffset - 1, m_yOffset - 1, m_pixmap.width() *
|
||||
m_dZoomFactor + 1, m_pixmap.height() *
|
||||
m_dZoomFactor + 1 );
|
||||
}*/
|
||||
|
||||
int frFormat = m_pcCurrFrame->getColorSpace();
|
||||
|
||||
// Draw pixel values in grid
|
||||
if( m_dZoomFactor >= 50.0 )
|
||||
if( m_dZoomFactor >= 60.0 || ( frFormat != CLP_COLOR_RGBA && m_dZoomFactor >= 50.0 ) )
|
||||
{
|
||||
Int imageWidth = m_pixmap.width();
|
||||
Int imageHeight = m_pixmap.height();
|
||||
PlaYUVerPixel sPixelValue;
|
||||
int imageWidth = m_pixmap.width();
|
||||
int imageHeight = m_pixmap.height();
|
||||
;
|
||||
|
||||
QFont font( "Helvetica" );
|
||||
font.setPixelSize( 12 );
|
||||
paInter.setFont( font );
|
||||
painter.setFont( font );
|
||||
|
||||
QRect vr = windowToView( winRect );
|
||||
vr &= QRect( 0, 0, imageWidth, imageHeight );
|
||||
|
||||
for( Int i = vr.x(); i <= vr.right(); i++ )
|
||||
for( int i = vr.x(); i <= vr.right(); i++ )
|
||||
{
|
||||
for( Int j = vr.y(); j <= vr.bottom(); j++ )
|
||||
for( int j = vr.y(); j <= vr.bottom(); j++ )
|
||||
{
|
||||
QPoint pixelTopLeft( i, j );
|
||||
|
||||
QRect pixelRect( viewToWindow( pixelTopLeft ), QSize( m_dZoomFactor, m_dZoomFactor ) );
|
||||
QString pixelValue;
|
||||
CalypPixel pixel = m_pcCurrFrame->getPixel( pixelTopLeft.x(), pixelTopLeft.y() );
|
||||
|
||||
Int frFormat = m_pcCurrFrame->getColorSpace();
|
||||
|
||||
if( frFormat == PlaYUVerPixel::COLOR_YUV )
|
||||
if( frFormat == CLP_COLOR_YUV || frFormat == CLP_COLOR_GRAY )
|
||||
{
|
||||
sPixelValue = m_pcCurrFrame->getPixelValue( pixelTopLeft.x(), pixelTopLeft.y() );
|
||||
|
||||
if( sPixelValue.Y() < m_uiPixelHalfScale )
|
||||
paInter.setPen( QColor( Qt::white ) );
|
||||
if( pixel[0] < m_uiPixelHalfScale )
|
||||
painter.setPen( QColor( Qt::white ) );
|
||||
else
|
||||
paInter.setPen( QColor( Qt::black ) );
|
||||
painter.setPen( QColor( Qt::black ) );
|
||||
|
||||
paInter.drawText( pixelRect, Qt::AlignCenter,
|
||||
"Y: " + QString::number( sPixelValue.Y() ) + "\n" +
|
||||
"U: " + QString::number( sPixelValue.Cb() ) + "\n" +
|
||||
"V: " + QString::number( sPixelValue.Cr() ) );
|
||||
}
|
||||
if( frFormat == PlaYUVerPixel::COLOR_GRAY )
|
||||
{
|
||||
sPixelValue = m_pcCurrFrame->getPixelValue( pixelTopLeft.x(), pixelTopLeft.y() );
|
||||
|
||||
if( sPixelValue.Y() < m_uiPixelHalfScale )
|
||||
paInter.setPen( QColor( Qt::white ) );
|
||||
else
|
||||
paInter.setPen( QColor( Qt::black ) );
|
||||
|
||||
paInter.drawText( pixelRect, Qt::AlignCenter,
|
||||
"Y: " + QString::number( sPixelValue.Y() ) );
|
||||
pixelValue = QString( "Y: %1" ).arg( pixel[0] );
|
||||
if( frFormat == CLP_COLOR_YUV )
|
||||
pixelValue += QString( "\nU: %1\nV: %2" ).arg( pixel[1] ).arg( pixel[2] );
|
||||
}
|
||||
|
||||
if( ( frFormat == PlaYUVerPixel::COLOR_RGB ) )
|
||||
if( frFormat == CLP_COLOR_RGB || frFormat == CLP_COLOR_RGBA )
|
||||
{
|
||||
sPixelValue = m_pcCurrFrame->getPixelValue( pixelTopLeft.x(), pixelTopLeft.y() );
|
||||
|
||||
if( ( sPixelValue.R() + sPixelValue.G() + sPixelValue.B() ) < ( m_uiPixelHalfScale * 3 ) )
|
||||
paInter.setPen( QColor( Qt::white ) );
|
||||
if( ( pixel[0] + pixel[1] + pixel[2] ) < ( m_uiPixelHalfScale * 3 ) )
|
||||
painter.setPen( QColor( Qt::white ) );
|
||||
else
|
||||
paInter.setPen( QColor( Qt::black ) );
|
||||
painter.setPen( QColor( Qt::black ) );
|
||||
|
||||
paInter.drawText( pixelRect, Qt::AlignCenter,
|
||||
"R: " + QString::number( sPixelValue.R() ) + "\n" +
|
||||
"G: " + QString::number( sPixelValue.G() ) + "\n" +
|
||||
"B: " + QString::number( sPixelValue.B() ) );
|
||||
pixelValue = QString( "R: %1\nG: %2\nB: %3" ).arg( pixel[0] ).arg( pixel[1] ).arg( pixel[2] );
|
||||
if( frFormat == CLP_COLOR_RGBA )
|
||||
pixelValue += QString( "\nA: %1" ).arg( pixel[3] );
|
||||
}
|
||||
painter.drawText( pixelRect, Qt::AlignCenter, pixelValue );
|
||||
}
|
||||
}
|
||||
|
||||
QColor color( Qt::white );
|
||||
QPen mainPen = QPen( color, 1, Qt::SolidLine );
|
||||
paInter.setPen( mainPen );
|
||||
painter.setPen( mainPen );
|
||||
|
||||
// Draw vertical line
|
||||
for( Int x = vr.x(); x <= ( vr.right() + 1 ); x++ )
|
||||
for( int x = vr.x(); x <= ( vr.right() + 1 ); x++ )
|
||||
{
|
||||
// Always draw the full line otherwise the line stippling
|
||||
// varies with the location of view area and we get glitchy
|
||||
// patterns.
|
||||
paInter.drawLine( viewToWindow( QPoint( x, 0 ) ), viewToWindow( QPoint( x, imageHeight ) ) );
|
||||
painter.drawLine( viewToWindow( QPoint( x, 0 ) ), viewToWindow( QPoint( x, imageHeight ) ) );
|
||||
}
|
||||
// Draw horizontal line
|
||||
for( Int y = vr.y(); y <= ( vr.bottom() + 1 ); y++ )
|
||||
for( int y = vr.y(); y <= ( vr.bottom() + 1 ); y++ )
|
||||
{
|
||||
paInter.drawLine( viewToWindow( QPoint( 0, y ) ), viewToWindow( QPoint( imageWidth, y ) ) );
|
||||
painter.drawLine( viewToWindow( QPoint( 0, y ) ), viewToWindow( QPoint( imageWidth, y ) ) );
|
||||
}
|
||||
}
|
||||
bool showZoomRect = m_pixmap.width() * m_dZoomFactor > windowSize.width() ||
|
||||
m_pixmap.height() * m_dZoomFactor > windowSize.height();
|
||||
|
||||
// VISIBLE ZOOM RECT
|
||||
#if 0
|
||||
if( m_visibleZoomRect && m_zoomWinTimer.isActive() )
|
||||
// VISIBLE ZOOM RECT
|
||||
if( m_visibleZoomRect && m_zoomWinTimer.isActive() && showZoomRect )
|
||||
{
|
||||
double dRatio = m_dZoomWinRatio;
|
||||
|
||||
QRect cImg = QRect(0, 0, m_pixmap.width(), m_pixmap.height() );
|
||||
QPoint cZWinRBpos = QPoint(winRect.bottomRight()) - QPoint(15,15);
|
||||
QRect cImgWinRect(0, 0, round((double)cImg.width()/dRatio), round((double)cImg.height()/dRatio) );
|
||||
cImgWinRect.moveBottomRight(cZWinRBpos);
|
||||
QRect cImg = QRect( 0, 0, m_pixmap.width(), m_pixmap.height() );
|
||||
QPoint cZWinRBpos = QPoint( winRect.bottomRight() ) - QPoint( 15, 15 );
|
||||
QRect cImgWinRect( 0, 0, round( (double)cImg.width() / dRatio ), round( (double)cImg.height() / dRatio ) );
|
||||
cImgWinRect.moveBottomRight( cZWinRBpos );
|
||||
|
||||
QRect vr = windowToView( winRect );
|
||||
QRect cVisibleImg = vr & cImg;
|
||||
//cVisibleImg.moveTopLeft(vr.topLeft());
|
||||
QRect cVisibleWinRect;
|
||||
cVisibleWinRect.setLeft(floor((double)cVisibleImg.x()/dRatio));
|
||||
cVisibleWinRect.setTop(floor((double)cVisibleImg.y()/dRatio));
|
||||
cVisibleWinRect.setRight(round((double)cVisibleImg.right()/dRatio));
|
||||
cVisibleWinRect.setBottom(round((double)cVisibleImg.bottom()/dRatio));
|
||||
cVisibleWinRect.setLeft( floor( (double)cVisibleImg.x() / dRatio ) );
|
||||
cVisibleWinRect.setTop( floor( (double)cVisibleImg.y() / dRatio ) );
|
||||
cVisibleWinRect.setRight( round( (double)cVisibleImg.right() / dRatio ) );
|
||||
cVisibleWinRect.setBottom( round( (double)cVisibleImg.bottom() / dRatio ) );
|
||||
|
||||
paInter.fillRect(cImgWinRect, QBrush(QColor(128, 128, 128, 128)));
|
||||
paInter.setPen(QColor(50, 50, 50, 128));
|
||||
paInter.drawRect(cImgWinRect);
|
||||
//painter.fillRect( cImgWinRect, QBrush( QColor( 128, 128, 128, 128 ) ) );
|
||||
painter.setPen( QColor( 50, 50, 50, 128 ) );
|
||||
//painter.drawRect( cImgWinRect );
|
||||
painter.setOpacity( 0.7 );
|
||||
painter.drawPixmap( cImgWinRect, m_pixmap );
|
||||
painter.setOpacity( 1 );
|
||||
|
||||
cVisibleWinRect.moveTopLeft( cImgWinRect.topLeft() + cVisibleWinRect.topLeft() );
|
||||
|
||||
cVisibleWinRect = cVisibleWinRect & cImgWinRect;
|
||||
|
||||
if(cVisibleWinRect.left()<0)
|
||||
cVisibleWinRect.moveLeft(0);
|
||||
if(cVisibleWinRect.top()<0)
|
||||
cVisibleWinRect.moveTop(0);
|
||||
if( cVisibleWinRect.left() < 0 )
|
||||
cVisibleWinRect.moveLeft( 0 );
|
||||
if( cVisibleWinRect.top() < 0 )
|
||||
cVisibleWinRect.moveTop( 0 );
|
||||
|
||||
if(cVisibleWinRect.width()<=0)
|
||||
cVisibleWinRect.setWidth(1);
|
||||
if(cVisibleWinRect.height()<=0)
|
||||
cVisibleWinRect.setHeight(1);
|
||||
if( cVisibleWinRect.width() <= 0 )
|
||||
cVisibleWinRect.setWidth( 1 );
|
||||
if( cVisibleWinRect.height() <= 0 )
|
||||
cVisibleWinRect.setHeight( 1 );
|
||||
|
||||
paInter.fillRect(cVisibleWinRect, QBrush(QColor(200, 200, 200, 128)));
|
||||
paInter.setPen(QColor(255, 255, 255, 128));
|
||||
paInter.drawRect(cVisibleWinRect);
|
||||
painter.fillRect( cVisibleWinRect, QBrush( QColor( 200, 200, 200, 128 ) ) );
|
||||
painter.setPen( QColor( 255, 255, 255, 128 ) );
|
||||
painter.drawRect( cVisibleWinRect );
|
||||
|
||||
//qDebug() << "Debug VisibleZoomRect: " << winRect << vr << cImgWinRect << cVisibleWinRect << cVisibleImg << dRatio;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
QRect sr = viewToWindow( m_selectedArea );
|
||||
QRect ir = sr & winRect;
|
||||
@@ -629,13 +624,13 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
QBrush brush( selectColor );
|
||||
|
||||
if( m_blockTrackEnable )
|
||||
paInter.setBrush( Qt::NoBrush );
|
||||
painter.setBrush( Qt::NoBrush );
|
||||
else
|
||||
paInter.setBrush( brush );
|
||||
painter.setBrush( brush );
|
||||
|
||||
paInter.setPen( Qt::darkCyan );
|
||||
painter.setPen( Qt::darkCyan );
|
||||
|
||||
// paInter.drawRect( sr/*m_selectedArea*/ );
|
||||
// painter.drawRect( sr/*m_selectedArea*/ );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -644,23 +639,23 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
fill.setAlpha( 150 );
|
||||
|
||||
QBrush brush( fill );
|
||||
paInter.setBrush( fill );
|
||||
paInter.setPen( Qt::NoPen );
|
||||
painter.setBrush( fill );
|
||||
painter.setPen( Qt::NoPen );
|
||||
QPainterPath myPath;
|
||||
QRect imgr = viewToWindow( QRect( 0, 0, m_pixmap.width(), m_pixmap.height() ) );
|
||||
|
||||
myPath.addRect( imgr );
|
||||
myPath.addRect( sr ); // m_selectedArea
|
||||
paInter.drawPath( myPath );
|
||||
painter.drawPath( myPath );
|
||||
|
||||
// 2) Draw the selection rectangle
|
||||
paInter.setBrush( Qt::NoBrush );
|
||||
paInter.setPen( Qt::darkCyan );
|
||||
// paInter.drawRect( sr/*m_selectedArea*/ );
|
||||
painter.setBrush( Qt::NoBrush );
|
||||
painter.setPen( Qt::darkCyan );
|
||||
// painter.drawRect( sr/*m_selectedArea*/ );
|
||||
}
|
||||
|
||||
if( !ir.isNull() )
|
||||
paInter.drawRect( sr /*m_selectedArea*/ );
|
||||
painter.drawRect( sr /*m_selectedArea*/ );
|
||||
}
|
||||
|
||||
// Mask Mode ----------------------------------------------------------
|
||||
@@ -679,12 +674,12 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
color = imageMaskColor;
|
||||
|
||||
color.setAlpha( 120 );
|
||||
paInter.setPen( color );
|
||||
paInter.save();
|
||||
paInter.translate( m_xOffset, m_yOffset );
|
||||
paInter.scale( m_dZoomFactor, m_dZoomFactor );
|
||||
paInter.drawPixmap( QPoint( 0, 0 ), m_mask );
|
||||
paInter.restore();
|
||||
painter.setPen( color );
|
||||
painter.save();
|
||||
painter.translate( m_xOffset, m_yOffset );
|
||||
painter.scale( m_dZoomFactor, m_dZoomFactor );
|
||||
painter.drawPixmap( QPoint( 0, 0 ), m_mask );
|
||||
painter.restore();
|
||||
|
||||
if( !m_selectedArea.isNull() )
|
||||
{
|
||||
@@ -692,8 +687,7 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
switch( tool() )
|
||||
{
|
||||
case MaskTool:
|
||||
{
|
||||
case MaskTool: {
|
||||
if( m_maskColor.isValid() )
|
||||
color = m_maskColor;
|
||||
else
|
||||
@@ -701,8 +695,7 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
|
||||
break;
|
||||
}
|
||||
case EraserTool:
|
||||
{
|
||||
case EraserTool: {
|
||||
color = eraserColor;
|
||||
break;
|
||||
}
|
||||
@@ -714,13 +707,13 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
brush = QBrush( color );
|
||||
|
||||
if( m_blockTrackEnable )
|
||||
paInter.setBrush( Qt::NoBrush );
|
||||
painter.setBrush( Qt::NoBrush );
|
||||
else
|
||||
paInter.setBrush( brush );
|
||||
painter.setBrush( brush );
|
||||
|
||||
paInter.setPen( color );
|
||||
painter.setPen( color );
|
||||
if( !ir.isNull() )
|
||||
paInter.drawRect( sr );
|
||||
painter.drawRect( sr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -728,14 +721,16 @@ Void ViewArea::paintEvent( QPaintEvent* event )
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Mouse Events
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Void ViewArea::wheelEvent( QWheelEvent* event )
|
||||
void ViewArea::wheelEvent( QWheelEvent* event )
|
||||
{
|
||||
Double scale;
|
||||
Double usedScale;
|
||||
double scale;
|
||||
double usedScale;
|
||||
|
||||
event->accept();
|
||||
|
||||
if( event->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
scale = 0.001 * event->delta();
|
||||
scale = 0.001 * event->angleDelta().y();
|
||||
if( scale > 0 )
|
||||
scale = 1.25;
|
||||
else
|
||||
@@ -751,7 +746,7 @@ Void ViewArea::wheelEvent( QWheelEvent* event )
|
||||
}
|
||||
}
|
||||
|
||||
Void ViewArea::mousePressEvent( QMouseEvent* event )
|
||||
void ViewArea::mousePressEvent( QMouseEvent* event )
|
||||
{
|
||||
event->accept();
|
||||
|
||||
@@ -784,12 +779,12 @@ Void ViewArea::mousePressEvent( QMouseEvent* event )
|
||||
// If grid tracking
|
||||
if( m_snapToGrid )
|
||||
{
|
||||
// Find if the cursor is near a grid Intersection
|
||||
Bool isNear = m_grid.isNear( m_lastPos );
|
||||
// Find if the cursor is near a grid intersection
|
||||
bool isNear = m_grid.isNear( m_lastPos );
|
||||
isNear = true;
|
||||
if( isNear )
|
||||
{
|
||||
// The grid 'near Intersection' found when used isNear()
|
||||
// The grid 'near intersection' found when used isNear()
|
||||
m_lastPos = m_grid.nearPos();
|
||||
}
|
||||
}
|
||||
@@ -817,16 +812,16 @@ Void ViewArea::mousePressEvent( QMouseEvent* event )
|
||||
}
|
||||
}
|
||||
|
||||
Void ViewArea::mouseMoveEvent( QMouseEvent* event )
|
||||
void ViewArea::mouseMoveEvent( QMouseEvent* event )
|
||||
{
|
||||
event->accept();
|
||||
|
||||
#ifndef _MSC_VER
|
||||
// Add this code line to aVoid slow navigation with some specific mouses
|
||||
// This seems to always appear on windows
|
||||
if( qApp->hasPendingEvents() )
|
||||
return;
|
||||
#endif
|
||||
//#ifndef _MSC_VER
|
||||
// // Add this code line to avoid slow navigation with some specific mouses
|
||||
// // This seems to always appear on windows
|
||||
// if( qApp->hasPendingEvents() )
|
||||
// return;
|
||||
//#endif
|
||||
|
||||
QPoint actualPos = windowToView( event->pos() );
|
||||
QRect updateRect;
|
||||
@@ -839,12 +834,12 @@ Void ViewArea::mouseMoveEvent( QMouseEvent* event )
|
||||
// Grid tracking
|
||||
if( m_snapToGrid )
|
||||
{
|
||||
// Find if the cursor is near a grid Intersection
|
||||
Bool isNear = m_grid.isNear( actualPos );
|
||||
// Find if the cursor is near a grid intersection
|
||||
bool isNear = m_grid.isNear( actualPos );
|
||||
|
||||
if( isNear )
|
||||
{
|
||||
// Return the last grid near Intersection found
|
||||
// Return the last grid near intersection found
|
||||
actualPos = m_grid.nearPos();
|
||||
}
|
||||
}
|
||||
@@ -904,21 +899,21 @@ Void ViewArea::mouseMoveEvent( QMouseEvent* event )
|
||||
}
|
||||
}
|
||||
/* else // if tool() == BlockSelectionTool || MaskTool || EraserTool
|
||||
{
|
||||
m_blockTrackEnable = false;
|
||||
// If cursor is inside the selected area, we most redraw
|
||||
// the selection rect because it may be smaller.
|
||||
if( m_selectedArea.contains( actualPos ) )
|
||||
{
|
||||
m_selectedArea = m_grid.rectContains( m_lastPos );
|
||||
}
|
||||
{
|
||||
m_blockTrackEnable = false;
|
||||
// If cursor is inside the selected area, we most redraw
|
||||
// the selection rect because it may be smaller.
|
||||
if( m_selectedArea.contains( actualPos ) )
|
||||
{
|
||||
m_selectedArea = m_grid.rectContains( m_lastPos );
|
||||
}
|
||||
|
||||
m_selectedArea = m_selectedArea.united( m_grid.rectContains( actualPos ) );
|
||||
}
|
||||
*/
|
||||
m_selectedArea = m_selectedArea.united( m_grid.rectContains( actualPos ) );
|
||||
}
|
||||
*/
|
||||
if( tool() == SelectionTool )
|
||||
{
|
||||
// Intercept the selected area with the image area to limit the
|
||||
// intercept the selected area with the image area to limit the
|
||||
// selection only to the image area, preventing it to come outside
|
||||
// the image.
|
||||
m_selectedArea &= QRect( 0, 0, m_pixmap.width(), m_pixmap.height() );
|
||||
@@ -959,7 +954,7 @@ Void ViewArea::mouseMoveEvent( QMouseEvent* event )
|
||||
}
|
||||
}
|
||||
|
||||
Void ViewArea::mouseReleaseEvent( QMouseEvent* event )
|
||||
void ViewArea::mouseReleaseEvent( QMouseEvent* event )
|
||||
{
|
||||
event->accept();
|
||||
|
||||
@@ -1003,7 +998,7 @@ Void ViewArea::mouseReleaseEvent( QMouseEvent* event )
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Bool ViewArea::isPosValid( const QPoint& pos ) const
|
||||
bool ViewArea::isPosValid( const QPoint& pos ) const
|
||||
{
|
||||
if( pos.x() < 0 || pos.y() < 0 || pos.x() >= m_pixmap.width() || pos.y() >= m_pixmap.height() )
|
||||
return false;
|
||||
@@ -1016,8 +1011,8 @@ Bool ViewArea::isPosValid( const QPoint& pos ) const
|
||||
QPoint ViewArea::windowToView( const QPoint& pt ) const
|
||||
{
|
||||
QPoint p;
|
||||
p.setX( static_cast<Int>( ( pt.x() - m_xOffset ) / m_dZoomFactor ) );
|
||||
p.setY( static_cast<Int>( ( pt.y() - m_yOffset ) / m_dZoomFactor ) );
|
||||
p.setX( static_cast<int>( ( pt.x() - m_xOffset ) / m_dZoomFactor ) );
|
||||
p.setY( static_cast<int>( ( pt.y() - m_yOffset ) / m_dZoomFactor ) );
|
||||
|
||||
return p;
|
||||
}
|
||||
@@ -1027,11 +1022,11 @@ QRect ViewArea::windowToView( const QRect& rc ) const
|
||||
QRect r;
|
||||
|
||||
r.setTopLeft( windowToView( rc.topLeft() ) );
|
||||
// r.setRight ( (Int)( ceil(( rc.right() - m_xOffset)/m_dZoomFactor )));
|
||||
// r.setBottom( (Int)( ceil(( rc.bottom()- m_yOffset)/m_dZoomFactor )));
|
||||
// r.setRight ( static_cast<Int>(( rc.right() - m_xOffset ) /
|
||||
// r.setRight ( (int)( ceil(( rc.right() - m_xOffset)/m_dZoomFactor )));
|
||||
// r.setBottom( (int)( ceil(( rc.bottom()- m_yOffset)/m_dZoomFactor )));
|
||||
// r.setRight ( static_cast<int>(( rc.right() - m_xOffset ) /
|
||||
// m_dZoomFactor +1));
|
||||
// r.setBottom( static_cast<Int>(( rc.bottom() - m_xOffset ) /
|
||||
// r.setBottom( static_cast<int>(( rc.bottom() - m_xOffset ) /
|
||||
// m_dZoomFactor+1));
|
||||
r.setBottomRight( windowToView( rc.bottomRight() ) );
|
||||
return r;
|
||||
@@ -1041,8 +1036,8 @@ QPoint ViewArea::viewToWindow( const QPoint& pt ) const
|
||||
{
|
||||
QPoint p;
|
||||
|
||||
p.setX( static_cast<Int>( pt.x() * m_dZoomFactor + m_xOffset ) );
|
||||
p.setY( static_cast<Int>( pt.y() * m_dZoomFactor + m_yOffset ) );
|
||||
p.setX( static_cast<int>( pt.x() * m_dZoomFactor + m_xOffset ) );
|
||||
p.setY( static_cast<int>( pt.y() * m_dZoomFactor + m_yOffset ) );
|
||||
|
||||
return p;
|
||||
}
|
||||
@@ -1052,18 +1047,18 @@ QRect ViewArea::viewToWindow( const QRect& rc ) const
|
||||
QRect r;
|
||||
|
||||
r.setTopLeft( viewToWindow( rc.topLeft() ) );
|
||||
// r.setRight ( (Int)( ceil(( rc.right() +1+m_xOffset )*m_dZoomFactor ) -
|
||||
// r.setRight ( (int)( ceil(( rc.right() +1+m_xOffset )*m_dZoomFactor ) -
|
||||
// 1 ));
|
||||
// r.setBottom( (Int)( ceil(( rc.bottom()+1+m_yOffset )*m_dZoomFactor ) -
|
||||
// r.setBottom( (int)( ceil(( rc.bottom()+1+m_yOffset )*m_dZoomFactor ) -
|
||||
// 1 ));
|
||||
// r.setRight ( (Int)( ceil(( rc.right()+0.5)*m_dZoomFactor )+ m_xOffset
|
||||
// r.setRight ( (int)( ceil(( rc.right()+0.5)*m_dZoomFactor )+ m_xOffset
|
||||
// )-1);
|
||||
// r.setBottom( (Int)( ceil(( rc.bottom()+0.5)*m_dZoomFactor ) +m_yOffset
|
||||
// r.setBottom( (int)( ceil(( rc.bottom()+0.5)*m_dZoomFactor ) +m_yOffset
|
||||
// )-1);
|
||||
// qDebug()<<"Right = "<< r.right();
|
||||
// r.setRight ( static_cast<Int>(( rc.right()+1) * m_dZoomFactor +
|
||||
// r.setRight ( static_cast<int>(( rc.right()+1) * m_dZoomFactor +
|
||||
// m_xOffset -1) );
|
||||
// r.setBottom( static_cast<Int>(( rc.bottom()+1) * m_dZoomFactor +
|
||||
// r.setBottom( static_cast<int>(( rc.bottom()+1) * m_dZoomFactor +
|
||||
// m_yOffset -1));
|
||||
r.setBottomRight( viewToWindow( rc.bottomRight() ) );
|
||||
|
||||
@@ -1073,28 +1068,26 @@ QRect ViewArea::viewToWindow( const QRect& rc ) const
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Masks Management
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Void ViewArea::updateMask( const QRect& rect )
|
||||
void ViewArea::updateMask( const QRect& rect )
|
||||
{
|
||||
switch( tool() )
|
||||
{
|
||||
case MaskTool:
|
||||
{
|
||||
case MaskTool: {
|
||||
// Add rect to the mask
|
||||
QPainter paInter( &m_mask );
|
||||
paInter.setBrush( Qt::color1 );
|
||||
paInter.setPen( Qt::NoPen );
|
||||
paInter.drawRect( rect );
|
||||
paInter.end();
|
||||
QPainter painter( &m_mask );
|
||||
painter.setBrush( Qt::color1 );
|
||||
painter.setPen( Qt::NoPen );
|
||||
painter.drawRect( rect );
|
||||
painter.end();
|
||||
break;
|
||||
}
|
||||
case EraserTool:
|
||||
{
|
||||
case EraserTool: {
|
||||
// Clears rect area in the mask
|
||||
QPainter paInter( &m_mask );
|
||||
paInter.setBrush( Qt::color0 );
|
||||
paInter.setPen( Qt::NoPen );
|
||||
paInter.drawRect( rect );
|
||||
paInter.end();
|
||||
QPainter painter( &m_mask );
|
||||
painter.setBrush( Qt::color0 );
|
||||
painter.setPen( Qt::NoPen );
|
||||
painter.drawRect( rect );
|
||||
painter.end();
|
||||
break;
|
||||
}
|
||||
default: /* Do Nothing */
|
||||
|
||||
+54
-49
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -26,17 +26,18 @@
|
||||
#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>
|
||||
|
||||
class PlaYUVerStream;
|
||||
#include "CommonDefs.h"
|
||||
#include "GridManager.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
class CalypStream;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -55,38 +56,42 @@ public:
|
||||
|
||||
ViewArea( QWidget* parent = 0 );
|
||||
|
||||
Void setImage( PlaYUVerFrame* pcFrame );
|
||||
Void setImage( const QPixmap& pixmap );
|
||||
void setImage( CalypFrame* pcFrame );
|
||||
void setImage( const QPixmap& pixmap );
|
||||
|
||||
Void setMode( Int mode );
|
||||
Void setMaskColor( const QColor& color = QColor() );
|
||||
void setMode( int mode );
|
||||
void setMaskColor( const QColor& color = QColor() );
|
||||
|
||||
/**
|
||||
* Clears any contents.
|
||||
*/
|
||||
Void clear();
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* Select tool from the menu
|
||||
*/
|
||||
Void setTool( UInt view );
|
||||
void setTool( unsigned int view );
|
||||
|
||||
Void setGridVisible( Bool enable );
|
||||
/**
|
||||
* Grid options
|
||||
*/
|
||||
void setGridVisible( bool enable );
|
||||
void setGridSize( int size );
|
||||
|
||||
/**
|
||||
* 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 );
|
||||
@@ -95,25 +100,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
|
||||
@@ -132,12 +137,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;
|
||||
@@ -145,16 +150,16 @@ private:
|
||||
QPoint viewToWindow( const QPoint& pt ) const;
|
||||
QRect viewToWindow( const QRect& rc ) const;
|
||||
|
||||
PlaYUVerFrame* m_pcCurrFrame;
|
||||
CalypFrame* m_pcCurrFrame;
|
||||
|
||||
Pel m_uiPixelHalfScale;
|
||||
ClpPel m_uiPixelHalfScale;
|
||||
|
||||
Tool m_eTool;
|
||||
Bool m_bGridVisible;
|
||||
bool m_bGridVisible;
|
||||
|
||||
QTimer m_zoomWinTimer;
|
||||
Double m_dZoomWinRatio;
|
||||
Double m_dZoomFactor;
|
||||
double m_dZoomWinRatio;
|
||||
double m_dZoomFactor;
|
||||
|
||||
QPixmap m_pixmap;
|
||||
QBitmap m_mask;
|
||||
@@ -165,13 +170,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,7 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -24,32 +25,31 @@
|
||||
* in KTikZ project
|
||||
*/
|
||||
|
||||
#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( ":/images/playuver-backgroud-logo.png" )
|
||||
.scaled( QSize( 500, 350 ), Qt::KeepAspectRatio );
|
||||
QPixmap logo = QPixmap( ":logos/calyp-logo.png" ).scaledToWidth( 200, Qt::SmoothTransformation );
|
||||
QLabel* pixmapLabel = new QLabel;
|
||||
pixmapLabel->setPixmap( logo );
|
||||
|
||||
QLabel* label =
|
||||
new QLabel( QString( "<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 );
|
||||
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 );
|
||||
|
||||
QString featuresList = QStringLiteral( "<p><b>Features:</b><ul>" );
|
||||
QString featuresList = QStringLiteral( "<p><h4><b>Features:</b></h4><ul>" );
|
||||
|
||||
#ifdef USE_QTDBUS
|
||||
featuresList.append( QStringLiteral( "<li>Support for Qt DBus messages" ) );
|
||||
@@ -61,18 +61,23 @@ AboutDialog::AboutDialog( QWidget* parent ) : QDialog( parent )
|
||||
featuresList.append( QStringLiteral( "<li>Support for OpenCV" ) );
|
||||
#endif
|
||||
featuresList.append( QStringLiteral( "</ul></p>" ) );
|
||||
|
||||
QLabel* labelFeatures = new QLabel( featuresList );
|
||||
|
||||
QLabel* labelCopyright =
|
||||
new QLabel( QStringLiteral( "Copyright © 2014–2017 Luis Lucas and Joao Carreira" ) );
|
||||
QString thanksList = QStringLiteral( "<p><h4><b>Thanks to:</b></h4><ul>" );
|
||||
thanksList.append( QStringLiteral( "<li>Joao Santos" ) );
|
||||
thanksList.append( QStringLiteral( "<li>Jose Filipe" ) );
|
||||
thanksList.append( QStringLiteral( "</ul></p>" ) );
|
||||
QLabel* labelContributors = new QLabel( thanksList );
|
||||
|
||||
QLabel* labelCopyright = new QLabel( QStringLiteral( "Copyright 2014–2021 Joao Carreira and Luis Lucas" ) );
|
||||
|
||||
QWidget* topWidget = new QWidget;
|
||||
QVBoxLayout* topLayout = new QVBoxLayout;
|
||||
topLayout->addWidget( pixmapLabel );
|
||||
topLayout->addWidget( pixmapLabel, 0, Qt::AlignHCenter );
|
||||
topLayout->addWidget( label );
|
||||
topLayout->addWidget( labelFeatures );
|
||||
topLayout->addWidget( labelCopyright );
|
||||
topLayout->addWidget( labelFeatures );
|
||||
topLayout->addWidget( labelContributors );
|
||||
topWidget->setLayout( topLayout );
|
||||
|
||||
// QTextEdit *textEdit = new QTextEdit(tr("<p>This program is free "
|
||||
@@ -96,4 +101,7 @@ AboutDialog::AboutDialog( QWidget* parent ) : QDialog( 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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -22,6 +22,8 @@
|
||||
* \brief Dialog box to set the sequence resolution
|
||||
*/
|
||||
|
||||
#include "ConfigureFormatDialog.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDebug>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -35,17 +37,15 @@
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
|
||||
#include "ConfigureFormatDialog.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
#define MAX_SUPPORTED_RESOLUTION 99999
|
||||
|
||||
QDataStream& operator<<( QDataStream& out, const PlaYUVerStdResolutionVector& array )
|
||||
QDataStream& operator<<( QDataStream& out, const CalypStandardResolutionVector& array )
|
||||
{
|
||||
PlaYUVerStdResolution d;
|
||||
CalypStandardResolution 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 PlaYUVerStdResolutionVector& ar
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream& operator>>( QDataStream& in, PlaYUVerStdResolutionVector& array )
|
||||
QDataStream& operator>>( QDataStream& in, CalypStandardResolutionVector& array )
|
||||
{
|
||||
PlaYUVerStdResolution d;
|
||||
CalypStandardResolution 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,7 +73,8 @@ QDataStream& operator>>( QDataStream& in, PlaYUVerStdResolutionVector& 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" );
|
||||
@@ -117,9 +118,9 @@ public:
|
||||
connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
}
|
||||
|
||||
PlaYUVerStdResolution runDialog()
|
||||
CalypStandardResolution runDialog()
|
||||
{
|
||||
PlaYUVerStdResolution stdResolution;
|
||||
CalypStandardResolution stdResolution;
|
||||
stdResolution.shortName = "";
|
||||
if( exec() == QDialog::Accepted )
|
||||
{
|
||||
@@ -136,31 +137,29 @@ private:
|
||||
QSpinBox* m_spinHeight;
|
||||
};
|
||||
|
||||
ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( parent )
|
||||
ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent )
|
||||
: QDialog( parent )
|
||||
{
|
||||
QString Name;
|
||||
UInt uiWidth, uiHeight;
|
||||
unsigned int 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<PlaYUVerStdResolution> listPlaYUVerStdResolution =
|
||||
PlaYUVerStream::stdResolutionSizes();
|
||||
for( UInt i = 0; i < listPlaYUVerStdResolution.size(); i++ )
|
||||
std::vector<CalypStandardResolution> listCalypStdResolution = CalypStream::stdResolutionSizes();
|
||||
for( unsigned int i = 0; i < listCalypStdResolution.size(); i++ )
|
||||
{
|
||||
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 ) );
|
||||
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 ) );
|
||||
standardResolutionSizes.append( QSize( uiWidth, uiHeight ) );
|
||||
}
|
||||
|
||||
@@ -208,8 +207,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
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 );
|
||||
|
||||
@@ -285,21 +283,18 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
m_comboBoxPixelFormat->setFont( normalFont );
|
||||
m_comboBoxPixelFormat->clear();
|
||||
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedColorSpacesListNames().size(); i++ )
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedColorSpacesListNames().size(); i++ )
|
||||
{
|
||||
m_comboBoxColorSpace->insertItem( i,
|
||||
PlaYUVerFrame::supportedColorSpacesListNames()[i].c_str() );
|
||||
m_comboBoxColorSpace->insertItem( i, CalypFrame::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();
|
||||
@@ -311,8 +306,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
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 );
|
||||
|
||||
/*
|
||||
@@ -329,8 +323,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
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 );
|
||||
@@ -350,8 +343,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
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 );
|
||||
@@ -379,8 +371,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
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() ) );
|
||||
@@ -391,13 +382,8 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget* parent ) : QDialog( paren
|
||||
setFixedSize( MainLayout->sizeHint() );
|
||||
}
|
||||
|
||||
Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
|
||||
UInt& rWidth,
|
||||
UInt& rHeight,
|
||||
Int& rInputFormat,
|
||||
UInt& rBits,
|
||||
Int& rEndianess,
|
||||
UInt& rFrameRate )
|
||||
int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, unsigned int& rWidth, unsigned int& rHeight,
|
||||
int& rInputFormat, unsigned int& rBits, int& rEndianess, unsigned int& rFrameRate )
|
||||
{
|
||||
// Set default values
|
||||
// setWindowTitle( "Configure resolution for " + Filename );
|
||||
@@ -405,16 +391,16 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
|
||||
m_spinBoxWidth->setValue( rWidth );
|
||||
m_spinBoxheight->setValue( rHeight );
|
||||
|
||||
Int colorSpace = 0;
|
||||
Int sampling = 0;
|
||||
int colorSpace = 0;
|
||||
int sampling = 0;
|
||||
if( rInputFormat >= 0 )
|
||||
{
|
||||
String pelFmtName = PlaYUVerFrame::supportedPixelFormatListNames()[rInputFormat];
|
||||
for( UInt j = 0; j < PlaYUVerFrame::supportedColorSpacesListNames().size(); j++ )
|
||||
ClpString pelFmtName = CalypFrame::supportedPixelFormatListNames()[rInputFormat];
|
||||
for( unsigned int j = 0; j < CalypFrame::supportedColorSpacesListNames().size(); j++ )
|
||||
{
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames( j ).size(); i++ )
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedPixelFormatListNames( j ).size(); i++ )
|
||||
{
|
||||
if( pelFmtName == PlaYUVerFrame::supportedPixelFormatListNames( j )[i] )
|
||||
if( pelFmtName == CalypFrame::supportedPixelFormatListNames( j )[i] )
|
||||
{
|
||||
colorSpace = j;
|
||||
sampling = i;
|
||||
@@ -437,7 +423,7 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
|
||||
}
|
||||
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 ) )
|
||||
{
|
||||
@@ -456,10 +442,10 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
|
||||
rHeight = m_spinBoxheight->value();
|
||||
colorSpace = m_comboBoxColorSpace->currentIndex();
|
||||
sampling = m_comboBoxPixelFormat->currentIndex();
|
||||
String pelFmtName = PlaYUVerFrame::supportedPixelFormatListNames( colorSpace )[sampling];
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames().size(); i++ )
|
||||
ClpString pelFmtName = CalypFrame::supportedPixelFormatListNames( colorSpace )[sampling];
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedPixelFormatListNames().size(); i++ )
|
||||
{
|
||||
if( pelFmtName == PlaYUVerFrame::supportedPixelFormatListNames()[i] )
|
||||
if( pelFmtName == CalypFrame::supportedPixelFormatListNames()[i] )
|
||||
{
|
||||
rInputFormat = i;
|
||||
break;
|
||||
@@ -472,21 +458,19 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
|
||||
return QDialog::Accepted;
|
||||
}
|
||||
|
||||
void ConfigureFormatDialog::slotStandardResolutionSelected( Int idx )
|
||||
void ConfigureFormatDialog::slotStandardResolutionSelected( int idx )
|
||||
{
|
||||
if( idx == standardResolutionSizes.size() - 1 )
|
||||
{
|
||||
AddCustomFormat* pcCustomFmtDialog = new AddCustomFormat;
|
||||
PlaYUVerStdResolution customResolution = pcCustomFmtDialog->runDialog();
|
||||
CalypStandardResolution 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 );
|
||||
@@ -509,11 +493,10 @@ 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;
|
||||
@@ -523,21 +506,20 @@ void ConfigureFormatDialog::slotResolutionChange()
|
||||
m_comboBoxStandardResolution->blockSignals( false );
|
||||
}
|
||||
|
||||
Void ConfigureFormatDialog::slotColorSpaceChange( Int idx )
|
||||
void ConfigureFormatDialog::slotColorSpaceChange( int idx )
|
||||
{
|
||||
if( idx == -1 )
|
||||
return;
|
||||
|
||||
m_comboBoxPixelFormat->clear();
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames( idx ).size(); i++ )
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedPixelFormatListNames( idx ).size(); i++ )
|
||||
{
|
||||
m_comboBoxPixelFormat->insertItem(
|
||||
i, PlaYUVerFrame::supportedPixelFormatListNames( idx )[i].c_str() );
|
||||
m_comboBoxPixelFormat->insertItem( i, CalypFrame::supportedPixelFormatListNames( idx )[i].c_str() );
|
||||
}
|
||||
m_comboBoxPixelFormat->setCurrentIndex( 0 );
|
||||
}
|
||||
|
||||
Void ConfigureFormatDialog::slotBitsChange( Int idx )
|
||||
void ConfigureFormatDialog::slotBitsChange( int idx )
|
||||
{
|
||||
if( idx > 8 )
|
||||
{
|
||||
@@ -549,17 +531,17 @@ Void ConfigureFormatDialog::slotBitsChange( Int idx )
|
||||
}
|
||||
}
|
||||
|
||||
Void ConfigureFormatDialog::readSettings()
|
||||
void ConfigureFormatDialog::readSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
QVariant value = appSettings.value( "ConfigureFormatDialog/CustomFormats" );
|
||||
aRCustomFileFormats = value.value<PlaYUVerStdResolutionVector>();
|
||||
aRCustomFileFormats = value.value<CalypStandardResolutionVector>();
|
||||
}
|
||||
|
||||
Void ConfigureFormatDialog::writeSettings()
|
||||
void ConfigureFormatDialog::writeSettings()
|
||||
{
|
||||
QSettings appSettings;
|
||||
QVariant var;
|
||||
var.setValue<PlaYUVerStdResolutionVector>( aRCustomFileFormats );
|
||||
var.setValue<CalypStandardResolutionVector>( aRCustomFileFormats );
|
||||
appSettings.setValue( "ConfigureFormatDialog/CustomFormats", var );
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <QDialog>
|
||||
#include <QVector>
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include "CommonDefs.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class QComboBox;
|
||||
class QHBoxLayout;
|
||||
@@ -38,9 +38,9 @@ class QSpinBox;
|
||||
class QString;
|
||||
class QWidget;
|
||||
|
||||
typedef QVector<PlaYUVerStdResolution> PlaYUVerStdResolutionVector;
|
||||
QDataStream& operator<<( QDataStream& out, const PlaYUVerStdResolutionVector& array );
|
||||
QDataStream& operator>>( QDataStream& in, PlaYUVerStdResolutionVector& array );
|
||||
typedef QVector<CalypStandardResolution> CalypStandardResolutionVector;
|
||||
QDataStream& operator<<( QDataStream& out, const CalypStandardResolutionVector& array );
|
||||
QDataStream& operator>>( QDataStream& in, CalypStandardResolutionVector& array );
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -51,16 +51,11 @@ class ConfigureFormatDialog : public QDialog
|
||||
|
||||
public:
|
||||
ConfigureFormatDialog( QWidget* parent = 0 );
|
||||
Int runConfigureFormatDialog( const QString& Filename,
|
||||
UInt& rWidth,
|
||||
UInt& rHeight,
|
||||
Int& rInputFormat,
|
||||
UInt& rBits,
|
||||
Int& rEndianess,
|
||||
UInt& rFrameRate );
|
||||
int runConfigureFormatDialog( const QString& Filename, unsigned int& rWidth, unsigned int& rHeight, int& rInputFormat, unsigned int& rBits,
|
||||
int& rEndianess, unsigned int& rFrameRate );
|
||||
|
||||
Void readSettings();
|
||||
Void writeSettings();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotStandardResolutionSelected( int );
|
||||
@@ -71,7 +66,7 @@ private Q_SLOTS:
|
||||
private:
|
||||
QStringList standardResolutionNames;
|
||||
QVector<QSize> standardResolutionSizes;
|
||||
PlaYUVerStdResolutionVector aRCustomFileFormats;
|
||||
CalypStandardResolutionVector aRCustomFileFormats;
|
||||
|
||||
QLabel* m_labelFilename;
|
||||
QComboBox* m_comboBoxStandardResolution;
|
||||
@@ -86,7 +81,7 @@ private:
|
||||
QSpinBox* m_spinBoxFrameRate;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( PlaYUVerStdResolution );
|
||||
Q_DECLARE_METATYPE( PlaYUVerStdResolutionVector );
|
||||
Q_DECLARE_METATYPE( CalypStandardResolution )
|
||||
Q_DECLARE_METATYPE( CalypStandardResolutionVector )
|
||||
|
||||
#endif // __CONFIGUREFORMATDIALOG_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,12 +25,16 @@
|
||||
#include "ModulesHandleOptDialog.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
#include "lib/PlaYUVerOptions.h"
|
||||
#include "lib/CalypOptions.h"
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
class OpionConfiguration : public QWidget
|
||||
{
|
||||
@@ -40,7 +44,8 @@ public:
|
||||
m_pcChecked = NULL;
|
||||
m_cName = option->opt_string;
|
||||
m_pcDescription = new QLabel;
|
||||
m_pcDescription->setText( QString::fromStdString( option->opt_desc ) );
|
||||
QString desc = QString::fromStdString( option->opt_desc );
|
||||
m_pcDescription->setText( desc );
|
||||
QHBoxLayout* layout = new QHBoxLayout;
|
||||
layout->addWidget( m_pcDescription, 0, Qt::AlignLeft );
|
||||
if( !option->isBinary() )
|
||||
@@ -67,29 +72,26 @@ public:
|
||||
}
|
||||
return m_pcValue->text();
|
||||
}
|
||||
const String& getName() { return m_cName; }
|
||||
const ClpString& getName() { return m_cName; }
|
||||
|
||||
private:
|
||||
QLineEdit* m_pcValue;
|
||||
QCheckBox* m_pcChecked;
|
||||
QLabel* m_pcDescription;
|
||||
String m_cName;
|
||||
ClpString m_cName;
|
||||
};
|
||||
|
||||
ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent,
|
||||
PlaYUVerAppModuleIf* pcCurrModuleIf )
|
||||
ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent, CalypAppModuleIf* pcCurrModuleIf )
|
||||
: QDialog( parent ), m_pcCurrModuleIf( pcCurrModuleIf )
|
||||
{
|
||||
resize( 400, 10 );
|
||||
setWindowTitle( "Select module parameters" );
|
||||
|
||||
const PlaYUVerOptions::OptionsList& moduleOptions =
|
||||
m_pcCurrModuleIf->m_pcModule->m_cModuleOptions.getOptionList();
|
||||
const CalypOptions::OptionsList& moduleOptions = m_pcCurrModuleIf->m_pcModule->m_cModuleOptions.getOptionList();
|
||||
|
||||
QVBoxLayout* optionsLayout = new QVBoxLayout;
|
||||
OpionConfiguration* pcOption;
|
||||
for( PlaYUVerOptions::OptionsList::const_iterator it = moduleOptions.begin();
|
||||
it != moduleOptions.end(); ++it )
|
||||
for( CalypOptions::OptionsList::const_iterator it = moduleOptions.begin(); it != moduleOptions.end(); ++it )
|
||||
{
|
||||
pcOption = new OpionConfiguration( ( *it )->opt );
|
||||
m_apcOptionList.append( pcOption );
|
||||
@@ -112,18 +114,18 @@ ModulesHandleOptDialog::ModulesHandleOptDialog( QWidget* parent,
|
||||
connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
}
|
||||
|
||||
Int ModulesHandleOptDialog::runConfiguration()
|
||||
int ModulesHandleOptDialog::runConfiguration()
|
||||
{
|
||||
if( exec() == QDialog::Rejected )
|
||||
{
|
||||
return QDialog::Rejected;
|
||||
}
|
||||
|
||||
std::vector<String> argsArray;
|
||||
String optionString;
|
||||
std::vector<ClpString> argsArray;
|
||||
ClpString optionString;
|
||||
QString valueString( "" );
|
||||
|
||||
for( Int i = 0; i < m_apcOptionList.size(); i++ )
|
||||
for( int i = 0; i < m_apcOptionList.size(); i++ )
|
||||
{
|
||||
valueString = m_apcOptionList.at( i )->getValue();
|
||||
if( !valueString.isEmpty() )
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,12 +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 OpionConfiguration;
|
||||
|
||||
/**
|
||||
@@ -41,11 +42,11 @@ class ModulesHandleOptDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ModulesHandleOptDialog( QWidget* parent, PlaYUVerAppModuleIf* pcCurrModuleIf );
|
||||
Int runConfiguration();
|
||||
ModulesHandleOptDialog( QWidget* parent, CalypAppModuleIf* pcCurrModuleIf );
|
||||
int runConfiguration();
|
||||
|
||||
private:
|
||||
PlaYUVerAppModuleIf* m_pcCurrModuleIf;
|
||||
CalypAppModuleIf* m_pcCurrModuleIf;
|
||||
QVector<OpionConfiguration*> m_apcOptionList;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,13 +23,14 @@
|
||||
*/
|
||||
|
||||
#include "ProgressBar.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QLabel>
|
||||
#include <QProgressBar>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
ProgressBar::ProgressBar( QWidget* parent, UInt maxValue )
|
||||
ProgressBar::ProgressBar( QWidget* parent, unsigned long long int maxValue )
|
||||
: QWidget( parent ), m_uiTotalProgress( maxValue ), m_uiProgress( 0 )
|
||||
{
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout( this );
|
||||
@@ -50,7 +51,7 @@ ProgressBar::ProgressBar( QWidget* parent, UInt maxValue )
|
||||
show();
|
||||
}
|
||||
|
||||
Void ProgressBar::incrementProgress( UInt increment )
|
||||
void ProgressBar::incrementProgress( unsigned int increment )
|
||||
{
|
||||
m_uiProgress += increment;
|
||||
m_pcProgressBar->setValue( m_uiProgress );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,10 +25,11 @@
|
||||
#ifndef __PROGRESSBAR_H__
|
||||
#define __PROGRESSBAR_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include <QDialog>
|
||||
#include <QWidget>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
|
||||
class QProgressBar;
|
||||
|
||||
class ProgressBar : public QWidget
|
||||
@@ -36,13 +37,13 @@ class ProgressBar : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProgressBar( QWidget* parent, UInt maxValue );
|
||||
ProgressBar( QWidget* parent, unsigned long long int maxValue );
|
||||
|
||||
Void incrementProgress( UInt );
|
||||
void incrementProgress( unsigned int );
|
||||
|
||||
private:
|
||||
UInt m_uiTotalProgress;
|
||||
UInt m_uiProgress;
|
||||
unsigned int m_uiTotalProgress;
|
||||
unsigned int m_uiProgress;
|
||||
QProgressBar* m_pcProgressBar;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,14 +23,17 @@
|
||||
*/
|
||||
|
||||
#include "SeekStreamDialog.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QSpinBox>
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
|
||||
SeekStreamDialog::SeekStreamDialog( PlaYUVerStream* pcCurrStream, QWidget* parent )
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
SeekStreamDialog::SeekStreamDialog( CalypStream* pcCurrStream, QWidget* parent )
|
||||
: QDialog( parent, Qt::Dialog | Qt::WindowTitleHint ), m_iSelectedFrameNum()
|
||||
{
|
||||
m_iSelectedFrameNum = pcCurrStream->getCurrFrameNum();
|
||||
@@ -57,8 +60,7 @@ SeekStreamDialog::SeekStreamDialog( PlaYUVerStream* pcCurrStream, QWidget* paren
|
||||
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 );
|
||||
@@ -68,7 +70,7 @@ SeekStreamDialog::SeekStreamDialog( PlaYUVerStream* pcCurrStream, QWidget* paren
|
||||
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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,12 +25,15 @@
|
||||
#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;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -39,12 +42,12 @@ class SeekStreamDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SeekStreamDialog( PlaYUVerStream* pcCurrStream, QWidget* parent = 0 );
|
||||
Int runDialog();
|
||||
SeekStreamDialog( CalypStream* pcCurrStream, QWidget* parent = 0 );
|
||||
int runDialog();
|
||||
|
||||
private:
|
||||
QSpinBox* m_spinFrameNum;
|
||||
Int m_iSelectedFrameNum;
|
||||
int m_iSelectedFrameNum;
|
||||
};
|
||||
|
||||
#endif // __MODULEHANDLEOPTDIALOG_H__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -22,17 +22,16 @@
|
||||
* \brief Dialog box to select sub windows
|
||||
*/
|
||||
|
||||
#include "DialogSubWindowSelector.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "SubWindowSelectorDialog.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QGroupBox>
|
||||
|
||||
DialogSubWindowSelector::DialogSubWindowSelector( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager,
|
||||
UInt uiCategory,
|
||||
Int minWindowsSelected,
|
||||
Int maxWindowsSelected )
|
||||
#include "SubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
SubWindowSelectorDialog::SubWindowSelectorDialog( QWidget* parent, SubWindowHandle* windowManager,
|
||||
unsigned int uiCategory, int minWindowsSelected, int maxWindowsSelected )
|
||||
: QDialog( parent )
|
||||
, m_uiCategory( uiCategory )
|
||||
, m_iMinSelectedWindows( minWindowsSelected )
|
||||
@@ -87,7 +86,7 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget* parent,
|
||||
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();
|
||||
@@ -102,17 +101,17 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget* parent,
|
||||
setFixedSize( mainLayout->sizeHint() );
|
||||
}
|
||||
|
||||
Void DialogSubWindowSelector::updateSubWindowList()
|
||||
void SubWindowSelectorDialog::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 )
|
||||
@@ -122,7 +121,7 @@ Void DialogSubWindowSelector::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 )
|
||||
@@ -131,23 +130,23 @@ Void DialogSubWindowSelector::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 DialogSubWindowSelector::selectSubWindow( SubWindowAbstract* subWindow )
|
||||
void SubWindowSelectorDialog::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 DialogSubWindowSelector::update()
|
||||
void SubWindowSelectorDialog::update()
|
||||
{
|
||||
if( m_apcSelectedSubWindowList.size() > 0 )
|
||||
{
|
||||
@@ -179,7 +178,7 @@ Void DialogSubWindowSelector::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 ) ) )
|
||||
{
|
||||
@@ -193,7 +192,7 @@ Void DialogSubWindowSelector::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 );
|
||||
}
|
||||
@@ -204,9 +203,9 @@ Void DialogSubWindowSelector::update()
|
||||
|
||||
// ----------------------- Slot Functions -----------------------
|
||||
|
||||
Void DialogSubWindowSelector::toggleSubWindow( Int idx )
|
||||
void SubWindowSelectorDialog::toggleSubWindow( int idx )
|
||||
{
|
||||
Bool isChecked = m_apcWindowsListCheckBox.at( idx )->isChecked();
|
||||
bool isChecked = m_apcWindowsListCheckBox.at( idx )->isChecked();
|
||||
|
||||
if( isChecked )
|
||||
{
|
||||
@@ -219,19 +218,19 @@ Void DialogSubWindowSelector::toggleSubWindow( Int idx )
|
||||
update();
|
||||
}
|
||||
|
||||
Void DialogSubWindowSelector::addAllSubWindow()
|
||||
void SubWindowSelectorDialog::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 DialogSubWindowSelector::removeAllSubWindow()
|
||||
void SubWindowSelectorDialog::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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,48 +25,41 @@
|
||||
#ifndef __DIALOGSUBWINDOWSELECTOR_H__
|
||||
#define __DIALOGSUBWINDOWSELECTOR_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>
|
||||
#include <QtCore>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QPixmap;
|
||||
class QColor;
|
||||
class QCheckBox;
|
||||
class QGroupBox;
|
||||
|
||||
class PlaYUVerSubWindowHandle;
|
||||
class SubWindowHandle;
|
||||
class SubWindowAbstract;
|
||||
|
||||
/**
|
||||
* Class to define the dialog box to select sub windows
|
||||
* This class enable the selection of several group of windows
|
||||
*/
|
||||
class DialogSubWindowSelector : public QDialog
|
||||
class SubWindowSelectorDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DialogSubWindowSelector( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager,
|
||||
UInt uiCategory,
|
||||
Int minWindowsSelected = 1,
|
||||
Int maxWindowsSelected = -1 );
|
||||
SubWindowSelectorDialog( QWidget* parent, SubWindowHandle* windowManager, unsigned int uiCategory,
|
||||
int minWindowsSelected = 1, int maxWindowsSelected = -1 );
|
||||
|
||||
Void selectSubWindow( SubWindowAbstract* subWindow );
|
||||
void selectSubWindow( SubWindowAbstract* subWindow );
|
||||
QList<SubWindowAbstract*> getSelectedWindows() { return m_apcSelectedSubWindowList; }
|
||||
|
||||
private:
|
||||
UInt m_uiCategory;
|
||||
Int m_iMinSelectedWindows;
|
||||
Int m_iMaxSlectedWindows;
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
unsigned int m_uiCategory;
|
||||
int m_iMinSelectedWindows;
|
||||
int m_iMaxSlectedWindows;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
|
||||
QList<SubWindowAbstract*> m_apcSubWindowList;
|
||||
QList<SubWindowAbstract*> m_apcSelectedSubWindowList;
|
||||
@@ -80,8 +73,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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,16 +23,17 @@
|
||||
*/
|
||||
|
||||
#include "FramePropertiesDock.h"
|
||||
|
||||
#include <QtDebug>
|
||||
#include <QtGui>
|
||||
#include <cmath>
|
||||
|
||||
FramePropertiesDock::FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch )
|
||||
: QWidget( parent ), m_pbIsPlaying( pbMainPlaySwitch )
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitch )
|
||||
: QWidget( parent ), m_bIsPlaying( false ), m_bHasFrame( false )
|
||||
{
|
||||
// -------------- Variables definition --------------
|
||||
m_pcFrame = NULL;
|
||||
m_pcSelectedFrame = NULL;
|
||||
m_iLastFrameType = -1;
|
||||
|
||||
// Histogram area -----------------------------------------------------
|
||||
@@ -41,27 +42,25 @@ 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" ) );
|
||||
@@ -93,11 +92,10 @@ 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" ) );
|
||||
@@ -134,9 +132,8 @@ 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 );
|
||||
@@ -149,26 +146,24 @@ 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 );
|
||||
|
||||
@@ -189,6 +184,11 @@ 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,12 +204,17 @@ 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 );
|
||||
@@ -217,21 +222,22 @@ 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, 5, 0 );
|
||||
// statisticsLayout->addWidget( labelPercentileValue, 5, 1 );
|
||||
statisticsLayout->addWidget( entropyLabel, gridRow, 0 );
|
||||
statisticsLayout->addWidget( labelEntropyValue, gridRow++, 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 );
|
||||
|
||||
@@ -240,21 +246,16 @@ 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()
|
||||
@@ -275,18 +276,14 @@ QSize FramePropertiesDock::sizeHint() const
|
||||
return currSize;
|
||||
}
|
||||
|
||||
Void FramePropertiesDock::reset()
|
||||
void FramePropertiesDock::reset()
|
||||
{
|
||||
m_pcFrame = NULL;
|
||||
m_bHasFrame = false;
|
||||
m_cSelectionArea = QRect();
|
||||
if( m_pcSelectedFrame )
|
||||
{
|
||||
delete m_pcSelectedFrame;
|
||||
m_pcSelectedFrame = NULL;
|
||||
}
|
||||
|
||||
m_iLastFrameType = -1;
|
||||
|
||||
labelNEBinsValue->clear();
|
||||
labelMeanValue->clear();
|
||||
labelPixelsValue->clear();
|
||||
labelStdDevValue->clear();
|
||||
@@ -300,100 +297,100 @@ Void FramePropertiesDock::reset()
|
||||
setEnabled( false );
|
||||
}
|
||||
|
||||
Void FramePropertiesDock::setFrame( PlaYUVerFrame* pcFrame )
|
||||
void FramePropertiesDock::setFrame( CalypFrame* pcFrame, bool isPlaying )
|
||||
{
|
||||
Int colorSpace = pcFrame->getColorSpace();
|
||||
int colorSpace = pcFrame->getColorSpace();
|
||||
if( m_iLastFrameType != colorSpace )
|
||||
{
|
||||
m_iLastFrameType = colorSpace;
|
||||
if( colorSpace == PlaYUVerPixel::COLOR_RGB || colorSpace == PlaYUVerPixel::COLOR_ARGB )
|
||||
if( colorSpace == CLP_COLOR_RGB || colorSpace == CLP_COLOR_RGBA )
|
||||
{
|
||||
channelCB->clear();
|
||||
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-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->insertItem( AlphaChannel, QIcon( ":/images/channel-alpha.png" ), "Alpha" );
|
||||
channelCB->addItem( QIcon( ":/images/channel-alpha.png" ), "Alpha", CalypFrame::HIST_COLOR_A );
|
||||
}
|
||||
channelCB->insertItem( ColorChannels, QIcon( ":/images/channel-all.png" ), "Colors" );
|
||||
channelCB->addItem( QIcon( ":/images/channel-all.png" ), "Colors", CalypFrame::HIST_ALL_CHANNELS );
|
||||
|
||||
colorsCB->clear();
|
||||
colorsCB->addItem( "Red" );
|
||||
colorsCB->addItem( "Green" );
|
||||
colorsCB->addItem( "Blue" );
|
||||
colorsCB->addItem( "Red", CalypFrame::HIST_COLOR_R );
|
||||
colorsCB->addItem( "Green", CalypFrame::HIST_COLOR_G );
|
||||
colorsCB->addItem( "Blue", CalypFrame::HIST_COLOR_B );
|
||||
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 == PlaYUVerPixel::COLOR_YUV )
|
||||
else if( colorSpace == CLP_COLOR_YUV )
|
||||
{
|
||||
channelCB->clear();
|
||||
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" );
|
||||
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 );
|
||||
|
||||
colorsCB->clear();
|
||||
colorsCB->addItem( "Luminance" );
|
||||
colorsCB->addItem( "Chroma U" );
|
||||
colorsCB->addItem( "Chroma V" );
|
||||
colorsCB->addItem( "Luminance", CalypFrame::HIST_LUMA );
|
||||
colorsCB->addItem( "Chroma U", CalypFrame::HIST_CHROMA_U );
|
||||
colorsCB->addItem( "Chroma V", CalypFrame::HIST_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( tr( "Luminance" ) );
|
||||
channelCB->setItemIcon( 0, QIcon( ":/images/channel-luma.png" ) );
|
||||
channelCB->addItem( QIcon( ":/images/channel-luma.png" ), "Luminance", CalypFrame::HIST_LUMA );
|
||||
colorsCB->hide();
|
||||
colorsLabel->hide();
|
||||
}
|
||||
}
|
||||
setEnabled( true );
|
||||
if( m_pcFrame || !( *m_pbIsPlaying ) )
|
||||
m_bIsPlaying = isPlaying;
|
||||
if( !m_bIsPlaying )
|
||||
{
|
||||
m_pcFrame = pcFrame;
|
||||
updateDataHistogram();
|
||||
if( pcFrame )
|
||||
{
|
||||
m_bHasFrame = true;
|
||||
m_cFrame = CalypFrame( pcFrame );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bHasFrame = false;
|
||||
}
|
||||
}
|
||||
updateDataHistogram();
|
||||
}
|
||||
|
||||
Void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
{
|
||||
if( m_pcFrame )
|
||||
if( m_bHasFrame )
|
||||
{
|
||||
Bool bSelectionChanged = !( selectionArea.size() == m_cSelectionArea.size() );
|
||||
m_cSelectionArea = selectionArea;
|
||||
bool bSelectionChanged = !( selectionArea.size() == m_cSelectionArea.size() );
|
||||
if( selectionArea.isValid() )
|
||||
{
|
||||
m_cSelectionArea = selectionArea;
|
||||
histogramWidget->stopHistogramComputation();
|
||||
|
||||
/*
|
||||
* Allocate a new image for the selection
|
||||
* or just copy information
|
||||
* Crop selection from frame
|
||||
*/
|
||||
if( bSelectionChanged )
|
||||
{
|
||||
if( m_pcSelectedFrame )
|
||||
{
|
||||
delete m_pcSelectedFrame;
|
||||
}
|
||||
m_pcSelectedFrame = new PlaYUVerFrame( m_pcFrame, selectionArea.x(), selectionArea.y(),
|
||||
selectionArea.width(), selectionArea.height() );
|
||||
m_cSelectedFrame = CalypFrame( m_cFrame, selectionArea.x(), selectionArea.y(), selectionArea.width(),
|
||||
selectionArea.height() );
|
||||
}
|
||||
updateDataHistogram();
|
||||
selectionImageButton->click();
|
||||
@@ -408,15 +405,15 @@ Void FramePropertiesDock::setSelection( const QRect& selectionArea )
|
||||
}
|
||||
}
|
||||
|
||||
Void FramePropertiesDock::updateDataHistogram()
|
||||
void FramePropertiesDock::updateDataHistogram()
|
||||
{
|
||||
if( m_pcFrame && isVisible() )
|
||||
if( m_bHasFrame && isVisible() )
|
||||
{
|
||||
if( !*m_pbIsPlaying )
|
||||
if( !m_bIsPlaying )
|
||||
{
|
||||
if( m_pcSelectedFrame )
|
||||
if( m_cSelectionArea.isValid() )
|
||||
{
|
||||
m_pcSelectedFrame->copyFrom( m_pcFrame, m_cSelectionArea.x(), m_cSelectionArea.y() );
|
||||
m_cSelectedFrame = CalypFrame( m_cFrame, m_cSelectionArea.x(), m_cSelectionArea.y(), m_cSelectionArea.width(), m_cSelectionArea.height() );
|
||||
fullImageButton->show();
|
||||
selectionImageButton->show();
|
||||
}
|
||||
@@ -425,7 +422,7 @@ Void FramePropertiesDock::updateDataHistogram()
|
||||
fullImageButton->hide();
|
||||
selectionImageButton->hide();
|
||||
}
|
||||
histogramWidget->updateData( m_pcFrame, m_pcSelectedFrame );
|
||||
histogramWidget->updateData( &m_cFrame, m_cSelectionArea.isValid() ? &m_cSelectedFrame : nullptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -440,18 +437,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 == HistogramWidget::ColorChannelsHistogram )
|
||||
channel = colorsCB->currentIndex();
|
||||
if( channel == CalypFrame::HIST_ALL_CHANNELS )
|
||||
channel = colorsCB->itemData( colorsCB->currentIndex() ).toInt();
|
||||
|
||||
PlaYUVerFrame* frame;
|
||||
CalypFrame* frame;
|
||||
|
||||
if( histogramWidget->m_renderingType == HistogramWidget::FullImageHistogram )
|
||||
frame = histogramWidget->m_fullImage;
|
||||
@@ -460,8 +457,11 @@ Void FramePropertiesDock::updateStatistiques()
|
||||
|
||||
if( frame )
|
||||
{
|
||||
QString rangeText = "[" + QString::number( frame->getMin( channel ) ) + ":" +
|
||||
QString::number( frame->getMax( channel ) ) + "]";
|
||||
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 ) ) + "]";
|
||||
labelRangeValue->setText( rangeText );
|
||||
|
||||
double mean = frame->getMean( channel, min, max );
|
||||
@@ -473,18 +473,21 @@ Void FramePropertiesDock::updateStatistiques()
|
||||
double stddev = frame->getStdDev( channel, min, max );
|
||||
labelStdDevValue->setText( value.setNum( stddev, 'f', 1 ) );
|
||||
|
||||
double counts = frame->getCount( channel, min, max );
|
||||
double counts = frame->getNumPixelsRange( channel, min, max );
|
||||
labelCountValue->setText( value.setNum( (float)counts, 'f', 0 ) );
|
||||
|
||||
double median = frame->getMedian( channel, min, max );
|
||||
labelMedianValue->setText( value.setNum( median, 'f', 1 ) );
|
||||
labelMedianValue->setText( value.setNum( median, 'f', 0 ) );
|
||||
|
||||
double entropy = frame->getEntropy( channel, min, max );
|
||||
labelEntropyValue->setText( value.setNum( entropy, 'f', 2 ) );
|
||||
|
||||
double percentile = ( pixels > 0 ? ( 100.0 * counts / pixels ) : 0.0 );
|
||||
labelPercentileValue->setText( value.setNum( percentile, 'f', 1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
Void FramePropertiesDock::stopHistogram()
|
||||
void FramePropertiesDock::stopHistogram()
|
||||
{
|
||||
histogramWidget->stopHistogramComputation();
|
||||
}
|
||||
@@ -493,7 +496,7 @@ Void FramePropertiesDock::stopHistogram()
|
||||
// SLOTS
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void FramePropertiesDock::slotRefreshOptions( int range )
|
||||
void FramePropertiesDock::slotRefreshOptions( int range )
|
||||
{
|
||||
if( !isVisible() )
|
||||
return;
|
||||
@@ -516,127 +519,90 @@ Void FramePropertiesDock::slotRefreshOptions( int range )
|
||||
}
|
||||
}
|
||||
|
||||
Void FramePropertiesDock::slotHistogramComputationFailed()
|
||||
void FramePropertiesDock::slotHistogramComputationFailed()
|
||||
{
|
||||
m_pcFrame = NULL;
|
||||
m_bHasFrame = false;
|
||||
}
|
||||
|
||||
Void FramePropertiesDock::slotChannelChanged( Int channel )
|
||||
void FramePropertiesDock::slotChannelChanged( int index )
|
||||
{
|
||||
if( m_pcFrame->getColorSpace() == PlaYUVerPixel::COLOR_YUV )
|
||||
channel += 1;
|
||||
if( channel == AlphaChannel && m_pcFrame->getColorSpace() != PlaYUVerPixel::COLOR_ARGB )
|
||||
channel = ColorChannels;
|
||||
int channel = channelCB->itemData( index ).toInt();
|
||||
|
||||
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;
|
||||
histogramWidget->m_channelType = channel;
|
||||
if( channel == CalypFrame::HIST_ALL_CHANNELS )
|
||||
colorsCB->setEnabled( true );
|
||||
break;
|
||||
default: // Luminance.
|
||||
// histogramWidget->m_channelType = HistogramWidget::LumaHistogram;
|
||||
histogramWidget->m_channelType = HistogramWidget::FirstChannelHistogram;
|
||||
else
|
||||
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 color )
|
||||
void FramePropertiesDock::slotColorsChanged( int index )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
int color = colorsCB->itemData( index ).toInt();
|
||||
histogramWidget->m_colorType = color;
|
||||
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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,55 +25,35 @@
|
||||
#ifndef __FRAMEPROPERTIESDOCK_H__
|
||||
#define __FRAMEPROPERTIESDOCK_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#endif
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "HistogramWidget.h"
|
||||
#include "lib/PlaYUVerFrame.h"
|
||||
#include "lib/PlaYUVerStream.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
|
||||
class CalypStream;
|
||||
|
||||
class FramePropertiesDock : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FramePropertiesDock( QWidget* parent, Bool* pbMainPlaySwitch );
|
||||
FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitch );
|
||||
~FramePropertiesDock();
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
Void setFrame( PlaYUVerFrame* m_pcFrame );
|
||||
Void setSelection( const QRect& selectionArea );
|
||||
Void reset();
|
||||
Void stopHistogram();
|
||||
void setFrame( CalypFrame* m_pcFrame, bool isPlaying );
|
||||
void setSelection( const QRect& selectionArea );
|
||||
void reset();
|
||||
void stopHistogram();
|
||||
|
||||
private:
|
||||
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;
|
||||
CalypFrame m_cFrame;
|
||||
CalypFrame m_cSelectedFrame;
|
||||
int m_iLastFrameType;
|
||||
bool m_bIsPlaying;
|
||||
bool m_bHasFrame;
|
||||
|
||||
QComboBox* channelCB;
|
||||
QComboBox* colorsCB;
|
||||
@@ -87,15 +67,17 @@ 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;
|
||||
@@ -104,21 +86,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 channel );
|
||||
void slotChannelChanged( int index );
|
||||
void slotScaleChanged( int scale );
|
||||
void slotColorsChanged( int color );
|
||||
void slotColorsChanged( int index );
|
||||
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__
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,17 +23,22 @@
|
||||
*/
|
||||
|
||||
#include "ModuleHandleDock.h"
|
||||
#include "ModulesHandle.h"
|
||||
#include "PlaYUVerAppModuleIf.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QtGui>
|
||||
|
||||
ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf )
|
||||
#include "CalypAppModuleIf.h"
|
||||
#include "ModulesHandle.h"
|
||||
|
||||
ModuleHandleDock::ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf )
|
||||
: QWidget( parent ), m_pcCurrModuleIf( moduleIf )
|
||||
{
|
||||
// ----------------- Dock definition -----------------
|
||||
|
||||
QString labelStr;
|
||||
labelStr.append( moduleIf->m_pcModule->m_pchModuleName );
|
||||
labelStr.append( moduleIf->m_pcModule->getModuleLongName() );
|
||||
labelStr.append( " Result:" );
|
||||
labelModulueValueLabel = new QLabel( labelStr );
|
||||
labelModulueValueLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||
@@ -42,7 +47,7 @@ ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* module
|
||||
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++;
|
||||
@@ -55,18 +60,18 @@ ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* module
|
||||
|
||||
ModuleHandleDock::~ModuleHandleDock() {}
|
||||
|
||||
Void ModuleHandleDock::setModulueReturnValue( 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 && m_pcCurrModuleIf )
|
||||
{
|
||||
PlaYUVerAppModuleIf* pcCurrentModule = m_pcCurrModuleIf;
|
||||
CalypAppModuleIf* pcCurrentModule = m_pcCurrModuleIf;
|
||||
m_pcCurrModuleIf = NULL;
|
||||
ModulesHandle::destroyModuleIf( pcCurrentModule );
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,32 +25,31 @@
|
||||
#ifndef __MODULEHANDLEDOCK_H__
|
||||
#define __MODULEHANDLEDOCK_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.h"
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QSize>
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#endif
|
||||
|
||||
class PlaYUVerAppModuleIf;
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QLabel;
|
||||
|
||||
class CalypAppModuleIf;
|
||||
|
||||
class ModuleHandleDock : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* moduleIf );
|
||||
ModuleHandleDock( QWidget* parent, CalypAppModuleIf* moduleIf );
|
||||
~ModuleHandleDock();
|
||||
|
||||
Void setModulueReturnValue( Double value );
|
||||
void setModulueReturnValue( double value );
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
private:
|
||||
PlaYUVerAppModuleIf* m_pcCurrModuleIf;
|
||||
CalypAppModuleIf* m_pcCurrModuleIf;
|
||||
|
||||
Bool m_bIsVisible;
|
||||
bool m_bIsVisible;
|
||||
QLabel* labelModulueValueLabel;
|
||||
QLabel* labelModulueReturnValue;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,12 +23,13 @@
|
||||
*/
|
||||
|
||||
#include "QualityMeasurementSidebar.h"
|
||||
#include "PlaYUVerSubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent,
|
||||
PlaYUVerSubWindowHandle* windowManager )
|
||||
#include "SubWindowHandle.h"
|
||||
#include "VideoSubWindow.h"
|
||||
|
||||
QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, SubWindowHandle* windowManager )
|
||||
: QWidget( parent ), m_pcMainWindowManager( windowManager ), m_pcCurrentVideoSubWindow( NULL )
|
||||
{
|
||||
// Side bar area -----------------------------------------------------
|
||||
@@ -43,9 +44,9 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent,
|
||||
RecLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
|
||||
|
||||
m_comboBoxMetric = new QComboBox;
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
for( unsigned int i = 0; i < CalypFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
m_comboBoxMetric->insertItem( i, PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
m_comboBoxMetric->insertItem( i, CalypFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
}
|
||||
m_comboBoxMetric->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
||||
m_comboBoxMetric->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||
@@ -63,35 +64,34 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent,
|
||||
mainLayout->addWidget( RefLabel, 1, 0, Qt::AlignLeft );
|
||||
mainLayout->addWidget( m_comboBoxRef, 1, 1, 1, 2, Qt::AlignLeft );
|
||||
|
||||
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_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[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_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_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 );
|
||||
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 );
|
||||
|
||||
QGridLayout* qualityResultsLayout = new QGridLayout;
|
||||
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 );
|
||||
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 );
|
||||
|
||||
// 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,8 +99,7 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent,
|
||||
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() {}
|
||||
@@ -115,23 +114,22 @@ 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 )
|
||||
@@ -140,8 +138,7 @@ Void QualityMeasurementSidebar::updateSubWindowList()
|
||||
}
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt(
|
||||
pcVideoSubWindow->getCurrFrame() ) )
|
||||
if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt( pcVideoSubWindow->getCurrFrame() ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -157,19 +154,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 );
|
||||
@@ -180,7 +177,7 @@ Void QualityMeasurementSidebar::updateCurrentWindow( VideoSubWindow* subWindow )
|
||||
}
|
||||
}
|
||||
|
||||
Void QualityMeasurementSidebar::updateSidebarData()
|
||||
void QualityMeasurementSidebar::updateSidebarData()
|
||||
{
|
||||
QString zeroValue( "0.0000" );
|
||||
if( m_pcCurrentVideoSubWindow )
|
||||
@@ -188,11 +185,13 @@ Void QualityMeasurementSidebar::updateSidebarData()
|
||||
VideoSubWindow* refSubWindow = m_pcCurrentVideoSubWindow->getRefSubWindow();
|
||||
if( refSubWindow )
|
||||
{
|
||||
PlaYUVerFrame* currFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
PlaYUVerFrame* refFrame = refSubWindow->getCurrFrame();
|
||||
Double quality;
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
|
||||
CalypFrame* currFrame = m_pcCurrentVideoSubWindow->getCurrFrame();
|
||||
CalypFrame* refFrame = refSubWindow->getCurrFrame();
|
||||
double quality;
|
||||
QString value;
|
||||
UInt component = 0;
|
||||
unsigned int component = 0;
|
||||
for( ; component < currFrame->getNumberChannels(); component++ )
|
||||
{
|
||||
quality = currFrame->getQuality( m_comboBoxMetric->currentIndex(), refFrame, component );
|
||||
@@ -200,9 +199,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
|
||||
@@ -210,23 +209,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( 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" );
|
||||
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" );
|
||||
updateSidebarData();
|
||||
}
|
||||
|
||||
Void QualityMeasurementSidebar::slotReferenceChanged( Int index )
|
||||
void QualityMeasurementSidebar::slotReferenceChanged( int index )
|
||||
{
|
||||
if( index > -1 && m_pcCurrentVideoSubWindow )
|
||||
{
|
||||
@@ -248,7 +247,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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,39 +25,35 @@
|
||||
#ifndef __QUALITYMEASUREMENTSIDEBAR_H__
|
||||
#define __QUALITYMEASUREMENTSIDEBAR_H__
|
||||
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "config.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 PlaYUVerSubWindowHandle;
|
||||
#include "CommonDefs.h"
|
||||
#include "HistogramWidget.h"
|
||||
#include "config.h"
|
||||
#include "lib/CalypFrame.h"
|
||||
#include "lib/CalypStream.h"
|
||||
|
||||
class SubWindowHandle;
|
||||
class VideoSubWindow;
|
||||
|
||||
class QualityMeasurementSidebar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QualityMeasurementSidebar( QWidget*, PlaYUVerSubWindowHandle* );
|
||||
QualityMeasurementSidebar( QWidget*, SubWindowHandle* );
|
||||
~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:
|
||||
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
|
||||
SubWindowHandle* m_pcMainWindowManager;
|
||||
|
||||
QVector<VideoSubWindow*> m_pcVideoWindowList;
|
||||
QStringList m_pcWindowListNames;
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# 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
+12
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# CMakeLists for qcustomplot
|
||||
#
|
||||
|
||||
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport)
|
||||
|
||||
SET(qcustomplot_SRCS qcustomplot.cpp qcustomplot.h)
|
||||
|
||||
ADD_LIBRARY(QCustomPlotLib STATIC ${qcustomplot_SRCS})
|
||||
TARGET_LINK_LIBRARIES(QCustomPlotLib Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport)
|
||||
|
||||
TARGET_INCLUDE_DIRECTORIES(QCustomPlotLib PUBLIC .)
|
||||
+674
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
+611
@@ -0,0 +1,611 @@
|
||||
#### 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
+65
-61
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -22,15 +22,16 @@
|
||||
* \brief main file
|
||||
*/
|
||||
|
||||
#include "CommonDefs.h"
|
||||
#include "ConfigureFormatDialog.h"
|
||||
#include "PlaYUVerApp.h"
|
||||
#include "PlaYUVerAppDefs.h"
|
||||
#include "MainWindow.h"
|
||||
#include "VideoSubWindow.h"
|
||||
#include "config.h"
|
||||
#include <QApplication>
|
||||
#ifdef USE_QTDBUS
|
||||
#include "PlaYUVerAppAdaptor.h"
|
||||
#include "DBusAppAdaptor.h"
|
||||
#endif
|
||||
#include <QApplication>
|
||||
#include <QStyleFactory>
|
||||
#ifdef USE_FERVOR
|
||||
#include "fvupdater.h"
|
||||
#endif
|
||||
@@ -41,29 +42,32 @@
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
qRegisterMetaType<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStreamInfoVector>();
|
||||
qRegisterMetaType<PlaYUVerStdResolutionVector>();
|
||||
qRegisterMetaTypeStreamOperators<PlaYUVerStdResolutionVector>();
|
||||
qRegisterMetaType<CalypFileInfoVector>();
|
||||
qRegisterMetaTypeStreamOperators<CalypFileInfoVector>();
|
||||
qRegisterMetaType<CalypStandardResolutionVector>();
|
||||
qRegisterMetaTypeStreamOperators<CalypStandardResolutionVector>();
|
||||
|
||||
QApplication application( argc, argv );
|
||||
QApplication::setApplicationName( "PlaYUVer" );
|
||||
QApplication::setApplicationVersion( PLAYUVER_VERSION_STRING );
|
||||
QApplication::setOrganizationName( "PixLRA" );
|
||||
QApplication::setApplicationName( QStringLiteral( "Calyp" ) );
|
||||
QApplication::setApplicationVersion( QStringLiteral( CALYP_VERSION_STRING ) );
|
||||
QApplication::setOrganizationName( QStringLiteral( "PixLRA" ) );
|
||||
|
||||
#if _WIN32
|
||||
application.setStyle( QStyleFactory::create( "Fusion" ) );
|
||||
#endif
|
||||
|
||||
#ifdef USE_QTDBUS
|
||||
/**
|
||||
* use dbus, if available
|
||||
* allows for resuse of running Kate instances
|
||||
* allows for resuse of running Calyp 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( QString( argv[i] ) ).absoluteFilePath() );
|
||||
filenameList.append( QFileInfo( QLatin1String( argv[i] ) ).absoluteFilePath() );
|
||||
}
|
||||
if( filenameList.isEmpty() )
|
||||
{
|
||||
@@ -74,65 +78,66 @@ int main( int argc, char* argv[] )
|
||||
bool foundRunningService = false;
|
||||
if( !force_new )
|
||||
{
|
||||
QDBusReply<bool> there =
|
||||
sessionBusInterface->isServiceRegistered( PLAYUVER_DBUS_SESSION_NAME );
|
||||
QDBusReply<bool> there = sessionBusinterface->isServiceRegistered( QStringLiteral( CALYP_DBUS_SESSION_NAME ) );
|
||||
foundRunningService = there.isValid() && there.value();
|
||||
}
|
||||
|
||||
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 )
|
||||
if( foundRunningService )
|
||||
{
|
||||
qInfo() << "Found running instance... Re-using";
|
||||
|
||||
// open given session
|
||||
QDBusMessage m = QDBusMessage::createMethodCall(
|
||||
PLAYUVER_DBUS_SESSION_NAME, QStringLiteral( PLAYUVER_DBUS_PATH ),
|
||||
QStringLiteral( PLAYUVER_DBUS_SESSION_NAME ), QStringLiteral( "loadFile" ) );
|
||||
QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( CALYP_DBUS_PATH ),
|
||||
QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( "activate" ) );
|
||||
|
||||
QList<QVariant> dbusargs;
|
||||
dbusargs.append( file );
|
||||
m.setArguments( dbusargs );
|
||||
QDBusConnection::sessionBus().call( m );
|
||||
|
||||
QDBusMessage res = QDBusConnection::sessionBus().call( m );
|
||||
if( res.type() == QDBusMessage::ReplyMessage )
|
||||
// only block, if files to open there....
|
||||
bool needToBlock = false;
|
||||
|
||||
QStringList tokens;
|
||||
|
||||
// open given files...
|
||||
foreach( const QString& file, filenameList )
|
||||
{
|
||||
if( res.arguments().count() == 1 )
|
||||
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 )
|
||||
{
|
||||
QVariant v = res.arguments()[0];
|
||||
if( v.isValid() )
|
||||
if( res.arguments().count() == 1 )
|
||||
{
|
||||
QString s = v.toString();
|
||||
if( ( !s.isEmpty() ) && ( s != QStringLiteral( "ERROR" ) ) )
|
||||
QVariant v = res.arguments()[0];
|
||||
if( v.isValid() )
|
||||
{
|
||||
tokens << s;
|
||||
QString s = v.toString();
|
||||
if( ( !s.isEmpty() ) && ( s != QStringLiteral( "ERROR" ) ) )
|
||||
{
|
||||
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 playuver instance!
|
||||
* if we arrive here, we need to start a new calyp instance!
|
||||
*/
|
||||
QDBusConnection::sessionBus().registerService( PLAYUVER_DBUS_SESSION_NAME );
|
||||
QDBusConnection::sessionBus().registerService( QStringLiteral( CALYP_DBUS_SESSION_NAME ) );
|
||||
#endif
|
||||
PlaYUVerApp mainwindow;
|
||||
MainWindow mainwindow;
|
||||
mainwindow.show();
|
||||
if( mainwindow.parseArgs( argc, argv ) )
|
||||
{
|
||||
@@ -140,9 +145,8 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
|
||||
#ifdef USE_FERVOR
|
||||
FvUpdater::sharedUpdater()->SetFeedURL(
|
||||
"http://192.168.96.201/share/PlaYUVerProject/"
|
||||
"PlaYUVerUpdate-" UPDATE_CHANNEL ".xml" );
|
||||
FvUpdater::sharedUpdater()->SetFeedURL( "http://192.168.96.201/share/CalypProject/"
|
||||
"CalypUpdate-" UPDATE_CHANNEL ".xml" );
|
||||
FvUpdater::sharedUpdater()->SetDependencies( "ALL" );
|
||||
#endif
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 125 KiB |
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env xdg-open
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=PlaYUVer
|
||||
Exec=playuver %U
|
||||
Icon=playuver
|
||||
Name=Calyp
|
||||
Exec=calyp %U
|
||||
Icon=calyp
|
||||
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.
Binary file not shown.
|
After Width: | Height: | Size: 91 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
@@ -1,22 +1,22 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<file alias="images/playuver.png">playuver.png</file>
|
||||
<file alias="images/playuver-backgroud-logo.png">playuver-background-logo.png</file>
|
||||
<file alias="logos/calyp-logo.png">calyp-logo.png</file>
|
||||
<file alias="logos/calyp-icon.png">calyp.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 "calyp.ico"
|
||||
File renamed without changes.
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 170 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 106 KiB |
@@ -1 +0,0 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "playuver.ico"
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -22,16 +22,14 @@
|
||||
* \brief Frame number widget
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <QtCore>
|
||||
#if( QT_VERSION_PLAYUVER == 5 )
|
||||
#include <QtWidgets>
|
||||
#elif( QT_VERSION_PLAYUVER == 4 )
|
||||
#include <QtGui>
|
||||
#endif
|
||||
#include "WidgetFrameNumber.h"
|
||||
#include "FrameNumberWidget.h"
|
||||
|
||||
WidgetFrameNumber::WidgetFrameNumber( QWidget* parent ) : QWidget( parent )
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
|
||||
FrameNumberWidget::FrameNumberWidget( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
QHBoxLayout* mainlayout = new QHBoxLayout;
|
||||
m_pcCurrFrameNumLabel = new QLabel;
|
||||
@@ -51,15 +49,15 @@ WidgetFrameNumber::WidgetFrameNumber( QWidget* parent ) : QWidget( parent )
|
||||
mainlayout->addWidget( m_pcTotalFrameNumLabel );
|
||||
setLayout( mainlayout );
|
||||
}
|
||||
Void WidgetFrameNumber::setCurrFrameNum( Int number )
|
||||
void FrameNumberWidget::setCurrFrameNum( int number )
|
||||
{
|
||||
m_pcCurrFrameNumLabel->setText( QString( tr( "%1" ) ).arg( number ) );
|
||||
}
|
||||
Void WidgetFrameNumber::setTotalFrameNum( Int number )
|
||||
void FrameNumberWidget::setTotalFrameNum( int number )
|
||||
{
|
||||
m_pcTotalFrameNumLabel->setText( QString( tr( "%1" ) ).arg( number ) );
|
||||
}
|
||||
Void WidgetFrameNumber::clear()
|
||||
void FrameNumberWidget::clear()
|
||||
{
|
||||
m_pcCurrFrameNumLabel->setText( "-" );
|
||||
m_pcTotalFrameNumLabel->setText( "-" );
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,22 +25,20 @@
|
||||
#ifndef __WIDGETFRAMENUMBER_H__
|
||||
#define __WIDGETFRAMENUMBER_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 <QWidget>
|
||||
|
||||
class WidgetFrameNumber : public QWidget
|
||||
#include "CommonDefs.h"
|
||||
#include "config.h"
|
||||
|
||||
class QLabel;
|
||||
|
||||
class FrameNumberWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
WidgetFrameNumber( QWidget* parent = 0 );
|
||||
Void setCurrFrameNum( Int number );
|
||||
Void setTotalFrameNum( Int number );
|
||||
Void clear();
|
||||
FrameNumberWidget( QWidget* parent = 0 );
|
||||
void setCurrFrameNum( int number );
|
||||
void setTotalFrameNum( int number );
|
||||
void clear();
|
||||
|
||||
private:
|
||||
QLabel* m_pcCurrFrameNumLabel;
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,17 +25,23 @@
|
||||
|
||||
// TODO:
|
||||
// - Optimizar paintEvent. Parece haver codigo redundante !!
|
||||
|
||||
#include "HistogramWidget.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QtDebug>
|
||||
#include <QtGui>
|
||||
#include <cmath>
|
||||
|
||||
class HistogramWorker : public QThread
|
||||
{
|
||||
private:
|
||||
QObject* m_parent;
|
||||
PlaYUVerFrame* m_pcFrame;
|
||||
CalypFrame* m_pcFrame;
|
||||
|
||||
public:
|
||||
HistogramWorker( QObject* parent )
|
||||
@@ -44,27 +50,20 @@ public:
|
||||
m_parent = parent;
|
||||
}
|
||||
|
||||
Void setup( PlaYUVerFrame* frame )
|
||||
void setup( CalypFrame* frame )
|
||||
{
|
||||
m_pcFrame = frame;
|
||||
run();
|
||||
//run();
|
||||
start();
|
||||
}
|
||||
Void 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->starting = false;
|
||||
// eventData->success = m_pcFrame->getHasHistogram();
|
||||
eventData->success = true;
|
||||
eventData->frame = m_pcFrame;
|
||||
QCoreApplication::postEvent( m_parent, eventData );
|
||||
@@ -72,12 +71,13 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom Event
|
||||
*/
|
||||
* Custom Event
|
||||
*/
|
||||
class EventData : public QEvent
|
||||
{
|
||||
public:
|
||||
EventData() : QEvent( QEvent::User )
|
||||
EventData()
|
||||
: QEvent( QEvent::User )
|
||||
{
|
||||
starting = false;
|
||||
success = false;
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
bool starting;
|
||||
bool success;
|
||||
PlaYUVerFrame* frame;
|
||||
CalypFrame* frame;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -134,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;
|
||||
@@ -165,20 +165,19 @@ 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 = LumaHistogram;
|
||||
m_channelType = FirstChannelHistogram;
|
||||
m_channelType = CalypFrame::HIST_LUMA;
|
||||
m_scaleType = LogScaleHistogram;
|
||||
m_colorType = FirstChannelColor;
|
||||
m_colorType = -1;
|
||||
m_renderingType = FullImageHistogram;
|
||||
|
||||
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode |
|
||||
HistogramWidget::ShowLumaChannel );
|
||||
setOptions( HistogramWidget::BlinkComputation | HistogramWidget::SelectMode | HistogramWidget::ShowLumaChannel );
|
||||
|
||||
setMouseTracking( true );
|
||||
setMinimumSize( width, height );
|
||||
@@ -203,12 +202,6 @@ HistogramWidget::~HistogramWidget()
|
||||
{
|
||||
d->blinkTimer->stop();
|
||||
|
||||
// if( m_imageHistogram )
|
||||
// delete m_imageHistogram;
|
||||
//
|
||||
// if( m_selectionHistogram )
|
||||
// delete m_selectionHistogram;
|
||||
|
||||
delete m_imageWorker;
|
||||
delete m_selectionWorker;
|
||||
|
||||
@@ -218,7 +211,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 );
|
||||
@@ -226,14 +219,14 @@ 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;
|
||||
@@ -247,7 +240,7 @@ Void HistogramWidget::reset()
|
||||
// Custom Event Handler
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void HistogramWidget::customEvent( QEvent* event )
|
||||
void HistogramWidget::customEvent( QEvent* event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
@@ -299,7 +292,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 );
|
||||
|
||||
@@ -319,16 +312,6 @@ 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();
|
||||
}
|
||||
}
|
||||
@@ -339,7 +322,7 @@ Void HistogramWidget::customEvent( QEvent* event )
|
||||
// Data Loading Functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void HistogramWidget::setDataLoading()
|
||||
void HistogramWidget::setDataLoading()
|
||||
{
|
||||
if( d->clearFlag != HistogramWidgetPrivate::HistogramDataLoading )
|
||||
{
|
||||
@@ -353,7 +336,7 @@ Void HistogramWidget::setDataLoading()
|
||||
}
|
||||
}
|
||||
|
||||
Void HistogramWidget::setLoadingSkipped()
|
||||
void HistogramWidget::setLoadingSkipped()
|
||||
{
|
||||
d->clearFlag = HistogramWidgetPrivate::HistogramSkipped;
|
||||
d->blinkTimer->stop();
|
||||
@@ -362,7 +345,7 @@ Void HistogramWidget::setLoadingSkipped()
|
||||
unsetCursor();
|
||||
}
|
||||
|
||||
Void HistogramWidget::setLoadingFailed()
|
||||
void HistogramWidget::setLoadingFailed()
|
||||
{
|
||||
d->clearFlag = HistogramWidgetPrivate::HistogramFailed;
|
||||
d->blinkTimer->stop();
|
||||
@@ -373,7 +356,7 @@ Void HistogramWidget::setLoadingFailed()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void HistogramWidget::stopHistogramComputation()
|
||||
void HistogramWidget::stopHistogramComputation()
|
||||
{
|
||||
// if( m_imageHistogram )
|
||||
// m_imageHistogram->setRunningFlag( false );
|
||||
@@ -388,17 +371,29 @@ Void HistogramWidget::stopHistogramComputation()
|
||||
// Update Data Methods
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void HistogramWidget::updateData( PlaYUVerFrame* pcFrame, PlaYUVerFrame* pcFrameSelection )
|
||||
void HistogramWidget::updateData( CalypFrame* pcFrame, CalypFrame* pcFrameSelection )
|
||||
{
|
||||
d->imageBits = pcFrame->getBitsPel();
|
||||
d->imageColorSpace = pcFrame->getColorSpace();
|
||||
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->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 PlaYUVerFrameStatistics::getHistogramSegment()
|
||||
// Do not using CalypFrameStatistics::getHistogramSegment()
|
||||
// method here because histogram hasn't yet been computed.
|
||||
|
||||
d->range = ( 1 << d->imageBits ) - 1;
|
||||
@@ -413,7 +408,7 @@ Void HistogramWidget::updateData( PlaYUVerFrame* pcFrame, PlaYUVerFrame* pcFrame
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void HistogramWidget::slotBlinkTimerDone()
|
||||
void HistogramWidget::slotBlinkTimerDone()
|
||||
{
|
||||
d->blinkFlag = !d->blinkFlag;
|
||||
d->inInitialRepaintWait = false;
|
||||
@@ -425,7 +420,7 @@ Void HistogramWidget::slotBlinkTimerDone()
|
||||
// Paint Event
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
{
|
||||
int maxX = size().width() - 1;
|
||||
int maxY = size().height() - 1;
|
||||
@@ -440,8 +435,7 @@ 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;
|
||||
@@ -463,8 +457,7 @@ 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;
|
||||
}
|
||||
@@ -496,7 +489,7 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
int wWidth = width() - 1;
|
||||
int wHeight = height() - 1;
|
||||
double max;
|
||||
PlaYUVerFrame* frame;
|
||||
CalypFrame* frame;
|
||||
|
||||
if( m_renderingType == ImageSelectionHistogram && m_selectionImage )
|
||||
frame = m_selectionImage;
|
||||
@@ -513,35 +506,12 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
yb = 0;
|
||||
max = 0.0;
|
||||
|
||||
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;
|
||||
}
|
||||
max = frame->getMaximum( m_channelType );
|
||||
|
||||
switch( m_scaleType )
|
||||
{
|
||||
case HistogramWidget::LinScaleHistogram:
|
||||
break;
|
||||
|
||||
case HistogramWidget::LogScaleHistogram:
|
||||
if( max > 0.0 )
|
||||
max = log( max );
|
||||
@@ -552,9 +522,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.
|
||||
|
||||
@@ -564,8 +534,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->getHistogramSegment() ) / wWidth;
|
||||
j = ( ( x + 1 ) * frame->getHistogramSegment() ) / wWidth;
|
||||
i = ( x * frame->getNumHistogramSegment() ) / wWidth;
|
||||
j = ( ( x + 1 ) * frame->getNumHistogramSegment() ) / wWidth;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -577,37 +547,12 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
vg = 0.0;
|
||||
vb = 0.0;
|
||||
|
||||
switch( m_channelType )
|
||||
if( m_channelType == CalypFrame::HIST_ALL_CHANNELS )
|
||||
{
|
||||
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;
|
||||
}
|
||||
vr = frame->getHistogramValue( CalypFrame::HIST_CHAN_ONE, i );
|
||||
vg = frame->getHistogramValue( CalypFrame::HIST_CHAN_TWO, i );
|
||||
vb = frame->getHistogramValue( CalypFrame::HIST_CHAN_THREE, i );
|
||||
|
||||
if( m_channelType != HistogramWidget::ColorChannelsHistogram )
|
||||
{
|
||||
if( v > value )
|
||||
value = v;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( vr > value_r )
|
||||
value_r = vr;
|
||||
if( vg > value_g )
|
||||
@@ -615,9 +560,16 @@ 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 != HistogramWidget::ColorChannelsHistogram )
|
||||
if( m_channelType != CalypFrame::HIST_ALL_CHANNELS )
|
||||
{
|
||||
switch( m_scaleType )
|
||||
{
|
||||
@@ -668,7 +620,7 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
// Drawing the histogram + selection or only the histogram.
|
||||
|
||||
if( m_channelType != HistogramWidget::ColorChannelsHistogram )
|
||||
if( m_channelType != CalypFrame::HIST_ALL_CHANNELS )
|
||||
{
|
||||
if( d->selectMode == true ) // Selection mode enable ?
|
||||
{
|
||||
@@ -721,17 +673,23 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// colors channel mode?
|
||||
switch( m_colorType )
|
||||
{
|
||||
case HistogramWidget::FirstChannelColor:
|
||||
case CalypFrame::HIST_LUMA:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
break;
|
||||
|
||||
case HistogramWidget::SecondChannelColor:
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
break;
|
||||
|
||||
default:
|
||||
case CalypFrame::HIST_CHROMA_V:
|
||||
case CalypFrame::HIST_COLOR_B:
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
break;
|
||||
|
||||
default:
|
||||
Q_ASSERT( 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -740,12 +698,13 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// colors channel mode?
|
||||
switch( m_colorType )
|
||||
{
|
||||
case HistogramWidget::FirstChannelColor:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
case CalypFrame::HIST_LUMA:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -757,12 +716,13 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
break;
|
||||
|
||||
case HistogramWidget::SecondChannelColor:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -773,23 +733,25 @@ 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:
|
||||
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;
|
||||
Q_ASSERT( 0 );
|
||||
}
|
||||
|
||||
if( x == wWidth / 4 || x == wWidth / 2 || x == 3 * wWidth / 4 )
|
||||
@@ -805,15 +767,16 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
// colors channel mode?
|
||||
switch( m_colorType )
|
||||
{
|
||||
case HistogramWidget::FirstChannelColor:
|
||||
case CalypFrame::HIST_LUMA:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
p1.setPen( QPen( Qt::green, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][SecondChannelColor], 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][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( Qt::red, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][0], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yr );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -825,15 +788,16 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
break;
|
||||
|
||||
case HistogramWidget::SecondChannelColor:
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
p1.setPen( QPen( Qt::blue, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][ThirdChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][2], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yb );
|
||||
p1.setPen( QPen( Qt::red, 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][FirstChannelColor], 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][SecondChannelColor], 1, Qt::SolidLine ) );
|
||||
p1.setPen( QPen( g_eColorPallet[pallet][1], 1, Qt::SolidLine ) );
|
||||
p1.drawLine( x, wHeight, x, wHeight - yg );
|
||||
|
||||
p1.setPen( QPen( Qt::white, 1, Qt::SolidLine ) );
|
||||
@@ -845,25 +809,28 @@ 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:
|
||||
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;
|
||||
Q_ASSERT( 0 );
|
||||
}
|
||||
|
||||
if( x == wWidth / 4 || x == wWidth / 2 || x == 3 * wWidth / 4 )
|
||||
@@ -884,22 +851,23 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
{
|
||||
switch( m_channelType )
|
||||
{
|
||||
case HistogramWidget::FirstChannelHistogram:
|
||||
case CalypFrame::HIST_CHROMA_V:
|
||||
case CalypFrame::HIST_COLOR_R:
|
||||
guidePos = d->colorGuide.red();
|
||||
break;
|
||||
|
||||
case HistogramWidget::SecondChannelHistogram:
|
||||
case CalypFrame::HIST_COLOR_G:
|
||||
guidePos = d->colorGuide.green();
|
||||
break;
|
||||
|
||||
case HistogramWidget::ThirdChannelHistogram:
|
||||
case CalypFrame::HIST_CHROMA_U:
|
||||
case CalypFrame::HIST_COLOR_B:
|
||||
guidePos = d->colorGuide.blue();
|
||||
break;
|
||||
|
||||
// case HistogramWidget::LumaHistogram:
|
||||
// guidePos = qMax( qMax( d->colorGuide.red(), d->colorGuide.green()
|
||||
// ), d->colorGuide.blue() );
|
||||
// break;
|
||||
case CalypFrame::HIST_LUMA:
|
||||
guidePos = qMax( qMax( d->colorGuide.red(), d->colorGuide.green() ), d->colorGuide.blue() );
|
||||
break;
|
||||
|
||||
default: // Alpha.
|
||||
guidePos = -1;
|
||||
@@ -908,7 +876,7 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
|
||||
if( guidePos != -1 )
|
||||
{
|
||||
int xGuide = ( guidePos * wWidth ) / frame->getHistogramSegment();
|
||||
int xGuide = ( guidePos * wWidth ) / frame->getNumHistogramSegment();
|
||||
p1.drawLine( xGuide, 0, xGuide, wHeight );
|
||||
|
||||
QString string = tr( "x:%1" ).arg( guidePos );
|
||||
@@ -945,7 +913,7 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
|
||||
tipText = "<table cellspacing=0 cellpadding=0>";
|
||||
|
||||
tipText += cellBeg + tr( "Mean:" ) + cellMid;
|
||||
double mean = frame->getMean( m_channelType, 0, frame->getHistogramSegment() - 1 );
|
||||
double mean = frame->getMean( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
tipText += value.setNum( mean, 'f', 1 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Pixels:" ) + cellMid;
|
||||
@@ -953,16 +921,20 @@ 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->getHistogramSegment() - 1 );
|
||||
double stddev = frame->getStdDev( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
tipText += value.setNum( stddev, 'f', 1 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Selected:" ) + cellMid;
|
||||
double counts = frame->getCount( m_channelType, 0, frame->getHistogramSegment() - 1 );
|
||||
double counts = frame->getNumPixelsRange( m_channelType, 0, frame->getNumHistogramSegment() - 1 );
|
||||
tipText += value.setNum( (float)counts, 'f', 0 ) + cellEnd;
|
||||
|
||||
tipText += cellBeg + tr( "Median:" ) + cellMid;
|
||||
double median = frame->getMedian( m_channelType, 0, frame->getHistogramSegment() - 1 );
|
||||
tipText += value.setNum( median, 'f', 1 ) + cellEnd;
|
||||
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;
|
||||
|
||||
tipText += cellBeg + tr( "Percent:" ) + cellMid;
|
||||
double percentile = ( pixels > 0 ? ( 100.0 * counts / pixels ) : 0.0 );
|
||||
@@ -985,7 +957,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 )
|
||||
{
|
||||
@@ -1003,7 +975,7 @@ Void HistogramWidget::mousePressEvent( QMouseEvent* e )
|
||||
}
|
||||
}
|
||||
|
||||
Void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
|
||||
void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
|
||||
{
|
||||
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
|
||||
|
||||
@@ -1021,7 +993,7 @@ Void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
|
||||
}
|
||||
}
|
||||
|
||||
Void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
|
||||
void HistogramWidget::mouseMoveEvent( QMouseEvent* e )
|
||||
{
|
||||
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
|
||||
{
|
||||
@@ -1056,13 +1028,12 @@ 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 )
|
||||
{
|
||||
@@ -1080,7 +1051,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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -26,12 +26,13 @@
|
||||
#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;
|
||||
@@ -42,20 +43,6 @@ 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 */
|
||||
@@ -64,14 +51,6 @@ public:
|
||||
LogScaleHistogram
|
||||
};
|
||||
|
||||
enum HistogramAllColorMode
|
||||
{
|
||||
// Select wich component is shown in foreground
|
||||
FirstChannelColor,
|
||||
SecondChannelColor,
|
||||
ThirdChannelColor,
|
||||
};
|
||||
|
||||
enum HistogramRendering
|
||||
{
|
||||
/** Full image histogram rendering */
|
||||
@@ -103,46 +82,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( PlaYUVerFrame* pcFrame, PlaYUVerFrame* pcFrameSelection );
|
||||
void updateData( CalypFrame* pcFrame, CalypFrame* 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;
|
||||
// PlaYUVerFrameStats* m_imageHistogram;
|
||||
PlaYUVerFrame* m_fullImage;
|
||||
// CalypFrameStats* m_imageHistogram;
|
||||
CalypFrame* m_fullImage;
|
||||
/** Histogram area selection */
|
||||
HistogramWorker* m_selectionWorker;
|
||||
// PlaYUVerFrameStats* m_selectionHistogram;
|
||||
PlaYUVerFrame* m_selectionImage;
|
||||
// CalypFrameStats* m_selectionHistogram;
|
||||
CalypFrame* 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 );
|
||||
@@ -155,14 +134,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;
|
||||
+94
-102
@@ -1,147 +1,139 @@
|
||||
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
|
||||
# * Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
|
||||
#
|
||||
# Once done this will define
|
||||
# FFMPEG_FOUND - System has the all required components.
|
||||
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
|
||||
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
|
||||
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
|
||||
# Once done this will define FFMPEG_FOUND - System has the all required components. FFMPEG_INCLUDE_DIRS - Include directory necessary for
|
||||
# using the required components headers. FFMPEG_LIBRARIES - Link these to use the required ffmpeg components. FFMPEG_DEFINITIONS - Compiler
|
||||
# switches required for using the required ffmpeg components.
|
||||
#
|
||||
# For each of the components it will additionally set.
|
||||
# - AVCODEC
|
||||
# - AVDEVICE
|
||||
# - AVFORMAT
|
||||
# - AVUTIL
|
||||
# - POSTPROCESS
|
||||
# - SWSCALE
|
||||
# the following variables will be defined
|
||||
# <component>_FOUND - System has <component>
|
||||
# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
|
||||
# <component>_LIBRARIES - Link these to use <component>
|
||||
# <component>_DEFINITIONS - Compiler switches required for using <component>
|
||||
# <component>_VERSION - The components version
|
||||
# For each of the components it will additionally set. - AVCODEC - AVDEVICE - AVFORMAT - AVUTIL - POSTPROCESS - SWSCALE the following variables will
|
||||
# be defined <component>_FOUND - System has <component> <component>_INCLUDE_DIRS - Include directory necessary for using the <component>
|
||||
# headers <component>_LIBRARIES - Link these to use <component> <component>_DEFINITIONS - Compiler switches required for using <component>
|
||||
# <component>_VERSION - The components version
|
||||
#
|
||||
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
|
||||
# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
|
||||
# Copyright (c) 2011, Michael Jansen, <kde@michael-jansen.biz>
|
||||
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org> Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org> Copyright (c) 2011, Michael Jansen,
|
||||
# <kde@michael-jansen.biz>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license. For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
# The default components were taken from a survey over other FindFFMPEG.cmake files
|
||||
if (NOT FFmpeg_FIND_COMPONENTS)
|
||||
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
|
||||
endif ()
|
||||
IF(NOT FFmpeg_FIND_COMPONENTS)
|
||||
SET(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
|
||||
ENDIF()
|
||||
|
||||
#
|
||||
### Macro: set_component_found
|
||||
# Macro: set_component_found
|
||||
#
|
||||
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
|
||||
#
|
||||
macro(set_component_found _component )
|
||||
if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
|
||||
MACRO(set_component_found _component)
|
||||
IF(${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
|
||||
# message(STATUS " - ${_component} found.")
|
||||
set(${_component}_FOUND TRUE)
|
||||
else ()
|
||||
SET(${_component}_FOUND TRUE)
|
||||
ELSE()
|
||||
# message(STATUS " - ${_component} not found.")
|
||||
endif ()
|
||||
endmacro()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
#
|
||||
### Macro: find_component
|
||||
# Macro: find_component
|
||||
#
|
||||
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
|
||||
# include directories.
|
||||
# Checks for the given component by invoking pkgconfig and then looking up the libraries and include directories.
|
||||
#
|
||||
macro(find_component _component _pkgconfig _library _header)
|
||||
MACRO(find_component _component _pkgconfig _library _header)
|
||||
|
||||
if (NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_${_component} ${_pkgconfig})
|
||||
endif ()
|
||||
endif (NOT WIN32)
|
||||
IF(NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(PC_${_component} ${_pkgconfig})
|
||||
ENDIF()
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
find_path(${_component}_INCLUDE_DIRS ${_header}
|
||||
HINTS
|
||||
${PC_LIB${_component}_INCLUDEDIR}
|
||||
${PC_LIB${_component}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
ffmpeg
|
||||
FIND_PATH(
|
||||
${_component}_INCLUDE_DIRS ${_header}
|
||||
HINTS ${PC_LIB${_component}_INCLUDEDIR} ${PC_LIB${_component}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ffmpeg
|
||||
)
|
||||
|
||||
find_library(${_component}_LIBRARIES NAMES ${_library}
|
||||
HINTS
|
||||
${PC_LIB${_component}_LIBDIR}
|
||||
${PC_LIB${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
|
||||
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
|
||||
|
||||
set_component_found(${_component})
|
||||
|
||||
mark_as_advanced(
|
||||
${_component}_INCLUDE_DIRS
|
||||
FIND_LIBRARY(
|
||||
${_component}_LIBRARIES
|
||||
${_component}_DEFINITIONS
|
||||
${_component}_VERSION)
|
||||
NAMES ${_library}
|
||||
HINTS ${PC_LIB${_component}_LIBDIR} ${PC_LIB${_component}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
endmacro()
|
||||
SET(${_component}_DEFINITIONS
|
||||
${PC_${_component}_CFLAGS_OTHER}
|
||||
CACHE STRING "The ${_component} CFLAGS."
|
||||
)
|
||||
SET(${_component}_VERSION
|
||||
${PC_${_component}_VERSION}
|
||||
CACHE STRING "The ${_component} version number."
|
||||
)
|
||||
|
||||
SET_COMPONENT_FOUND(${_component})
|
||||
|
||||
MARK_AS_ADVANCED(${_component}_INCLUDE_DIRS ${_component}_LIBRARIES ${_component}_DEFINITIONS ${_component}_VERSION)
|
||||
|
||||
ENDMACRO()
|
||||
|
||||
# Check for cached results. If there are skip the costly part.
|
||||
if (NOT FFMPEG_LIBRARIES)
|
||||
IF(NOT FFMPEG_LIBRARIES)
|
||||
|
||||
# Check for all possible component.
|
||||
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
|
||||
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
|
||||
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
|
||||
find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
|
||||
FIND_COMPONENT(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||
FIND_COMPONENT(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||
FIND_COMPONENT(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
|
||||
FIND_COMPONENT(AVUTIL libavutil avutil libavutil/avutil.h)
|
||||
FIND_COMPONENT(SWSCALE libswscale swscale libswscale/swscale.h)
|
||||
FIND_COMPONENT(SWRESAMPLE libswresample swresample libswresample/swresample.h)
|
||||
FIND_COMPONENT(POSTPROC libpostproc postproc libpostproc/postprocess.h)
|
||||
|
||||
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
|
||||
foreach (_component ${FFmpeg_FIND_COMPONENTS})
|
||||
if (${_component}_FOUND)
|
||||
FOREACH(_component ${FFmpeg_FIND_COMPONENTS})
|
||||
IF(${_component}_FOUND)
|
||||
# message(STATUS "Required component ${_component} present.")
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
|
||||
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
|
||||
else ()
|
||||
SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
|
||||
SET(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
|
||||
LIST(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
|
||||
ELSE()
|
||||
# message(STATUS "Required component ${_component} missing.")
|
||||
endif ()
|
||||
endforeach ()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
# Build the include path with duplicates removed.
|
||||
if (FFMPEG_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
endif ()
|
||||
IF(FFMPEG_INCLUDE_DIRS)
|
||||
LIST(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
ENDIF()
|
||||
|
||||
# cache the vars.
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
|
||||
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
|
||||
SET(FFMPEG_INCLUDE_DIRS
|
||||
${FFMPEG_INCLUDE_DIRS}
|
||||
CACHE STRING "The FFmpeg include directories." FORCE
|
||||
)
|
||||
SET(FFMPEG_LIBRARIES
|
||||
${FFMPEG_LIBRARIES}
|
||||
CACHE STRING "The FFmpeg libraries." FORCE
|
||||
)
|
||||
SET(FFMPEG_DEFINITIONS
|
||||
${FFMPEG_DEFINITIONS}
|
||||
CACHE STRING "The FFmpeg cflags." FORCE
|
||||
)
|
||||
|
||||
mark_as_advanced(FFMPEG_INCLUDE_DIRS
|
||||
FFMPEG_LIBRARIES
|
||||
FFMPEG_DEFINITIONS)
|
||||
MARK_AS_ADVANCED(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS)
|
||||
|
||||
endif ()
|
||||
ENDIF()
|
||||
|
||||
# Now set the noncached _FOUND vars for the components.
|
||||
foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
|
||||
set_component_found(${_component})
|
||||
endforeach ()
|
||||
FOREACH(_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
|
||||
SET_COMPONENT_FOUND(${_component})
|
||||
ENDFOREACH()
|
||||
|
||||
# Compile the list of required vars
|
||||
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
|
||||
foreach (_component ${FFmpeg_FIND_COMPONENTS})
|
||||
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
|
||||
endforeach ()
|
||||
SET(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
|
||||
FOREACH(_component ${FFmpeg_FIND_COMPONENTS})
|
||||
LIST(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
|
||||
ENDFOREACH()
|
||||
|
||||
# Give a nice error message if some of the required vars are missing.
|
||||
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
|
||||
+54
-50
@@ -1,64 +1,68 @@
|
||||
|
||||
|
||||
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)
|
||||
# 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)
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
MACRO(ADD_MODULE_USE_OPENCV name file )
|
||||
IF( USE_OPENCV )
|
||||
SET( ADD_MODULE_USE_OPENCV_VERSION "2.4" )
|
||||
CMAKE_PARSE_ARGUMENTS(ADD_MODULE_USE_OPENCV "" "VERSION" "MODULES" ${ARGN} )
|
||||
IF( NOT ( ${OpenCV_VERSION} VERSION_LESS ${ADD_MODULE_USE_OPENCV_VERSION} ) )
|
||||
SET( _HAS_MODULES TRUE )
|
||||
FOREACH(opencv_module IN LISTS ADD_MODULE_USE_OPENCV_MODULES )
|
||||
string(TOUPPER "${opencv_module}" opencv_moduleUP)
|
||||
FIND_PACKAGE( OpenCV QUIET COMPONENTS ${opencv_module} )
|
||||
IF( NOT ${OPENCV_${opencv_moduleUP}_FOUND} EQUAL "1" )
|
||||
SET( _HAS_MODULES FALSE )
|
||||
# General function to add a module It receives the name of the module and the filename where it is defined. Moreover it receives a VERSION and MODULES
|
||||
# (OpenCV modules required) Used in modules/CMakeLists.txt
|
||||
MACRO(ADD_MODULE_USE_OPENCV name file)
|
||||
IF(USE_OPENCV)
|
||||
SET(ADD_MODULE_USE_OPENCV_VERSION "2.4")
|
||||
CMAKE_PARSE_ARGUMENTS(ADD_MODULE_USE_OPENCV "" "VERSION" "MODULES" ${ARGN})
|
||||
IF(NOT (${OpenCV_VERSION} VERSION_LESS ${ADD_MODULE_USE_OPENCV_VERSION}))
|
||||
SET(_HAS_MODULES TRUE)
|
||||
FOREACH(opencv_module IN LISTS ADD_MODULE_USE_OPENCV_MODULES)
|
||||
STRING(TOUPPER "${opencv_module}" opencv_moduleUP)
|
||||
FIND_PACKAGE(OpenCV QUIET COMPONENTS ${opencv_module})
|
||||
IF(NOT ${OPENCV_${opencv_moduleUP}_FOUND} EQUAL "1")
|
||||
SET(_HAS_MODULES FALSE)
|
||||
ELSE()
|
||||
LIST(APPEND OPENCV_MODULES ${opencv_module} )
|
||||
LIST(APPEND OPENCV_MODULES ${opencv_module})
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
IF( _HAS_MODULES )
|
||||
ADD_MODULE( ${name} ${file} )
|
||||
IF(_HAS_MODULES)
|
||||
ADD_MODULE(${name} ${file})
|
||||
ENDIF()
|
||||
UNSET( OPENCV_${opencv_moduleUP}_FOUND )
|
||||
UNSET( _HAS_MODULES )
|
||||
UNSET(OPENCV_${opencv_moduleUP}_FOUND)
|
||||
UNSET(_HAS_MODULES)
|
||||
ENDIF()
|
||||
UNSET( ADD_MODULE_USE_OPENCV_VERSION )
|
||||
UNSET(ADD_MODULE_USE_OPENCV_VERSION)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
#
|
||||
# Create header
|
||||
#
|
||||
MACRO(CREATE_MODULE_MACROS)
|
||||
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "// This files add the header files of each module\n"
|
||||
"#ifndef __MODULESLISTHEADER_H__\n#define __MODULESLISTHEADER_H__\n"
|
||||
)
|
||||
FOREACH(module ${MODULES_LIST_FILES})
|
||||
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${module}.h\"\n")
|
||||
ENDFOREACH(module ${MODULES_LIST_FILES})
|
||||
|
||||
MACRO(CREATE_MODULE_MACROS )
|
||||
|
||||
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "// This files add the header files of each module\n"
|
||||
|
||||
"#ifndef __MODULESLISTHEADER_H__\n#define __MODULESLISTHEADER_H__\n" )
|
||||
|
||||
foreach(module ${MODULES_LIST_FILES})
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${module}.h\"\n")
|
||||
endforeach(module ${MODULES_LIST_FILES})
|
||||
|
||||
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#define REGISTER_ALL_MODULES \\\n" )
|
||||
foreach(module ${MODULES_LIST_NAME})
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "Register( \"${module}\", &(${module}::Create) ); \\\n")
|
||||
endforeach(module ${MODULES_LIST_NAME})
|
||||
|
||||
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "\n#endif // __MODULESLISTHEADER_H__\n" )
|
||||
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")
|
||||
ENDMACRO()
|
||||
+68
-38
@@ -1,51 +1,81 @@
|
||||
#####################################################################################
|
||||
# ####################################################################################################################################################
|
||||
# DLLs and Win32 specific code
|
||||
######################################################################################
|
||||
# ####################################################################################################################################################
|
||||
|
||||
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
|
||||
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
|
||||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "." )
|
||||
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "." )
|
||||
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "." )
|
||||
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
|
||||
FOREACH(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
STRING(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ".")
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ".")
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ".")
|
||||
ENDFOREACH(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
|
||||
|
||||
SET(MSVC_DLL_DIR "MSVC_DLL_DIR" CACHE PATH "Where to find MSVC dlls")
|
||||
INSTALL(FILES ${MSVC_DLL_DIR}/msvcr120.dll DESTINATION bin )
|
||||
INSTALL(FILES ${MSVC_DLL_DIR}/msvcp120.dll DESTINATION bin )
|
||||
SET(MSVC_DLL_DIR
|
||||
"MSVC_DLL_DIR"
|
||||
CACHE PATH "Where to find MSVC dlls"
|
||||
)
|
||||
# INSTALL(FILES ${MSVC_DLL_DIR}/msvcr120.dll DESTINATION bin ) INSTALL(FILES ${MSVC_DLL_DIR}/msvcp120.dll DESTINATION bin )
|
||||
|
||||
SET(QT_DIR "QT-Dir" CACHE PATH "Where to find QT Lib on Windows")
|
||||
SET(QT_ICU_VERSION "" CACHE STRING "Qt ICU version of dll's" )
|
||||
SET(QT_DLL_POSTFIX "" CACHE STRING "Postfix to dll's name for debug" )
|
||||
SET(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} ${QT_DIR}" )
|
||||
SET(QT_DIR
|
||||
"QT-Dir"
|
||||
CACHE PATH "Where to find QT Lib on Windows"
|
||||
)
|
||||
SET(QT_ICU_VERSION
|
||||
""
|
||||
CACHE STRING "Qt ICU version of dll's"
|
||||
)
|
||||
SET(QT_DLL_POSTFIX
|
||||
""
|
||||
CACHE STRING "Postfix to dll's name for debug"
|
||||
)
|
||||
SET(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} ${QT_DIR}")
|
||||
|
||||
SET(WINDLLIB "Dl-location" CACHE PATH "Where to find DL Lib on Windows")
|
||||
SET(WINDLLIB
|
||||
"Dl-location"
|
||||
CACHE PATH "Where to find DL Lib on Windows"
|
||||
)
|
||||
|
||||
IF(NOT USE_QT4)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Core${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Gui${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Widgets${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5PrintSupport${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qwindows${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms)
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qminimal${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms)
|
||||
INSTALL(FILES ${QT_DIR}/plugins/platforms/qoffscreen${QT_DLL_POSTFIX}.dll DESTINATION bin/platforms)
|
||||
|
||||
IF( NOT USE_QT4 )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Core${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Gui${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Widgets${QT_DLL_POSTFIX}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${QT_DIR}/bin/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 )
|
||||
IF(USE_FERVOR)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Network${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5WebKit${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5WebKitWidgets${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Quick${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Qml${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Multimedia${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Sql${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Positioning${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5Sensors${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5MultimediaWidgets${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
INSTALL(FILES ${QT_DIR}/bin/Qt5OpenGL${QT_DLL_POSTFIX}.dll DESTINATION bin)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF( USE_OPENCV )
|
||||
SET(OpenCV_DLL_DIR "${OpenCV_DIR}/bin" CACHE PATH "Where to find OpenCV dlls")
|
||||
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 )
|
||||
IF(USE_OPENCV)
|
||||
SET(OpenCV_DLL_DIR
|
||||
"${OpenCV_DIR}/bin"
|
||||
CACHE PATH "Where to find OpenCV dlls"
|
||||
)
|
||||
SET(OpenCV_INSTALL_MODULES
|
||||
${OPENCV_MODULES}
|
||||
CACHE STRING "List of OpenCV modules"
|
||||
)
|
||||
FOREACH(opencv_module IN LISTS OpenCV_INSTALL_MODULES)
|
||||
INSTALL(FILES ${OpenCV_DLL_DIR}/opencv_${opencv_module}${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}.dll DESTINATION bin)
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
IF( USE_FFMPEG )
|
||||
SET(FFMPEG_DIR "FFmpeg-Dir" CACHE PATH "Where to find FFmpeg Lib on Windows")
|
||||
INSTALL(FILES ${FFMPEG_DIR}/bin/avcodec-${AVCODEC_VERSION}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${FFMPEG_DIR}/bin/avformat-${AVFORMAT_VERSION}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${FFMPEG_DIR}/bin/avutil-${AVUTIL_VERSION}.dll DESTINATION bin )
|
||||
INSTALL(FILES ${FFMPEG_DIR}/bin/swresample-1.dll DESTINATION bin )
|
||||
IF(USE_FFMPEG)
|
||||
SET(FFMPEG_DIR
|
||||
"FFmpeg-Dir"
|
||||
CACHE PATH "Where to find FFmpeg Lib on Windows"
|
||||
)
|
||||
INSTALL(DIRECTORY ${FFMPEG_DIR}/bin/ DESTINATION bin)
|
||||
ENDIF()
|
||||
+13
-25
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -17,37 +17,26 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* \file config.h.in
|
||||
* \brief definition of the building options
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CONFIG_PLAYUVER_H__
|
||||
#define __CONFIG_PLAYUVER_H__
|
||||
#ifndef __CONFIG_CALYP_H__
|
||||
#define __CONFIG_CALYP_H__
|
||||
|
||||
/* Version definition */
|
||||
#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 CALYP_VERSION_MAJOR @CALYP_VERSION_MAJOR @
|
||||
#define CALYP_VERSION_MINOR @CALYP_VERSION_MINOR @
|
||||
#define CALYP_VERSION_PATCH @CALYP_VERSION_PATCH @
|
||||
#define CALYP_VERSION @CALYP_VERSION @
|
||||
#define CALYP_VERSION_STRING "@CALYP_VERSION_STRING@"
|
||||
|
||||
#define UPDATE_CHANNEL "@UPDATE_CHANNEL@"
|
||||
|
||||
/* 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
|
||||
|
||||
@@ -55,7 +44,7 @@
|
||||
#cmakedefine USE_DYNLOAD
|
||||
|
||||
/* Use modules in a different thread */
|
||||
#cmakedefine PLAYUVER_THREADED_MODULES
|
||||
#cmakedefine CALYP_THREADED_MODULES
|
||||
|
||||
/* OpenCV */
|
||||
#cmakedefine USE_OPENCV
|
||||
@@ -66,5 +55,4 @@
|
||||
/* Fervor update lib */
|
||||
#cmakedefine USE_FERVOR
|
||||
|
||||
|
||||
#endif // __CONFIG_PLAYUVER_H__
|
||||
#endif // __CONFIG_CALYP_H__
|
||||
@@ -1,7 +1,6 @@
|
||||
###
|
||||
### CMakeLists for examples
|
||||
###
|
||||
|
||||
|
||||
ADD_SUBDIRECTORY( modules )
|
||||
#
|
||||
# CMakeLists for examples
|
||||
#
|
||||
|
||||
ADD_SUBDIRECTORY(modules)
|
||||
ADD_SUBDIRECTORY(stream)
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "AbsoluteFrameDifferenceExample.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
REGISTER_CLASS_MAKER( AbsoluteFrameDifferenceExample )
|
||||
@@ -30,46 +31,46 @@ REGISTER_CLASS_MAKER( AbsoluteFrameDifferenceExample )
|
||||
AbsoluteFrameDifferenceExample::AbsoluteFrameDifferenceExample()
|
||||
{
|
||||
/* Module Definition */
|
||||
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_iModuleAPI = CLP_MODULE_API_2; // Use API version 2 (recommended).
|
||||
// See this example for details on the functions prototype
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE; // 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 = CLP_MODULE_REQUIRES_NEW_WINDOW; // Module requirements (check CalypModulesIf.h).
|
||||
// Several requirements should be "or" between each others.
|
||||
m_pcFrameDifference = NULL;
|
||||
}
|
||||
|
||||
Bool AbsoluteFrameDifferenceExample::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
bool AbsoluteFrameDifferenceExample::create( std::vector<CalypFrame*> apcFrameList )
|
||||
{
|
||||
_BASIC_MODULE_API_2_CHECK_
|
||||
|
||||
for( UInt i = 1; i < apcFrameList.size(); i++ )
|
||||
if( !apcFrameList[i]->haveSameFmt( apcFrameList[0], PlaYUVerFrame::MATCH_COLOR_SPACE |
|
||||
PlaYUVerFrame::MATCH_RESOLUTION |
|
||||
PlaYUVerFrame::MATCH_BITS ) )
|
||||
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 ) )
|
||||
return false;
|
||||
|
||||
m_pcFrameDifference =
|
||||
new PlaYUVerFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), PlaYUVerFrame::GRAY );
|
||||
new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), CLP_GRAY );
|
||||
return true;
|
||||
}
|
||||
|
||||
PlaYUVerFrame* AbsoluteFrameDifferenceExample::process( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
CalypFrame* AbsoluteFrameDifferenceExample::process( std::vector<CalypFrame*> apcFrameList )
|
||||
{
|
||||
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;
|
||||
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;
|
||||
|
||||
for( UInt y = 0; y < m_pcFrameDifference->getHeight(); y++ )
|
||||
for( UInt x = 0; x < m_pcFrameDifference->getWidth(); x++ )
|
||||
for( unsigned int y = 0; y < m_pcFrameDifference->getHeight(); y++ )
|
||||
for( unsigned int x = 0; x < m_pcFrameDifference->getWidth(); x++ )
|
||||
{
|
||||
aux_pel_1 = *pInput1PelYUV++;
|
||||
aux_pel_2 = *pInput2PelYUV++;
|
||||
@@ -78,7 +79,7 @@ PlaYUVerFrame* AbsoluteFrameDifferenceExample::process( std::vector<PlaYUVerFram
|
||||
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 plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,23 +25,23 @@
|
||||
#ifndef __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
#define __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
|
||||
#include "PlaYUVerModuleIf.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
class AbsoluteFrameDifferenceExample : public PlaYUVerModuleIf
|
||||
#include "CalypModuleIf.h"
|
||||
|
||||
class AbsoluteFrameDifferenceExample : public CalypModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( AbsoluteFrameDifferenceExample )
|
||||
|
||||
private:
|
||||
PlaYUVerFrame* m_pcFrameDifference;
|
||||
private:
|
||||
CalypFrame* m_pcFrameDifference;
|
||||
|
||||
public:
|
||||
public:
|
||||
AbsoluteFrameDifferenceExample();
|
||||
virtual ~AbsoluteFrameDifferenceExample() {}
|
||||
Bool create( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
PlaYUVerFrame* process( std::vector<PlaYUVerFrame*> apcFrameList );
|
||||
Void destroy();
|
||||
bool create( std::vector<CalypFrame*> apcFrameList );
|
||||
CalypFrame* process( std::vector<CalypFrame*> apcFrameList );
|
||||
void destroy();
|
||||
};
|
||||
|
||||
#endif // __ABSOLUTEFRAMEDIFFERENCEEXAMPLE_H__
|
||||
@@ -1,19 +1,16 @@
|
||||
###
|
||||
### CMakeLists for modules_example
|
||||
###
|
||||
#
|
||||
# CMakeLists for modules_example
|
||||
#
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.9 )
|
||||
PROJECT("modules_example")
|
||||
|
||||
PROJECT( "modules_example" )
|
||||
|
||||
# FIND_PACKAGE( PlaYUVer )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${PLAYUVER_INCLUDE_DIRS} )
|
||||
# THIS FIND_PACKAGE( Calyp ) INCLUDE_DIRECTORIES( ${CALYP_INCLUDE_DIRS} ) OR
|
||||
INCLUDE_DIRECTORIES(../../lib)
|
||||
|
||||
ADD_LIBRARY(FrameBinarization SHARED FrameBinarization_APIv1.cpp)
|
||||
TARGET_LINK_LIBRARIES( FrameBinarization ${PLAYUVER_LINKER_LIBS} )
|
||||
TARGET_LINK_LIBRARIES(FrameBinarization ${PROJECT_LIBRARY})
|
||||
|
||||
ADD_LIBRARY(AbsoluteFrameDifferenceExample SHARED AbsoluteFrameDifferenceExample.cpp)
|
||||
TARGET_LINK_LIBRARIES( AbsoluteFrameDifferenceExample ${PLAYUVER_LINKER_LIBS} )
|
||||
|
||||
TARGET_LINK_LIBRARIES(AbsoluteFrameDifferenceExample ${PROJECT_LIBRARY})
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -29,12 +29,13 @@ REGISTER_CLASS_MAKER( FrameBinarization_APIv1 )
|
||||
FrameBinarization_APIv1::FrameBinarization_APIv1()
|
||||
{
|
||||
/* Module Definition */
|
||||
m_iModuleType = FRAME_PROCESSING_MODULE;
|
||||
m_iModuleType = CLP_FRAME_PROCESSING_MODULE;
|
||||
m_pchModuleCategory = "Utilities";
|
||||
m_pchModuleName = "FrameBinarization_APIv1";
|
||||
m_pchModuleLongName = "Frame Binarization API v1";
|
||||
m_pchModuleTooltip = "Binarize frame";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_OPTIONS;
|
||||
m_uiNumberOfFrames = 1;
|
||||
m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS;
|
||||
|
||||
m_cModuleOptions.addOptions() /**/
|
||||
( "threshold", m_uiThreshold, "Threshold level for binarization (0-255) [128]" );
|
||||
@@ -43,25 +44,25 @@ FrameBinarization_APIv1::FrameBinarization_APIv1()
|
||||
m_uiThreshold = 128;
|
||||
}
|
||||
|
||||
Void FrameBinarization_APIv1::create( PlaYUVerFrame* frame )
|
||||
void FrameBinarization_APIv1::create( CalypFrame* frame )
|
||||
{
|
||||
m_pcBinFrame = NULL;
|
||||
m_pcBinFrame = new PlaYUVerFrame( frame->getWidth(), frame->getHeight(), PlaYUVerFrame::GRAY, 8 );
|
||||
m_pcBinFrame = new CalypFrame( frame->getWidth(), frame->getHeight(), CLP_GRAY, 8 );
|
||||
}
|
||||
|
||||
PlaYUVerFrame* FrameBinarization_APIv1::process( PlaYUVerFrame* frame )
|
||||
CalypFrame* FrameBinarization_APIv1::process( CalypFrame* frame )
|
||||
{
|
||||
Pel* pPelInput = frame->getPelBufferYUV()[0][0];
|
||||
Pel* pPelBin = m_pcBinFrame->getPelBufferYUV()[0][0];
|
||||
for( UInt y = 0; y < frame->getHeight(); y++ )
|
||||
for( UInt x = 0; x < frame->getWidth(); x++ )
|
||||
const ClpPel* pPelInput = frame->getPelBufferYUV()[0][0];
|
||||
ClpPel* pPelBin = m_pcBinFrame->getPelBufferYUV()[0][0];
|
||||
for( unsigned int y = 0; y < frame->getHeight(); y++ )
|
||||
for( unsigned int x = 0; x < frame->getWidth(); x++ )
|
||||
{
|
||||
*pPelBin++ = *pPelInput++ >= m_uiThreshold ? 255 : 0;
|
||||
}
|
||||
return m_pcBinFrame;
|
||||
}
|
||||
|
||||
Void FrameBinarization_APIv1::destroy()
|
||||
void FrameBinarization_APIv1::destroy()
|
||||
{
|
||||
if( m_pcBinFrame )
|
||||
delete m_pcBinFrame;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* This file is a part of plaYUVer project
|
||||
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
|
||||
* Joao Carreira (jfmcarreira@gmail.com)
|
||||
/* 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
|
||||
@@ -25,22 +25,22 @@
|
||||
#ifndef __FRAMEBINARIZATION_APIV1_H__
|
||||
#define __FRAMEBINARIZATION_APIV1_H__
|
||||
|
||||
#include "PlaYUVerModuleIf.h"
|
||||
#include "CalypModuleIf.h"
|
||||
|
||||
class FrameBinarization_APIv1 : public PlaYUVerModuleIf
|
||||
class FrameBinarization_APIv1 : public CalypModuleIf
|
||||
{
|
||||
REGISTER_CLASS_FACTORY( FrameBinarization_APIv1 )
|
||||
|
||||
private:
|
||||
PlaYUVerFrame* m_pcBinFrame;
|
||||
UInt m_uiThreshold;
|
||||
private:
|
||||
CalypFrame* m_pcBinFrame;
|
||||
unsigned int m_uiThreshold;
|
||||
|
||||
public:
|
||||
FrameBinarization_APIv1();
|
||||
virtual ~FrameBinarization_APIv1() {}
|
||||
Void create( PlaYUVerFrame* );
|
||||
PlaYUVerFrame* process( PlaYUVerFrame* );
|
||||
Void destroy();
|
||||
public:
|
||||
FrameBinarization_APIv1();
|
||||
virtual ~FrameBinarization_APIv1() {}
|
||||
void create( CalypFrame* );
|
||||
CalypFrame* process( CalypFrame* );
|
||||
void destroy();
|
||||
};
|
||||
|
||||
#endif // __FRAMEBINARIZATION_APIV1_H__
|
||||
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# CMakeLists for modules_example
|
||||
#
|
||||
INCLUDE_DIRECTORIES(../../lib)
|
||||
|
||||
ADD_DEFINITIONS(-DCALYP_TEST_DATA_DIR=\"${CALYP_TEST_DATA_DIR}\")
|
||||
|
||||
ADD_EXECUTABLE(testStreamReading testStreamReading.cpp)
|
||||
TARGET_LINK_LIBRARIES(testStreamReading ${PROJECT_LIBRARY})
|
||||
@@ -0,0 +1,69 @@
|
||||
/* This file is a part of Calyp project
|
||||
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
|
||||
*
|
||||
* Luis Lucas (luisfrlucas@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file testStreamReading.cpp
|
||||
* \brief Example of open and reading from a stream
|
||||
*/
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
||||
#include "CalypFrame.h"
|
||||
#include "CalypStream.h"
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
// Use auto keyword to avoid typing long
|
||||
// type definitions to get the timepoint
|
||||
// at this instant use function now()
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
double n = 0;
|
||||
CalypStream stream;
|
||||
//stream.open( ClpString( CALYP_TEST_DATA_DIR ) + ClpString( "/Kendo_c4_1024x768_yuv420p.yuv" ), 1024, 768, 0, 8, CLP_BIG_ENDIAN, 1, true );
|
||||
stream.open( ClpString( CALYP_TEST_DATA_DIR ) + ClpString( "/SteamLocomotiveTrain_2560x1600_60_10bit_crop.yuv" ), 2560, 1600, 0, 10, CLP_LITTLE_ENDIAN, 1, true );
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
CalypFrame* frame = stream.getCurrFrame();
|
||||
frame->fillRGBBuffer();
|
||||
n++;
|
||||
if( stream.setNextFrame() )
|
||||
break;
|
||||
stream.readNextFrame();
|
||||
}
|
||||
|
||||
// After function call
|
||||
auto stop = std::chrono::high_resolution_clock::now();
|
||||
|
||||
// Subtract stop and start timepoints and
|
||||
// cast it to required unit. Predefined units
|
||||
// are nanoseconds, microseconds, milliseconds,
|
||||
// seconds, minutes, hours. Use duration_cast()
|
||||
// function.
|
||||
auto duration = std::chrono::duration_cast<std::chrono::microseconds>( stop - start );
|
||||
|
||||
// To get the value of duration use the count()
|
||||
// member function on the duration object
|
||||
std::cout << duration.count() / 1000.0 / n << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Executable
+127
@@ -0,0 +1,127 @@
|
||||
#!/bin/bash
|
||||
|
||||
export LC_ALL=en_GB.utf8
|
||||
export LANG=C
|
||||
CLANG_FORMAT="clang-format"
|
||||
MY_NAME="$(basename "$0")"
|
||||
|
||||
SET_VERBOSE=0
|
||||
ALL_FILES=0
|
||||
|
||||
function parsearguments() {
|
||||
local ARGS=$(getopt -o "h" -l "verbose,all,help" -n "${MY_NAME}" -- "$@")
|
||||
local PRINT_HELP=0
|
||||
|
||||
#Bad arguments
|
||||
if [ $? -ne 0 ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# A little magic
|
||||
eval set -- "$ARGS"
|
||||
|
||||
while true ; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
PRINT_HELP=1
|
||||
shift
|
||||
;;
|
||||
--verbose )
|
||||
SET_VERBOSE=1
|
||||
shift
|
||||
;;
|
||||
--all )
|
||||
ALL_FILES=1
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ${PRINT_HELP} -ne 0 ]] ; then
|
||||
echo "Usage: ${MY_NAME} [--all] [--verbose]" >&2
|
||||
echo "Format C++ source code and headers in a git-controlled directory structure." >&2
|
||||
echo >&2
|
||||
echo "Options:" >&2
|
||||
echo " --help" >&2
|
||||
echo " Show this help" >&2
|
||||
echo " --verbose" >&2
|
||||
echo " Show verbose (more) output" >&2
|
||||
echo " --all" >&2
|
||||
echo " Format all .cpp/.h files, not just those marked by git as added or modified">&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
parsearguments "$@"
|
||||
|
||||
git_branch=$(git status | head -1 | awk '{print $3}')
|
||||
|
||||
if [[ ${ALL_FILES} -eq 0 ]] ; then
|
||||
# Format only files seen by git as added or modified,
|
||||
# filter for .cpp or .h files.
|
||||
# Trying to handle filenames with spaces correctly (not tested)
|
||||
git status --untracked-files=no --porcelain | awk '/^\s*[AM]+\s+.*[.](cpp|h)$/ {for(i=2;i<NF;++i){printf $i" "};printf $NF"\n"}'
|
||||
else
|
||||
# Format all .cpp or .h files; using "find" to located those files
|
||||
# find . -type f -name '*.cpp' -o -name '*.h'
|
||||
git ls-tree -r $(git status | head -1 | awk '{print $3}') --name-only | grep "\.cpp\|\.h"
|
||||
fi | \
|
||||
# Sort files alphabetically, omit duplicates
|
||||
sort -u | \
|
||||
while read filename ; do
|
||||
if [[ ! -s "${filename}" ]] ; then
|
||||
echo "${MY_NAME}: File not found: \"${filename}\"" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ ! -z $( echo ${filename} | grep "\/external\/" ) ]]; then
|
||||
echo "${MY_NAME}: Skip external source: \"${filename}\"" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
TEMPFILE=$(mktemp -t 'calyp_formatted_source_XXXXXXXXXXX.cpp')
|
||||
|
||||
echo "Processing \"${filename}\""
|
||||
# astyle -n --align-reference=name --align-pointer=name --indent=spaces=4 --indent-labels --pad-oper --unpad-paren --pad-header --keep-one-line-statements --convert-tabs --indent-preprocessor <"${filename}" >${TEMPFILE}
|
||||
$CLANG_FORMAT -style=file ${filename} > ${TEMPFILE}
|
||||
|
||||
# # Astyle has problem with 'foreach' statements
|
||||
# sed -i -e 's/\bforeach(/foreach (/g' ${TEMPFILE}
|
||||
|
||||
# normalize SIGNAL statements as recommended at
|
||||
# http://marcmutz.wordpress.com/effective-qt/prefer-to-use-normalised-signalslot-signatures/
|
||||
# astyle would insert spaces etc
|
||||
grep -Po '(SIGNAL|SLOT)\([^(]+\([^)]*\)\)' "${TEMPFILE}" | while read original ; do
|
||||
normalized="$(sed -e 's/const //g;s/&//g;s/ //g;s/\//\\\//g' <<<${original})"
|
||||
originalregexpized="$(sed -e 's/\*/\\*/g;s/\//\\\//g' <<<${original})"
|
||||
sed -i -e 's/'"${originalregexpized}"'/'"${normalized}"'/g' ${TEMPFILE}
|
||||
done
|
||||
|
||||
# # correct some astyle mis-formattings
|
||||
# if [[ "${filename}" != "${filename/%.h/}" ]] ; then
|
||||
# sed -i -e 's/^\([ ]*\)\(:[ ][a-zA-Z]\)/\1 \2/g' ${TEMPFILE}
|
||||
# elif [[ "${filename}" != "${filename/%.cpp/}" ]] ; then
|
||||
# sed -i -e 's/^\([ ]*\)\(:[ ][a-zA-Z]\)/\1 \2/g;s/\(foreach([^)]*\) \([&*]\) /\1 \2/g' ${TEMPFILE}
|
||||
# fi
|
||||
|
||||
# In const_cast operations, ensure space before ampersand
|
||||
sed -i -r 's!( : const_cast<[^(;]+[^ ])&>[(]!\1 \&>(!g' ${TEMPFILE}
|
||||
|
||||
# Remove superfluous empty lines at file's end
|
||||
# http://unix.stackexchange.com/a/81687
|
||||
# http://sed.sourceforge.net/sed1line.txt
|
||||
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' ${TEMPFILE}
|
||||
|
||||
# Check if copyright year is up to date
|
||||
head -n 5 ${TEMPFILE} | grep -Eo --color=NEVER '20[0-9][0-9] by ' | head -n 1 | while read year rest ; do
|
||||
[ "${year}" = $(date '+%Y') ] || echo "File '${filename}' has an outdated copyright year: ${year}"
|
||||
done
|
||||
|
||||
# only change/touch original file if it has been changed
|
||||
diff -q ${TEMPFILE} "${filename}" >/dev/null || { echo "Updating \"${filename}\"" ; cp -p ${TEMPFILE} "${filename}" || echo "Cannot copy \"${TEMPFILE}\" \"${filename}\"" ; }
|
||||
|
||||
# rm -f ${TEMPFILE}
|
||||
done
|
||||
+74
-41
@@ -1,58 +1,91 @@
|
||||
###
|
||||
### CMakeLists for playuver lib component
|
||||
###
|
||||
#
|
||||
# CMakeLists for calyp lib component
|
||||
#
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
INCLUDE(GNUInstallDirs)
|
||||
|
||||
set(PlaYUVer_Lib_SRCS
|
||||
LibMemory.h
|
||||
PlaYUVerLib.h
|
||||
# Frame
|
||||
PlaYUVerPixel.cpp
|
||||
PlaYUVerFrame.cpp
|
||||
PlaYUVerFramePixelFormats.cpp
|
||||
# Stream
|
||||
PlaYUVerStream.cpp
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
SET(Calyp_Lib_Frame_SRCS CalypPixel.cpp PixelFormats.h PixelFormats.cpp CalypFrame.h CalypFrame.cpp)
|
||||
|
||||
SET(Calyp_Lib_Stream_SRCS
|
||||
CalypStream.h
|
||||
CalypStream.cpp
|
||||
CalypStreamHandlerIf.h
|
||||
StreamHandlerRaw.h
|
||||
StreamHandlerRaw.cpp
|
||||
StreamHandlerPortableMap.h
|
||||
StreamHandlerPortableMap.cpp
|
||||
# Options Parser
|
||||
PlaYUVerOptions.cpp
|
||||
# Modules
|
||||
PlaYUVerModuleIf.h
|
||||
)
|
||||
|
||||
IF( USE_FFMPEG )
|
||||
LIST( APPEND PlaYUVer_Lib_SRCS StreamHandlerLibav.cpp )
|
||||
ENDIF()
|
||||
SET(Calyp_Lib_OptionParser_SRCS CalypOptions.h CalypOptions.cpp)
|
||||
|
||||
IF( USE_OPENCV )
|
||||
LIST( APPEND PlaYUVer_Lib_SRCS StreamHandlerOpenCV.cpp )
|
||||
ENDIF()
|
||||
SET(Calyp_Lib_Modules_SRCS CalypOptions.h CalypOptions.cpp)
|
||||
|
||||
|
||||
set(PlaYUVer_Lib_HEADERS
|
||||
PlaYUVerDefs.h
|
||||
PlaYUVerPixel.h
|
||||
PlaYUVerFrame.h
|
||||
PlaYUVerStream.h
|
||||
PlaYUVerOptions.h
|
||||
PlaYUVerModuleIf.h
|
||||
SET(Calyp_Lib_SRCS
|
||||
LibMemory.h
|
||||
CalypLib.h
|
||||
CalypDefs.h
|
||||
${Calyp_Lib_Frame_SRCS}
|
||||
${Calyp_Lib_Stream_SRCS}
|
||||
${Calyp_Lib_OptionParser_SRCS}
|
||||
${Calyp_Lib_Modules_SRCS}
|
||||
)
|
||||
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${PROJECT_LIBRARY})
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
CONFIGURE_FILE( PlaYUVerConfig.cmake.in PlaYUVerConfig.cmake @ONLY)
|
||||
IF(USE_FFMPEG)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerLibav.h)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerLibav.cpp)
|
||||
|
||||
IF( USE_STATIC )
|
||||
ADD_LIBRARY( PlaYUVerLib STATIC ${PlaYUVer_Lib_SRCS} )
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${FFMPEG_LIBRARIES})
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
|
||||
IF(USE_OPENCV)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerOpenCV.h)
|
||||
LIST(APPEND Calyp_Lib_SRCS StreamHandlerOpenCV.cpp)
|
||||
|
||||
LIST(APPEND Calyp_Lib_SRCS CalypOpenCVModuleIf.cpp)
|
||||
|
||||
LIST(APPEND CMAKE_CFG_LINKER_LIBSS ${OpenCV_LIBRARIES})
|
||||
LIST(APPEND CMAKE_CFG_INCLUDE_DIRS ${OpenCV_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
|
||||
SET(Calyp_Lib_HEADERS CalypDefs.h CalypFrame.h CalypStream.h CalypOptions.h CalypModuleIf.h CalypOpenCVModuleIf.h)
|
||||
|
||||
CONFIGURE_FILE(CalypConfig.cmake.in CalypConfig.cmake @ONLY)
|
||||
|
||||
INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
|
||||
|
||||
IF(USE_STATIC)
|
||||
ADD_LIBRARY(${PROJECT_LIBRARY} STATIC ${Calyp_Lib_SRCS})
|
||||
ELSE()
|
||||
ADD_LIBRARY( PlaYUVerLib SHARED ${PlaYUVer_Lib_SRCS} )
|
||||
ADD_LIBRARY(${PROJECT_LIBRARY} SHARED ${Calyp_Lib_SRCS})
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} )
|
||||
TARGET_LINK_LIBRARIES( PlaYUVerLib ${FFMPEG_LIBRARIES} ${OpenCV_LIBRARIES} )
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_LIBRARY} ${FFMPEG_LIBRARIES} ${OpenCV_LIBRARIES})
|
||||
|
||||
IF( NOT USE_STATIC )
|
||||
INSTALL(FILES ${PlaYUVer_Lib_HEADERS} DESTINATION include )
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PlaYUVerConfig.cmake DESTINATION share/playuver )
|
||||
INSTALL(TARGETS PlaYUVerLib DESTINATION ${CMAKE_INSTALL_LIBDIR} )
|
||||
TARGET_INCLUDE_DIRECTORIES(${PROJECT_LIBRARY} PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
||||
|
||||
SET_TARGET_PROPERTIES(${PROJECT_LIBRARY} PROPERTIES VERSION ${CALYP_VERSION} SOVERSION ${CALYP_VERSION_MAJOR})
|
||||
|
||||
IF(NOT USE_STATIC)
|
||||
INSTALL(
|
||||
TARGETS ${PROJECT_LIBRARY}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
INSTALL(FILES ${Calyp_Lib_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CalypConfig.cmake DESTINATION share/calyp)
|
||||
ENDIF()
|
||||
|
||||
IF(BUILD_TESTS)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ENDIF()
|
||||
|
||||
IF(BUILD_TESTS_CATCH2)
|
||||
ADD_SUBDIRECTORY(catch2)
|
||||
ENDIF()
|
||||
@@ -0,0 +1,36 @@
|
||||
# ===================================================================================================================
|
||||
# The Calyp Libs CMake configuration file
|
||||
#
|
||||
# ** File generated automatically, do not modify **
|
||||
#
|
||||
# Usage from an external project:
|
||||
# In your CMakeLists.txt, add these lines:
|
||||
#
|
||||
# find_package(Calyp REQUIRED)
|
||||
# include_directories(${CALYP_INCLUDE_DIRS})
|
||||
# target_link_libraries(MY_TARGET_NAME ${CALYP_LINKER_LIBS})
|
||||
#
|
||||
#
|
||||
# This file will define the following variables:
|
||||
# - CALYP_LINKER_LIBS : The list of all imported targets for OpenCV modules.
|
||||
# - CALYP_CXX_FLAGS
|
||||
# - CALYP_INCLUDE_DIRS : The Calyp include directories.
|
||||
# - CALYP_VERSION : The version of this Calyp build: "@CALYP_VERSION@"
|
||||
# - CALYP_VERSION_MAJOR : Major version part of CALYP_VERSION: "@CALYP_VERSION_MAJOR@"
|
||||
# - CALYP_VERSION_MINOR : Minor version part of CALYP_VERSION: "@CALYP_VERSION_MINOR@"
|
||||
# - CALYP_VERSION_PATCH : Patch version part of CALYP_VERSION: "@CALYP_VERSION_PATCH@"
|
||||
#
|
||||
# ===================================================================================================================
|
||||
|
||||
|
||||
# ======================================================
|
||||
# Variables:
|
||||
# ======================================================
|
||||
SET(CALYP_VERSION @CALYP_VERSION@)
|
||||
SET(CALYP_VERSION_MAJOR @CALYP_VERSION_MAJOR@)
|
||||
SET(CALYP_VERSION_MINOR @CALYP_VERSION_MINOR@)
|
||||
SET(CALYP_VERSION_PATCH @CALYP_VERSION_PATCH@)
|
||||
|
||||
SET( CALYP_CXX_FLAGS "" )
|
||||
SET( CALYP_INCLUDE_DIRS "@CMAKE_CFG_INCLUDE_DIRS@" )
|
||||
SET( CALYP_LINKER_LIBS "@CMAKE_CFG_LINKER_LIBSS@" )
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
/* 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 CalypDefs.h
|
||||
* \ingroup CalypLibGrp
|
||||
* \brief Define basic types, new types and enumerations
|
||||
*/
|
||||
|
||||
#ifndef __CALYPDEFS_H__
|
||||
#define __CALYPDEFS_H__
|
||||
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
using ClpByte = std::uint8_t;
|
||||
using ClpPel = std::uint16_t;
|
||||
using ClpULong = std::uint64_t;
|
||||
using ClpString = std::string;
|
||||
|
||||
enum CLP_LOG_LEVEL
|
||||
{
|
||||
CLP_LOG_INFO = 1,
|
||||
CLP_LOG_WARNINGS = 2,
|
||||
CLP_LOG_RESULT = 3,
|
||||
CLP_LOG_ERROR = 4,
|
||||
};
|
||||
|
||||
/**
|
||||
* \enum CalypColorSpace
|
||||
* \brief List of supported color spaces
|
||||
* \ingroup CalypLibGrp
|
||||
*/
|
||||
enum CalypColorSpace
|
||||
{
|
||||
CLP_COLOR_INVALID = -1, //!< Invalid
|
||||
CLP_COLOR_YUV = 0, //!< YUV
|
||||
CLP_COLOR_RGB = 1, //!< RGB
|
||||
CLP_COLOR_GRAY = 2, //!< Grayscale
|
||||
CLP_COLOR_RGBA = 3, //!< RGB + Alpha
|
||||
CLP_COLOR_MAX = 255, //!< Account for future formats
|
||||
};
|
||||
|
||||
/**
|
||||
* \enum CalypPixelFormats
|
||||
* \brief List of supported pixel formats
|
||||
* \ingroup CalypLibGrp
|
||||
*/
|
||||
enum CalypPixelFormats
|
||||
{
|
||||
CLP_INVALID_FMT = -1, //!< Invalid
|
||||
CLP_YUV420P = 0, //!< YUV 420 progressive
|
||||
CLP_YUV422P, //!< YUV 422 progressive
|
||||
CLP_YUV444P, //!< YUV 444 progressive
|
||||
CLP_YUYV422, //!< YUV 422 interleaved
|
||||
CLP_GRAY, //!< Grayscale
|
||||
CLP_RGB24P, //!< RGB 32 bpp progressive
|
||||
CLP_RGB24, //!< RGB 32 bpp
|
||||
CLP_BGR24, //!< BGR 32 bpp
|
||||
CLP_RGBA32, //!< RGBA 32 bpp
|
||||
CLP_BGRA32, //!< BGRA 32 bpp
|
||||
CLP_MAX_FMT = 255, //!< Account for future formats
|
||||
};
|
||||
|
||||
enum CLP_YUV_Components
|
||||
{
|
||||
CLP_LUMA = 0,
|
||||
CLP_CHROMA_U,
|
||||
CLP_CHROMA_V,
|
||||
};
|
||||
|
||||
enum CLP_RGB_Components
|
||||
{
|
||||
CLP_COLOR_R = 0,
|
||||
CLP_COLOR_G,
|
||||
CLP_COLOR_B,
|
||||
CLP_COLOR_A,
|
||||
};
|
||||
|
||||
enum CLP_Endianness
|
||||
{
|
||||
CLP_BIG_ENDIAN = 0,
|
||||
CLP_LITTLE_ENDIAN = 1,
|
||||
};
|
||||
|
||||
static const double S_PI = 3.14159265358979323846;
|
||||
static const double S_PI_2 = 1.57079632679489661923;
|
||||
|
||||
inline ClpString clpLowercase( const ClpString& in )
|
||||
{
|
||||
ClpString out;
|
||||
transform( in.begin(), in.end(), std::back_inserter( out ), tolower );
|
||||
return out;
|
||||
}
|
||||
|
||||
inline ClpString clpUppercase( const ClpString& in )
|
||||
{
|
||||
ClpString out;
|
||||
transform( in.begin(), in.end(), std::back_inserter( out ), toupper );
|
||||
return out;
|
||||
}
|
||||
|
||||
struct CalypFailure : public std::exception
|
||||
{
|
||||
ClpString m_class_name;
|
||||
ClpString m_error_msg;
|
||||
CalypFailure( ClpString error_msg ) throw()
|
||||
: m_error_msg( error_msg ) {}
|
||||
CalypFailure( ClpString class_name, ClpString error_msg ) throw()
|
||||
: m_class_name( class_name ), m_error_msg( error_msg )
|
||||
{
|
||||
}
|
||||
~CalypFailure() throw() {}
|
||||
const char* what() const throw()
|
||||
{
|
||||
ClpString* msg = new ClpString( "[" + m_class_name + "] " + m_error_msg );
|
||||
return msg->c_str();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // __CALYPDEFS_H__
|
||||
+1583
File diff suppressed because it is too large.
Load diff
Loaded 100 of 215 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user