Author SHA1 Message Date
jfmcarreira 500e0e85ba Add macro to protect against the Qt version 2021-11-28 01:46:37 +00:00
jfmcarreira d4886a7fee Fix fetch content to build main product 2021-11-27 23:28:27 +00:00
jfmcarreira f3919ac8e8 Change cmake fetch content 2021-11-27 22:51:58 +00:00
jfmcarreira 562fd915fe Add build checks 2021-11-27 01:04:51 +00:00
jfmcarreira f3df40cdf7 Code cleanup 2021-11-27 00:52:32 +00:00
jfmcarreira 1bb2773abc Add support to filter components to display 2021-11-27 00:45:56 +00:00
jfmcarreira a5e0554286 Tidy up CalypFrame 2021-10-30 20:01:20 +01:00
jfmcarreira dc56de6f30 Fix memory leak in modules tests 2021-10-30 17:53:12 +01:00
jfmcarreira 0cc89ab949 Fix problem creating opencv mat from CalypFrame 2021-10-30 17:49:24 +01:00
jfmcarreira 480a7f1d38 Refactor ClpPixelFormats enum 2021-10-27 23:17:32 +01:00
jfmcarreira bb2a1ac228 Refactor pixel formats enum 2021-10-27 23:07:46 +01:00
jfmcarreira 90a5c32bb6 Fix option errors and add dummy module 2021-10-24 22:18:25 +01:00
jfmcarreira acc9d8ea98 Fix modules errors 2021-10-24 17:55:52 +01:00
jfmcarreira 6f91b6c04f Refactor CalypOption 2021-10-24 17:26:13 +01:00
jfmcarreira b1ca7dff0b Improve safety of class methods 2021-10-24 11:25:22 +01:00
jfmcarreira f5df1b3f9d Refactor code based on lib changes 2021-10-24 00:56:39 +01:00
jfmcarreira bd1bbef22b Fix CalypStream and CalypFrame methods 2021-10-23 23:38:03 +01:00
jfmcarreira 3a9aa5e498 Fix warnings and remove warnings are erros from tests checks 2021-10-20 00:54:10 +01:00
jfmcarreira 5499312fca Fix compilation erros 2021-10-20 00:28:49 +01:00
jfmcarreira 93cf60e34a Improvements on CalypModuleIf
Add type safe flags
Replace MACRO with templates (WIP)
2021-10-19 23:42:18 +01:00
jfmcarreira 09ec5213c3 Fix compilation errors and add new tests 2021-10-15 23:40:41 +01:00
jfmcarreira 26f3dc7612 Fix wrong filename in tests 2021-10-13 00:21:22 +01:00
jfmcarreira 6ce220be82 Check if file exists before running tests 2021-10-13 00:08:33 +01:00
jfmcarreira cc84c42fd4 Checkout LFS content for tests 2021-10-12 23:57:08 +01:00
jfmcarreira 8d2a9e6100 Fix build.yml 2021-10-12 21:10:56 +01:00
jfmcarreira c05aa73e86 Fix github action 2021-10-11 23:25:03 +01:00
jfmcarreira ddc9f40329 Fix repository with test data (fix last commit) 2021-10-11 23:14:10 +01:00
jfmcarreira e87049dccf Fix repository with test data 2021-10-11 23:12:50 +01:00
jfmcarreira 1c1afa7bfc Code clean up and add initial support to run tests in CI enviroment 2021-10-11 23:07:08 +01:00
jfmcarreira 366d69b5c9 Always use RAW format if first try to open file fails 2021-10-10 23:04:39 +01:00
jfmcarreira 26a718a06a Open .raw formats as raw video 2021-10-10 22:26:31 +01:00
jfmcarreira 3b31453221 Add support to signall if the format supports user configuration 2021-10-10 22:25:32 +01:00
jfmcarreira b7ad00a4c5 Minor refactor CalypStream header and format handler 2021-10-10 19:48:14 +01:00
jfmcarreira fbbd77bfbf Merge branch 'devel' 2021-10-10 18:05:23 +01:00
jfmcarreira be06ca656d Add new window classes for modules and streams 2021-10-10 15:13:42 +01:00
jfmcarreira 665cd0bb1c Add new window classes 2021-10-09 20:02:19 +01:00
jfmcarreira 1c0321a705 Fix histogram widget 2021-10-09 20:01:02 +01:00
jfmcarreira 5b9e16a708 Make CalypPixel work on stack 2021-10-09 18:31:21 +01:00
jfmcarreira 5b6d3e9031 Add iwyu 2021-10-03 19:19:21 +01:00
jfmcarreira 12c3b26580 appveyor: revert opencv dir change 2021-10-03 18:44:29 +01:00
jfmcarreira 574c712207 appveyor: Fix qt dll dir 2021-10-03 18:18:07 +01:00
jfmcarreira 4deef9e11c appveyor: fix Qt dir 2021-10-03 16:15:53 +01:00
jfmcarreira c7c8074cf8 appveyor: use visual studio 16 2019 generator 2021-10-03 16:02:06 +01:00
jfmcarreira a7ca36d252 appveyor: use latest cmake generator 2021-10-03 15:37:31 +01:00
jfmcarreira 8940ede351 appveyor: add executable name to the command 2021-10-03 15:34:05 +01:00
jfmcarreira b57e887d55 Fix last commit 2021-10-03 15:31:45 +01:00
jfmcarreira 3502b5df0d Fix script location in appveyor 2021-10-03 15:27:14 +01:00
jfmcarreira 15007d7784 Upgrade visual studio version in appveyor 2021-10-03 15:20:37 +01:00
jfmcarreira 9790ef3e31 Fix generator 2021-10-03 15:15:20 +01:00
jfmcarreira 5f0bdb30b5 Change CMake generator for appveyor 2021-10-03 14:48:15 +01:00
jfmcarreira 900c9c0418 Remove some files from the Calyp lib and clean up code 2021-10-03 14:30:15 +01:00
jfmcarreira 54f9f185e2 Add compile options and put Qt definitions in app CMakeLists 2021-10-03 14:13:02 +01:00
jfmcarreira dda88d8334 Fix c++20 compiler flag 2021-10-03 00:21:25 +01:00
jfmcarreira 73e5608624 Print the full log 2021-10-02 23:40:43 +01:00
jfmcarreira 317123c7b9 Remove flags not available on windows 2021-10-02 23:28:24 +01:00
jfmcarreira 0a40a8bdb6 Fix c++ flags for windows 2021-10-02 22:52:52 +01:00
jfmcarreira 5f66af794c Clean up code of HistogramWidget 2021-10-02 22:31:50 +01:00
jfmcarreira a6e1acd406 Update Cmake to fix config file 2021-10-02 22:29:51 +01:00
jfmcarreira 7818dbc9e3 Upate repo before install dependencies 2021-09-30 00:10:51 +01:00
jfmcarreira 448b64a8e3 Fix examples and tests 2021-09-30 00:06:57 +01:00
jfmcarreira 612f147639 Merge branch 'master' into devel 2021-09-29 23:37:30 +01:00
jfmcarreira 53bb100ad4 Fix bug removing a module 2021-09-29 23:36:53 +01:00
jfmcarreira d7b1d58b4b Merge branch 'master' into devel 2021-09-29 22:06:08 +01:00
jfmcarreira 58ce738026 Add devel build badge 2021-09-29 22:04:17 +01:00
jfmcarreira c8382ccaff Add github actions to devel 2021-09-28 01:21:39 +01:00
jfmcarreira 1a00bd328c Guard method position against Qt version 2021-09-28 01:13:55 +01:00
jfmcarreira 095d1863c2 Specify gcc-10 in the actions 2021-09-28 01:03:12 +01:00
jfmcarreira 3a56f532c1 Use GCC 10 in Github actions 2021-09-28 00:50:50 +01:00
jfmcarreira 2c89e47b8a Fix warnings to build with Werror flag 2021-09-28 00:38:33 +01:00
jfmcarreira 4aebcb979c Version bump 2.0.1 2021-09-26 01:13:24 +01:00
jfmcarreira f8aa92b7fa Remove C++20 methods not available on Windows 2021-09-26 01:11:44 +01:00
jfmcarreira a2f7f10fea Merge remote-tracking branch 'upstream/master' 2021-09-25 17:56:17 +01:00
jfmcarreira 223bd859a9 Version bump 2.0.0 2021-09-25 17:47:18 +01:00
jfmcarreira b148f28dab Update README.md 2021-09-25 17:44:23 +01:00
jfmcarreira b383eff34f Update CI and fix compilation errors on windows 2021-09-25 17:41:16 +01:00
jfmcarreira 1ec77b64c6 Merge remote-tracking branch 'upstream/master' 2021-09-25 17:25:24 +01:00
jfmcarreira 237bc1cc2e CI - Fix cmake config step 2021-09-25 17:20:38 +01:00
jfmcarreira d4913ed2d2 Update build.yml 2021-09-25 17:18:17 +01:00
jfmcarreira 113e86e583 Updata build action 2021-09-25 17:16:29 +01:00
jfmcarreira 9ea9d845c7 Update version CI config and README 2021-09-25 17:02:03 +01:00
jfmcarreira 48afd0be45 Remove the use of QRecursiveMutex 2021-09-22 01:20:01 +01:00
jfmcarreira 1e4de99fba Remove span include 2021-09-22 00:59:13 +01:00
jfmcarreira d446ee7ac1 Fix compiler flags 2021-09-22 00:31:45 +01:00
jfmcarreira 357971c68b Make the use of FetchContent optional 2021-09-21 22:31:08 +01:00
jfmcarreira 6be534d00c Fix warnings 2021-09-21 01:09:37 +01:00
jfmcarreira 437325c96f Clean up some redundant code 2021-09-20 01:51:54 +01:00
jfmcarreira 94444e38ec Refactor modules ownership 2021-09-19 21:50:15 +01:00
jfmcarreira a093efce9c Changes in CalypStream buffers 2021-09-18 16:26:14 +01:00
jfmcarreira de80c85596 Refactor the use of multiple threads for streams 2021-09-12 23:43:11 +01:00
jfmcarreira 9a63a57458 Reset window title when the last subwindow is closed 2021-09-12 14:35:44 +01:00
jfmcarreira 2451494677 Change CalypStream to RAII management with two buffers 2021-09-12 13:01:26 +01:00
jfmcarreira ffe1bf688d Improve the use of threads and sleep when not in use 2021-09-07 02:00:30 +01:00
jfmcarreira bf5235352b Start using resource handler to manage different streams 2021-09-06 22:43:21 +01:00
jfmcarreira 463e1a58b9 Make module instances unique ptrs 2021-09-04 13:57:12 +01:00
jfmcarreira 8ef5b31268 Reduce the use of C-pointers in CalypFrame and CalypStream 2021-07-10 16:28:10 +01:00
jfmcarreira be82c6ca89 Merge remote-tracking branch 'origin/devel' into devel 2021-07-10 12:40:25 +01:00
jfmcarreira eaa9987314 Change includes and minor fixes 2021-07-10 12:33:27 +01:00
jfmcarreira 304c0f6683 Fix the module skip while playing 2021-06-10 23:45:09 +01:00
jfmcarreira 83a9decc26 Remove compiler flag exclusively from MacOS 2021-06-10 11:32:20 +01:00
jfmcarreira 2a1b0abb2f Improve histogram drawing and refresh of module window
- Now histogram update if some windows is playing but not the current window
- If the current window is a module window it will check if the source
  window is playing
- The white fill of the window is only drawn after 500ms. Trying to
  reduce the continuous refreshing even on simple modules
2021-06-10 02:16:04 +01:00
jfmcarreira cad1f6d7a6 Merge branch 'feature/Vectorization' into devel 2021-06-07 00:22:16 +01:00
jfmcarreira d330ecfd0d Improve time critical functions in CalypFrame 2021-06-07 00:05:45 +01:00
jfmcarreira 7b5e5d5694 Add -O3 compiler optimisation option 2021-06-06 21:33:08 +01:00
jfmcarreira f2a636baa1 Add specific function to convert from YUV420 to RGB 2021-06-06 21:28:21 +01:00
jfmcarreira 9e3fb9c0a0 Fix threads for histogram and modules 2021-06-06 12:12:16 +01:00
jfmcarreira 420aeb89a6 Update qcustomplot to version 2.1.0 2021-05-31 03:10:02 +01:00
jfmcarreira a1b44895b8 For-loop clenups 2021-05-30 21:36:49 +01:00
jfmcarreira e1e5c4eb3c Add fps labels in the status bar 2021-05-30 20:48:55 +01:00
jfmcarreira 206613d08a Cleanups in CalypStream 2021-05-30 17:08:31 +01:00
jfmcarreira b7e8087163 Remove hard-coded frame rate in Raw video handler 2021-05-29 12:53:48 +01:00
jfmcarreira f4cf81b63c Make both google and catch2 test framework include in the project 2021-05-29 03:36:56 +01:00
jfmcarreira 47504ff46f Merge branch 'devel' 2021-05-29 03:16:43 +01:00
jfmcarreira bdc5317ccc Merge remote-tracking branch 'origin/devel' into devel 2021-05-29 03:16:30 +01:00
jfmcarreira 1dfddcf7fb Use threaded modules by default 2021-05-29 03:14:15 +01:00
jfmcarreira cea720f8e9 Improve the use of separate threads for each module
FramePropertiesDock now copies an instance of the CalypFrame that
is always kept valid until updated
2021-05-29 03:14:15 +01:00
jfmcarreira 48907ef614 Extend CalypFrame constructors
Add copy-assignement constructor
Add move and move assignement constructor
2021-05-29 03:14:15 +01:00
jfmcarreira cdff468904 Do not compensate flow if point outside the image 2021-05-29 03:14:15 +01:00
jfmcarreira dea3dd93d5 Add icon to MacOS build 2021-05-29 03:14:15 +01:00
jfmcarreira 3745a687cb Add missing header to QThread 2021-05-29 03:14:15 +01:00
jfmcarreira a1ebf62e21 Add Catch2 testing into the Calyp library 2021-05-29 03:14:15 +01:00
jfmcarreira 3c85c96769 Add modules to calyp 2021-05-29 03:14:15 +01:00
jfmcarreira e7e1a8534b Fix cmake warnings for devs 2021-05-29 03:14:15 +01:00
João Carreira 8807c14b59 Ignore any build dir starting with build-* 2021-05-29 03:14:15 +01:00
jfmcarreira 039887f2e6 Fix deprecated Qt functions
Change the way to get the screen size
Remove Qt::WindowFlags
Change function to process events from mouse wheel
2021-05-29 03:14:15 +01:00
jfmcarreira 4c6a4aba65 Remove deprecated av_register_all() 2021-05-29 03:14:15 +01:00
jfmcarreira 910ab8024e Add GitHub action to build code using cmake 2021-05-29 03:14:15 +01:00
jfmcarreira 6b0f7f6de3 Fix missing include in the windows build
Add missing QStyleFactory include
Minor version bump
2021-05-29 03:14:15 +01:00
jfmcarreira 6b8b4cbb6a Bump version 2021-05-29 03:14:15 +01:00
jfmcarreira 0a70267ab7 Add details to about dialog and change theme for windows 2021-05-29 03:14:15 +01:00
jfmcarreira 4a4f985ac1 Define style on windows 2021-05-29 03:14:15 +01:00
jfmcarreira 58424b8f4e Update last commit 2021-05-29 03:14:15 +01:00
jfmcarreira 3bbbf81ca2 Remove ffmpeg exe before building against it 2021-05-29 03:14:15 +01:00
jfmcarreira 7ea1db3202 Change ffmpeg installation on windows 2021-05-29 03:14:15 +01:00
jfmcarreira 0e26fd8964 Add libswresample to FindFFmpeg 2021-05-29 03:14:15 +01:00
jfmcarreira 27ecd818e8 Complete ffmpeg def in appveyor
Add missing variable definitions for avdevice and postproc library
Define variable FFMPEG_DIR
2021-05-29 03:14:15 +01:00
jfmcarreira d5d21a458f Remove testing from travis ci 2021-05-29 03:14:15 +01:00
jfmcarreira 1066aaa73c Add missing dependency to gtest in travis env 2021-05-29 03:14:15 +01:00
jfmcarreira ddd5eeb6b9 Revert changes to travis CI 2021-05-29 03:14:15 +01:00
jfmcarreira 876e1ba9e3 Use threaded modules by default 2021-05-29 03:13:49 +01:00
jfmcarreira 47dd2ad3f9 Improve the use of separate threads for each module
FramePropertiesDock now copies an instance of the CalypFrame that
is always kept valid until updated
2021-05-29 03:13:49 +01:00
jfmcarreira e77e0a82fa Extend CalypFrame constructors
Add copy-assignement constructor
Add move and move assignement constructor
2021-05-29 03:13:49 +01:00
jfmcarreira 2181fd6add Do not compensate flow if point outside the image 2021-05-29 03:13:49 +01:00
jfmcarreira eda28d1380 Add icon to MacOS build 2021-05-29 03:13:49 +01:00
jfmcarreira 1599a80d46 Add missing header to QThread 2021-05-29 03:13:49 +01:00
jfmcarreira 42c4e3b388 Use threaded modules by default 2021-05-29 03:13:22 +01:00
jfmcarreira d86ed3508b Improve the use of separate threads for each module
FramePropertiesDock now copies an instance of the CalypFrame that
is always kept valid until updated
2021-05-29 03:08:56 +01:00
jfmcarreira cd18227b8b Extend CalypFrame constructors
Add copy-assignement constructor
Add move and move assignement constructor
2021-05-29 03:05:55 +01:00
jfmcarreira fc913fdc08 Do not compensate flow if point outside the image 2021-05-29 03:02:53 +01:00
jfmcarreira f90c681788 Add icon to MacOS build 2021-05-29 00:41:52 +01:00
jfmcarreira 44f7a9b02e Add missing header to QThread 2021-05-28 19:11:49 +01:00
jfmcarreira 624612d49b Merge branch 'devel' 2021-05-09 23:25:13 +01:00
jfmcarreira 70db70a7cf Add Catch2 testing into the Calyp library 2021-05-09 23:24:16 +01:00
jfmcarreira 33bf02ba0f Add modules to calyp 2021-05-08 22:56:07 +01:00
jfmcarreira 864c3253f1 Fix cmake warnings for devs 2021-05-03 01:31:21 +01:00
João Carreira a2d452fd64 Ignore any build dir starting with build-* 2021-05-02 23:23:42 +01:00
jfmcarreira 3732810f9e Fix deprecated Qt functions
Change the way to get the screen size
Remove Qt::WindowFlags
Change function to process events from mouse wheel
2021-05-01 01:35:28 +01:00
jfmcarreira 56fc2e45bb Remove deprecated av_register_all() 2021-05-01 01:34:38 +01:00
jfmcarreira 7ff939c33a Fix missing include in the windows build
Add missing QStyleFactory include
Minor version bump
2021-04-17 23:18:39 +01:00
jfmcarreira fa23256955 Add GitHub action to build code using cmake 2021-04-17 18:33:13 +01:00
jfmcarreira ffe0c38427 Bump version 2021-04-17 18:29:08 +01:00
jfmcarreira 12bd1a4c2c Add details to about dialog and change theme for windows 2021-04-17 18:27:47 +01:00
jfmcarreira b830b700ca Define style on windows 2021-04-17 12:59:55 +01:00
jfmcarreira 3109250471 Update last commit 2021-04-17 02:19:07 +01:00
jfmcarreira c6b43ac7fa Remove ffmpeg exe before building against it 2021-04-17 02:09:27 +01:00
jfmcarreira beed955e3f Change ffmpeg installation on windows 2021-04-17 01:57:27 +01:00
jfmcarreira 1f003ec2ac Add libswresample to FindFFmpeg 2021-04-17 01:22:34 +01:00
jfmcarreira c718d01700 Complete ffmpeg def in appveyor
Add missing variable definitions for avdevice and postproc library
Define variable FFMPEG_DIR
2021-04-17 00:44:34 +01:00
jfmcarreira 847f4f06b9 Remove testing from travis ci 2021-04-16 22:47:07 +01:00
jfmcarreira 344188234b Add missing dependency to gtest in travis env 2021-04-16 22:25:40 +01:00
jfmcarreira 5439fd1af5 Revert changes to travis CI 2021-04-07 15:56:57 +01:00
jfmcarreira 2f434d269b Run tests in travisCI 2021-04-06 22:58:20 +01:00
jfmcarreira a72208f0e6 Remove unused file and update .gitignore 2021-04-06 22:57:31 +01:00
jfmcarreira c3c4e229d8 Tests: Add general tests for modules
The idea of these tests is to check whether the modules will work
with different kinds of inputs. The modules should be able to initialize
or return an error indication. But in all cases they should be able to handle
default arguments all different inputs
2021-04-06 22:57:12 +01:00
jfmcarreira fedcb2e03a Add pre-commit checks and reformat code 2021-02-14 01:39:41 +00:00
jfmcarreira e755608b02 Merge branch 'master' into devel 2021-02-14 01:35:55 +00:00
jfmcarreira 2debe78ed8 Refactoring lib CMakeLists.txt 2021-02-14 00:51:21 +00:00
jfmcarreira 4d1730f928 Explicitly use static library for modules 2021-02-13 23:49:36 +00:00
jfmcarreira 521e56202c Remove clang-tidy 2021-02-13 04:16:25 +00:00
jfmcarreira d0933f43c9 Add cmake and clang format and linter 2021-02-13 04:08:43 +00:00
jfmcarreira 1674ec4061 Add missing information 2021-02-13 03:40:56 +00:00
jfmcarreira ab58ca44f2 Fix copyright 2021-02-13 03:16:17 +00:00
jfmcarreira 11bf3f6bfd Format code 2021-02-13 03:12:28 +00:00
jfmcarreira 669f3db250 Add modules test for create operation 2021-02-13 02:27:39 +00:00
jfmcarreira 3c6e0555bc Update doc and gitignore 2021-02-13 02:26:39 +00:00
jfmcarreira fca79a7992 Add cmake variable to define test data location 2021-02-13 02:07:43 +00:00
jfmcarreira b507b61ce4 Pre fill configuration dialog with the last used values 2021-02-02 00:03:29 +00:00
jfmcarreira 72bfaf6796 Update github token 2020-12-18 22:39:05 +00:00
jfmcarreira 0998d98375 Fix 7z extract command 2020-12-18 20:28:54 +00:00
jfmcarreira 3afa6eeb6f Run extract ffmpeg script 2020-12-18 20:18:18 +00:00
jfmcarreira 41c65dcac4 Fix ffmpeg download for appveyor windows build 2020-12-16 02:58:02 +00:00
jfmcarreira 25d40cadbe Merge remote-tracking branch 'upstream/master' 2020-12-12 13:20:14 +00:00
jfmcarreira ca68f5a78f Remove IDE related files 2020-12-12 13:18:48 +00:00
Joao Santos f2e1e4bfc7 Removed decimal places from the median value. 2020-12-12 13:11:09 +00:00
Joao Santos b5edc60794 Added option to print statistics to calypTools. 2020-12-12 13:08:53 +00:00
Joao Santos 6b084c1a7e Fixed minor issue with getEntropy function. 2020-12-12 13:06:52 +00:00
jfmcarreira 7b712bb232 Fix parsing cli args in Calyp 2020-12-12 11:05:39 +00:00
jfmcarreira 684cecd632 Minor bug fixes in the help of calypTools 2020-12-11 18:00:12 +00:00
Joao Santos f6cc0ffd29 The entropy of the image was added to the statistics. 2020-12-10 17:16:38 +00:00
jfmcarreira c1cef58de1 Fix extract command in appveyor 2020-10-24 00:08:55 +01:00
jfmcarreira f9e62c73ac Update appveyor to fetch ffmpeg from a new source 2020-10-23 23:13:02 +01:00
jfmcarreira 6486104db2 Minor changes in optimise display 2020-10-23 18:36:52 +01:00
jfmcarreira 31f7e46e94 Add new option in calypTools to process video with negative values 2019-11-29 00:36:54 +00:00
jfmcarreira aaa5a0fde4 Add new features to CalypFrame and support for sum operation 2019-11-28 23:18:29 +00:00
jfmcarreira f2c8697ace Fix modules name to avoid confusion 2019-11-28 00:51:06 +00:00
jfmcarreira 3ed8b0916f Add new module FrameResampling and change opencv interface 2019-11-23 01:25:46 +00:00
jfmcarreira ce82d0a17d Change the opencv includes 2019-11-16 02:27:47 +00:00
jfmcarreira 81972c9ded Add headers to the CMakeLists 2019-11-16 02:09:56 +00:00
jfmcarreira 115c4b0476 Merge branch 'master' into develOpencvModules 2019-11-16 01:45:22 +00:00
jfmcarreira fd5dcc0e1a Do not show modules with API 3 in CalypApp 2019-11-16 01:45:09 +00:00
jfmcarreira 56f1df4a56 Add new interface for modules using opencv 2019-11-16 01:44:31 +00:00
João Santos d4dddda2c2 Optimise display module now doesn't require a new window. 2019-11-12 16:24:56 +00:00
jfmcarreira 753c4cca3f Update README.md 2019-11-03 20:52:15 +00:00
jfmcarreira 67b0406f86 Increase CalypTools input limit to 255 2019-10-25 11:23:42 +01:00
João Santos abff4f3aa7 OptimiseDisplay now works for all of the image channels. 2019-10-22 16:12:00 +01:00
João Santos 7d83009f4b Fixed the reading of Portable Map images header. 2019-10-22 16:00:35 +01:00
jfmcarreira 2933269ea4 Improve ThreeSixtyFaceConcatenation and ThreeSixtyFaceExtraction 2019-10-21 15:07:53 +01:00
jfmcarreira 20b6edd667 Fix pixel format in OptimiseDisplay module 2019-10-14 15:35:50 +01:00
jfmcarreira 64153e572f Add opencv photo module 2019-09-20 22:49:45 +01:00
jfmcarreira 19cc7002e6 Merge branch 'master' of github.com:pixlra/calyp 2019-09-19 21:00:41 +01:00
jfmcarreira 115a5edec2 Add new modules from private repository 2019-09-19 21:00:31 +01:00
jfmcarreira 50b4ef20ce Add memory checks in xCallocMem 2019-07-29 15:25:01 +01:00
jfmcarreira 5f28b90811 Update binaries and dev in README.md 2019-06-14 17:14:30 +01:00
jfmcarreira 9fb445288c Change function outputs 2019-06-05 00:11:42 +01:00
João Santos 08d9fd1d5d Changed module window title to use the long name. 2019-05-30 16:42:37 +01:00
João Santos 3e186e9685 Added OptimiseDisplay module. 2019-05-30 16:42:09 +01:00
jfmcarreira c26e7c2265 Fix bpp match 2019-05-30 16:40:32 +01:00
João Santos b10a593e01 Improved statistics:
- Fixed issue with the range maximum value calculation
- Added the number of actual used values
2019-05-30 11:21:17 +01:00
jfmcarreira 63442d58b9 Complete last commig 2019-05-28 19:05:16 +01:00
jfmcarreira b36bbeef7a Support for variable number of inputs 2019-05-28 18:55:34 +01:00
jfmcarreira 2adfd28e48 Change module to enable frame re-sampling 2019-05-07 22:12:44 +01:00
jfmcarreira d76d2082ca Add prefix string before dumping stream information 2019-05-06 14:06:53 +01:00
jfmcarreira 10dec18118 Change the definition of the output endinness 2019-05-06 13:32:08 +01:00
jfmcarreira 39618ca7d5 Fix minor bug in the modules API and change input params in CalypFrame 2019-05-06 11:25:21 +01:00
jfmcarreira 833bd5f1c9 Use the same endianess for output as the input 2019-05-06 11:24:54 +01:00
jfmcarreira 937669d3c9 Finishing adding log information about input and output streams 2019-04-16 15:43:33 +01:00
jfmcarreira 63a9e2d22d Change CalypStream methods to support const 2019-04-16 15:42:37 +01:00
jfmcarreira 14bd963046 Start adding support for extended information in calypTools 2019-04-16 14:31:02 +01:00
jfmcarreira d6676b3eaf Fix copyTo and copyFrom functions 2019-04-15 16:37:44 +01:00
jfmcarreira 8152e82129 Fix bug introduced in the CalypFrame->toMat function 2019-04-12 16:58:16 +01:00
jfmcarreira a8ead5dcf6 Remove unused variable 2019-04-12 13:45:04 +01:00
jfmcarreira 35dcb020e6 Remove extra ; 2019-04-12 03:35:58 +01:00
jfmcarreira 68faafc9ed Improve conversion to OpenCv Mat with more than 8 bits 2019-04-12 03:35:42 +01:00
jfmcarreira 0989810e1f Add error message for portable map when pixel format is not supported 2019-04-10 22:15:04 +01:00
jfmcarreira 8620e3ddf2 Fix error in copy from function in CalypFrame 2019-04-08 15:00:15 +01:00
jfmcarreira b5c5c837e8 Add new information in modules 2019-04-07 18:29:04 +01:00
jfmcarreira 291b0b3890 Fix quality metrics 2019-04-04 19:51:28 +01:00
jfmcarreira 9a24ba2236 Fix CalypFrame to OpenCV 2019-04-04 12:41:24 +01:00
jfmcarreira f502dcc70a Add support for WS-PSNR quality metric 2019-04-03 23:37:16 +01:00
jfmcarreira cf2109e016 Change opencv to optional 2019-04-03 21:45:45 +01:00
jfmcarreira eff57f2fec Fix opencv include 2019-04-03 19:49:08 +01:00
jfmcarreira 608cc20508 Change the condtion checking the extra modules location 2019-04-03 19:43:23 +01:00
jfmcarreira e4e4994f25 Fix cmake code to correctly add extra modules 2019-04-03 19:38:36 +01:00
jfmcarreira a8a8043ced Fix the cmake code to support external modules 2019-04-03 18:51:36 +01:00
jfmcarreira e42f0d02bb Major changes in OpenCV handling
CalypFrame to Mat conversion
Remove custom modules
2019-04-03 16:37:32 +01:00
jfmcarreira 97c2fccf1a Fix comments in 360 modules 2019-03-27 14:56:43 +00:00
jfmcarreira 2d1af68418 Reverse change to use calyp-deployment repo 2019-03-21 23:12:03 +00:00
jfmcarreira 9b82ed0e88 Appveyor: do not lock the VM in the end 2019-03-21 13:58:26 +00:00
jfmcarreira 9a05fa3e62 Finish appveyor CI and add badge 2019-03-21 02:20:17 +00:00
jfmcarreira 57c82be827 Add BuildPkg.cmake with instruction to build Windows and Linux pkgs 2019-03-21 01:43:21 +00:00
jfmcarreira 3bcc61780b Improve AppVeyor and change opencv dep 2019-03-21 01:29:37 +00:00
jfmcarreira 5b633f7bda Fix lack of opencv dep in some modules 2019-03-20 22:55:32 +00:00
jfmcarreira 777f39ff9d Re-add appveyor configuration 2019-03-20 22:31:35 +00:00
jfmcarreira 518cd558e3 Delete .appveyor.yml 2019-03-20 15:24:49 +00:00
jfmcarreira 6bebaf0e2e Add AppVeyor configuration 2019-03-20 14:34:32 +00:00
jfmcarreira 2eead20ef0 Update travis CI and add badge 2019-03-20 14:11:23 +00:00
jfmcarreira cff796a4b7 Add different interpolation techniques to the ERP to NxN conversion 2019-03-12 02:18:11 +00:00
jfmcarreira 432d2c6cad Add module to convert ERP to NxN 2019-03-12 02:05:49 +00:00
jfmcarreira 183052148e Merge branch 'master' into private 2019-03-11 23:53:29 +00:00
jfmcarreira fda7e0f0c6 Fix frameToBuffer when using interleaved formats 2019-03-08 18:16:38 +00:00
jfmcarreira 75f16c2b34 Bugfix: Do not guess format if forcing config 2019-03-07 21:54:16 +00:00
jfmcarreira 0013190d27 Allow to save ppm using the StreamHandlerPortableMap 2019-03-07 16:01:15 +00:00
jfmcarreira ea613e097f Move warning flag to GNU compilers
Move -Wno-deprecated-declarations flag to GNU compilers only. This does not exist on windows
2019-03-06 19:06:00 +00:00
jfmcarreira a0fa4364e3 Merge pull request #1 from JNSFilipe/master
Improvements in guessing the sequence format form the name of the file
2019-03-06 18:37:44 +00:00
JFilipe df38f3d832 Name of the file is now read form the end to the begining, in order to guess seuqence format 2019-02-28 21:42:29 +00:00
JFilipe be0c5dca74 Merge branch 'master' of https://github.com/JNSFilipe/calyp 2019-02-28 21:26:47 +00:00
JFilipe f24adede0f add qcif format support and frame rate guessing on opening sequence 2019-02-28 21:25:34 +00:00
jfmcarreira b671596a24 Show configuration windows when it fails to open using a guess 2019-02-28 18:05:15 +00:00
jfmcarreira 805cee6fbc Improve frame difference to support multiple channels 2019-02-28 18:04:47 +00:00
jfmcarreira b3340bb13b Fix StreamHandlerLibav ffmpeg version check 2019-02-27 22:02:19 +00:00
JFilipe 2eec03b23f Enable OpenCV4 compability 2019-02-25 18:09:43 +00:00
jfmcarreira 2b00cceb09 Add a log including the frame num 2019-02-22 17:44:40 +00:00
jfmcarreira b20d5aef49 Fix CalypTools loop with the new module API 2019-02-22 17:31:53 +00:00
jfmcarreira 1dfbc06d7f Fix re-using instance using QDBus 2019-02-22 14:49:21 +00:00
jfmcarreira bad10649e3 Test some code 2019-02-21 02:41:16 +00:00
jfmcarreira c47192f5f3 Add module to reverse transform from video to cube map projection
Add module and fix bug in CalypFrame and add new feature to modules API 3
2019-02-20 23:26:28 +00:00
jfmcarreira ca562ae9f4 Bugfixes and improvements
Uniform the use of unsigned long in the frame number by defining a ClpULong type
CalypFrame Add function to copyTo a specific position
2019-02-20 22:22:43 +00:00
jfmcarreira 00ec0485f4 Fix bits per pixel in calypTools 2019-02-20 04:41:28 +00:00
jfmcarreira b5a5bb90f9 Fix bugs in CalypFrame 2019-02-20 04:41:07 +00:00
jfmcarreira 2129d05e6e Add new API for modules 2019-02-20 03:26:44 +00:00
jfmcarreira 710731db55 Change resolution list 2019-02-08 14:02:34 +00:00
jfmcarreira f2d8b06db2 Fix support for interlaced formats with more than 1 byte / pixel 2019-02-01 18:25:39 +00:00
jfmcarreira 37e14ff1bb Fix axis limits when using several plots 2019-01-06 23:17:24 +00:00
jfmcarreira c0b0388b02 Add average quality into the plot window 2019-01-06 22:37:48 +00:00
jfmcarreira 40d1189275 Add quality metrics units 2019-01-06 22:37:15 +00:00
jfmcarreira 17dbd59338 News year formating
Update copyrights to 2019
Minor code formating while passing formating script to all files
2019-01-06 21:59:04 +00:00
jfmcarreira 088c1955e0 Add Google tests 2018-10-18 18:05:47 +01:00
jfmcarreira 8ed4dc81dd Fix libav seek to the beginning of the stream 2018-10-18 03:09:30 +01:00
jfmcarreira cac909c35e Merge branch 'master' into devel 2018-10-18 02:56:51 +01:00
jfmcarreira 59c6d797f6 Add EOF support to stream handler 2018-10-18 02:51:15 +01:00
jfmcarreira a473abc498 Fix some code and remove old SSE code 2018-10-14 22:13:41 +01:00
jfmcarreira 8408b7ba2b Add new cmake flags and fix warnings 2018-10-14 19:56:36 +01:00
jfmcarreira 1ea65cabf0 Update QCustomPlot library to version 2.0.1 2018-10-14 19:55:07 +01:00
jfmcarreira 57721f5d1a Fix warning in HEVCIntraPrediction module 2018-10-14 19:54:31 +01:00
jfmcarreira a26bd74b0d Accept all wheel events in ViewArea 2018-10-14 01:56:59 +01:00
jfmcarreira 5cea952d32 Add support for residue in HEVC intra pred module 2018-10-13 15:43:10 +01:00
jfmcarreira f219ee1b3e Fix error message 2018-10-13 15:41:52 +01:00
jfmcarreira 4e67dd0adf add TARGET_INCLUDE_DIRECTORIES to the Calyp library 2018-10-03 23:05:56 +01:00
jfmcarreira 1810be9489 Add option to change grid size and save it 2018-07-24 22:54:43 +01:00
jfmcarreira 6657a738b8 Merge branch 'master' into devel 2018-07-24 22:27:25 +01:00
jfmcarreira aa87bda65c Add rectangle with the whole frame 2018-07-24 22:24:31 +01:00
jfmcarreira 322ddfb7da Merge branch 'master' into devel 2018-07-24 20:40:08 +01:00
jfmcarreira 76b0e01d4c Fix mouseMoveEvent 2018-07-24 20:40:03 +01:00
jfmcarreira ac996ea577 Add function to show module info 2018-07-24 20:39:37 +01:00
jfmcarreira def17102e5 Add option to show module info in the video window 2018-07-24 20:39:18 +01:00
jfmcarreira 58e975a681 Implement an initial approach for all directional intra modes 2018-07-24 19:48:50 +01:00
jfmcarreira 34e01b59f5 Add module to measure HEVC intra-prediction modes 2018-07-23 21:43:57 +01:00
jfmcarreira f770266250 Fix bug in gray images with more than 8 bits 2018-06-27 14:14:22 +01:00
jfmcarreira 1ef70c485d Update to version 1.0 codename chaos 2018-05-07 22:43:18 +01:00
jfmcarreira a133fabe9e Fix warnings 2018-05-07 22:35:22 +01:00
jfmcarreira 0654f4260d Add frame concatenation module 2018-05-07 22:11:56 +01:00
jfmcarreira 412cd8ccb7 Fix problem with frame swapping in modules 2018-05-07 22:10:35 +01:00
jfmcarreira bd0e1296b4 Fix bug when measuring quality of frame with only one component 2018-04-04 22:06:40 +01:00
jfmcarreira bcba3c7368 Fix bug when saving frame 2018-04-04 21:58:25 +01:00
jfmcarreira 6ce6b95b30 Fix error in modules examples 2018-04-04 21:58:10 +01:00
jfmcarreira 7470bc1ffd Complete last commit:
fix the log message
2018-03-16 18:52:45 +00:00
jfmcarreira 6a708a00ac Change return values to negative ints 2018-03-16 18:49:09 +00:00
jfmcarreira 7f8b8c6ee3 Add missing ffmpeg dlls install 2018-03-16 00:10:50 +00:00
jfmcarreira eed59123d5 Fix IF condition in cmake 2018-03-15 23:27:57 +00:00
jfmcarreira 5d44227a0f Bugfix: incorrect space in config.h.in 2018-03-15 23:19:42 +00:00
jfmcarreira 3a43289fa1 Fix visual studio error 2018-03-15 23:09:57 +00:00
jfmcarreira b5d97c1831 Remove packaging information 2018-03-15 23:09:39 +00:00
jfmcarreira 0b429a0c34 Refactor Playuver into Calyp
commit 1fd9cf34f06ba2a156919b5c9b73c31d4c6c6257
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Mon Mar 12 18:06:39 2018 +0000

    Remove code style

commit 165588840126a7ab35b32e5be47f00c613829ef3
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Mon Mar 12 18:06:25 2018 +0000

    Update Mainpage.dox

commit 5b1a2773c48697346c7b0b64519b81a5aecc0150
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Mon Feb 19 03:46:24 2018 +0000

    Re-add CalypPixel.cpp but keep include with frame class

commit 2343be49ff4906c3171d2df7791e3cf34494eb21
Author: Joao Santos <joaompssantos@gmail.com>
Date:   Sun Feb 18 21:06:57 2018 +0000

    Fixed several things:
    - Removed unused define
    - Added: #include <cassert> to MainWindow.cpp
    - Fixed compilation issue when USE_FFMPEG is OFF on CalypStream.cpp

commit 8d1d64bac828a6bcdfa6af977a5d17d0792acb69
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Thu Feb 15 02:14:13 2018 +0000

    Fix several things:
    - Fix examples
    - Improve code formatting script
    - Change generated cmake config file

commit ea1d0265f1e9300f76fd3f0c8ca03d110ec13eaa
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Thu Feb 15 01:28:50 2018 +0000

    Fix dump of the module list: remove the use of char arrays

commit b4d19dda169715113a74713ca62d05f5a18fd0b5
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 14 23:20:56 2018 +0000

    Increase linesize of tools help

commit 8b3eab54e376863276b0d7e032f9e1de8aaf90e5
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 14 23:20:35 2018 +0000

    Fix CalypPixel

commit 1c6ba03c379518acf5fc6f1fdf328ca740a8851d
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 14 22:24:10 2018 +0000

    Enums CalypPixelFormats and CalypColorSpace are now class independent

commit 5dcc35e1716a70095e1720b01823c2e3a3980576
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 14 02:04:31 2018 +0000

    Change functions input and return types

commit 5514e3e24f9b428d5db71156561b2d8b6f61dd23
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 14 02:04:31 2018 +0000

    Change functions input and return types

commit fae7a9a91e1899e7a2833c634221f970d44b8fb6
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 14 01:39:14 2018 +0000

    Replace custom types with std ones

commit 0c3b62b8ea01903e213d9e8dd73a5b49c7c8c36e
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 14 00:37:18 2018 +0000

    Refactoring entries with Playuver name with Calyp
    Replace number of frames and add CLP tag into public definitions

commit e8cd8d7a219446513a5dda2c183dd892ec25a6f1
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Sat Feb 10 14:42:15 2018 +0000

    Fix min opencv version and missing ffmpeg module

commit 1233598af8ac15c88fa84569942cc6f865325452
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Sat Feb 10 03:10:12 2018 +0000

    Change version to 0.999.0 untill finishing refactoring

commit 1fe0cac8f0e70f352bf6c63b8cb2e06ab43fb633
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Sat Feb 10 00:21:47 2018 +0000

    Change project library

commit 44e9d330bc63b8b8a1687a14ff0be05af0bf2eb5
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Fri Feb 9 01:42:58 2018 +0000

    Change doxygen files and upload new ico

commit 0d6f3408a2682cfac1533a57a2f1b4e2cc1f0f29
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Thu Feb 8 21:25:31 2018 +0000

    Fix logos - different when it is icon or the full logo

commit 9f3561acd4b51c7de5f21d63d7e8f2b43c253148
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Thu Feb 8 01:25:39 2018 +0000

    fix install files

commit 832154e3e40f17a863898a77c929a6c6850ffded
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Thu Feb 8 01:21:23 2018 +0000

    rename calip to calyp

commit 341b32bfcc0133fdbceea9b8390d59190e495b79
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Thu Feb 8 00:58:29 2018 +0000

    Refactor lib, modules and tools

commit b4b988cf80052fdcfe0e1f9099d5435ef7945584
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Thu Feb 8 00:02:33 2018 +0000

    Refactor classes and filename in app

commit 6b4ab728202531ad00db1e6299ee69a01f3594ba
Author: Joao Carreira <jfmcarreira@gmail.com>
Date:   Wed Feb 7 17:49:53 2018 +0000

    Refactor about dialog and background logo

commit d5c954d39fb89d735c4feddf62f529077840ab6c
Author: João Santos <joaompssantos@gmail.com>
Date:   Wed Feb 7 15:05:19 2018 +0000

    Added the misteriously missing new logo.

commit f40d81f765bfdd2dc89c0647cf5f4a80eef845c7
Author: João Santos <joaompssantos@gmail.com>
Date:   Wed Feb 7 14:45:08 2018 +0000

    Added new logo to resource folder.

commit 52dc6d60d6590995d32de33f8199e954e0a6e120
Author: João Santos <joaompssantos@gmail.com>
Date:   Wed Feb 7 14:41:13 2018 +0000

    Added new logo where it was previously forgotten.

commit 6d8e064c3154e5202f01b1b10ba6ab3637383ecd
Author: João Santos <joaompssantos@gmail.com>
Date:   Tue Feb 6 17:44:11 2018 +0000

    About window no longer resizable. Added new logo.
2018-03-12 18:21:07 +00:00
jfmcarreira 5a701c83e7 Add headers as source files 2018-02-06 04:27:33 +00:00
jfmcarreira 014fd2f28b Improve PlaYUVerFrame and add comments 2018-02-06 04:06:39 +00:00
jfmcarreira ee5b07e558 Fix histogram with frames with alpha 2018-02-06 01:40:54 +00:00
jfmcarreira 8ba512f4d0 Improve histogram measurement and display.
Now it is possible to show histogram of luminance in RGB frames
2018-02-06 01:10:16 +00:00
jfmcarreira 2d6ba03d4a Improve PlaYUVerPixel and add support for RGBA format
Changes ColorSpace enum
Add Alpha channel support in pixel class
Add RGBA pixel format to the list of supported formats
2018-02-04 20:32:59 +00:00
jfmcarreira d735df75fd Fix bug with PlaYUVerPixel 2018-02-04 19:32:00 +00:00
jfmcarreira e9e8db92b5 Remove PlaYUVerPixel.* files
Merge PlaYUVerPixel class into PlaYUVerFrame.h as frame and
pixels are always related. This simplifies the lib files that
are installed
2018-02-04 04:07:17 +00:00
jfmcarreira ec1679a2e7 Improve modules examples 2018-02-03 03:20:21 +00:00
jfmcarreira ee24e5a7d3 Improve Stream class to be binary compatible
Add "*" to pixel format when it is not native in App
2018-02-03 03:01:21 +00:00
jfmcarreira 5b91c91b90 Refactor and add new support in LibAvHandler
Refactor list of pixel formats
Add support for custom pixel formats by converting it to YUV444p
2018-02-03 02:12:39 +00:00
jfmcarreira 0b1e4574e6 Remove support for PBM 2018-02-02 16:44:44 +00:00
jfmcarreira 8bfe88e4f4 Fix comments in saliency detection classes 2018-02-02 16:43:25 +00:00
João Santos 2bc89dcc68 Added chagens to Mainpage.dox and README.md 2018-02-02 16:34:30 +00:00
jfmcarreira 2958c03249 Add motion based saliency and improve documentation 2018-02-02 04:56:11 +00:00
jfmcarreira 50cc22cb46 Add saliency detection modules 2018-02-02 03:54:44 +00:00
jfmcarreira a29c269f74 Fix bug with the seek slider 2018-02-02 03:53:51 +00:00
jfmcarreira 5863c3c48d Changes in Modules handling and re-enable module while playing 2018-02-02 03:42:28 +00:00
jfmcarreira 2dfb3f0ecd Format code 2018-02-02 03:03:01 +00:00
jsantos 777073cc23 Corrected background image name and added the logo to the about menu. 2018-02-01 16:40:24 +00:00
jfmcarreira e69f405c9c Add new long name description to modules in order to enhance GUI 2018-02-01 02:44:47 +00:00
jfmcarreira 0fa65ed836 Merge branch 'master' into devel 2018-01-31 02:25:36 +00:00
jfmcarreira fb0e654d74 Update README.md 2018-01-31 02:25:25 +00:00
jfmcarreira ed5876bbc3 Add module to rotate frame 2018-01-31 02:24:55 +00:00
jfmcarreira a55806a4d5 Format code 2018-01-31 02:18:21 +00:00
jfmcarreira 65582eea4c Merge branch 'master' into devel 2018-01-31 01:33:31 +00:00
jfmcarreira 0a8a31bce8 Bugfix:
- Fix seek using ffmpeg libs
 - Fix close of VideoSubWindow
2018-01-31 01:32:29 +00:00
jfmcarreira 87156f24b8 Remove FPS checker 2018-01-30 20:17:20 +00:00
jfmcarreira 6e418f6b71 Disable scroll bars 2018-01-30 20:15:37 +00:00
jfmcarreira 6cce568791 Change zoom lock inner works
Now zoom is locked based on the ratio of the position of the scroll bar
2018-01-30 05:30:04 +00:00
jfmcarreira d021ceefeb Version bump 0.18.3 2018-01-29 01:11:55 +00:00
jfmcarreira 2f21f7322c Fix bug with the frame slider 2018-01-29 01:10:33 +00:00
jfmcarreira 7230adfe2e Improve CMakeLists for lib to better support multiarch 2018-01-20 02:32:21 +00:00
jfmcarreira cd233e30ca Update README.md 2018-01-20 02:04:56 +00:00
jfmcarreira eea084d4a2 Format code 2018-01-20 01:56:58 +00:00
jfmcarreira e9b1717699 Add cast to remove build errors 2018-01-20 01:56:05 +00:00
jfmcarreira c3039f1bd4 Version bump 0.18.1 2018-01-18 23:44:18 +00:00
jfmcarreira 6043e2791b Add soversion to lib 2018-01-18 23:06:11 +00:00
jfmcarreira 706f21066b Version bump 0.18.0 2018-01-18 20:51:27 +00:00
jfmcarreira 0b1a537071 Break dependency from lib to modules 2018-01-18 20:50:38 +00:00
jfmcarreira 06cdda6d8a Change formating and copyrights 2018-01-15 23:47:58 +00:00
jfmcarreira bc5258a94d Start implementation of a method to save the entire stream 2018-01-05 17:27:16 +00:00
jfmcarreira 7e44308626 Fix bug when no file is given when saving a module 2017-12-18 23:28:17 +00:00
jfmcarreira c560449fbf Add some code protection into FrameCrop module 2017-12-18 23:25:45 +00:00
jfmcarreira 25a4e9765f Fix some problems
Fix problems in the histogram calculation
Change handle of frame count in the stream handlers
2017-12-09 02:32:11 +00:00
jfmcarreira fe50d8fa6e Format code 2017-12-06 21:34:54 +00:00
jfmcarreira 0339e90e54 Fix problems in save file 2017-12-06 21:29:38 +00:00
jfmcarreira 3f4b1d8a58 Remove commented code 2017-12-06 21:29:15 +00:00
jfmcarreira 86dec9e98e Change how files are loaded 2017-12-06 21:07:54 +00:00
jfmcarreira 430bdc09cd Major changes on code
Remove Qt4 support
Change include headers
Change the include of QCustomPlot lib and updated code based on upstream
2017-12-06 03:11:02 +00:00
jfmcarreira 73d843abf5 Fix libav handler to support older API 2017-12-06 01:56:54 +00:00
jfmcarreira e788a84c11 Version bump 0.17 2017-12-05 02:44:04 +00:00
jfmcarreira 86feb437df Fix libav problems and correct playing timer 2017-12-05 02:27:37 +00:00
jfmcarreira 7280d26fab Change errors messages and include StreamHandler name 2017-12-04 18:54:12 +00:00
jfmcarreira e5825b602f Fix error when loading sequence 2017-11-30 22:09:52 +00:00
jfmcarreira af55ce11e3 Remove debian related stuff 2017-11-29 22:24:59 +00:00
jfmcarreira 6ba5da0365 Version bump 0.16.1 2017-11-29 22:17:46 +00:00
jfmcarreira 601d25fec6 Fix windows and debian deploy 2017-11-29 20:59:50 +00:00
jfmcarreira e5102114f7 Revert debian/control file on master 2017-11-29 04:29:48 +00:00
jfmcarreira f772b1c569 Version bump 0.16.0 2017-11-29 03:51:30 +00:00
jfmcarreira 4bb15c0efd Change package name 2017-11-29 03:49:27 +00:00
jfmcarreira 61386825c8 Merge branch 'stable' 2017-11-29 03:40:40 +00:00
jfmcarreira 7feb3e0bcc Add debian packaging stuff 2017-11-29 03:30:10 +00:00
jfmcarreira e70c0259f4 Add ffmpeg version check 2017-11-29 03:17:01 +00:00
jfmcarreira 6fe8a0f69e Change format ext api and re-format code 2017-11-27 20:13:05 +00:00
jfmcarreira 327f5921f5 Merge branch 'master' into devel 2017-10-06 02:34:06 +01:00
jfmcarreira 485ba41b55 Fix CMakeLists to correctly check for USE_QTDBUS variable 2017-10-06 02:18:36 +01:00
jfmcarreira cf9219716e Minor change on how to re-use existing instance 2017-10-06 00:15:15 +01:00
jfmcarreira 96be33fc7c Merge branch 'master' into devel 2017-10-04 19:07:04 +01:00
jfmcarreira cb26fb92ae Fix SSIM of chroma samples 2017-10-04 18:20:10 +01:00
jfmcarreira 1d192abcd7 Add thread controlling functions for modules 2017-10-01 04:04:55 +01:00
jfmcarreira b0d5c32099 Merge with stable after wrong versioning 2017-09-28 03:27:33 +01:00
jfmcarreira e99935fe28 Version bump 0.15.0 2017-09-28 03:26:02 +01:00
jfmcarreira a4cf934c76 Version bump 0.14.2 2017-09-27 01:02:52 +01:00
jfmcarreira 67f11592b9 Fix windows build 2017-09-27 00:59:34 +01:00
jfmcarreira 11c60cb659 Fix declaration of an array 2017-09-26 16:32:12 +01:00
jfmcarreira 4ffd0c6ea4 Fix CMakeLists to remove -ldl if not present 2017-09-26 16:09:29 +01:00
jfmcarreira cf920cdde7 Finish last bugfix 2017-09-23 03:58:25 +01:00
jfmcarreira f4c4a4e8e2 Fix dependency to lib DL (dynamic loader) 2017-09-23 03:51:25 +01:00
jfmcarreira 6e7aa9be5e Merge branch 'stable' 2017-09-23 02:09:45 +01:00
jfmcarreira 168f56fe08 Version bump 0.14.1 2017-09-23 02:05:23 +01:00
jfmcarreira 4544affd59 Change VideoHandle class type to QObject 2017-09-23 02:03:12 +01:00
jfmcarreira d9864e584c Change VideoHandle class type to QObject 2017-09-23 02:01:52 +01:00
jfmcarreira 1d07dd6b38 Improve buffering and fix memory leaks
Use a dedicated class to handle frame buffer
Fix memory leak in stream handler and frame allocation
2017-09-22 00:54:46 +01:00
jfmcarreira 58146a6b06 Remove debug code 2017-09-20 23:22:58 +01:00
jfmcarreira d611d2a0df Increase maximum frame rate 2017-09-20 22:40:43 +01:00
jfmcarreira 0d88e74ba7 Add new class to handle framebuffer 2017-09-20 21:42:45 +01:00
231 changed files with 63687 additions and 41268 deletions

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
image: Visual Studio 2019
configuration: Release
platform:
- x64
environment:
access_token:
secure: SMxOWNKN0RkPvICWhIet2FJM5g/zx5mguM/XAPjM2OrC3U2/LAqcBZw0veS9peS4
clone_folder: C:\Projects\calyp
init:
- ps: Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
- git config --global credential.helper store
- git config --global user.email "jfmcarreira@gmail.com"
- git config --global user.name "AppVeyor"
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
- '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64'
- choco install nsis
- choco install opencv
- 'C:\Tools\opencv\build\setup_vars_opencv4.cmd'
- cd C:\Projects
- ps: Start-FileDownload 'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z' ffmpeg.7z
- 7z x ffmpeg.7z -y -offmpeg
- git clone https://github.com/pixlra/calyp-deployment.git
- CALL calyp-deployment/scripts/extract_ffmpeg.bat
- ps: rm C:\Projects\ffmpeg_libraries\bin\*.exe
build_script:
- mv C:\Projects\calyp C:\Projects\calyp-deployment\cmake-helper\
- mkdir C:\Projects\calyp-build
- cd C:\Projects\calyp-build
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DUSE_DYNLOAD=OFF -DOpenCV_DIR="C:/Tools/opencv/build" -DOpenCV_DLL_DIR="C:/Tools/opencv/build/x64/vc15/bin" -DOpenCV_INSTALL_MODULES="world" -DQT_DIR="C:\Qt\latest\msvc2019_64" -DQt5_DIR="C:\Qt\latest\msvc2019_64\lib\cmake\Qt5" -DUSE_QTDBUS=OFF -DAVFORMAT_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avformat.lib -DAVFORMAT_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVCODEC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avcodec.lib -DAVCODEC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVUTIL_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avutil.lib -DAVUTIL_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DSWSCALE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swscale.lib -DSWSCALE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DAVDEVICE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/avdevice.lib -DAVDEVICE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DPOSTPROC_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/postproc.lib -DPOSTPROC_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -DFFMPEG_DIR=C:\Projects\ffmpeg_libraries -DSWRESAMPLE_LIBRARIES=C:/Projects/ffmpeg_libraries/lib/swresample.lib -DSWRESAMPLE_INCLUDE_DIRS=C:/Projects/ffmpeg_libraries/include -G "Visual Studio 16 2019" -A x64 C:\Projects\calyp-deployment\cmake-helper
- cmake --build . --target ALL_BUILD -- /p:Configuration=Release
- cmake --build . --target INSTALL -- /p:Configuration=Release
- cmake --build . --target PACKAGE -- /p:Configuration=Release
after_build:
- IF "%APPVEYOR_REPO_BRANCH%" == "master" (CALL ..\calyp-deployment\scripts\deploy-to-github.bat)
on_failure:
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+20 -21
View File
@@ -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
...
+45
View File
@@ -0,0 +1,45 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-non-private-member-variables-in-classes, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-constant-array-index, -readability-magic-numbers,-cppcoreguidelines-avoid-magic-numbers'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: llvm-else-after-return.WarnOnConditionVariables
value: '0'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
value: '0'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: '0'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: '1'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: llvm-qualified-auto.AddConstToQualified
value: '0'
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: llvm-else-after-return.WarnOnUnfixable
value: '0'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
value: '1'
+117
View File
@@ -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'
+61
View File
@@ -0,0 +1,61 @@
name: Build on Linux
on:
push:
branches:
- master
- devel
pull_request:
branches: [ master ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
check-build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install gcc-10 g++-10 cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev
- uses: actions/checkout@v2
- name: Build with default options
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_WERROR=ON; cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Build without threads
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_WERROR=ON -DCALYP_MANAGED_RESOURCES=OFF -DCALYP_THREADED_MODULES=OFF; cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
check-tests:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install gcc-10 g++-10 cmake qtbase5-dev libavcodec-dev libavformat-dev libavutil-dev libopencv-dev libopencv-video-dev libopencv-contrib-dev
- uses: actions/checkout@v2
- name: Check out tests data
uses: actions/checkout@master
with:
repository: 'pixlra/calyp-testdata'
path: ${{github.workspace}}/tests_data
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -D CMAKE_C_COMPILER=gcc-10 -D CMAKE_CXX_COMPILER=g++-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON -DCALYP_TEST_DATA_DIR=${{github.workspace}}/tests_data
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: CalypLib tests
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -t test
+149
View File
@@ -0,0 +1,149 @@
# Created by https://www.gitignore.io/api/c++,clion,linux
# Edit at https://www.gitignore.io/?templates=c++,clion,linux
deps/**
### C++ ###
# Prerequisites
*.d
# Clang
.cache/
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
### CLion ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
bin/
build/
build-*
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### CLion Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### vscode ###
.vscode/*
*.code-workspace
# Documentation
doc/
# CLang
compile_commands.json
# Build dirs
build*
+29
View File
@@ -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
+4 -3
View File
@@ -1,6 +1,7 @@
language: cpp
dist: xenial
dist: bionic
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 ..
+268 -143
View File
@@ -1,201 +1,326 @@
###
### 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 "2")
SET(CALYP_VERSION_MINOR "0")
SET(CALYP_VERSION_PATCH "1")
SET(CALYP_VERSION
"${CALYP_VERSION_MAJOR}.${CALYP_VERSION_MINOR}.${CALYP_VERSION_PATCH}"
CACHE INTERNAL "" FORCE
)
PROJECT(
${PROJECT_NAME}
VERSION ${CALYP_VERSION}
LANGUAGES "CXX"
)
# ####################################################################################################################################################
# CMake functions
######################################################################################
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
INCLUDE( cmake/ModulesFct.cmake )
# ####################################################################################################################################################
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
INCLUDE(cmake/ModulesFct.cmake)
INCLUDE(FeatureSummary)
INCLUDE(GNUInstallDirs)
######################################################################################
# Project Definition
######################################################################################
set( PROJECT_NAME "playuver" CACHE INTERNAL "" FORCE )
PROJECT( ${PROJECT_NAME} )
SET( PLAYUVER_VERSION_MAJOR "0" )
SET( PLAYUVER_VERSION_MINOR "14" )
SET( PLAYUVER_VERSION_PATCH "1" )
SET( PLAYUVER_VERSION "${PLAYUVER_VERSION_MAJOR}.${PLAYUVER_VERSION_MINOR}.${PLAYUVER_VERSION_PATCH}" CACHE INTERNAL "" FORCE )
######################################################################################
# ####################################################################################################################################################
# Variables
######################################################################################
# ####################################################################################################################################################
OPTION( BUILD_APP "Build GUI Application" ON )
OPTION( BUILD_TOOLS "Build Command Line Application" ON )
OPTION( BUILD_EXAMPLES "Build Examples" OFF )
OPTION( BUILD_DOC "Build Documentation" OFF )
OPTION( BUILD_TESTS "Build 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 Tests" OFF)
OPTION(BUILD_WITH_SANITIZERS "Build with sanitizers" OFF)
OPTION(BUILD_WITH_THREAD_SANITIZER "Build with thread sanitizer" 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" ON)
OPTION(USE_WERROR "Warnings as errors" OFF)
OPTION(USE_STATIC "Use static libs" OFF)
OPTION(USE_IWYU "Use include what you use tool" OFF)
######################################################################################
# ####################################################################################################################################################
# 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
# ####################################################################################################################################################
INCLUDE(FetchContent)
SET(FETCHCONTENT_BASE_DIR "${CMAKE_SOURCE_DIR}/deps")
# Doxygen
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
)
# Type safe
FETCHCONTENT_DECLARE(
type_safe
GIT_REPOSITORY https://github.com/foonathan/type_safe
GIT_TAG v0.2.2
SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/type_safe"
)
SET_PACKAGE_PROPERTIES(
type_safe PROPERTIES
URL "https://github.com/foonathan/type_safe"
DESCRIPTION "Zero overhead abstractions that use the C++ type system to prevent bugs."
TYPE REQUIRED
)
FETCHCONTENT_MAKEAVAILABLE(type_safe)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/deps/type_safe/include/ ${CMAKE_SOURCE_DIR}/deps/type_safe/external/debug_assert/)
# Catch2 and Google Tests
IF(BUILD_TESTS)
FETCHCONTENT_DECLARE(googletest URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip)
# For Windows: Prevent overriding the parent project's compiler/linker settings
SET(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE
)
FETCHCONTENT_DECLARE(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.1
)
SET_PACKAGE_PROPERTIES(
googletest PROPERTIES
URL "https://github.com/google/googletest"
DESCRIPTION "Google unit tests"
TYPE OPTIONAL
)
SET_PACKAGE_PROPERTIES(
Catch2 PROPERTIES
URL "https://github.com/catchorg/Catch2"
DESCRIPTION "Catch2 unit tests"
TYPE OPTIONAL
)
FETCHCONTENT_MAKEAVAILABLE(googletest Catch2)
INCLUDE(${CMAKE_SOURCE_DIR}/deps/catch2-src/contrib/Catch.cmake)
INCLUDE(CTest)
ENABLE_TESTING()
SET(CALYP_TEST_DATA_DIR
"CALYP_TEST_DATA_DIR"
CACHE PATH "Location of video information for testing"
)
ENDIF()
# OpenCV
OPTION(USE_OPENCV "Add OpenCV support" ON)
IF(USE_OPENCV)
FIND_PACKAGE(OpenCV COMPONENTS core highgui imgproc video)
IF(${OpenCV_FOUND})
SET(USE_OPENCV TRUE)
LIST(APPEND OPENCV_MODULES core highgui imgproc video)
FIND_PACKAGE(OpenCV COMPONENTS videoio photo)
IF(${OPENCV_VIDEOIO_FOUND})
LIST(APPEND OPENCV_MODULES videoio)
ENDIF()
IF(${OPENCV_PHOTO_FOUND})
LIST(APPEND OPENCV_MODULES photo)
ENDIF()
ELSE()
SET(USE_OPENCV FALSE)
ENDIF()
ENDIF()
SET_PACKAGE_PROPERTIES(
OpenCV PROPERTIES
URL "http://opencv.willowgarage.com"
DESCRIPTION "OpenCV library support in CalypFrame"
TYPE OPTIONAL
)
# FFmpeg
OPTION(USE_FFMPEG "Add FFMPEG support" ON)
IF(USE_FFMPEG)
FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
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)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
IF(MSVC)
ADD_COMPILE_OPTIONS(/std:c++20)
ELSE()
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
ADD_DEFINITIONS(-std=gnu++2a)
ELSE()
ADD_DEFINITIONS(-std=c++20)
ENDIF()
ENDIF()
IF(NOT CMAKE_BUILD_TYPE)
MESSAGE(STATUS "No build type selected, default to Release")
SET(CMAKE_BUILD_TYPE "Release")
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops")
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") endif()
IF(USE_WERROR)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
ENDIF()
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
IF(BUILD_WITH_SANITIZERS)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fsanitize=leak -fsanitize=undefined")
ENDIF()
IF(BUILD_WITH_THREAD_SANITIZER)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=thread")
ENDIF()
IF(USE_IWYU)
FIND_PROGRAM(iwyu_path NAMES include-what-you-use iwyu REQUIRED)
SET(CXX_INCLUDE_WHAT_YOU_USE ON)
ENDIF()
# ####################################################################################################################################################
# Configure targets
######################################################################################
# ####################################################################################################################################################
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)
IF(${BUILD_TOOLS} OR ${BUILD_APP})
ADD_SUBDIRECTORY(modules)
ENDIF()
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
IF( USE_WERROR )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
IF(${BUILD_TOOLS})
ADD_SUBDIRECTORY(tools)
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_APP})
ADD_SUBDIRECTORY(app)
ENDIF()
IF( ${BUILD_APP} )
ADD_SUBDIRECTORY( app )
IF(${BUILD_EXAMPLES})
ADD_SUBDIRECTORY(examples)
ENDIF()
IF( ${BUILD_EXAMPLES} )
ADD_SUBDIRECTORY( examples )
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
######################################################################################
# ####################################################################################################################################################
# Final information dump
######################################################################################
# ####################################################################################################################################################
MESSAGE("")
MESSAGE( STATUS "${PROJECT_NAME} INFORMATION" )
MESSAGE( STATUS "Version: " "${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)
+68 -68
View File
@@ -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
View File
@@ -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)
- Lui­s 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)
- [**Lui­s Lucas** ](https://github.com/lfrlucas) (Founder, Developer)
- [**Joao Santos** ](https://github.com/jpataias) (Contributor)
- [**JNSFilipe** ](https://github.com/JNSFilipe) (Contributor)
*/
-49
View File
@@ -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>
+39 -23
View File
@@ -1,6 +1,14 @@
# [PlaYUVer](https://github.com/pixlra/playuver)
# Calyp
## Enhanced YUV video player based on Qt focusing on image/video analysis
## Build Status
| Master | Development |
|--|--|
| ![master branch](https://github.com/pixlra/calyp/actions/workflows/build.yml/badge.svg?branch=master) | ![devel branch](https://github.com/pixlra/calyp/actions/workflows/build.yml/badge.svg?branch=master) |
[![Windows status](https://ci.appveyor.com/api/projects/status/ea2ktvtg7uqwrika/branch/master?svg=true)](https://ci.appveyor.com/project/jfmcarreira/calyp/branch/master)
## Features
- Support for libavformat and libavcodec;
@@ -11,25 +19,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
- Powefull command-line tool for quality and frame processing algorithms (uses the referred APIs)
- Frame level quality measurement API based on the CalypFrame class
- Powerful 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,34 +47,41 @@
## 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)
- **Lui­s Lucas** (luisfrlucas@gmail.com)
## Development Team
- [**Joao Carreira**](https://github.com/jfmcarreira) (Founder, Main Developer)
- [**Lui­s 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
3. a Qt development environment: QtCore, QtGui, QtWidgets, QtPrintSupport and QtConcurrent (version 4 or higher)
3. a Qt development environment: QtCore, QtGui, QtWidgets, QtPrintSupport and QtConcurrent (version 5 or higher)
4. Optional: QtDBus, OpenCV, FFmpeg
* **List of required commands**
```
mkdir build
cd build
cmake -DUSE_QT4=OFF -DUSE_FFMPEG=ON -DUSE_OPENCV=ON .. (for FFmpeg and OpenCV support)
cmake -DUSE_FFMPEG=ON -DUSE_OPENCV=ON .. (for FFmpeg and OpenCV support)
make
make install
```
+129 -133
View File
@@ -1,184 +1,180 @@
###
### 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}/.. ${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)
OPTION(CALYP_MANAGED_RESOURCES "Handle streams in separate threads" ON)
OPTION(CALYP_THREADED_MODULES "Use threads for modules" ON)
#####################################################################################
# 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 )
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
)
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
VideoSubWindow.cpp
ViewArea.cpp
# Module Video
ResourceHandle.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
VideoSubWindow.cpp
VideoStreamSubWindow.cpp
ModuleSubWindow.cpp
ViewArea.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
# 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)
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-enum-enum-conversion")
ENDIF()
# 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)
+266
View File
@@ -0,0 +1,266 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file CalypAppModuleIf.cpp
* \brief Calyp modules interface
*/
#include "CalypAppModuleIf.h"
#include <QAction>
#include <QApplication>
#include <QDockWidget>
#include "ModuleHandleDock.h"
#include "ModuleSubWindow.h"
#include "VideoSubWindow.h"
#include "lib/CalypFrame.h"
#include "lib/CalypStream.h"
CalypAppModuleIf::CalypAppModuleIf( QObject* parent, QAction* action, CalypModulePtr&& module )
: m_pcModuleAction( action ), m_pcModule( std ::move( module ) )
{
setParent( parent );
#ifdef CALYP_THREADED_MODULES
setObjectName( m_pcModule->m_pchModuleName );
#endif
m_frameList.reserve( m_pcModule->m_uiNumberOfFrames );
m_frameListPtr.reserve( m_pcModule->m_uiNumberOfFrames );
m_pcSubWindow.resize( m_pcModule->m_uiNumberOfFrames, nullptr );
}
CalypAppModuleIf::~CalypAppModuleIf()
{
#ifdef CALYP_THREADED_MODULES
wait();
#endif
if( m_pcModuleDock )
{
auto* ptr = m_pcModuleDock;
m_pcModuleDock = NULL;
ptr->close();
delete ptr;
}
if( m_pcDisplaySubWindow )
{
auto* ptr = m_pcDisplaySubWindow;
m_pcDisplaySubWindow = NULL;
ptr->closeSubWindow();
delete ptr;
}
if( m_pcDockWidget )
{
m_pcDockWidget->close();
delete m_pcDockWidget;
}
if( m_pcModule )
{
m_pcModule->destroy();
m_pcModule = nullptr;
}
}
void CalypAppModuleIf::update( bool isPlaying )
{
if( m_pcDisplaySubWindow )
{
m_pcDisplaySubWindow->refreshSubWindow();
}
else
{
apply( isPlaying );
}
}
// void CalypAppModuleIf::setPlaying( bool isPlaying )
// {
// if( m_pcDisplaySubWindow )
// {
// m_pcDisplaySubWindow->setPlaying( isPlaying );
// }
// }
bool CalypAppModuleIf::isRunning() const
{
#ifdef CALYP_THREADED_MODULES
return QThread::isRunning();
#else
return false;
#endif
}
void CalypAppModuleIf::run()
{
bool result = process();
if( result )
{
EventData* eventData = new EventData( m_bSuccess, this );
QCoreApplication::postEvent( parent(), eventData );
}
}
bool CalypAppModuleIf::apply( bool isPlaying, bool disableThreads )
{
bool moduleExecuted = false;
if( m_pcModule->m_iModuleType == ClpModuleType::FrameProcessing )
{
if( m_pcDisplaySubWindow )
{
m_pcDisplaySubWindow->setFillWindow( true );
}
else
{
m_pcSubWindow[0]->setFillWindow( true );
}
}
if( !( isPlaying && m_pcModule->m_uiModuleRequirements.is_set( ClpModuleFeature::SkipWhilePlaying ) ) )
{
m_frameList.clear();
for( unsigned int i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ )
{
m_frameList.push_back( m_pcSubWindow[i]->getCurrFrameAsset() );
}
// Skip module is is already running
if( isRunning() )
return moduleExecuted;
moduleExecuted = true;
#ifdef CALYP_THREADED_MODULES
if( !disableThreads )
{
wait();
start();
}
else
#endif
{
QApplication::setOverrideCursor( Qt::WaitCursor );
process();
QApplication::restoreOverrideCursor();
show();
}
}
return moduleExecuted;
}
bool CalypAppModuleIf::process()
{
m_bSuccess = false;
if( m_frameList.empty() )
return false;
#ifdef CALYP_THREADED_MODULES
QMutexLocker locker( &m_Mutex );
#endif
m_frameListPtr.clear();
for( auto& frame : m_frameList )
{
m_frameListPtr.push_back( frame.get() );
}
if( m_pcModule->m_iModuleType == ClpModuleType::FrameProcessing )
{
CalypFrame* framePtr{ nullptr };
if( m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
{
framePtr = m_pcModule->process( m_frameListPtr );
}
else
{
framePtr = m_pcModule->process( m_pcSubWindow[0]->getCurrFrame() );
}
assert( framePtr != nullptr );
m_pcProcessedFrame = std::shared_ptr<CalypFrame>{ framePtr, []( CalypFrame* ptr ) {} };
}
else if( m_pcModule->m_iModuleType == ClpModuleType::FrameMeasurement )
{
if( m_pcModule->m_iModuleAPI >= CLP_MODULE_API_2 )
{
m_dMeasurementResult = m_pcModule->measure( m_frameListPtr );
}
else
{
m_dMeasurementResult = m_pcModule->measure( m_pcSubWindow[0]->getCurrFrame() );
}
}
else
{
return false;
}
m_bSuccess = true;
return true;
}
void CalypAppModuleIf::show()
{
#ifdef CALYP_THREADED_MODULES
if( m_canceling )
return;
#endif
switch( m_pcModule->m_iModuleType )
{
case ClpModuleType::FrameProcessing: {
auto displayWindow = qobject_cast<VideoSubWindow*>( m_pcDisplaySubWindow );
if( displayWindow == nullptr )
displayWindow = m_pcSubWindow[0];
#ifdef CALYP_THREADED_MODULES
if( m_Mutex.try_lock() )
{
displayWindow->setFillWindow( false );
displayWindow->setCurrFrame( m_pcProcessedFrame );
m_Mutex.unlock();
}
#else
displayWindow->setFillWindow( false );
displayWindow->setCurrFrame( m_pcProcessedFrame );
#endif
break;
}
case ClpModuleType::FrameMeasurement:
m_pcModuleDock->setModuleReturnValue( m_dMeasurementResult );
break;
default:
assert( false );
}
}
void CalypAppModuleIf::disable()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
#ifdef CALYP_THREADED_MODULES
m_canceling = true;
m_Mutex.lock();
m_Mutex.unlock();
#endif
m_frameList.clear();
m_frameListPtr.clear();
while( m_pcSubWindow.size() > 0 )
{
auto window = m_pcSubWindow.back();
m_pcSubWindow.erase( m_pcSubWindow.end() - 1 );
if( window != nullptr )
window->disableModule( this );
}
QApplication::restoreOverrideCursor();
}
+124
View File
@@ -0,0 +1,124 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file CalypAppModuleIf.h
* \brief Calyp App modules interface
*/
#ifndef __CALYPAPPMODULESIF_H__
#define __CALYPAPPMODULESIF_H__
#include <QEvent>
#include <QPointer>
#include <QVector>
#include <cstdio>
#include <iostream>
#include "config.h"
#ifdef CALYP_THREADED_MODULES
#include <QMutex>
#include <QThread>
#endif
#include "CommonDefs.h"
#include "ModuleHandleDock.h"
// #include "lib/CalypFrame.h"
#include "lib/CalypModuleIf.h"
// #include "lib/CalypStream.h"
class QAction;
class QDockWidget;
class CalypStream;
class CalypFrame;
class VideoSubWindow;
class ModuleSubWindow;
class CalypAppModuleIf : std::enable_shared_from_this<CalypAppModuleIf>,
#ifdef CALYP_THREADED_MODULES
public QThread
#else
public QObject
#endif
{
friend class ModulesHandle;
friend class ModuleHandleDock;
friend class ModulesHandleOptDialog;
public:
class EventData : public QEvent
{
public:
EventData( bool success, CalypAppModuleIf* module )
: QEvent( QEvent::User ), m_bSuccess{ success }, m_pcModule{ module }
{
}
bool m_bSuccess;
QPointer<CalypAppModuleIf> m_pcModule;
};
CalypAppModuleIf( QObject* parent, QAction* action, CalypModulePtr&& module );
~CalypAppModuleIf();
auto getSubWindowList() const -> const std::vector<VideoSubWindow*>& { return m_pcSubWindow; }
CalypModuleIf* getModule() { return m_pcModule.get(); }
auto getModuleRequirements() const -> ClpModuleFeatures { return m_pcModule->m_uiModuleRequirements; }
std::string moduleInfo() const { return m_pcModule->moduleInfo(); }
void update( bool isPlaying );
bool apply( bool isPlaying = false, bool disableThreads = false );
bool process();
// void setPlaying( bool isPlaying );
bool isRunning() const;
void show();
void disable();
protected:
virtual void run();
private:
bool m_bSuccess{ false };
QAction* m_pcModuleAction{ nullptr };
CalypModulePtr m_pcModule{ nullptr };
std::vector<VideoSubWindow*> m_pcSubWindow;
// The module owns the related widgets
ModuleSubWindow* m_pcDisplaySubWindow{ nullptr };
QDockWidget* m_pcDockWidget{ nullptr };
ModuleHandleDock* m_pcModuleDock{ nullptr };
std::unique_ptr<CalypStream> m_pcModuleStream{ nullptr };
std::vector<std::shared_ptr<CalypFrame>> m_frameList;
std::vector<CalypFrame*> m_frameListPtr;
std::shared_ptr<CalypFrame> m_pcProcessedFrame{ nullptr };
double m_dMeasurementResult{ 0 };
#ifdef CALYP_THREADED_MODULES
QMutex m_Mutex;
std::atomic<bool> m_canceling{ false };
#endif
};
#endif // __CALYPAPPMODULESIF_H__
+9 -9
View File
@@ -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__
+15 -12
View File
@@ -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,10 +44,15 @@ GridManager::GridManager()
m_cGridColor = QColor( Qt::white );
}
void GridManager::setGridSize( int newsize )
{
m_uiHSpace = m_uiVSpace = newsize;
}
////////////////////////////////////////////////////////////////////////////////
// Grid Drawer
////////////////////////////////////////////////////////////////////////////////
void GridManager::drawGrid( QPixmap& image, const QRect& area, QPainter* painter )
void GridManager::drawGrid( const QImage& image, const QRect& area, QPainter* painter )
{
int offsetx = 0; // Grid offset doesn't applies to SCODE
int offsety = 0; // project for now...
@@ -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 );
}
+13 -10
View File
@@ -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,15 +45,17 @@ class GridManager
public:
enum Style
{
IntersectionDot = 0,
IntersectionCross,
intersectionDot = 0,
intersectionCross,
Dashed,
Solid
};
GridManager();
void drawGrid( QPixmap& image, const QRect& area, QPainter* painter );
void setGridSize( int newsize );
void drawGrid( const QImage& image, const QRect& area, QPainter* painter );
/**
* @returns a QRect defined by the grid that contains the point (x, y).
@@ -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;
+267 -225
View File
@@ -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,35 @@
#include <QDropEvent>
#include <QSignalMapper>
#include <QtDebug>
#include <memory>
#include "AboutDialog.h"
#include "ModulesHandle.h"
#include "QualityHandle.h"
#include "SubWindowAbstract.h"
#include "SubWindowHandle.h"
#include "SubWindowSelectorDialog.h"
#include "VideoHandle.h"
#include "VideoSubWindow.h"
#include "lib/CalypOptions.h"
#ifdef USE_FERVOR
#include "fvupdater.h"
#endif
#include "AboutDialog.h"
#include "DialogSubWindowSelector.h"
#include "ModulesHandle.h"
#include "PlaYUVerSubWindowHandle.h"
#include "QualityHandle.h"
#include "SubWindowAbstract.h"
#include "VideoHandle.h"
#include "VideoSubWindow.h"
#include "lib/PlaYUVerOptions.h"
#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_appResourceHandle = std::make_unique<ResourceHandle>();
m_pcWindowHandle = new SubWindowHandle( this );
m_appModuleVideo = new VideoHandle( this, m_pcWindowHandle );
m_appModuleQuality = new QualityHandle( this, m_pcWindowHandle );
@@ -73,34 +77,34 @@ PlaYUVerApp::PlaYUVerApp()
readSettings();
setWindowTitle( QApplication::applicationName() );
setWindowIcon( QIcon( ":/images/playuver.png" ) );
setWindowIcon( QIcon( ":logos/calyp-icon.png" ) );
setUnifiedTitleAndToolBarOnMac( true );
setCentralWidget( m_pcWindowHandle );
setCentralWidget( m_pcWindowHandle->getWidget() );
setAcceptDrops( true );
setBackgroundRole( QPalette::Background );
setBackgroundRole( QPalette::Window );
connect( m_pcWindowHandle, SIGNAL( windowActivated() ), this, SLOT( update() ) );
connect( m_pcWindowHandle, SIGNAL( changed() ), this, SLOT( update() ) );
connect( m_appModuleVideo, SIGNAL( changed() ), this, SLOT( update() ) );
connect( m_appModuleQuality, SIGNAL( changed() ), this, SLOT( update() ) );
connect( m_appModuleExtensions, SIGNAL( changed() ), this, SLOT( update() ) );
connect( m_pcWindowHandle, &SubWindowHandle::windowActivated, this, &MainWindow::updateMainWindow );
connect( m_pcWindowHandle, &SubWindowHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
connect( m_appModuleVideo, &VideoHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
connect( m_appModuleQuality, &QualityHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
connect( m_appModuleExtensions, &ModulesHandle::changed, this, &MainWindow::updateMainWindow, Qt::QueuedConnection );
}
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<std::string> m_apcInputs;
std::string strResolution( "" );
std::string strPelFmt( "" );
pcCmdParser.addOptions() /**/
( "input,i", m_apcInputs, "input file" ) /**/
( "size,s", strResolution, "size (WxH)" ) /**/
( "pel_fmt", strPelFmt, "pixel format" );
if( !pcCmdParser.parse( argc, argv ) )
if( pcCmdParser.parse( argc, argv ) < 0 )
{
bRet |= true;
}
@@ -113,14 +117,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 +132,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 +157,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,64 +180,71 @@ Void PlaYUVerApp::closeEvent( QCloseEvent* event )
}
}
Void PlaYUVerApp::closeAll()
void MainWindow::closeAll()
{
m_pcWindowHandle->removeAllSubWindow();
}
Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
void MainWindow::loadFile( CalypFileInfo pStreamInfo )
{
QString filename{ pStreamInfo.m_cFilename };
loadFile( std::move( filename ), std::move( pStreamInfo ) );
}
void MainWindow::loadFile( QString fileName, std::optional<CalypFileInfo> streamInfo )
{
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 );
auto* videoSubWindow = MainWindow::findVideoStreamSubWindow( m_pcWindowHandle, fileName );
if( videoSubWindow )
{
m_pcWindowHandle->setActiveSubWindow( videoSubWindow );
return;
}
videoSubWindow =
new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); // createSubWindow();
SubWindowAbstract* subWindow = videoSubWindow;
if( !pStreamInfo )
videoSubWindow = new VideoStreamSubWindow(); // createSubWindow();
videoSubWindow->setResourceManaget( m_appResourceHandle.get() );
if( !streamInfo.has_value() )
{
Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName );
pStreamInfo = (PlaYUVerStreamInfo*)( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL );
auto idx = findCalypStreamInfo( m_aRecentFileStreamInfo, fileName );
if( idx >= 0 )
streamInfo = m_aRecentFileStreamInfo.at( idx );
}
try
{
Bool opened = false;
bool opened = false;
if( !pStreamInfo )
if( streamInfo.has_value() )
{
try
{
opened = videoSubWindow->loadFile( std::move( *streamInfo ) );
}
catch( CalypFailure& e )
{
}
}
if( !opened )
opened = videoSubWindow->loadFile( fileName );
else
opened = videoSubWindow->loadFile( 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 +252,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<std::string> 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<std::string>::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e )
{
supported.append( " *." );
currFmt.append( "*." );
supported.append( QString::fromStdString( *e ) );
currFmt.append( QString::fromStdString( *e ) );
}
currFmt.append( ")" );
formatsList << currFmt;
}
@@ -279,84 +298,107 @@ 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() )
{
loadFile( fileNameList.at( i ) );
loadFile( std::move( fileNameList.at( i ) ) );
}
}
}
// 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>();
if( action )
loadFile( recentFile.m_cFilename, &recentFile );
{
loadFile( action->data().value<CalypFileInfo>() );
}
}
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* pcVideoSubWindow = m_pcCurrentVideoSubWindow;
VideoSubWindow* saveWindow = m_pcCurrentVideoSubWindow;
QStringList fileNameList = showFileDialog( false );
if( fileNameList.size() == 1 )
{
QString fileName = fileNameList[0];
m_cLastOpenPath = QFileInfo( fileName ).path();
try
{
saveWindow->save( fileName );
}
catch( CalypFailure& e )
{
QApplication::restoreOverrideCursor();
QString warningMsg =
"Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + e.what();
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
printMessage( warningMsg, CLP_LOG_ERROR );
return;
}
}
}
}
void MainWindow::format()
{
if( auto* pcVideoSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
{
try
{
if( pcVideoSubWindow->loadFile( pcVideoSubWindow->getCurrentFileName(), true ) )
@@ -364,65 +406,63 @@ 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();
}
m_pcCurrentSubWindow = NULL;
update();
updateMainWindow();
}
}
Void PlaYUVerApp::reload()
void MainWindow::reload()
{
if( m_pcCurrentSubWindow )
{
m_pcCurrentSubWindow->refreshSubWindow();
m_pcCurrentSubWindow = NULL;
update();
updateMainWindow();
}
}
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();
}
}
m_pcCurrentSubWindow = NULL;
update();
updateMainWindow();
}
Void PlaYUVerApp::loadAll()
void MainWindow::loadAll()
{
if( m_pcCurrentVideoSubWindow )
if( auto* pcVideoSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
{
printMessage( "Loading file into memory...", LOG_INFO );
m_pcCurrentVideoSubWindow->loadAll();
printMessage( "File loaded", LOG_INFO );
printMessage( "Loading file into memory...", CLP_LOG_INFO );
pcVideoSubWindow->loadAll();
printMessage( "File loaded", CLP_LOG_INFO );
}
}
// ----------------------- Zoom Functions -----------------------
Void PlaYUVerApp::normalSize()
void MainWindow::normalSize()
{
if( m_pcCurrentSubWindow )
{
@@ -431,7 +471,7 @@ Void PlaYUVerApp::normalSize()
}
}
Void PlaYUVerApp::zoomToFit()
void MainWindow::zoomToFit()
{
if( m_pcCurrentSubWindow )
{
@@ -440,12 +480,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 +493,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 +524,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,25 +545,23 @@ Void PlaYUVerApp::dropEvent( QDropEvent* event )
// ----------------------- Sub Window Functions -----------------------
VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
const QString& fileName )
VideoStreamSubWindow* 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 ) );
auto* pcSubWindow = qobject_cast<VideoStreamSubWindow*>( subWindowList.at( i ) );
if( pcSubWindow->getCurrentFileName() == canonicalFilePath )
return qobject_cast<VideoSubWindow*>( pcSubWindow );
return pcSubWindow;
}
return 0;
return nullptr;
}
// ----------------------- Update Functions -----------------------
Void PlaYUVerApp::update()
void MainWindow::updateMainWindow()
{
SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow();
QCoreApplication::processEvents();
@@ -557,31 +594,38 @@ 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;
if( m_pcCurrentSubWindow )
if( m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW )
hasVideoStreamSubWindow = true;
bool hasVideoStreamSubWindow{ false };
bool supportsFormat{ false };
if( m_pcCurrentSubWindow && m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW )
{
hasVideoStreamSubWindow = true;
if( auto* pcVideoSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
{
supportsFormat = pcVideoSubWindow->supportsFormatConfiguration();
}
}
m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false );
@@ -591,7 +635,7 @@ Void PlaYUVerApp::updateMenus()
m_arrayActions[RELOAD_ACT]->setEnabled( hasSubWindow );
m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasSubWindow );
m_arrayActions[FORMAT_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[FORMAT_ACT]->setEnabled( supportsFormat );
m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[ZOOM_IN_ACT]->setEnabled( hasSubWindow );
@@ -608,38 +652,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 +713,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 +729,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 +775,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 +785,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 +793,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] );
@@ -783,12 +829,9 @@ Void PlaYUVerApp::createMenus()
menuBar()->addMenu( m_appModuleVideo->createVideoMenu() );
menuBar()->addMenu( m_appModuleVideo->createImageMenu() );
QMenu* QualityMenu = m_appModuleQuality->createMenu();
menuBar()->addMenu( QualityMenu );
QMenu* ModuleMenu = m_appModuleExtensions->createMenu();
menuBar()->addMenu( ModuleMenu );
QMenu* windowMenu = m_pcWindowHandle->createMenu();
menuBar()->addMenu( windowMenu );
menuBar()->addMenu( m_appModuleQuality->createMenu() );
menuBar()->addMenu( m_appModuleExtensions->createMenu() );
menuBar()->addMenu( m_pcWindowHandle->createMenu() );
menuBar()->addSeparator();
@@ -801,7 +844,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 +865,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 +878,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 +886,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 +904,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 +928,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 +940,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 +951,7 @@ Void PlaYUVerApp::checkRecentFileActions()
}
}
Void PlaYUVerApp::readSettings()
void MainWindow::readSettings()
{
QSettings appSettings;
@@ -921,7 +963,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 +973,7 @@ Void PlaYUVerApp::readSettings()
m_pcWindowHandle->readSettings();
}
Void PlaYUVerApp::writeSettings()
void MainWindow::writeSettings()
{
QSettings appSettings;
@@ -940,7 +982,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();
+55 -45
View File
@@ -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,22 @@
*
*/
#ifndef __PLAYUVERAPP_H__
#define __PLAYUVERAPP_H__
#ifndef __MAINWINDOW_H__
#define __MAINWINDOW_H__
#include "PlaYUVerAppDefs.h"
#include "config.h"
#include <QMainWindow>
#include <QString>
#include <QVector>
#ifdef USE_QTDBUS
#include "PlaYUVerAppAdaptor.h"
#endif
#include <optional>
#include "CommonDefs.h"
#include "VideoStreamSubWindow.h"
#include "VideoSubWindow.h"
#include "config.h"
#ifdef USE_QTDBUS
#include "DBusAppAdaptor.h"
#endif
#include "ResourceHandle.h"
class QCloseEvent;
class QDragEnterEvent;
@@ -54,32 +58,34 @@ class QActionGroup;
class QAction;
class QSignalMapper;
class PlaYUVerOptions;
class PlaYUVerStream;
class PlaYUVerSubWindowHandle;
class CalypOptions;
class CalypStream;
class SubWindowHandle;
class VideoStreamSubWindow;
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( CalypFileInfo pStreamInfo );
void loadFile( QString fileName, std::optional<CalypFileInfo> pStreamInfo = {} );
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 +97,8 @@ private Q_SLOTS:
void open();
// void openDevice();
void openRecent();
void save();
void saveFrame();
void saveStream();
void format();
void reload();
void reloadAll();
@@ -112,12 +119,12 @@ private Q_SLOTS:
void dragEnterEvent( QDragEnterEvent* event );
void dropEvent( QDropEvent* event );
void update();
void updateMainWindow();
void updateZoomFactorSBox();
private:
PlaYUVerAppAdaptor* m_pDBusAdaptor;
PlaYUVerOptions* m_pcCmdParser;
DBusAppAdaptor* m_pDBusAdaptor;
CalypOptions* m_pcCmdParser;
/**
* Save the current subwindow for every category
*/
@@ -125,24 +132,25 @@ private:
VideoSubWindow* m_pcCurrentVideoSubWindow;
QString m_cLastOpenPath;
QStringList showFileDialog( bool bRead );
static VideoSubWindow* findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
const QString& fileName );
static VideoStreamSubWindow* 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;
@@ -155,10 +163,11 @@ private:
* Quality
* Modules
*/
std::unique_ptr<ResourceHandle> m_appResourceHandle;
VideoHandle* m_appModuleVideo;
QualityHandle* m_appModuleQuality;
ModulesHandle* m_appModuleExtensions;
PlaYUVerSubWindowHandle* m_pcWindowHandle;
SubWindowHandle* m_pcWindowHandle;
/**
* Array of menus for the main app
@@ -210,6 +219,7 @@ private:
OPEN_ACT = 0,
OPEN_DEVICE_ACT,
SAVE_ACT,
SAVE_STREAM_ACT,
FORMAT_ACT,
RELOAD_ACT,
RELOAD_ALL_ACT,
@@ -231,9 +241,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 );
setBackgroundRole( QPalette::Window );
}
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_
+114
View File
@@ -0,0 +1,114 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file ModuleSubWindow.cpp
* \brief Video Sub windows handling
*/
#include "ModuleSubWindow.h"
#include <QSettings>
#include <QStaticText>
#include <cassert>
#include "ModulesHandle.h"
ModuleSubWindow::ModuleSubWindow( CalypAppModuleIf* module, QWidget* parent )
: VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW, parent )
{
m_pcDisplayModule = module;
}
ModuleSubWindow::~ModuleSubWindow()
{
}
void ModuleSubWindow::resetWindowName()
{
QString windowName{ "Module" };
if( auto module_ptr = m_pcDisplayModule )
{
windowName.append( " " ).append( module_ptr->getModule()->m_pchModuleLongName );
}
setWindowName( windowName );
}
void ModuleSubWindow::updateVideoWindowInfo()
{
m_cStreamInformation = "";
m_cStreamInformation = "Module";
if( auto module_ptr = m_pcDisplayModule )
{
const auto& arraySubWindows = module_ptr->getSubWindowList();
QStringList windowInfoList;
if( arraySubWindows.size() > 0 )
{
for( std::size_t i = 0; i < arraySubWindows.size(); i++ )
{
if( arraySubWindows[i]->getWindowName() != getWindowName() )
{
windowInfoList.append( QString( "Input %1 - " + arraySubWindows[i]->getWindowName() ).arg( i + 1 ) );
}
}
}
if( module_ptr->getModuleRequirements().is_set( ClpModuleFeature::HasInfo ) )
{
QStringList list = QString::fromStdString( module_ptr->moduleInfo() ).split( '\n' );
windowInfoList.append( list );
}
if( windowInfoList.size() > 0 )
{
m_pcVideoInfo->setInformationTopLeft( windowInfoList );
}
}
if( m_pcCurrFrameAsset )
{
QString m_cPelFmtName = QString::fromStdString( m_pcCurrFrameAsset->getPelFmtName() );
m_cStreamInformation += " | " + m_cPelFmtName;
}
if( m_cStreamInformation.isEmpty() )
{
m_cStreamInformation = " ";
}
}
bool ModuleSubWindow::isPlaying()
{
if( auto module_ptr = m_pcDisplayModule )
{
for( auto window : module_ptr->getSubWindowList() )
{
if( window->isPlaying() )
return true;
}
}
return false;
}
void ModuleSubWindow::refreshSubWindow()
{
if( auto module_ptr = m_pcDisplayModule )
{
setFillWindow( true );
updateVideoWindowInfo();
module_ptr->apply( isPlaying(), false );
}
}
+64
View File
@@ -0,0 +1,64 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file ModuleSubWindow.h
* \brief Video Sub windows handling
*/
#ifndef __MODULESUBWINDOW_H__
#define __MODULESUBWINDOW_H__
#include <QDataStream>
#include <QFuture>
#include <QRect>
#include <QString>
#include <QVector>
#include "CalypAppModuleIf.h"
#include "CommonDefs.h"
#include "VideoSubWindow.h"
#include "config.h"
#include "lib/CalypStream.h"
class VideoInformation;
class ModuleSubWindow : public VideoSubWindow
{
Q_OBJECT
public:
ModuleSubWindow( CalypAppModuleIf* module, QWidget* parent = 0 );
~ModuleSubWindow();
void resetWindowName();
void updateVideoWindowInfo();
bool isPlaying();
void stop(){};
void advanceOneFrame(){};
auto getFrameNum() -> std::uint64_t { return 1; };
void refreshSubWindow();
void setCurrFrame( std::shared_ptr<CalypFrame> pcCurrFrame );
};
#endif // __MODULESUBWINDOW_H__
+233 -266
View File
@@ -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,31 @@
/**
* \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 "ModuleSubWindow.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 )
: 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 );
@@ -53,36 +51,32 @@ Void ModulesHandle::createActions()
connect( m_pcActionMapper, SIGNAL( mapped( int ) ), this, SLOT( processOpt( int ) ) );
// m_arrayActions[FORCE_PLAYING_REFRESH_ACT] = new QAction( "Refresh while
// playing", parent() );
// playing", m_pcParent );
// m_arrayActions[FORCE_PLAYING_REFRESH_ACT]->setStatusTip( "Force module
// refreshing while playing" );
// m_arrayActions[FORCE_PLAYING_REFRESH_ACT]->setCheckable( true );
m_arrayActions[LOAD_EXTERNAL_ACT] = new QAction( "Load external module", parent() );
m_arrayActions[LOAD_EXTERNAL_ACT] = new QAction( "Load external module", m_pcParent );
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], &QAction::triggered, this, &ModulesHandle::loadExternalModule );
m_arrayActions[APPLY_ALL_ACT] = new QAction( "Apply to All", parent() );
m_arrayActions[APPLY_ALL_ACT] = new QAction( "Apply to All", m_pcParent );
m_arrayActions[APPLY_ALL_ACT]->setStatusTip( "Apply module to all frames and save the result" );
connect( m_arrayActions[APPLY_ALL_ACT], SIGNAL( triggered() ), m_pcActionMapper, SLOT( map() ) );
m_pcActionMapper->setMapping( m_arrayActions[APPLY_ALL_ACT], APPLY_ALL_ACT );
m_arrayActions[SWAP_FRAMES_ACT] = new QAction( "Swap frames", parent() );
m_arrayActions[SWAP_FRAMES_ACT] = new QAction( "Swap frames", m_pcParent );
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() ) );
m_arrayActions[DISABLE_ACT] = new QAction( "Disable Modules", m_pcParent );
connect( m_arrayActions[DISABLE_ACT], &QAction::triggered, this, &ModulesHandle::destroyWindowModules );
m_arrayActions[DISABLE_ALL_ACT] = new QAction( "Disable All Modules", parent() );
connect( m_arrayActions[DISABLE_ALL_ACT], SIGNAL( triggered() ), this,
SLOT( destroyAllModulesIf() ) );
m_arrayActions[DISABLE_ALL_ACT] = new QAction( "Disable All Modules", m_pcParent );
connect( m_arrayActions[DISABLE_ALL_ACT], &QAction::triggered, this, &ModulesHandle::destroyAllModulesIf );
m_arrayActions[FORCE_NEW_WINDOW_ACT] = new QAction( "Use New Window", parent() );
m_arrayActions[FORCE_NEW_WINDOW_ACT] = new QAction( "Use New Window", m_pcParent );
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setStatusTip(
"Show module result in a new window. Some modules already force this "
"feature" );
@@ -91,65 +85,64 @@ Void ModulesHandle::createActions()
QMenu* ModulesHandle::createMenu()
{
m_pcModulesMenu = new QMenu( "&Modules", this );
m_pcModulesMenu = new QMenu( "&Modules", m_pcParent );
buildMenu();
return m_pcModulesMenu;
}
Void ModulesHandle::buildMenu()
void ModulesHandle::buildMenu()
{
PlaYUVerModuleIf* pcCurrModuleIf;
QString ModuleIfInternalName;
QAction* currAction;
QMenu* currSubMenu;
for( Int i = 0; i < m_arrayModulesActions.size(); i++ )
for( auto& action : m_arrayModulesActions )
{
delete m_arrayModulesActions.at( i );
delete action;
}
m_arrayModulesActions.clear();
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 );
auto pcCurrModuleIf = it->second();
QString ModuleIfinternalName = QString::fromLocal8Bit( it->first );
currSubMenu = NULL;
if( pcCurrModuleIf->m_pchModuleCategory )
QMenu* currSubMenu{ nullptr };
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 );
QAction* currAction = new QAction( pcCurrModuleIf->getModuleLongName(), m_pcParent );
QString moduleTooltip = pcCurrModuleIf->m_pchModuleTooltip;
if( pcCurrModuleIf->m_uiNumberOfFrames > 1 )
moduleTooltip += QString( " | Requires %1 frames" ).arg( pcCurrModuleIf->m_uiNumberOfFrames );
currAction->setStatusTip( moduleTooltip );
currAction->setData( ModuleIfinternalName );
currAction->setCheckable( false );
connect( currAction, SIGNAL( triggered() ), this, SLOT( activateModule() ) );
connect( currAction, &QAction::triggered, this, &ModulesHandle::activateModule );
m_arrayModulesActions.append( currAction );
if( currSubMenu )
currSubMenu->addAction( currAction );
else
m_pcModulesMenu->addAction( currAction );
pcCurrModuleIf->Delete();
}
m_pcModulesMenu->addAction( m_arrayActions[LOAD_EXTERNAL_ACT] );
@@ -161,82 +154,76 @@ 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;
QAction* currModuleAction;
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
for( Int i = 0; i < m_arrayModulesActions.size(); i++ )
bool hasSubWindow = pcSubWindow != nullptr ? true : false;
for( int i = 0; i < m_arrayModulesActions.size(); i++ )
{
currModuleAction = m_arrayModulesActions.at( i );
currModuleAction->setEnabled( hasSubWindow );
auto* currModuleAction = m_arrayModulesActions.at( i );
// currModuleAction->setEnabled( hasSubWindow );
currModuleAction->setChecked( false );
}
for( Int i = 0; i < m_pcModulesSubMenuList.size(); i++ )
{
m_pcModulesSubMenuList.at( i )->setEnabled( hasSubWindow );
}
// for( int i = 0; i < m_pcModulesSubMenuList.size(); i++ )
//{
// m_pcModulesSubMenuList.at( i )->setEnabled( hasSubWindow );
// }
for( Int i = 0; i < m_arrayActions.size(); i++ )
for( int i = 0; i < m_arrayActions.size(); i++ )
{
m_arrayActions.at( i )->setEnabled( false );
}
m_arrayActions[LOAD_EXTERNAL_ACT]->setEnabled( true );
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setEnabled( hasSubWindow );
m_arrayActions[DISABLE_ALL_ACT]->setEnabled( m_pcPlaYUVerAppModuleIfList.size() > 0 );
m_arrayActions[DISABLE_ALL_ACT]->setEnabled( true );
if( pcSubWindow )
{
QList<PlaYUVerAppModuleIf*> apcCurrentModule = pcSubWindow->getModuleArray();
m_arrayActions[DISABLE_ACT]->setEnabled( apcCurrentModule.size() > 0 );
m_arrayActions[DISABLE_ACT]->setEnabled( pcSubWindow->hasModules() );
if( pcSubWindow->getDisplayModule() )
{
m_arrayActions[APPLY_ALL_ACT]->setEnabled( true );
m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true );
}
for( Int i = 0; i < apcCurrentModule.size(); i++ )
{
currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction;
currModuleAction->setChecked( true );
}
// for( int i = 0; i < apcCurrentModule.size(); i++ )
// {
// currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction;
// currModuleAction->setChecked( true );
// }
}
}
Void ModulesHandle::readSettings()
void ModulesHandle::readSettings()
{
QSettings appSettings;
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked(
appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() );
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setChecked( appSettings.value( "ModulesHandle/UseNewWindow", false ).toBool() );
}
Void ModulesHandle::writeSettings()
void ModulesHandle::writeSettings()
{
QSettings appSettings;
appSettings.setValue( "ModulesHandle/UseNewWindow",
m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() );
appSettings.setValue( "ModulesHandle/UseNewWindow", m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() );
}
Void ModulesHandle::processOpt( Int index )
void ModulesHandle::processOpt( int index )
{
VideoSubWindow* pcSubWindow =
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
if( pcSubWindow )
{
PlaYUVerAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
CalypAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule();
if( pcCurrentModule )
{
PlaYUVerAppModuleIf* pcCurrModule = pcCurrentModule;
switch( index )
{
case INVALID_OPT:
break;
case SWAP_FRAMES_ACT:
swapModulesWindowsIf( pcCurrModule );
swapModulesWindowsIf( pcCurrentModule );
break;
case APPLY_ALL_ACT:
applyAllModuleIf( pcCurrModule );
applyAllModuleIf( pcCurrentModule );
break;
default:
Q_ASSERT( 0 );
@@ -246,70 +233,68 @@ 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 = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
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 );
auto pcCurrModuleIf = CalypModulesFactory::Get()->CreateModule( ModuleIfName.toLocal8Bit().constData() );
if( pcCurrModuleIf == nullptr )
{
return;
}
auto pcCurrAppModuleIf = std::make_shared<CalypAppModuleIf>( this, pcAction, std::move( 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.is_set( ClpModuleFeature::VariableNumOfFrames ) )
{
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 +303,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,25 +316,23 @@ 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 );
destroyModuleIf( pcCurrAppModuleIf );
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Error! Incompatible frames", CLP_LOG_ERROR );
// destroyModuleIf( pcCurrAppModuleIf );
return;
}
}
@@ -362,98 +345,83 @@ Void ModulesHandle::activateModule()
if( videoSubWindowList.size() == 0 )
{
qobject_cast<PlaYUVerApp*>( m_pcParent )
->printMessage( "Error! There is no windows to apply the module", LOG_ERROR );
destroyModuleIf( pcCurrAppModuleIf );
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.is_set( ClpModuleFeature::Options ) )
{
ModulesHandleOptDialog moduleOptDialog( m_pcParent, pcCurrAppModuleIf );
ModulesHandleOptDialog moduleOptDialog( m_pcParent, pcCurrAppModuleIf.get() );
if( moduleOptDialog.runConfiguration() == QDialog::Rejected )
{
qobject_cast<PlaYUVerApp*>( m_pcParent )
->printMessage( "Module canceled by user!", LOG_WARNINGS );
destroyModuleIf( pcCurrAppModuleIf );
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 == ClpModuleType::FrameProcessing )
{
if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) ||
bShowModulesNewWindow )
if( bShowModulesNewWindow || pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements.is_set( ClpModuleFeature::NewWindow ) )
{
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 ) ) );
auto pcModuleSubWindow = new ModuleSubWindow( pcCurrAppModuleIf.get() );
pcModuleSubWindow->resetWindowName();
pcCurrAppModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow;
// connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo,
// SLOT( updateSelectionArea( QRect ) ) );
// connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo,
// SLOT( zoomToFactorAll( double, QPoint ) ) );
// connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo,
// SLOT( moveAllScrollBars( const QPoint ) ) );
}
else
{
pcCurrAppModuleIf->m_pcSubWindow[0]->setDisplayModule( pcCurrAppModuleIf.get() );
}
}
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == ClpModuleType::FrameMeasurement )
{
pcCurrAppModuleIf->m_pcDisplaySubWindow = NULL;
pcCurrAppModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent, pcCurrAppModuleIf );
pcCurrAppModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent, pcCurrAppModuleIf.get() );
QString titleDockWidget;
titleDockWidget.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName );
titleDockWidget.append( " Information" );
pcCurrAppModuleIf->m_pcDockWidget = new QDockWidget( titleDockWidget, m_pcParent );
pcCurrAppModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetFloatable );
pcCurrAppModuleIf->m_pcDockWidget->setAllowedAreas( Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea );
pcCurrAppModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
pcCurrAppModuleIf->m_pcDockWidget->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
pcCurrAppModuleIf->m_pcDockWidget->setWidget( pcCurrAppModuleIf->m_pcModuleDock );
qobject_cast<QMainWindow*>( m_pcParent )
->addDockWidget( Qt::RightDockWidgetArea, pcCurrAppModuleIf->m_pcDockWidget );
}
// Associate module with subwindows
if( !pcCurrAppModuleIf->m_pcDisplaySubWindow && !pcCurrAppModuleIf->m_pcModuleDock )
for( int i = 0; i < videoSubWindowList.size(); i++ )
{
pcCurrAppModuleIf->m_pcSubWindow[0]->enableModule( pcCurrAppModuleIf );
}
else
{
if( pcCurrAppModuleIf->m_pcDisplaySubWindow )
pcCurrAppModuleIf->m_pcDisplaySubWindow->enableModule( pcCurrAppModuleIf );
for( Int i = 0; i < videoSubWindowList.size(); i++ )
{
pcCurrAppModuleIf->m_pcSubWindow[i]->associateModule( pcCurrAppModuleIf );
}
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,20 +429,20 @@ Void ModulesHandle::activateModule()
if( !moduleCreated )
{
qobject_cast<PlaYUVerApp*>( m_pcParent )
->printMessage( "Error! Module cannot be created", LOG_ERROR );
destroyModuleIf( pcCurrAppModuleIf );
qobject_cast<MainWindow*>( m_pcParent )->printMessage( "Error! Module cannot be created", CLP_LOG_ERROR );
// destroyModuleIf( pcCurrAppModuleIf );
return;
}
pcCurrAppModuleIf->apply( false, true );
QCoreApplication::processEvents();
if( pcModuleSubWindow )
if( pcCurrAppModuleIf->m_pcDisplaySubWindow )
{
pcModuleSubWindow->setWindowName( windowName );
m_pcMainWindowManager->addSubWindow( pcModuleSubWindow );
pcModuleSubWindow->show();
m_pcMainWindowManager->addSubWindow( pcCurrAppModuleIf->m_pcDisplaySubWindow );
pcCurrAppModuleIf->m_pcDisplaySubWindow->show();
m_appModuleVideo->addSubWindow( pcCurrAppModuleIf->m_pcDisplaySubWindow );
}
else
{
@@ -484,123 +452,118 @@ Void ModulesHandle::activateModule()
videoSubWindowList.at( 0 )->setWindowName( windowName );
}
m_pcPlaYUVerAppModuleIfList.append( pcCurrAppModuleIf );
// Change ownership of the module
// if( !pcCurrAppModuleIf->m_pcDisplaySubWindow && !pcCurrAppModuleIf->m_pcModuleDock )
// {
// pcCurrAppModuleIf->m_pcSubWindow[0]->enableModule( pcCurrAppModuleIf );
// }
// else if( pcCurrAppModuleIf->m_pcDisplaySubWindow )
// {
// pcCurrAppModuleIf->m_pcDisplaySubWindow->enableModule( pcCurrAppModuleIf );
// }
emit changed();
}
Void ModulesHandle::destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
void ModulesHandle::destroyWindowModules()
{
if( pcCurrModuleIf )
{
pcCurrModuleIf->destroy();
}
}
Void ModulesHandle::destroyWindowModules()
{
VideoSubWindow* pcVideoSubWindow =
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
VideoSubWindow* pcVideoSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
if( pcVideoSubWindow )
{
pcVideoSubWindow->disableModule();
pcVideoSubWindow->disableAllModules();
emit changed();
}
}
Void ModulesHandle::destroyAllModulesIf()
void ModulesHandle::destroyAllModulesIf()
{
for( Int i = 0; i < m_pcPlaYUVerAppModuleIfList.size(); i++ )
bool emit_changed = false;
QList<SubWindowAbstract*> windowsList = m_pcMainWindowManager->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
for( auto window : windowsList )
{
destroyModuleIf( m_pcPlaYUVerAppModuleIfList.at( i ) );
emit_changed |= qobject_cast<VideoSubWindow*>( window )->disableAllModules();
}
emit changed();
if( emit_changed )
emit changed();
}
Void ModulesHandle::applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
Bool isPlaying,
Bool disableThreads )
{
for( Int i = 0; i < pcCurrModuleIfList.size() && !isPlaying; i++ )
{
pcCurrModuleIfList.at( i )->apply( isPlaying, disableThreads );
}
}
Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf )
void ModulesHandle::applyAllModuleIf( CalypAppModuleIf* pcCurrModuleIf )
{
if( pcCurrModuleIf )
{
if( !pcCurrModuleIf->m_pcModuleStream )
{
UInt Width = 0, Height = 0, FrameRate = 30;
Int BitsPixel, InputFormat = -1;
QString supported = tr( "Supported Files (" );
QStringList formatsList;
std::vector<CalypStreamFormat> supportedFmts = CalypStream::supportedWriteFormats();
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<std::string> arrayExt = supportedFmts[i].getExts();
if( arrayExt.size() > 0 )
{
QString currFmt( QString::fromStdString( supportedFmts[i].formatName ) );
currFmt.append( " (" );
for( std::vector<std::string>::iterator e = arrayExt.begin(); e != arrayExt.end(); ++e )
{
supported.append( " *." );
currFmt.append( "*." );
supported.append( QString::fromStdString( *e ) );
currFmt.append( QString::fromStdString( *e ) );
}
currFmt.append( ")" );
formatsList << currFmt;
}
}
supported.append( " )" );
QStringList filter;
filter << supported << formatsList << tr( "All Files (*)" );
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(),
filter.join( ";;" ) );
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 ) )
QString fileName = QFileDialog::getSaveFileName( m_pcParent, tr( "Open File" ), QString(), filter.join( ";;" ) );
if( fileName.isEmpty() )
{
delete pcCurrModuleIf->m_pcModuleStream;
pcCurrModuleIf->m_pcModuleStream = NULL;
return;
}
auto Width = pcCurrModuleIf->m_pcProcessedFrame->getWidth();
auto Height = pcCurrModuleIf->m_pcProcessedFrame->getHeight();
auto InputFormat = pcCurrModuleIf->m_pcProcessedFrame->getPelFormat();
auto BitsPixel = pcCurrModuleIf->m_pcProcessedFrame->getBitsPel();
auto FrameRate = 30;
pcCurrModuleIf->m_pcModuleStream = std::unique_ptr<CalypStream>();
if( !pcCurrModuleIf->m_pcModuleStream->open( fileName.toStdString(), Width, Height, InputFormat, BitsPixel,
CLP_LITTLE_ENDIAN, FrameRate, CalypStream::Type::Output ) )
{
pcCurrModuleIf->m_pcModuleStream = nullptr;
return;
}
}
}
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;
std::uint64_t currFrames = 0;
std::uint64_t numberOfFrames = -1;
for( unsigned int i = 0; i < numberOfWindows; i++ )
{
currFrames = pcCurrModuleIf->m_pcSubWindow[i]->getInputStream()->getFrameNum();
currFrames = pcCurrModuleIf->m_pcSubWindow[i]->getFrameNum();
if( currFrames < numberOfFrames )
numberOfFrames = currFrames;
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++ )
pcCurrModuleIf->m_pcModuleStream->writeFrame( *pcCurrModuleIf->m_pcProcessedFrame );
for( unsigned int i = 0; i < numberOfWindows; i++ )
{
pcCurrModuleIf->m_pcSubWindow[i]->play();
pcCurrModuleIf->m_pcSubWindow[i]->playEvent();
pcCurrModuleIf->m_pcSubWindow[i]->advanceOneFrame();
}
}
for( UInt i = 0; i < numberOfWindows; i++ )
for( unsigned int i = 0; i < numberOfWindows; i++ )
{
pcCurrModuleIf->m_pcSubWindow[i]->stop();
}
@@ -608,26 +571,30 @@ 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 )
{
event->accept();
// The module could be freed by the time the event is processed
if( eventData->m_pcModule.isNull() )
return;
eventData->m_pcModule->show();
}
}
+25 -35
View File
@@ -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,46 @@
*/
/**
* \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
class ModulesHandle : public QObject
{
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();
static Void destroyModuleIf( PlaYUVerAppModuleIf* pcCurrModuleIf );
static Void applyModuleIf( QList<PlaYUVerAppModuleIf*> pcCurrModuleIfList,
Bool isPlaying = false,
Bool disableThreads = false );
void readSettings();
void writeSettings();
private:
QWidget* m_pcParent;
PlaYUVerSubWindowHandle* m_pcMainWindowManager;
SubWindowHandle* m_pcMainWindowManager;
VideoHandle* m_appModuleVideo;
enum
@@ -79,7 +69,7 @@ private:
QMenu* m_pcModulesMenu;
QList<QMenu*> m_pcModulesSubMenuList;
QList<PlaYUVerAppModuleIf*> m_pcPlaYUVerAppModuleIfList;
QList<CalypAppModuleIf*> m_pcCalypAppModuleIfList;
QVector<QAction*> m_arrayModulesActions;
@@ -97,11 +87,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();
-219
View File
@@ -1,219 +0,0 @@
/* This file is a part of plaYUVer project
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
* Joao Carreira (jfmcarreira@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file PlaYUVerAppModuleIf.cpp
* \brief PlaYUVer modules interface
*/
#include "PlaYUVerAppModuleIf.h"
#include "VideoSubWindow.h"
#include "VideoSubWindow.h"
PlaYUVerAppModuleIf::PlaYUVerAppModuleIf( QObject* parent,
QAction* action,
PlaYUVerModuleIf* module )
: m_bIsRunning( false )
, m_pcModuleAction( action )
, m_pcModule( module )
, m_pcDisplaySubWindow( NULL )
, m_pcDockWidget( NULL )
, m_pcModuleDock( NULL )
, m_pcModuleStream( NULL )
, m_pcProcessedFrame( NULL )
, m_dMeasurementResult( 0 )
{
setParent( parent );
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
{
m_pcSubWindow[i] = NULL;
}
}
Void PlaYUVerAppModuleIf::update()
{
if( m_pcDisplaySubWindow )
{
m_pcDisplaySubWindow->refreshFrame( true );
}
else
{
apply();
}
}
Bool PlaYUVerAppModuleIf::apply( Bool isPlaying, Bool disableThreads )
{
Bool bRet = false;
QApplication::setOverrideCursor( Qt::WaitCursor );
if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
{
if( m_pcDisplaySubWindow )
{
m_pcDisplaySubWindow->setFillWindow( true );
}
else
{
m_pcSubWindow[0]->setFillWindow( true );
}
}
if( !( isPlaying && ( m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_SKIP_WHILE_PLAY ) ) )
{
#ifdef PLAYUVER_THREADED_MODULES
if( !disableThreads )
{
wait();
start();
}
else
#endif
{
run();
show();
}
if( m_pcDisplaySubWindow || m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
{
bRet = true;
}
}
else
{
bRet = true;
}
QApplication::restoreOverrideCursor();
return bRet;
}
Void PlaYUVerAppModuleIf::run()
{
m_bIsRunning = true;
m_bSuccess = false;
std::vector<PlaYUVerFrame*> apcFrameList;
for( UInt i = 0; i < m_pcModule->m_uiNumberOfFrames; i++ )
{
apcFrameList.push_back( m_pcSubWindow[i]->getCurrFrame() );
}
if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
{
if( m_pcModule->m_iModuleAPI == MODULE_API_2 )
{
m_pcProcessedFrame = m_pcModule->process( apcFrameList );
}
else
{
m_pcProcessedFrame = m_pcModule->process( m_pcSubWindow[0]->getCurrFrame() );
}
}
else if( m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
{
if( m_pcModule->m_iModuleAPI == MODULE_API_2 )
{
m_dMeasurementResult = m_pcModule->measure( apcFrameList );
}
else
{
m_dMeasurementResult = m_pcModule->measure( m_pcSubWindow[0]->getCurrFrame() );
}
}
else
{
return;
}
m_bSuccess = true;
m_bIsRunning = false;
#ifdef PLAYUVER_THREADED_MODULES
EventData* eventData = new EventData( m_bSuccess, this );
if( parent() )
QCoreApplication::postEvent( parent(), eventData );
#endif
return;
}
Void PlaYUVerAppModuleIf::show()
{
switch( m_pcModule->m_iModuleType )
{
case FRAME_PROCESSING_MODULE:
if( m_pcDisplaySubWindow )
{
m_pcDisplaySubWindow->setCurrFrame( m_pcProcessedFrame );
m_pcDisplaySubWindow->setFillWindow( false );
m_pcDisplaySubWindow->clearWindowBusy();
}
else
{
m_pcSubWindow[0]->setCurrFrame( m_pcProcessedFrame );
m_pcSubWindow[0]->setFillWindow( false );
m_pcSubWindow[0]->clearWindowBusy();
}
break;
case FRAME_MEASUREMENT_MODULE:
m_pcModuleDock->setModulueReturnValue( m_dMeasurementResult );
break;
}
}
Void PlaYUVerAppModuleIf::destroy()
{
if( m_bIsRunning )
{
QApplication::setOverrideCursor( Qt::WaitCursor );
while( m_bIsRunning )
{
}
QApplication::restoreOverrideCursor();
}
if( m_pcModuleDock )
{
m_pcModuleDock->close();
m_pcModuleDock = NULL;
}
if( m_pcDockWidget )
{
m_pcDockWidget->close();
m_pcDockWidget = NULL;
}
if( m_pcDisplaySubWindow )
m_pcDisplaySubWindow->closeSubWindow();
m_pcDisplaySubWindow = NULL;
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
{
if( m_pcSubWindow[i] )
{
m_pcSubWindow[i]->disableModule( this );
m_pcSubWindow[i] = NULL;
}
}
if( m_pcModuleStream )
{
m_pcModuleStream->close();
delete m_pcModuleStream;
m_pcModuleStream = NULL;
}
if( m_pcModule )
{
m_pcModule->destroy();
m_pcModule->Delete();
m_pcModule = NULL;
}
}
-108
View File
@@ -1,108 +0,0 @@
/* This file is a part of plaYUVer project
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
* Joao Carreira (jfmcarreira@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file PlaYUVerAppModuleIf.h
* \brief PlaYUVer App modules interface
*/
#ifndef __PLAYUVERAPPMODULESIF_H__
#define __PLAYUVERAPPMODULESIF_H__
#include "ModuleHandleDock.h"
#include "PlaYUVerAppDefs.h"
#include "config.h"
#include "lib/PlaYUVerFrame.h"
#include "lib/PlaYUVerModuleIf.h"
#include "lib/PlaYUVerStream.h"
#include <QVector>
#include <cstdio>
#include <iostream>
class QAction;
//#define PLAYUVER_THREADED_MODULES
class VideoSubWindow;
class PlaYUVerAppModuleIf
#ifdef PLAYUVER_THREADED_MODULES
: public QThread
#else
: public QObject
#endif
{
friend class ModulesHandle;
friend class ModuleHandleDock;
friend class ModulesHandleOptDialog;
private:
Bool m_bIsRunning;
Bool m_bSuccess;
QAction* m_pcModuleAction;
PlaYUVerModuleIf* m_pcModule;
VideoSubWindow* m_pcSubWindow[MODULE_REQUIRES_MAX_NUM_FRAMES];
VideoSubWindow* m_pcDisplaySubWindow;
QDockWidget* m_pcDockWidget;
ModuleHandleDock* m_pcModuleDock;
PlaYUVerStream* m_pcModuleStream;
PlaYUVerFrame* m_pcProcessedFrame;
Double m_dMeasurementResult;
public:
class EventData : public QEvent
{
public:
EventData( bool success, PlaYUVerAppModuleIf* module ) : QEvent( QEvent::User )
{
m_bSuccess = success;
m_pcModule = module;
}
Bool m_bSuccess;
PlaYUVerAppModuleIf* m_pcModule;
};
PlaYUVerAppModuleIf( QObject* parent, QAction* action, PlaYUVerModuleIf* module );
virtual ~PlaYUVerAppModuleIf() {}
QList<VideoSubWindow*> getSubWindowList()
{
QList<VideoSubWindow*> arraySubWindows;
for( Int i = 0; i < MODULE_REQUIRES_MAX_NUM_FRAMES; i++ )
if( m_pcSubWindow[i] )
arraySubWindows.append( m_pcSubWindow[i] );
return arraySubWindows;
}
PlaYUVerModuleIf* getModule() { return m_pcModule; }
UInt getModuleRequirements() { return m_pcModule->m_uiModuleRequirements; }
Void update();
Bool apply( Bool isPlaying = false, Bool disableThreads = false );
Void show();
Void destroy();
protected:
virtual void run();
};
#endif // __PLAYUVERAPPMODULESIF_H__
+55 -40
View File
@@ -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,14 @@
*/
#include "PlotSubWindow.h"
#include <QGuiApplication>
#include <QScreen>
#include <QSize>
#include "qcustomplot.h"
Void PlotSubWindow::definePlotColors()
void PlotSubWindow::definePlotColors()
{
m_arrayColorList.append( Qt::blue );
m_arrayColorList.append( Qt::red );
@@ -94,18 +99,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 +117,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 +129,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 +152,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 +177,7 @@ QSize PlotSubWindow::sizeHint() const
}
else
{
maxSize = QApplication::desktop()->availableGeometry().size();
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
}
return sizeHint( maxSize );
}
@@ -180,42 +187,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 +254,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
View File
@@ -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__
+75 -83
View File
@@ -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,24 @@
*/
#include "QualityHandle.h"
#include "DialogSubWindowSelector.h"
#include "PlaYUVerSubWindowHandle.h"
#include <QtGui>
#include "PlotSubWindow.h"
#include "ProgressBar.h"
#include "VideoSubWindow.h"
#include "lib/LibMemory.h"
#include <QtGui>
#if( QT_VERSION_PLAYUVER == 5 )
#include "QtConcurrent/qtconcurrentrun.h"
#endif
#include "SubWindowHandle.h"
#include "SubWindowSelectorDialog.h"
#include "VideoSubWindow.h"
QualityHandle::QualityHandle( QWidget* parent, PlaYUVerSubWindowHandle* windowManager )
: m_pcParet( parent ), m_pcMainWindowManager( windowManager )
QualityHandle::QualityHandle( QWidget* parent, SubWindowHandle* windowManager )
: m_pcParent( parent ), m_pcMainWindowManager( windowManager )
{
}
QualityHandle::~QualityHandle() {}
Void QualityHandle::createActions()
void QualityHandle::createActions()
{
m_actionGroupQualityMetric = new QActionGroup( this );
m_actionGroupQualityMetric->setExclusive( true );
@@ -49,9 +48,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,20 +60,17 @@ Void QualityHandle::createActions()
m_arrayActions.resize( TOTAL_ACT );
m_arrayActions[SELECT_CURR_REF_ACT] = new QAction( "Mark as Reference", this );
connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this,
SLOT( slotSelectCurrentAsReference() ) );
connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectCurrentAsReference() ) );
m_arrayActions[PLOT_QUALITY] = new QAction( "Plot Window's Quality", this );
connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this,
SLOT( slotPlotQualitySingle() ) );
connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySingle() ) );
m_arrayActions[PLOT_SEVERAL_QUALITY] = new QAction( "Plot Several Quality", this );
connect( m_arrayActions[PLOT_SEVERAL_QUALITY], SIGNAL( triggered() ), this,
SLOT( slotPlotQualitySeveral() ) );
connect( m_arrayActions[PLOT_SEVERAL_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySeveral() ) );
}
QMenu* QualityHandle::createMenu()
{
m_pcMenuQuality = new QMenu( "Quality", this );
m_pcMenuQuality = new QMenu( "Quality", m_pcParent );
m_pcSubMenuQualityMetrics = m_pcMenuQuality->addMenu( "Quality Metrics" );
m_pcSubMenuQualityMetrics->addActions( m_actionGroupQualityMetric->actions() );
m_pcMenuQuality->addAction( m_arrayActions[SELECT_CURR_REF_ACT] );
@@ -86,28 +82,26 @@ QMenu* QualityHandle::createMenu()
QDockWidget* QualityHandle::createDock()
{
m_pcQualityHandleSideBar = new QualityMeasurementSidebar( m_pcParet, m_pcMainWindowManager );
m_pcQualityHandleDock = new QDockWidget( tr( "Quality Measurement" ), this );
m_pcQualityHandleSideBar = new QualityMeasurementSidebar( m_pcParent, m_pcMainWindowManager );
m_pcQualityHandleDock = new QDockWidget( tr( "Quality Measurement" ), m_pcParent );
m_pcQualityHandleDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
m_pcQualityHandleDock->setWidget( m_pcQualityHandleSideBar );
connect( m_pcQualityHandleSideBar, SIGNAL( signalQualityMetricChanged( int ) ), this,
SLOT( slotQualityMetricChanged( int ) ) );
connect( m_mapperQualityMetric, SIGNAL( mapped( int ) ), this,
SLOT( slotQualityMetricChanged( int ) ) );
connect( m_mapperQualityMetric, SIGNAL( mapped( int ) ), this, SLOT( slotQualityMetricChanged( int ) ) );
slotQualityMetricChanged( 0 );
return m_pcQualityHandleDock;
}
Void QualityHandle::updateMenus()
void QualityHandle::updateMenus()
{
VideoSubWindow* pcCurrentVideoSubWindow =
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
Bool hasSubWindow = pcCurrentVideoSubWindow ? true : false;
Bool hasReference = false;
Bool isReference = false;
VideoSubWindow* pcCurrentVideoSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
bool hasSubWindow = pcCurrentVideoSubWindow ? true : false;
bool hasReference = false;
bool isReference = false;
if( hasSubWindow )
{
@@ -117,7 +111,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 +132,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();
std::uint64_t currFrames = 0;
std::uint64_t numberOfFrames = -1;
//! Check reference window
for( UInt i = 0; i < numberOfWindows; i++ )
for( unsigned i = 0; i < numberOfWindows; i++ )
{
if( !apcWindowList.at( i )->getRefSubWindow() )
{
@@ -176,64 +169,66 @@ Void QualityHandle::measureQuality( QVector<VideoSubWindow*> apcWindowList )
}
VideoSubWindow* pcReferenceWindow = apcWindowList.at( 0 )->getRefSubWindow();
numberOfFrames = pcReferenceWindow->getInputStream()->getFrameNum();
for( UInt i = 0; i < numberOfWindows; i++ )
numberOfFrames = pcReferenceWindow->getFrameNum();
for( unsigned i = 0; i < numberOfWindows; i++ )
{
currFrames = apcWindowList.at( i )->getInputStream()->getFrameNum();
currFrames = apcWindowList.at( i )->getFrameNum();
if( currFrames < numberOfFrames )
numberOfFrames = currFrames;
apcWindowList.at( i )->stop();
}
pcReferenceWindow->stop();
ProgressBar* pcProgressBar = new ProgressBar( m_pcParet, numberOfFrames );
ProgressBar* pcProgressBar = new ProgressBar( m_pcParent, numberOfFrames );
padQualityValues = new QVector<Double>[numberOfWindows + 1];
QVector<double>* padQualityValues = new QVector<double>[numberOfWindows + 1];
double* padAverageQuality = new double[numberOfWindows + 1];
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 ) );
apcWindowList.at( i )->seekRelativeEvent( true );
double dCurrentQuality = pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, CLP_LUMA );
padAverageQuality[i + 1] = ( padAverageQuality[i + 1] * double( f ) + dCurrentQuality ) / double( f + 1 );
padQualityValues[i + 1].append( dCurrentQuality );
apcWindowList.at( i )->advanceOneFrame();
}
pcReferenceWindow->seekRelativeEvent( true );
pcReferenceWindow->advanceOneFrame();
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 +237,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 +245,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 = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
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 +265,9 @@ Void QualityHandle::slotSelectCurrentAsReference()
}
}
Void QualityHandle::slotPlotQualitySingle()
void QualityHandle::slotPlotQualitySingle()
{
VideoSubWindow* pcSubWindow =
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
if( pcSubWindow )
{
if( pcSubWindow->getRefSubWindow() )
@@ -296,10 +289,9 @@ Void QualityHandle::slotPlotQualitySingle()
}
}
Void QualityHandle::slotPlotQualitySeveral()
void QualityHandle::slotPlotQualitySeveral()
{
VideoSubWindow* pcSubWindow =
qobject_cast<VideoSubWindow*>( m_pcMainWindowManager->activeSubWindow() );
VideoSubWindow* pcSubWindow = m_pcMainWindowManager->activeSubWindow<VideoSubWindow>();
if( pcSubWindow )
{
QVector<VideoSubWindow*> apcWindowList;
@@ -313,7 +305,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 )
+21 -24
View File
@@ -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 <QFuture>
#include <QtCore>
#if( QT_VERSION_PLAYUVER == 5 )
#include <QtWidgets>
#elif( QT_VERSION_PLAYUVER == 4 )
#include <QtGui>
#endif
#include "QFuture"
#include "QualityMeasurementSidebar.h"
class PlaYUVerSubWindowHandle;
#include "CommonDefs.h"
#include "QualityMeasurementSidebar.h"
#include "config.h"
class SubWindowHandle;
class VideoSubWindow;
class QualityHandle : public QWidget
class QualityHandle : public QObject
{
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;
QWidget* m_pcParent;
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();
+167
View File
@@ -0,0 +1,167 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
* Joao Santos (joaompssantos@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file ResourceHandle.cpp
* \brief Handle resources
*/
#include "ResourceHandle.h"
#include <QCoreApplication>
#include <QEvent>
#include <QFileInfo>
#include <QMutex>
#include <QThread>
#include <chrono>
#include <iostream>
#include <memory>
#include <optional>
ResourceWorker::ResourceWorker( std::shared_ptr<CalypStream> stream )
{
m_pcStream = stream;
}
void ResourceWorker::stop()
{
m_bStop = true;
wake();
wait();
}
void ResourceWorker::wake()
{
m_Mutex.lock();
m_ResourceIdle.wakeAll();
m_Mutex.unlock();
}
void ResourceWorker::run()
{
m_bStop = false;
// Loop forever
while( !m_bStop )
{
//auto start = std::chrono::steady_clock::now();
m_pcStream->readNextFrameFillRGBBuffer();
// auto end = std::chrono::steady_clock::now();
// std::cout << "Elapsed time reading and processing a frame: "
// << std::chrono::duration_cast<std::chrono::milliseconds>( end - start ).count()
// << " ms" << std::endl;
// if( !m_pcStream->hasWritingSlot() )
// {
// m_Mutex.lock();
// m_ResourceIdle.wait( &m_Mutex );
// m_Mutex.unlock();
// }
while( !m_bStop && !m_pcStream->hasWritingSlot() )
{
// Wait here
}
}
}
ResourceHandle::ResourceHandle()
{
}
auto ResourceHandle::addResource() -> std::size_t
{
auto resource_id = unique_id;
unique_id++;
auto newStreamResource = std::make_shared<CalypStream>();
auto newStreamResourceWorker = std::make_unique<ResourceWorker>( newStreamResource );
m_apcStreamResourcesList[resource_id] = newStreamResource;
m_apcStreamResourcesWorkersList[resource_id] = std::move( newStreamResourceWorker );
return resource_id;
}
auto ResourceHandle::getResource( CalypStream* ptr ) -> std::size_t
{
if( ptr != nullptr )
{
for( std::size_t i = 0; i < m_apcStreamResourcesList.size(); i++ )
{
if( m_apcStreamResourcesList[i].get() == ptr )
return i;
}
}
return addResource();
}
auto ResourceHandle::getResourceAsset( std::size_t id ) -> CalypStream*
{
if( m_apcStreamResourcesWorkersList.count( id ) )
{
return m_apcStreamResourcesList[id].get();
}
return nullptr;
}
void ResourceHandle::removeResource( std::size_t id )
{
if( !m_apcStreamResourcesWorkersList.count( id ) )
{
assert( false );
return;
}
// Remove worker first
m_apcStreamResourcesWorkersList[id]->stop();
m_apcStreamResourcesWorkersList[id] = nullptr;
// Then the underlying stream
m_apcStreamResourcesList[id] = nullptr;
}
void ResourceHandle::stopResourceWorker( std::size_t id )
{
if( !m_apcStreamResourcesWorkersList.count( id ) )
{
assert( false );
return;
}
m_apcStreamResourcesWorkersList[id]->stop();
}
void ResourceHandle::startResourceWorker( std::size_t id )
{
if( !m_apcStreamResourcesWorkersList.count( id ) )
{
assert( false );
return;
}
m_apcStreamResourcesWorkersList[id]->setObjectName(
"RW-" +
QFileInfo( QString::fromStdString( m_apcStreamResourcesList[id]->getFileName() ) ).completeBaseName() );
m_apcStreamResourcesWorkersList[id]->start();
}
void ResourceHandle::wakeResourceWorker( std::size_t id )
{
if( !m_apcStreamResourcesWorkersList.count( id ) )
{
assert( false );
return;
}
m_apcStreamResourcesWorkersList[id]->wake();
}
+73
View File
@@ -0,0 +1,73 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file ResourceHandle.h
* \brief Handle multiple sub-windows
*/
#ifndef __RESOURCEHANDLE_H__
#define __RESOURCEHANDLE_H__
#include <QMutex>
#include <QThread>
#include <QVector>
#include <QWaitCondition>
#include "CommonDefs.h"
#include "lib/CalypStream.h"
class ResourceWorker : public QThread
{
private:
QMutex m_Mutex;
QWaitCondition m_ResourceIdle;
std::shared_ptr<CalypStream> m_pcStream;
bool m_bStop{ false };
public:
ResourceWorker( std::shared_ptr<CalypStream> stream );
void stop();
void wake();
void run();
};
class ResourceHandle
{
public:
ResourceHandle();
~ResourceHandle() = default;
auto getResource( CalypStream* ptr ) -> std::size_t;
auto getResourceAsset( std::size_t id ) -> CalypStream*;
void removeResource( std::size_t id );
void stopResourceWorker( std::size_t id );
void startResourceWorker( std::size_t id );
void wakeResourceWorker( std::size_t id );
private:
auto addResource() -> std::size_t;
private:
std::size_t unique_id{ 0 };
std::map<std::size_t, std::shared_ptr<CalypStream>> m_apcStreamResourcesList;
std::map<std::size_t, std::unique_ptr<ResourceWorker>> m_apcStreamResourcesWorkersList;
};
#endif // __RESOURCEHANDLE_H__
+29 -15
View File
@@ -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,18 @@
*/
#include "SubWindowAbstract.h"
#include "PlaYUVerMdiSubWindow.h"
#include <QCloseEvent>
#include <QFocusEvent>
#include <QGuiApplication>
#include <QHBoxLayout>
#include <QIcon>
#include <QScreen>
#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 );
@@ -38,9 +42,9 @@ SubWindowAbstract::SubWindowAbstract( QWidget* parent, UInt category )
// setFocusPolicy( Qt::WheelFocus );
setFocusPolicy( Qt::StrongFocus );
setAttribute( Qt::WA_DeleteOnClose );
setBackgroundRole( QPalette::Background );
setBackgroundRole( QPalette::Window );
setWindowIcon( QIcon( ":/images/playuver.png" ) );
setWindowIcon( QIcon( ":/logos/calyp-icon.png" ) );
// setWidgetResizable( true );
m_pcLayout = NULL;
@@ -55,7 +59,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 +71,7 @@ void SubWindowAbstract::onDestroyed()
return;
}
Void SubWindowAbstract::setWindowName( QString name )
void SubWindowAbstract::setWindowName( QString name )
{
m_cWindowName = name;
setWindowTitle( m_cWindowName );
@@ -78,33 +82,43 @@ QString SubWindowAbstract::getWindowName()
return m_cWindowName;
}
Bool SubWindowAbstract::mayClose()
bool SubWindowAbstract::mayClose()
{
return true;
}
QSize SubWindowAbstract::sizeHint() const
{
return QSize();
QSize maxSize;
QWidget* p = parentWidget();
if( p )
{
maxSize = p->size();
}
else
{
maxSize = QGuiApplication::screens()[0]->availableGeometry().size();
}
return sizeHint( maxSize );
}
QSize SubWindowAbstract::sizeHint( const QSize& ) const
QSize SubWindowAbstract::sizeHint( const QSize& maxSize ) 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 )
+31 -30
View File
@@ -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,50 +73,50 @@ 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
*/
virtual QSize sizeHint() const;
virtual QSize sizeHint( const QSize& ) const;
virtual QSize sizeHint( const QSize& maxSize ) const;
/**
* 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 );
setBackgroundRole( QPalette::Window );
}
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 )
: m_pcApp( qobject_cast<MainWindow*>( 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_pcCentralWidget = new QWidget;
// 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,17 +146,17 @@ 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() );
m_apcSubWindowList.at( i )->show();
}
setVisible( false );
parentWidget()->update();
m_pcCentralWidget->setVisible( false );
m_pcApp->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() );
@@ -160,15 +164,14 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
if( iWindowMode == MDISUBWINDOWMODE )
{
setVisible( true );
m_pcMdiArea = new PlaYUVerMdiArea;
m_pcCentralWidget->setVisible( true );
m_pcMdiArea = new MdiArea;
m_pcMdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this,
SLOT( updateActiveSubWindow() ) );
m_pcWindowManagerLayout = new QHBoxLayout( this );
connect( m_pcMdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( updateActiveSubWindow() ) );
m_pcWindowManagerLayout = new QHBoxLayout( m_pcCentralWidget );
m_pcWindowManagerLayout->addWidget( m_pcMdiArea );
setLayout( m_pcWindowManagerLayout );
for( Int i = 0; i < m_apcSubWindowList.size(); i++ )
m_pcCentralWidget->setLayout( m_pcWindowManagerLayout );
for( int i = 0; i < m_apcSubWindowList.size(); i++ )
{
addMdiSubWindow( m_apcSubWindowList.at( i ) );
m_apcSubWindowList.at( i )->resize( m_apcSubWindowList.at( i )->sizeHint() );
@@ -177,8 +180,11 @@ 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() );
}
else
{
m_pcApp->setWindowTitle( QApplication::applicationName() );
}
}
m_iWindowMode = iWindowMode;
@@ -187,7 +193,7 @@ Void PlaYUVerSubWindowHandle::setWindowMode( Int iWindowMode )
// qApp->processEvents();
}
Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
void SubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
{
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
{
@@ -205,8 +211,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,30 +220,33 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowAbstract* window )
}
if( m_pcActiveWindow )
{
m_pcApp->setWindowTitle( QApplication::applicationName() +
" :: " + m_pcActiveWindow->getWindowName() );
m_pcApp->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() );
}
else
{
m_pcApp->setWindowTitle( QApplication::applicationName() );
}
}
}
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,
connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), m_pcApp,
SLOT( updateZoomFactorSBox() ) );
if( m_iWindowMode == DETACHEDSUBWINDOWMODE )
{
@@ -255,7 +263,7 @@ Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowAbstract* window, Qt::Windo
}
}
Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx )
void SubWindowHandle::removeSubWindow( int windowIdx )
{
if( windowIdx >= 0 )
{
@@ -267,7 +275,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();
@@ -278,23 +286,28 @@ Void PlaYUVerSubWindowHandle::removeSubWindow( Int windowIdx )
if( !m_apcSubWindowList.isEmpty() )
m_apcSubWindowList.front()->setFocus();
else
m_pcActiveWindow = NULL;
m_pcActiveWindow = nullptr;
if( m_pcActiveWindow == nullptr )
{
m_pcApp->setWindowTitle( QApplication::applicationName() );
}
emit changed();
}
}
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 +315,12 @@ Void PlaYUVerSubWindowHandle::removeAllSubWindow()
}
}
Void PlaYUVerSubWindowHandle::removeActiveSubWindow()
void SubWindowHandle::removeActiveSubWindow()
{
removeSubWindow( m_pcActiveWindow );
}
SubWindowAbstract* PlaYUVerSubWindowHandle::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 +329,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 +338,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 +354,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 +365,7 @@ SubWindowAbstract* PlaYUVerSubWindowHandle::findSubWindow(
return 0;
}
Void PlaYUVerSubWindowHandle::setActiveSubWindow( QWidget* window )
void SubWindowHandle::setActiveSubWindow( QWidget* window )
{
if( !window )
return;
@@ -375,16 +382,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 +408,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 +433,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 +449,7 @@ Void PlaYUVerSubWindowHandle::tileSubWindows()
}
}
Void PlaYUVerSubWindowHandle::cascadeSubWindows()
void SubWindowHandle::cascadeSubWindows()
{
if( m_iWindowMode == MDISUBWINDOWMODE )
{
@@ -451,11 +457,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,36 +474,30 @@ 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 );
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
m_arrayActions[CLOSE_ACT]->setIcon( m_pcApp->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]->setIcon( m_pcApp->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 +505,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( m_pcApp->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( m_pcApp->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,15 +530,20 @@ Void PlaYUVerSubWindowHandle::createActions()
m_arrayActions[SEPARATOR_ACT]->setSeparator( true );
}
QMenu* PlaYUVerSubWindowHandle::createMenu()
QMenu* SubWindowHandle::createMenu()
{
m_pcMenuWindow = new QMenu( "&Window", this );
m_pcMenuWindow = new QMenu( "&Window", m_pcApp );
updateMenu();
connect( m_pcMenuWindow, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) );
return m_pcMenuWindow;
}
Void PlaYUVerSubWindowHandle::updateMenu()
auto SubWindowHandle::getWidget() -> QWidget*
{
return m_pcCentralWidget;
}
void SubWindowHandle::updateMenu()
{
m_pcMenuWindow->clear();
m_pcMenuWindow->addAction( m_arrayActions[NORMAL_SUBWINDOW_MODE_ACT] );
@@ -560,7 +559,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 +573,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 +594,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,40 @@ 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 QObject
{
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;
template <class T = SubWindowAbstract>
T* activeSubWindow() const
{
static_assert( std::is_base_of<SubWindowAbstract, T>::value, "T must inherit from SubWindowAbstract" );
return qobject_cast<T*>( m_pcActiveWindow );
}
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();
auto getWidget() -> QWidget*;
void readSettings();
void writeSettings();
enum WindowMode
{
@@ -72,13 +79,14 @@ public:
};
private:
PlaYUVerApp* m_pcApp;
Int m_iWindowMode;
MainWindow* m_pcApp;
int m_iWindowMode;
QList<SubWindowAbstract*> m_apcSubWindowList;
QWidget* m_pcCentralWidget;
QHBoxLayout* m_pcWindowManagerLayout;
PlaYUVerMdiArea* m_pcMdiArea;
QList<PlaYUVerMdiSubWindow*> m_apcMdiSubWindowList;
MdiArea* m_pcMdiArea;
QList<MdiSubWindow*> m_apcMdiSubWindowList;
SubWindowAbstract* m_pcActiveWindow;
@@ -105,18 +113,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 +136,4 @@ Q_SIGNALS:
void windowActivated();
};
#endif // __PLAYUVERSUBWINDOWHANDLE_H__
#endif // __SUBWINDOWHANDLE_H__
+395 -231
View File
File diff suppressed because it is too large. Load diff
+51 -36
View File
@@ -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,55 @@
#ifndef __VIDEOHANDLE_H__
#define __VIDEOHANDLE_H__
#include "PlaYUVerAppDefs.h"
#include "config.h"
#include <QElapsedTimer>
#include <QMenu>
#include <QPoint>
#include <QVector>
#include <QThread>
#include <QVector>
#include <QWidget>
#define _CONTROL_PLAYING_TIME_ 0
#include "CommonDefs.h"
#include "VideoSubWindow.h"
#include "config.h"
class QToolBar;
class QDockWidget;
class QSignalMapper;
class QLabel;
class QSlider;
class QElapsedTimer;
class PlaYUVerSubWindowHandle;
class SubWindowHandle;
class SubWindowAbstract;
class VideoSubWindow;
class VideoStreamSubWindow;
class FramePropertiesDock;
class WidgetFrameNumber;
class FrameNumberWidget;
class QTimer;
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;
QWidget* m_pcParent;
SubWindowHandle* m_pcMainWindowManager;
enum
{
PLAY_ACT,
@@ -95,12 +95,21 @@ private:
QSignalMapper* m_mapperVideoSeek;
QSlider* m_pcFrameSlider;
WidgetFrameNumber* m_pcFrameNumInfo;
FrameNumberWidget* m_pcFrameNumInfo;
// Tools Actions;
QActionGroup* actionGroupTools;
// Filter component actions
QMenu* m_menuComponent;
QActionGroup* m_actionGroupComponent;
QSignalMapper* m_mapperComponent;
// 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,23 +118,25 @@ private:
QDockWidget* m_pcFramePropertiesDock;
FramePropertiesDock* m_pcFramePropertiesSideBar;
QLabel* m_pcPlayingFPSLabel;
QLabel* m_pcVideoFormatLabel;
QLabel* m_pcResolutionLabel;
VideoSubWindow* m_pcCurrentVideoSubWindow;
QVector<VideoSubWindow*> m_acPlayingSubWindows;
QPointer<VideoSubWindow> m_pcCurrentVideoSubWindow;
QVector<VideoStreamSubWindow*> 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{ 0 };
unsigned int m_uiRealAverageFrameRate{ 0 };
std::unique_ptr<QElapsedTimer> m_pcFrameRateFeedbackTimer;
UInt64 getMaxFrameNumber();
Void setTimerStatus();
void configureFrameRateTimer();
void calculateRealFrameRate();
unsigned long getMaxFrameNumber();
void setTimerStatus();
void updateComponentMenu();
Q_SIGNALS:
void changed();
@@ -135,16 +146,20 @@ 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 );
void seekVideo();
void videoSelectionButtonEvent();
void setComponent( int component );
void setTool( int tool );
void toggleGrid( bool checked );
void setGridSize( int size );
};
#endif // __VIDEOHANDLE_H__
+604
View File
@@ -0,0 +1,604 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file VideoStreamSubWindow.cpp
* \brief Video Sub windows handling
*/
#include "VideoStreamSubWindow.h"
#include <QScrollArea>
#include <QSettings>
#include <QStaticText>
#include <cassert>
#include "ConfigureFormatDialog.h"
#include "ModulesHandle.h"
#include "QtConcurrent/qtconcurrentrun.h"
#include "ResourceHandle.h"
#include "SubWindowAbstract.h"
#define QT_NO_CONCURRENT
/**
* \brief Functions to control data stream from stream information
*/
QDataStream& operator<<( QDataStream& out, const CalypFileInfoVector& array )
{
CalypFileInfo d;
out << array.size();
for( int i = 0; i < array.size(); i++ )
{
d = array.at( i );
out << d.m_cFilename << d.m_uiWidth << d.m_uiHeight << d.m_iPelFormat << d.m_uiBitsPelPixel << d.m_iEndianness
<< d.m_uiFrameRate << d.m_uiFileSize << d.m_bForceRaw;
}
return out;
}
QDataStream& operator>>( QDataStream& in, CalypFileInfoVector& array )
{
CalypFileInfo d;
int array_size{ 0 };
in >> array_size;
for( int i = 0; i < array_size; i++ )
{
in >> d.m_cFilename;
in >> d.m_uiWidth;
in >> d.m_uiHeight;
in >> d.m_iPelFormat;
in >> d.m_uiBitsPelPixel;
in >> d.m_iEndianness;
in >> d.m_uiFrameRate;
in >> d.m_uiFileSize;
in >> d.m_bForceRaw;
array.append( d );
}
return in;
}
auto findCalypStreamInfo( const CalypFileInfoVector& array, const QString& filename ) -> int
{
for( int i = 0; i < array.size(); i++ )
if( array.at( i ).m_cFilename == filename )
return i;
return -1;
}
VideoStreamSubWindow::VideoStreamSubWindow( QWidget* parent )
: VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW, parent )
, m_pcResourceManager( nullptr )
, m_pCurrStream( NULL )
, m_bIsPlaying( false )
{
}
VideoStreamSubWindow::~VideoStreamSubWindow()
{
if( m_pcResourceManager )
m_pcResourceManager->removeResource( m_uiResourceId );
}
void VideoStreamSubWindow::resetWindowName()
{
setWindowName( QFileInfo( m_cFilename ).fileName() );
}
void VideoStreamSubWindow::updateVideoWindowInfo()
{
m_cStreamInformation = "";
if( m_pcDisplayModule )
{
m_cStreamInformation = "Module";
const auto& arraySubWindows = m_pcDisplayModule->getSubWindowList();
QStringList windowInfoList;
if( arraySubWindows.size() > 0 )
{
for( std::size_t i = 0; i < arraySubWindows.size(); i++ )
{
if( arraySubWindows[i]->getWindowName() != getWindowName() )
{
windowInfoList.append( QString( "Input %1 - " + arraySubWindows[i]->getWindowName() ).arg( i + 1 ) );
}
}
}
if( m_pcDisplayModule->getModuleRequirements() & ClpModuleFeature::HasInfo )
{
QStringList list = QString::fromStdString( m_pcDisplayModule->moduleInfo() ).split( '\n' );
windowInfoList.append( list );
}
if( windowInfoList.size() > 0 )
{
m_pcVideoInfo->setInformationTopLeft( windowInfoList );
}
}
else if( m_pCurrStream )
{
QString m_cFormatName = QString::fromStdString( m_pCurrStream->getFormatName() );
QString m_cCodedName = QString::fromStdString( m_pCurrStream->getCodecName() );
m_cStreamInformation = m_cFormatName + " | " + m_cCodedName;
}
if( m_pcCurrFrameAsset )
{
QString m_cPelFmtName = QString::fromStdString( m_pcCurrFrameAsset->getPelFmtName() );
if( m_pCurrStream )
if( !m_pCurrStream->isNative() )
m_cPelFmtName += "*";
m_cStreamInformation += " | " + m_cPelFmtName;
}
if( m_cStreamInformation.isEmpty() )
{
m_cStreamInformation = " ";
}
}
void VideoStreamSubWindow::loadAll()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
m_pCurrStream->loadAll();
refreshFrame();
QApplication::restoreOverrideCursor();
}
bool VideoStreamSubWindow::loadFile( QString cFilename, bool bForceDialog )
{
assert( m_pcResourceManager != nullptr );
ConfigureFormatDialog formatDialog( this );
unsigned int Width = 0, Height = 0, BitsPel = 8, FrameRate = 30;
int Endianness = CLP_LITTLE_ENDIAN;
auto InputFormat = ClpPixelFormats::YUV420p;
QSettings appSettings;
if( m_pCurrStream )
m_pCurrStream->getFormat( Width, Height, InputFormat, BitsPel, Endianness, FrameRate );
else
m_uiResourceId = m_pcResourceManager->getResource( nullptr );
m_pCurrStream = m_pcResourceManager->getResourceAsset( m_uiResourceId );
bool bConfig = true;
if( !bForceDialog )
{
bConfig = guessFormat( cFilename, Width, Height, InputFormat, BitsPel, Endianness, FrameRate );
if( bConfig )
{
// Pre-load values with last opened file
Width = appSettings.value( "VideoStreamSubWindow/LastWidth" ).value<unsigned int>();
Height = appSettings.value( "VideoStreamSubWindow/LastHeight" ).value<unsigned int>();
BitsPel = appSettings.value( "VideoStreamSubWindow/LastBitsPerPixel" ).value<unsigned int>();
}
}
bool bRet{ false };
bool forceRaw{ false };
for( int iPass = 0; iPass < 2 && !bRet; iPass++ )
{
if( iPass || bConfig )
{
if( formatDialog.runConfigureFormatDialog( QFileInfo( cFilename ).fileName(), Width, Height, InputFormat, BitsPel,
Endianness, FrameRate ) == QDialog::Rejected )
{
return false;
}
}
try
{
bRet = m_pCurrStream->open( cFilename.toStdString(), Width, Height, InputFormat, BitsPel, Endianness, FrameRate, iPass == 1, CalypStream::Type::Input );
forceRaw = iPass > 0;
}
catch( CalypFailure& e )
{
if( iPass > 0 )
throw( e );
}
}
if( !bRet )
{
return false;
}
m_sStreamInfo.m_cFilename = cFilename;
m_sStreamInfo.m_uiWidth = Width;
m_sStreamInfo.m_uiHeight = Height;
m_sStreamInfo.m_iPelFormat = static_cast<std::int64_t>( InputFormat );
m_sStreamInfo.m_uiBitsPelPixel = BitsPel;
m_sStreamInfo.m_iEndianness = Endianness;
m_sStreamInfo.m_uiFrameRate = FrameRate;
m_sStreamInfo.m_uiFileSize = QFileInfo( cFilename ).size();
m_sStreamInfo.m_bForceRaw = forceRaw;
QVariant var;
var.setValue<unsigned int>( Width );
appSettings.setValue( "VideoStreamSubWindow/LastWidth", var );
var.setValue<unsigned int>( Height );
appSettings.setValue( "VideoStreamSubWindow/LastHeight", var );
var.setValue<unsigned int>( BitsPel );
appSettings.setValue( "VideoStreamSubWindow/LastBitsPerPixel", var );
#ifdef CALYP_MANAGED_RESOURCES
m_pcResourceManager->startResourceWorker( m_uiResourceId );
#endif
QApplication::restoreOverrideCursor();
refreshFrame();
m_cFilename = cFilename;
updateVideoWindowInfo();
setWindowName( QFileInfo( m_cFilename ).fileName() );
return true;
}
bool VideoStreamSubWindow::loadFile( CalypFileInfo streamInfo )
{
assert( m_pcResourceManager != nullptr );
m_uiResourceId = m_pcResourceManager->getResource( m_pCurrStream );
m_pCurrStream = m_pcResourceManager->getResourceAsset( m_uiResourceId );
if( !m_pCurrStream->open( streamInfo.m_cFilename.toStdString(), streamInfo.m_uiWidth, streamInfo.m_uiHeight,
static_cast<ClpPixelFormats>( streamInfo.m_iPelFormat ), streamInfo.m_uiBitsPelPixel, streamInfo.m_iEndianness,
streamInfo.m_uiFrameRate, streamInfo.m_bForceRaw, CalypStream::Type::Input ) )
{
return false;
}
m_cFilename = streamInfo.m_cFilename;
m_sStreamInfo = std::move( streamInfo );
#ifdef CALYP_MANAGED_RESOURCES
m_pcResourceManager->startResourceWorker( m_uiResourceId );
#endif
QApplication::restoreOverrideCursor();
refreshFrame();
updateVideoWindowInfo();
setWindowName( QFileInfo( m_cFilename ).fileName() );
return true;
}
bool VideoStreamSubWindow::guessFormat( const QString& filename, unsigned int& rWidth, unsigned int& rHeight, ClpPixelFormats& rInputFormat, unsigned int& rBitsPerPixel,
int& rEndianness, unsigned int& rFrameRate )
{
std::vector<CalypStandardResolution> stdResList = CalypStream::stdResolutionSizes();
bool bGuessed = true;
bool bGuessedByFilesize = false;
QString FilenameShort = QFileInfo( filename ).fileName();
QString fileExtension = QFileInfo( filename ).suffix();
if( filename.startsWith( "/dev/" ) )
{
return false;
}
if( !fileExtension.compare( "yuv", Qt::CaseInsensitive ) || !fileExtension.compare( "rgb", Qt::CaseInsensitive ) ||
!fileExtension.compare( "gray", Qt::CaseInsensitive ) )
{
bGuessed = false;
// Guess pixel format
const auto& formats_list = CalypFrame::supportedPixelFormatListNames();
for( const auto& [key, name] : formats_list )
{
if( FilenameShort.contains( QString::fromStdString( std::string( name ) ), Qt::CaseInsensitive ) )
{
rInputFormat = key;
break;
}
}
if( rWidth == 0 || rHeight == 0 )
{
// Guess resolution - match resolution name
int iMatch = -1;
for( unsigned int i = 0; i < stdResList.size(); i++ )
{
if( FilenameShort.contains( QString::fromStdString( stdResList[i].shortName ) ) )
{
iMatch = i;
}
}
if( iMatch >= 0 )
{
rWidth = stdResList[iMatch].uiWidth;
rHeight = stdResList[iMatch].uiHeight;
}
// Guess resolution - match %dx%d
// QRegularExpressionMatch resolutionMatch = QRegularExpression( "_\\d*x\\d*" ).match( FilenameShort );
QRegularExpressionMatch resolutionMatch = QRegularExpression( "_[0-9]+x[0-9]+" ).match( FilenameShort );
if( resolutionMatch.hasMatch() )
{
QString resolutionString = resolutionMatch.captured( resolutionMatch.lastCapturedIndex() );
if( resolutionString.startsWith( "_" ) || resolutionString.endsWith( "_" ) )
{
resolutionString.remove( "_" );
QStringList resolutionArgs = resolutionString.split( "x" );
if( resolutionArgs.size() == 2 )
{
rWidth = resolutionArgs.at( 0 ).toUInt();
rHeight = resolutionArgs.at( 1 ).toUInt();
}
}
}
}
// Guess resolution by file size
if( rWidth == 0 && rHeight == 0 )
{
FILE* pF = fopen( filename.toStdString().c_str(), "rb" );
if( pF )
{
fseek( pF, 0, SEEK_END );
unsigned long long int uiFileSize = ftell( pF );
fclose( pF );
int count = 0, module, frame_bytes, match;
for( unsigned int i = 0; i < stdResList.size(); i++ )
{
frame_bytes =
CalypFrame::getBytesPerFrame( stdResList[i].uiWidth, stdResList[i].uiHeight, rInputFormat, 8 );
module = uiFileSize % frame_bytes;
if( module == 0 )
{
match = i;
count++;
}
}
if( count == 1 )
{
rWidth = stdResList[match].uiWidth;
rHeight = stdResList[match].uiHeight;
bGuessedByFilesize = true;
}
}
}
// [.|_]
// Guess bits per pixel - match %dbpp
QRegularExpressionMatch BppMatch = QRegularExpression( "_[0-9]+bpp" ).match( FilenameShort );
if( BppMatch.hasMatch() )
{
QString matchString = BppMatch.captured( BppMatch.lastCapturedIndex() );
matchString.remove( "_" );
matchString.remove( "bpp" );
rBitsPerPixel = matchString.toUInt();
if( !( rBitsPerPixel > 0 && rBitsPerPixel < 16 ) )
{
rBitsPerPixel = -1;
}
}
QRegularExpressionMatch BppOnlybMatch = QRegularExpression( "_[0-9]+b" ).match( FilenameShort );
if( BppOnlybMatch.hasMatch() )
{
QString matchString = BppOnlybMatch.captured( BppOnlybMatch.lastCapturedIndex() );
matchString.remove( "_" );
matchString.remove( "b" );
rBitsPerPixel = matchString.toUInt();
if( !( rBitsPerPixel > 0 && rBitsPerPixel < 16 ) )
{
rBitsPerPixel = -1;
}
}
// Guess frame rate - match %dbpp
QRegularExpressionMatch FpsMatch = QRegularExpression( "_[0-9]+fps" ).match( FilenameShort );
if( FpsMatch.hasMatch() )
{
QString matchString = FpsMatch.captured( FpsMatch.lastCapturedIndex() );
matchString.remove( "_" );
matchString.remove( "fps" );
rFrameRate = matchString.toUInt();
if( rFrameRate < 0 )
{
rFrameRate = 30;
}
}
// Guess Endianness
if( FilenameShort.contains( QStringLiteral( "be" ), Qt::CaseInsensitive ) )
{
rEndianness = CLP_BIG_ENDIAN;
}
if( FilenameShort.contains( QStringLiteral( "le" ), Qt::CaseInsensitive ) )
{
rEndianness = CLP_LITTLE_ENDIAN;
}
if( rWidth > 0 && rHeight > 0 && rInputFormat != ClpPixelFormats::Invalid )
bGuessed = true && !bGuessedByFilesize;
}
return !bGuessed;
}
void VideoStreamSubWindow::refreshSubWindow()
{
#ifdef CALYP_MANAGED_RESOURCES
m_pcResourceManager->stopResourceWorker( m_uiResourceId );
#endif
if( !m_pCurrStream->reload() )
{
close();
return;
}
#ifdef CALYP_MANAGED_RESOURCES
m_pcResourceManager->startResourceWorker( m_uiResourceId );
#endif
updateVideoWindowInfo();
refreshFrame();
}
void VideoStreamSubWindow::refreshFrame()
{
bool bSetFrame = true;
m_pcCurrFrameAsset = m_pCurrStream->getCurrFrameAsset();
if( m_pcDisplayModule )
{
// bool disableThreads = !m_bIsPlaying && hasAssociatedModule();
m_pcDisplayModule->apply( m_bIsPlaying, true );
bSetFrame = false;
}
if( bSetFrame )
VideoSubWindow::refreshFrame();
}
void VideoStreamSubWindow::refreshFrame( bool bThreaded )
{
#ifndef QT_NO_CONCURRENT
m_cRefreshResult.waitForFinished();
if( bThreaded )
{
m_cRefreshResult = QtConcurrent::run( this, &VideoSubWindow::refreshFrame );
}
else
#endif
{
refreshFrame();
}
}
bool VideoStreamSubWindow::goToNextFrame( bool bThreaded )
{
#ifndef QT_NO_CONCURRENT
m_cRefreshResult.waitForFinished();
m_cReadResult.waitForFinished();
#endif
#ifdef CALYP_MANAGED_RESOURCES
while( !m_pCurrStream->hasNextFrame() && !m_pCurrStream->isEof() )
{
}
#endif
bool bEndOfSeq = m_pCurrStream->setNextFrame();
#ifdef CALYP_MANAGED_RESOURCES
bThreaded = false;
m_pcResourceManager->wakeResourceWorker( m_uiResourceId );
#endif
if( !bEndOfSeq )
{
#ifndef QT_NO_CONCURRENT
m_cRefreshResult.waitForFinished();
if( bThreaded )
{
m_cReadResult = QtConcurrent::run( m_pCurrStream, &CalypStream::readNextFrameFillRGBBuffer );
refreshFrame( bThreaded );
}
else
#endif
{
refreshFrame( bThreaded );
#ifndef CALYP_MANAGED_RESOURCES
m_pCurrStream->readNextFrameFillRGBBuffer();
#endif
}
}
return bEndOfSeq;
}
bool VideoStreamSubWindow::saveStream( const QString& filename )
{
bool iRet = false;
QApplication::setOverrideCursor( Qt::WaitCursor );
// TODO: implement this
QApplication::restoreOverrideCursor();
return iRet;
}
bool VideoStreamSubWindow::isPlaying()
{
return m_bIsPlaying;
}
bool VideoStreamSubWindow::play()
{
bool isPlaying = false;
if( m_pCurrStream && m_pCurrStream->getFrameNum() > 1 )
{
isPlaying = true;
}
m_bIsPlaying = isPlaying;
return m_bIsPlaying;
}
bool VideoStreamSubWindow::playEvent()
{
bool bEndOfSeq = false;
if( m_pCurrStream && m_bIsPlaying )
{
bEndOfSeq = goToNextFrame( true );
}
return bEndOfSeq;
}
void VideoStreamSubWindow::pause()
{
m_bIsPlaying = false;
refreshFrame();
}
void VideoStreamSubWindow::seekAbsoluteEvent( unsigned int new_frame_num )
{
if( m_pCurrStream )
{
if( m_pCurrStream->seekInput( new_frame_num ) )
refreshFrame();
#ifdef CALYP_MANAGED_RESOURCES
m_pcResourceManager->wakeResourceWorker( m_uiResourceId );
#endif
}
}
void VideoStreamSubWindow::seekRelativeEvent( bool bIsFoward )
{
if( m_pCurrStream )
{
if( bIsFoward )
{
goToNextFrame( true );
}
else
{
m_pCurrStream->seekInputRelative( bIsFoward );
#ifdef CALYP_MANAGED_RESOURCES
m_pcResourceManager->wakeResourceWorker( m_uiResourceId );
#endif
refreshFrame();
}
}
}
void VideoStreamSubWindow::stop()
{
#ifndef QT_NO_CONCURRENT
m_cRefreshResult.waitForFinished();
m_cReadResult.waitForFinished();
#endif
m_bIsPlaying = false;
seekAbsoluteEvent( 0 );
return;
}
+135
View File
@@ -0,0 +1,135 @@
/* This file is a part of Calyp project
* Copyright (C) 2014-2021 by Joao Carreira (jfmcarreira@gmail.com)
* Luis Lucas (luisfrlucas@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file VideoStreamSubWindow.h
* \brief Video Sub windows handling
*/
#ifndef __VIDEOSTREAMSUBWINDOW_H__
#define __VIDEOSTREAMSUBWINDOW_H__
#include <QDataStream>
#include <QFuture>
#include <QRect>
#include <QString>
#include <QVector>
#include <cstdint>
#include "CommonDefs.h"
#include "VideoSubWindow.h"
#include "config.h"
#include "lib/CalypStream.h"
class QScrollArea;
class VideoInformation;
class VideoStreamSubWindow;
class ResourceHandle;
class CalypAppModuleIf;
struct CalypFileInfo
{
QString m_cFilename;
unsigned int m_uiWidth;
unsigned int m_uiHeight;
int m_iPelFormat;
unsigned int m_uiBitsPelPixel;
int m_iEndianness;
unsigned int m_uiFrameRate;
unsigned long long int m_uiFileSize;
bool m_bForceRaw{ false };
};
using CalypFileInfoVector = QVector<CalypFileInfo>;
QDataStream& operator<<( QDataStream& out, const CalypFileInfoVector& d );
QDataStream& operator>>( QDataStream& in, CalypFileInfoVector& d );
auto findCalypStreamInfo( const CalypFileInfoVector& array, const QString& filename ) -> int;
class VideoStreamSubWindow : public VideoSubWindow
{
Q_OBJECT
public:
VideoStreamSubWindow( QWidget* parent = 0 );
~VideoStreamSubWindow();
void resetWindowName() override;
void updateVideoWindowInfo() override;
bool isPlaying() override;
void stop() override;
void advanceOneFrame() override { goToNextFrame( true ); }
auto getFrameNum() -> std::uint64_t override { return m_pCurrStream->getFrameNum(); }
void setResourceManaget( ResourceHandle* resourceManager ) { m_pcResourceManager = resourceManager; }
bool supportsFormatConfiguration() const { return m_pCurrStream->supportsFormatConfiguration(); };
bool loadFile( QString cFilename, bool bForceDialog = false );
bool loadFile( CalypFileInfo streamInfo );
void loadAll();
bool saveStream( const QString& filename );
bool play();
void pause();
bool playEvent();
void seekAbsoluteEvent( unsigned int new_frame_num );
void seekRelativeEvent( bool bIsFoward );
CalypFileInfo getStreamInfo() { return m_sStreamInfo; }
const CalypStream* getInputStream() { return m_pCurrStream; }
const CalypStream* getCurrStream() { return m_pCurrStream; }
QString getCurrentFileName() { return m_cFilename; }
void refreshSubWindow() override;
void refreshFrame();
void refreshFrame( bool bThreaded );
private:
bool goToNextFrame( bool bThreaded );
static bool guessFormat( const QString& filename, unsigned int& rWidth, unsigned int& rHeight, ClpPixelFormats& rInputFormat, unsigned int& rBitsPerPixel,
int& rEndianness, unsigned int& rFrameRate );
private: // NO_LINT
ResourceHandle* m_pcResourceManager;
QString m_cFilename;
CalypFileInfo m_sStreamInfo;
std::size_t m_uiResourceId;
CalypStream* m_pCurrStream;
QString m_cCurrFileName;
bool m_bIsPlaying;
/**
* Threads variables
* QtConcurrent
*/
QFuture<void> m_cRefreshResult;
QFuture<void> m_cReadResult;
};
Q_DECLARE_METATYPE( CalypFileInfo ) // NOLINT
Q_DECLARE_METATYPE( CalypFileInfoVector ) // NOLINT
#endif // __VIDEOSTREAMSUBWINDOW_H__
+315 -751
View File
File diff suppressed because it is too large. Load diff
+101 -135
View File
@@ -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,100 +25,53 @@
#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 <QStaticText>
#include <QString>
#include <QVector>
#include "CalypAppModuleIf.h"
#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 ResourceHandle;
class CalypAppModuleIf;
typedef struct
/**
* \class VideoInformation
* \brief Shows information about video sub window
*/
class VideoInformation : public QWidget
{
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;
public:
VideoInformation( QWidget* parent );
void setInformationTopLeft( const QStringList& textLines );
void setBusyWindow( bool bFlag );
QDataStream& operator<<( QDataStream& out, const PlaYUVerStreamInfoVector& d );
QDataStream& operator>>( QDataStream& in, PlaYUVerStreamInfoVector& d );
Int findPlaYUVerStreamInfo( PlaYUVerStreamInfoVector array, QString filename );
protected:
void paintEvent( QPaintEvent* event ) override;
private:
QTimer* m_pcRefreshTimer;
QList<QStaticText> m_cTopLeftTextList;
QFont m_cTopLeftTextFont;
QFont m_cCenterTextFont;
bool m_bBusyWindow;
};
class VideoSubWindow : public SubWindowAbstract
{
Q_OBJECT
private:
Bool m_bWindowBusy;
QScrollArea* m_pcScrollArea;
QPoint m_cLastScroll;
QPoint m_cCurrScroll;
ViewArea* m_cViewArea;
VideoInformation* m_pcVideoInfo;
QString m_cFilename;
QString m_cStreamInformation;
PlaYUVerStreamInfo m_sStreamInfo;
PlaYUVerStream* m_pCurrStream;
PlaYUVerFrame* m_pcCurrFrame;
QRect m_cSelectedArea;
PlaYUVerAppModuleIf* m_pcCurrentDisplayModule;
QList<PlaYUVerAppModuleIf*> m_apcCurrentModule;
VideoSubWindow* m_pcReferenceSubWindow;
// QString m_cWindowShortName;
QString m_cCurrFileName;
Bool m_bIsPlaying;
QTimer* m_pcUpdateTimer;
/**
* Threads variables
* QtConcurrent
*/
QFuture<Void> m_cRefreshResult;
QFuture<Void> m_cReadResult;
Void refreshFrameOperation();
Bool goToNextFrame( Bool bThreaded = false );
static Bool guessFormat( QString filename,
UInt& rWidth,
UInt& rHeight,
Int& rInputFormat,
UInt& rBitsPerPixel,
Int& rEndianness );
/**
* Private zoom function to handle
* zoom to fit
*/
Void scaleView( const QSize& size, QPoint center = QPoint() );
Void updateVideoWindowInfo();
QSize getScrollSize();
public:
enum VideoSubWindowCategories
{
@@ -128,95 +81,108 @@ 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 );
virtual void resetWindowName() = 0;
virtual void updateVideoWindowInfo() = 0;
Void refreshSubWindow();
Void refreshFrame( Bool bThreaded = false );
virtual bool isPlaying() = 0;
virtual void stop() = 0;
virtual void advanceOneFrame() = 0;
virtual auto getFrameNum() -> std::uint64_t { return 1; };
Bool play();
Void pause();
Bool playEvent();
Void stop();
QString getVideoInformation() { return m_cStreamInformation; }
bool save( const QString& filename );
Bool isPlaying() { return m_bIsPlaying; }
Void seekAbsoluteEvent( UInt new_frame_num );
Void seekRelativeEvent( Bool bIsFoward );
void setCurrFrame( std::shared_ptr<CalypFrame> pcCurrFrame );
Void setCurrFrame( PlaYUVerFrame* pcCurrFrame );
auto getCurrFrame() -> CalypFrame* { return m_pcCurrFrameAsset.get(); }
auto getCurrFrameAsset() -> std::shared_ptr<CalypFrame> { return m_pcCurrFrameAsset; };
auto getViewArea() -> ViewArea* { return m_cViewArea; }
QScrollArea* getScroll() { return m_pcScrollArea; }
PlaYUVerStreamInfo getStreamInfo() { return m_sStreamInfo; }
QString getStreamInformation() { return m_cStreamInformation; }
PlaYUVerStream* getInputStream() { return m_pCurrStream; }
PlaYUVerStream* getCurrStream() { return m_pCurrStream; }
PlaYUVerFrame* getCurrFrame() { return m_pcCurrFrame; }
ViewArea* getViewArea() { return m_cViewArea; }
Void setRefSubWindow( VideoSubWindow* subWindow )
VideoSubWindow* getRefSubWindow() { return m_pcReferenceSubWindow; }
void setRefSubWindow( VideoSubWindow* subWindow )
{
m_pcReferenceSubWindow = NULL;
if( subWindow )
if( m_pcCurrFrame->haveSameFmt( subWindow->getCurrFrame() ) )
if( m_pcCurrFrameAsset->haveSameFmt( subWindow->getCurrFrame() ) )
m_pcReferenceSubWindow = subWindow;
}
VideoSubWindow* getRefSubWindow() { return m_pcReferenceSubWindow; }
/**
* Functions to enable a module in the
* current SubWindow
*/
Void enableModule( PlaYUVerAppModuleIf* pcModule );
Void disableModule( PlaYUVerAppModuleIf* pcModule = NULL );
Void associateModule( PlaYUVerAppModuleIf* pcModule );
PlaYUVerAppModuleIf* getDisplayModule() { return m_pcCurrentDisplayModule; }
QList<PlaYUVerAppModuleIf*> getModuleArray()
{
QList<PlaYUVerAppModuleIf*> apcModulesArray;
if( m_pcCurrentDisplayModule )
apcModulesArray.append( m_pcCurrentDisplayModule );
apcModulesArray.append( m_apcCurrentModule );
return apcModulesArray;
}
auto hasModules() -> bool { return m_associatedModules.size() > 0; }
bool hasAssociatedModule();
void setDisplayModule( CalypAppModuleIf* pcModule );
void associateModule( std::shared_ptr<CalypAppModuleIf> pcModule );
void disableModule( CalypAppModuleIf* pcModule );
bool disableAllModules();
CalypAppModuleIf* getDisplayModule() { return m_pcDisplayModule; }
/**
* Virtual functions from SubWindowAbstract
*/
Void normalSize();
Void zoomToFit();
Void scaleView( Double scale, QPoint center = QPoint() );
Void zoomToFactor( Double factor, QPoint center = QPoint() );
void normalSize() override;
void zoomToFit() override;
void scaleView( double scale, QPoint center = QPoint() ) override;
void zoomToFactor( double factor, QPoint center = QPoint() ) override;
Double getScaleFactor() { return m_cViewArea->getZoomFactor(); }
double getScaleFactor() override { return m_cViewArea->getZoomFactor(); }
/**
* Size related functions
*/
QSize sizeHint() const;
QSize sizeHint( const QSize& ) const;
QSize sizeHint( const QSize& ) const override;
QString getCurrentFileName() { return m_cFilename; }
Bool getIsModule() { return getCategory() | SubWindowAbstract::MODULE_SUBWINDOW; }
Void clearWindowBusy() { m_bWindowBusy = false; }
Void setFillWindow( Bool bFlag );
void setFillWindow( bool bFlag );
void adjustScrollBarToRatio( const double horRatio, const double verRatio );
private:
bool hasRunningModule();
/**
* Private zoom function to handle
* zoom to fit
*/
void scaleView( const QSize& size, QPoint center = QPoint() );
QSize getScrollSize();
protected:
Void keyPressEvent( QKeyEvent* event );
Void resizeEvent( QResizeEvent* event );
// void closeEvent( QCloseEvent *event );
void refreshFrame();
void keyPressEvent( QKeyEvent* event ) override;
void resizeEvent( QResizeEvent* event ) override;
void closeEvent( QCloseEvent* event ) override;
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 );
protected:
VideoInformation* m_pcVideoInfo;
QString m_cStreamInformation;
std::shared_ptr<CalypFrame> m_pcCurrFrameAsset;
// bool m_bWindowBusy;
// bool m_bIsPlaying;
std::vector<std::shared_ptr<CalypAppModuleIf>> m_associatedModules;
CalypAppModuleIf* m_pcDisplayModule{ nullptr };
// bool m_hasAssociatedModules;
private:
QScrollArea* m_pcScrollArea;
QPoint m_cCurrScroll;
double m_dHorScroll{ 0 };
double m_dVerScroll{ 0 };
ViewArea* m_cViewArea;
QRect m_cSelectedArea;
VideoSubWindow* m_pcReferenceSubWindow;
QTimer* m_pcUpdateTimer;
};
Q_DECLARE_METATYPE( PlaYUVerStreamInfo );
Q_DECLARE_METATYPE( PlaYUVerStreamInfoVector );
#endif // __VIDEOSUBWINDOW_H__
+333 -300
View File
File diff suppressed because it is too large. Load diff
+61 -57
View File
@@ -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,38 @@ public:
ViewArea( QWidget* parent = 0 );
Void setImage( PlaYUVerFrame* pcFrame );
Void setImage( const QPixmap& pixmap );
void setImage( std::shared_ptr<CalypFrame> frame );
Void setMode( Int mode );
Void setMaskColor( const QColor& color = QColor() );
auto getFilteredChannel() -> std::optional<std::size_t>;
void setFilteredChannel( std::size_t channel );
void clearFilteredChannel();
/**
* Clears any contents.
*/
Void clear();
void setMode( int mode );
void setMaskColor( const QColor& color = QColor() );
/**
* 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 +96,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 ) override;
void resizeEvent( QResizeEvent* event ) override;
void mousePressEvent( QMouseEvent* event ) override;
void mouseMoveEvent( QMouseEvent* event ) override;
void mouseReleaseEvent( QMouseEvent* event ) override;
void wheelEvent( QWheelEvent* event ) override;
Void updateSize();
Void updateOffset();
void updateSize();
void updateOffset();
private:
enum ViewMode
@@ -132,12 +133,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,33 +146,36 @@ private:
QPoint viewToWindow( const QPoint& pt ) const;
QRect viewToWindow( const QRect& rc ) const;
PlaYUVerFrame* m_pcCurrFrame;
std::shared_ptr<CalypFrame> m_currFrame;
QImage m_image;
std::shared_ptr<CalypFrame> m_nextFrame;
Pel m_uiPixelHalfScale;
std::optional<std::size_t> m_filterSingleChannel;
ClpPel m_uiPixelHalfScale;
Tool m_eTool;
Bool m_bGridVisible;
Tool m_eTool{ NavigationTool };
bool m_bGridVisible{ false };
QTimer m_zoomWinTimer;
Double m_dZoomWinRatio;
Double m_dZoomFactor;
double m_dZoomWinRatio;
double m_dZoomFactor{ 1.0 };
QPixmap m_pixmap;
// QPixmap m_pixmap;
QBitmap m_mask;
QRect m_selectedArea;
QPoint m_lastPos;
QPoint m_lastWindowPos;
GridManager m_grid;
ViewMode m_mode;
ViewMode m_mode{ NormalMode };
QColor m_maskColor;
Int m_xOffset;
Int m_yOffset;
Bool m_blockTrackEnable;
Bool m_newShape;
Bool m_snapToGrid;
Bool m_cursorInGrid;
Bool m_visibleZoomRect;
int m_xOffset{ 0 };
int m_yOffset{ 0 };
bool m_blockTrackEnable{ false };
bool m_newShape;
bool m_snapToGrid{ false };
bool m_cursorInGrid;
bool m_visibleZoomRect{ true };
};
#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 "&nbsp;&nbsp;&nbsp;"
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,28 @@ 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 )
auto findPelFormatColorSpace( ClpPixelFormats rInputFormat ) -> std::pair<int, std::int64_t>
{
if( rInputFormat != ClpPixelFormats::Invalid )
{
auto pelFmtName = CalypFrame::pixelFormatName( rInputFormat );
for( unsigned int j = 0; j < CalypFrame::supportedColorSpacesListNames().size(); j++ )
{
const auto& formats_list = CalypFrame::supportedPixelFormatListNames( j );
for( const auto& [key, name] : formats_list )
{
if( pelFmtName == name )
{
return std::make_pair( j, static_cast<int>( key ) );
}
}
}
}
return std::make_pair( 0, 0 );
}
int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename, unsigned int& rWidth, unsigned int& rHeight,
ClpPixelFormats& rInputFormat, unsigned int& rBits, int& rEndianess, unsigned int& rFrameRate )
{
// Set default values
// setWindowTitle( "Configure resolution for " + Filename );
@@ -405,24 +411,8 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
m_spinBoxWidth->setValue( rWidth );
m_spinBoxheight->setValue( rHeight );
Int colorSpace = 0;
Int sampling = 0;
if( rInputFormat >= 0 )
{
String pelFmtName = PlaYUVerFrame::supportedPixelFormatListNames()[rInputFormat];
for( UInt j = 0; j < PlaYUVerFrame::supportedColorSpacesListNames().size(); j++ )
{
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames( j ).size(); i++ )
{
if( pelFmtName == PlaYUVerFrame::supportedPixelFormatListNames( j )[i] )
{
colorSpace = j;
sampling = i;
break;
}
}
}
}
auto [colorSpace, sampling] = findPelFormatColorSpace( rInputFormat );
m_comboBoxColorSpace->setCurrentIndex( colorSpace );
m_comboBoxPixelFormat->setCurrentIndex( sampling );
m_spinBoxBits->setValue( rBits );
@@ -437,7 +427,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 ) )
{
@@ -455,16 +445,8 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( const QString& Filename,
rWidth = m_spinBoxWidth->value();
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++ )
{
if( pelFmtName == PlaYUVerFrame::supportedPixelFormatListNames()[i] )
{
rInputFormat = i;
break;
}
}
sampling = m_comboBoxPixelFormat->currentData().toInt();
rInputFormat = static_cast<ClpPixelFormats>( sampling );
rBits = m_spinBoxBits->value();
rEndianess = m_comboBoxEndianness->currentIndex();
rFrameRate = m_spinBoxFrameRate->value();
@@ -472,21 +454,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 +489,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 +502,21 @@ void ConfigureFormatDialog::slotResolutionChange()
m_comboBoxStandardResolution->blockSignals( false );
}
Void ConfigureFormatDialog::slotColorSpaceChange( Int idx )
void ConfigureFormatDialog::slotColorSpaceChange( int idx )
{
if( idx == -1 )
return;
m_comboBoxPixelFormat->clear();
for( UInt i = 0; i < PlaYUVerFrame::supportedPixelFormatListNames( idx ).size(); i++ )
const auto& formats_list = CalypFrame::supportedPixelFormatListNames( idx );
for( const auto& [key, name] : formats_list )
{
m_comboBoxPixelFormat->insertItem(
i, PlaYUVerFrame::supportedPixelFormatListNames( idx )[i].c_str() );
m_comboBoxPixelFormat->addItem( QString::fromStdString( std::string( name ) ), static_cast<int>( key ) );
}
m_comboBoxPixelFormat->setCurrentIndex( 0 );
}
Void ConfigureFormatDialog::slotBitsChange( Int idx )
void ConfigureFormatDialog::slotBitsChange( int idx )
{
if( idx > 8 )
{
@@ -549,17 +528,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 );
using CalypStandardResolutionVector = QVector<CalypStandardResolution>;
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, ClpPixelFormats& 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,24 +25,28 @@
#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 OpionConfiguration : public QWidget
class QLineEdit;
class OptionConfiguration : public QWidget
{
public:
OpionConfiguration( OptionBase* option )
OptionConfiguration( CalypOptions::OptionBase* option )
: m_cName{ option->opt_string }
{
m_pcChecked = NULL;
m_cName = option->opt_string;
m_pcDescription = new QLabel;
m_pcDescription->setText( QString::fromStdString( option->opt_desc ) );
auto* pcDescription = new QLabel;
QString desc = QString::fromStdString( option->opt_desc );
pcDescription->setText( desc );
QHBoxLayout* layout = new QHBoxLayout;
layout->addWidget( m_pcDescription, 0, Qt::AlignLeft );
layout->addWidget( pcDescription, 0, Qt::AlignLeft );
if( !option->isBinary() )
{
m_pcValue = new QLineEdit;
@@ -59,7 +63,7 @@ public:
layout->setContentsMargins( 1, 1, 1, 1 );
setLayout( layout );
}
const QString getValue() const
auto getValue() const -> QString
{
if( m_pcChecked )
{
@@ -67,31 +71,26 @@ public:
}
return m_pcValue->text();
}
const String& getName() { return m_cName; }
auto getName() const -> std::string { return m_cName; }
private:
QLineEdit* m_pcValue;
QCheckBox* m_pcChecked;
QLabel* m_pcDescription;
String m_cName;
QLineEdit* m_pcValue{ nullptr };
QCheckBox* m_pcChecked{ nullptr };
std::string 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();
auto& 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( auto& option : moduleOptions )
{
pcOption = new OpionConfiguration( ( *it )->opt );
auto pcOption = new OptionConfiguration( option->base_opt.get() );
m_apcOptionList.append( pcOption );
optionsLayout->addWidget( pcOption );
}
@@ -112,24 +111,24 @@ 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<std::string> argsArray;
std::string optionString;
QString valueString( "" );
for( Int i = 0; i < m_apcOptionList.size(); i++ )
for( const auto& option : m_apcOptionList )
{
valueString = m_apcOptionList.at( i )->getValue();
valueString = option->getValue();
if( !valueString.isEmpty() )
{
optionString.append( "--" );
optionString.append( m_apcOptionList.at( i )->getName() );
optionString.append( option->getName() );
if( !( valueString == "true" ) )
{
optionString.append( "=" );
@@ -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,13 +25,14 @@
#ifndef __MODULEHANDLEOPTDIALOG_H__
#define __MODULEHANDLEOPTDIALOG_H__
#include "PlaYUVerAppDefs.h"
#include "PlaYUVerAppModuleIf.h"
#include "config.h"
#include <QDialog>
#include <QVector>
class OpionConfiguration;
#include "CalypAppModuleIf.h"
#include "CommonDefs.h"
#include "config.h"
class OptionConfiguration;
/**
*
@@ -41,12 +42,12 @@ 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;
QVector<OpionConfiguration*> m_apcOptionList;
CalypAppModuleIf* m_pcCurrModuleIf;
QVector<OptionConfiguration*> m_apcOptionList;
};
#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
@@ -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( const 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( const 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,24 @@ 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( percentileLabel, gridRow, 0 );
statisticsLayout->addWidget( labelPercentileValue, gridRow++, 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 +248,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,24 +278,25 @@ QSize FramePropertiesDock::sizeHint() const
return currSize;
}
Void FramePropertiesDock::reset()
void FramePropertiesDock::reset()
{
m_pcFrame = NULL;
m_pcFrame = nullptr;
m_pcSelectedFrame = nullptr;
m_bHasFrame = false;
m_cSelectionArea = QRect();
if( m_pcSelectedFrame )
{
delete m_pcSelectedFrame;
m_pcSelectedFrame = NULL;
}
m_iLastFrameType = -1;
labelRangeValue->clear();
labelNEBinsValue->clear();
labelMeanValue->clear();
labelPixelsValue->clear();
labelStdDevValue->clear();
labelCountValue->clear();
labelMedianValue->clear();
labelPercentileValue->clear();
labelEntropyValue->clear();
// Remove the histogram data from memory
histogramWidget->reset();
@@ -300,100 +304,102 @@ Void FramePropertiesDock::reset()
setEnabled( false );
}
Void FramePropertiesDock::setFrame( PlaYUVerFrame* pcFrame )
void FramePropertiesDock::setFrame( std::shared_ptr<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_pcFrame = 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_pcSelectedFrame = std::make_shared<CalypFrame>( *m_pcFrame, selectionArea.x(),
selectionArea.y(),
selectionArea.width(),
selectionArea.height() );
}
updateDataHistogram();
selectionImageButton->click();
@@ -408,15 +414,23 @@ 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 )
histogramWidget->setLoadingSkipped();
}
else
{
if( m_cSelectionArea.isValid() )
{
m_pcSelectedFrame->copyFrom( m_pcFrame, m_cSelectionArea.x(), m_cSelectionArea.y() );
m_pcSelectedFrame = std::make_shared<CalypFrame>( *m_pcFrame,
m_cSelectionArea.x(),
m_cSelectionArea.y(),
m_cSelectionArea.width(),
m_cSelectionArea.height() );
fullImageButton->show();
selectionImageButton->show();
}
@@ -425,12 +439,9 @@ Void FramePropertiesDock::updateDataHistogram()
fullImageButton->hide();
selectionImageButton->hide();
}
histogramWidget->updateData( m_pcFrame, m_pcSelectedFrame );
}
else
{
histogramWidget->setLoadingSkipped();
histogramWidget->updateData( m_pcFrame, m_cSelectionArea.isValid() ? m_pcSelectedFrame : nullptr );
}
histogramWidget->update();
}
else
@@ -440,18 +451,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;
std::shared_ptr<CalypFrame> frame;
if( histogramWidget->m_renderingType == HistogramWidget::FullImageHistogram )
frame = histogramWidget->m_fullImage;
@@ -460,8 +471,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 +487,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 +510,7 @@ Void FramePropertiesDock::stopHistogram()
// SLOTS
////////////////////////////////////////////////////////////////////////////////
Void FramePropertiesDock::slotRefreshOptions( int range )
void FramePropertiesDock::slotRefreshOptions( int range )
{
if( !isVisible() )
return;
@@ -516,127 +533,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( std::shared_ptr<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;
std::shared_ptr<CalypFrame> m_pcFrame;
std::shared_ptr<CalypFrame> m_pcSelectedFrame;
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++;
@@ -53,22 +58,20 @@ ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* module
setEnabled( true );
}
ModuleHandleDock::~ModuleHandleDock() {}
ModuleHandleDock::~ModuleHandleDock() = default;
Void ModuleHandleDock::setModulueReturnValue( Double value )
void ModuleHandleDock::setModuleReturnValue( 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 )
if( !visiblity )
{
PlaYUVerAppModuleIf* pcCurrentModule = m_pcCurrModuleIf;
m_pcCurrModuleIf = NULL;
ModulesHandle::destroyModuleIf( pcCurrentModule );
m_pcCurrModuleIf->disable();
}
}
@@ -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 setModuleReturnValue( 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;
+5
View File
@@ -0,0 +1,5 @@
#
# CMakeLists for calyp external components
#
ADD_SUBDIRECTORY(qcustomplot)
-25331
View File
File diff suppressed because it is too large. Load diff
-3958
View File
File diff suppressed because it is too large. Load diff
+17
View File
@@ -0,0 +1,17 @@
#
# CMakeLists for qcustomplot
#
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport)
SET(qcustomplot_SRCS qcustomplot.cpp qcustomplot.h)
SET(CMAKE_AUTOMOC ON)
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-deprecated-enum-enum-conversion")
ENDIF()
ADD_LIBRARY(QCustomPlotLib STATIC ${qcustomplot_SRCS})
TARGET_LINK_LIBRARIES(QCustomPlotLib Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport)
TARGET_INCLUDE_DIRECTORIES(QCustomPlotLib PUBLIC .)
+674
View File
@@ -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
View File
@@ -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
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+65 -61
View File
@@ -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>
+1
View File
@@ -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
View File
@@ -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,68 +25,58 @@
// 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;
std::shared_ptr<CalypFrame> m_pcFrame{ nullptr };
public:
HistogramWorker( QObject* parent )
{
m_pcFrame = NULL;
m_parent = parent;
}
: m_parent{ parent } {}
Void setup( PlaYUVerFrame* frame )
void reset() { m_pcFrame = nullptr; }
void setup( std::shared_ptr<CalypFrame> frame )
{
m_pcFrame = frame;
run();
m_pcFrame = std::move( frame );
EventData* eventData = new EventData(); // NOLINT
eventData->starting = true;
// QCoreApplication::postEvent( m_parent, eventData );
start();
}
Void run()
void run() override
{
if( m_pcFrame && m_parent )
EventData* eventData = new EventData(); // NOLINT
if( m_pcFrame != nullptr )
{
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 );
eventData->frame = m_pcFrame.get();
}
eventData->success = true;
QCoreApplication::postEvent( m_parent, eventData );
}
/**
* Custom Event
*/
class EventData : public QEvent
{
public:
EventData() : QEvent( QEvent::User )
{
starting = false;
success = false;
frame = NULL;
}
bool starting;
bool success;
PlaYUVerFrame* frame;
EventData()
: QEvent( QEvent::User ), frame{ nullptr } {}
CalypFrame* frame{ nullptr };
bool starting{ false };
bool success{ false };
};
};
@@ -134,25 +124,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 +155,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 +192,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 +201,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,20 +209,22 @@ Void HistogramWidget::setOptions( HistogramOptions options )
d->lumaChannel = (bool)( options & ShowLumaChannel );
}
Void HistogramWidget::setHistogramGuideByColor( QColor color )
void HistogramWidget::setHistogramGuideByColor( QColor color )
{
d->guideVisible = true;
d->colorGuide = color;
update();
}
Void HistogramWidget::reset()
void HistogramWidget::reset()
{
d->guideVisible = false;
d->clearFlag = HistogramWidgetPrivate::HistogramNone;
// Remove histogram data from memory.
m_fullImage = NULL;
m_selectionImage = NULL;
m_fullImage = nullptr;
m_selectionImage = nullptr;
m_imageWorker->setup( nullptr );
m_selectionWorker->setup( nullptr );
update();
}
@@ -247,7 +232,7 @@ Void HistogramWidget::reset()
// Custom Event Handler
////////////////////////////////////////////////////////////////////////////////
Void HistogramWidget::customEvent( QEvent* event )
void HistogramWidget::customEvent( QEvent* event )
{
if( !event )
{
@@ -261,7 +246,7 @@ Void HistogramWidget::customEvent( QEvent* event )
return;
}
if( ed->frame != m_fullImage && ed->frame != m_selectionImage )
if( ed->frame != m_fullImage.get() && ed->frame != m_selectionImage.get() )
{
return;
}
@@ -299,7 +284,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,27 +304,15 @@ Void HistogramWidget::customEvent( QEvent* event )
// Remove old histogram data from memory.
m_fullImage = NULL;
m_selectionImage = NULL;
// if( m_imageHistogram )
// {
// delete m_imageHistogram;
// m_imageHistogram = 0;
// }
// if( m_selectionHistogram )
// {
// delete m_selectionHistogram;
// m_selectionHistogram = 0;
// }
emit signalHistogramComputationFailed();
}
}
// delete ed;
}
////////////////////////////////////////////////////////////////////////////////
// Data Loading Functions
////////////////////////////////////////////////////////////////////////////////
Void HistogramWidget::setDataLoading()
void HistogramWidget::setDataLoading()
{
if( d->clearFlag != HistogramWidgetPrivate::HistogramDataLoading )
{
@@ -353,7 +326,7 @@ Void HistogramWidget::setDataLoading()
}
}
Void HistogramWidget::setLoadingSkipped()
void HistogramWidget::setLoadingSkipped()
{
d->clearFlag = HistogramWidgetPrivate::HistogramSkipped;
d->blinkTimer->stop();
@@ -362,7 +335,7 @@ Void HistogramWidget::setLoadingSkipped()
unsetCursor();
}
Void HistogramWidget::setLoadingFailed()
void HistogramWidget::setLoadingFailed()
{
d->clearFlag = HistogramWidgetPrivate::HistogramFailed;
d->blinkTimer->stop();
@@ -373,7 +346,7 @@ Void HistogramWidget::setLoadingFailed()
////////////////////////////////////////////////////////////////////////////////
Void HistogramWidget::stopHistogramComputation()
void HistogramWidget::stopHistogramComputation()
{
// if( m_imageHistogram )
// m_imageHistogram->setRunningFlag( false );
@@ -388,17 +361,29 @@ Void HistogramWidget::stopHistogramComputation()
// Update Data Methods
////////////////////////////////////////////////////////////////////////////////
Void HistogramWidget::updateData( PlaYUVerFrame* pcFrame, PlaYUVerFrame* pcFrameSelection )
void HistogramWidget::updateData( std::shared_ptr<CalypFrame> pcFrame, std::shared_ptr<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 +398,7 @@ Void HistogramWidget::updateData( PlaYUVerFrame* pcFrame, PlaYUVerFrame* pcFrame
////////////////////////////////////////////////////////////////////////////////
Void HistogramWidget::slotBlinkTimerDone()
void HistogramWidget::slotBlinkTimerDone()
{
d->blinkFlag = !d->blinkFlag;
d->inInitialRepaintWait = false;
@@ -425,7 +410,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 +425,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 +447,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 +479,7 @@ Void HistogramWidget::paintEvent( QPaintEvent* )
int wWidth = width() - 1;
int wHeight = height() - 1;
double max;
PlaYUVerFrame* frame;
std::shared_ptr<CalypFrame> frame;
if( m_renderingType == ImageSelectionHistogram && m_selectionImage )
frame = m_selectionImage;
@@ -513,35 +496,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 +512,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 +524,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 +537,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 +550,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 +610,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 +663,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 +688,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 +706,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 +723,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 +757,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 +778,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 +799,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 +841,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 +866,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 +903,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 +911,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 +947,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 +965,7 @@ Void HistogramWidget::mousePressEvent( QMouseEvent* e )
}
}
Void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
void HistogramWidget::mouseReleaseEvent( QMouseEvent* )
{
if( d->selectMode == true && d->clearFlag == HistogramWidgetPrivate::HistogramCompleted )
@@ -1021,7 +983,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 +1018,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 +1041,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,44 @@ 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( std::shared_ptr<CalypFrame> pcFrame, std::shared_ptr<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;
std::shared_ptr<CalypFrame> m_fullImage;
/** Histogram area selection */
HistogramWorker* m_selectionWorker;
// PlaYUVerFrameStats* m_selectionHistogram;
PlaYUVerFrame* m_selectionImage;
std::shared_ptr<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 +132,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
View File
@@ -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
View File
@@ -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
View File
@@ -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()
+15 -24
View File
@@ -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,7 @@
/* Fervor update lib */
#cmakedefine USE_FERVOR
/* Use a resource manager to manage streams in different threads */
#cmakedefine CALYP_MANAGED_RESOURCES
#endif // __CONFIG_PLAYUVER_H__
#endif // __CONFIG_CALYP_H__
+5 -6
View File
@@ -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 = ClpModuleType::FrameProcessing; // Apply module to the frames or to the whole sequence.
m_pchModuleCategory = "Measurements"; // Category (sub-menu)
m_pchModuleName = "AbsoluteDifferenceExample"; // Name
m_pchModuleLongName = "Absolute Difference Example"; // Name
m_pchModuleTooltip = "Measure the absolute difference " // Description
"between two images (Y plane), e. g., abs( Y1 - Y2 )";
m_uiNumberOfFrames = 2; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
m_uiModuleRequirements = ClpModuleFeature::NewWindow; // Module requirements (check CalypModulesIf.h).
// Several requirements should be "or" between each others.
m_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(), ClpPixelFormats::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__
+10 -13
View File
@@ -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" )
# THIS FIND_PACKAGE( Calyp ) INCLUDE_DIRECTORIES( ${CALYP_INCLUDE_DIRS} ) OR
INCLUDE_DIRECTORIES(../../lib)
# FIND_PACKAGE( PlaYUVer )
INCLUDE_DIRECTORIES( ${PLAYUVER_INCLUDE_DIRS} )
ADD_LIBRARY(FrameBinarization SHARED FrameBinarization_APIv1.cpp)
TARGET_LINK_LIBRARIES( FrameBinarization ${PLAYUVER_LINKER_LIBS} )
ADD_LIBRARY(FrameBinarizationAPIv1 SHARED FrameBinarizationAPIv1.cpp)
TARGET_LINK_LIBRARIES(FrameBinarizationAPIv1 ${PROJECT_LIBRARY})
ADD_LIBRARY(AbsoluteFrameDifferenceExample SHARED AbsoluteFrameDifferenceExample.cpp)
TARGET_LINK_LIBRARIES( AbsoluteFrameDifferenceExample ${PLAYUVER_LINKER_LIBS} )
TARGET_LINK_LIBRARIES(AbsoluteFrameDifferenceExample ${PROJECT_LIBRARY})
Loaded 100 of 231 files, more files were not shown because too many files have changed in this diff. Show more