Merge remote-tracking branch 'tt/stop_motion_improvements' into tahoma
This commit is contained in:
commit
f25ac63302
63 changed files with 8928 additions and 3202 deletions
|
@ -4,7 +4,7 @@ git:
|
|||
depth: 1
|
||||
|
||||
sudo: required
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
|
||||
install:
|
||||
- bash ci-scripts/$TRAVIS_OS_NAME/travis-install.sh
|
||||
|
|
|
@ -11,6 +11,8 @@ clone_depth: 1
|
|||
# C:\Qt\5.9 is mapped to C:\Qt\5.9.n for backward compatibility
|
||||
install:
|
||||
- cmd: >-
|
||||
choco install opencv
|
||||
|
||||
cd thirdparty
|
||||
|
||||
copy /Y LibJPEG\jpeg-9\jconfig.vc LibJPEG\jpeg-9\jconfig.h
|
||||
|
@ -26,7 +28,7 @@ install:
|
|||
|
||||
mkdir %PLATFORM% && cd %PLATFORM%
|
||||
|
||||
cmake ..\sources -G "Visual Studio 14 2015 Win64" -DQT_PATH="C:\Qt\5.9\msvc2015_64" -DBOOST_ROOT="C:\Libraries\boost_1_60_0"
|
||||
cmake ..\sources -G "Visual Studio 14 2015 Win64" -DQT_PATH="C:\Qt\5.9\msvc2015_64" -DBOOST_ROOT="C:\Libraries\boost_1_60_0" -DOpenCV_DIR="C:\Tools\opencv\build"
|
||||
build:
|
||||
project: $(APPVEYOR_BUILD_FOLDER)\toonz\$(PLATFORM)\ALL_BUILD.vcxproj
|
||||
parallel: true
|
||||
|
@ -51,6 +53,10 @@ after_build:
|
|||
|
||||
copy /Y ..\..\thirdparty\libmypaint\dist\64\libmypaint-1-4-0.dll %CONFIGURATION%\OpenToonz
|
||||
|
||||
copy /Y ..\..\thirdparty\libjpeg-turbo64\dist\turbojpeg.dll %CONFIGURATION%\OpenToonz
|
||||
|
||||
copy /Y "C:\Tools\opencv\build\x64\vc14\bin\opencv_world412.dll" %CONFIGURATION%\OpenToonz
|
||||
|
||||
mkdir "%CONFIGURATION%\OpenToonz stuff"
|
||||
|
||||
xcopy /Y /E ..\..\stuff "%CONFIGURATION%\OpenToonz stuff"
|
||||
|
|
2
ci-scripts/linux/travis-build.sh
Normal file → Executable file
2
ci-scripts/linux/travis-build.sh
Normal file → Executable file
|
@ -3,7 +3,7 @@ pushd thirdparty/tiff-4.0.3
|
|||
CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --disable-jbig && make
|
||||
popd
|
||||
cd toonz && mkdir build && cd build
|
||||
source /opt/qt59/bin/qt59-env.sh
|
||||
source /opt/qt514/bin/qt514-env.sh
|
||||
cmake ../sources \
|
||||
-DWITH_SYSTEM_SUPERLU:BOOL=OFF
|
||||
# according to https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments
|
||||
|
|
5
ci-scripts/linux/travis-install.sh
Normal file → Executable file
5
ci-scripts/linux/travis-install.sh
Normal file → Executable file
|
@ -1,7 +1,8 @@
|
|||
sudo add-apt-repository --yes ppa:beineri/opt-qt597-trusty
|
||||
sudo add-apt-repository --yes ppa:beineri/opt-qt-5.14.1-xenial
|
||||
sudo add-apt-repository --yes ppa:achadwick/mypaint-testing
|
||||
sudo add-apt-repository --yes ppa:litenstein/opencv3-xenial
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y liblzo2-dev liblz4-dev libfreetype6-dev libpng-dev libegl1-mesa-dev libgles2-mesa-dev libglew-dev freeglut3-dev qt59script libsuperlu3-dev qt59svg qt59tools qt59multimedia wget libusb-1.0-0-dev libboost-all-dev liblzma-dev libjson-c-dev libmypaint-dev
|
||||
sudo apt-get install -y cmake liblzo2-dev liblz4-dev libfreetype6-dev libpng-dev libegl1-mesa-dev libgles2-mesa-dev libglew-dev freeglut3-dev qt514script libsuperlu-dev qt514svg qt514tools qt514multimedia wget libusb-1.0-0-dev libboost-all-dev liblzma-dev libjson-c-dev libmypaint-dev libjpeg-turbo8-dev libopencv-dev libglib2.0-dev qt514serialport
|
||||
|
||||
# someone forgot to include liblz4.pc with the package, use the version from xenial, as it only depends on libc
|
||||
wget http://mirrors.kernel.org/ubuntu/pool/main/l/lz4/liblz4-1_0.0~r131-2ubuntu2_amd64.deb -O liblz4.deb
|
||||
|
|
1
ci-scripts/osx/travis-build.sh
Normal file → Executable file
1
ci-scripts/osx/travis-build.sh
Normal file → Executable file
|
@ -5,6 +5,7 @@ popd
|
|||
cd toonz && mkdir build && cd build
|
||||
QTVERSION=`ls /usr/local/Cellar/qt`
|
||||
echo "QT Version detected: $QTVERSION"
|
||||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/jpeg-turbo/lib/pkgconfig"
|
||||
cmake ../sources \
|
||||
-DQT_PATH=/usr/local/Cellar/qt/$QTVERSION/lib/ \
|
||||
-DTIFF_INCLUDE_DIR=../../thirdparty/tiff-4.0.3/libtiff/ \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
brew update
|
||||
brew install glew lz4 lzo libusb libmypaint
|
||||
brew install glew lz4 lzo libusb libmypaint opencv jpeg-turbo
|
||||
brew tap tcr/tcr
|
||||
brew install clang-format
|
||||
# from Homebrew 1.6.0 the old formula for obtaining Qt5.9.2 becomes invalid.
|
||||
|
|
|
@ -13,21 +13,33 @@ Building OpenToonz from source requires the following dependencies:
|
|||
- Lzo2
|
||||
- FreeType
|
||||
- LibMyPaint (1.3 or newer)
|
||||
- Jpeg-Turbo (1.4 or newer)
|
||||
- OpenCV 3.2 or newer
|
||||
|
||||
### Installing Dependencies on Debian / Ubuntu
|
||||
### Installing Dependencies on Debian / Ubuntu 16.04 (Xenial)
|
||||
|
||||
```
|
||||
$ sudo apt-get install build-essential git cmake pkg-config libboost-all-dev qt5-default qtbase5-dev libqt5svg5-dev qtscript5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtmultimedia5-dev libsuperlu-dev liblz4-dev libusb-1.0-0-dev liblzo2-dev libpng-dev libjpeg-dev libglew-dev freeglut3-dev libfreetype6-dev libjson-c-dev qtwayland5 libqt5multimedia5-plugins
|
||||
$ sudo apt-get install build-essential git cmake freeglut3-dev libboost-all-dev libegl1-mesa-dev libfreetype6-dev libgles2-mesa-dev libglew-dev libglib2.0-dev libjpeg-dev libjpeg-turbo8-dev libjson-c-dev liblz4-dev liblzma-dev liblzo2-dev libpng-dev libsuperlu-dev libusb-1.0-0-dev pkg-config qt5-default qtbase5-dev libqt5svg5-dev qtscript5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtmultimedia5-dev qtwayland5 libqt5multimedia5-plugins
|
||||
```
|
||||
|
||||
For newest versions of OS you may install libmypaint from repository and don't need to build it from source:
|
||||
|
||||
Find a PPA respository for Qt 5.9 or later and install the following:
|
||||
```
|
||||
$ sudo apt-get install libmypaint-dev
|
||||
$ sudo apt-get install -y qt59multimedia qt59script qt59serialport qt59svg qt59tools
|
||||
```
|
||||
|
||||
Find a PPA repository for MyPaint 1.3 and install the following:
|
||||
```
|
||||
$ sudo apt-get install -y libmypaint-dev
|
||||
```
|
||||
|
||||
Find a PPA repository for OpenCV 3.2 or later and install the following:
|
||||
```
|
||||
$ sudo apt-get install -y libopencv-dev
|
||||
```
|
||||
|
||||
Notes:
|
||||
* It's possible we also need `libgsl2` (or maybe `libopenblas-dev`)
|
||||
* For Qt, MyPaint and OpenCV, you can alternatively build and install from source.
|
||||
|
||||
### Installing Dependencies on Fedora
|
||||
(it may include some useless packages)
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
- cmake (3.2.2 or later)
|
||||
- Qt (5.9.2 or later)
|
||||
- boost (1.55.0 or later)
|
||||
- OpenCV
|
||||
- Jpeg-turbo
|
||||
|
||||
## Building on macOS
|
||||
### Download boost from https://boost.org
|
||||
|
@ -25,6 +27,7 @@ Apple store usually provides for the most recent macOS version. For older versi
|
|||
|
||||
After installing the application, you will need to start it in order to complete the installation.
|
||||
|
||||
|
||||
### Install Homebrew from https://brew.sh
|
||||
|
||||
Check site for any changes in installation instructions, but they will probably just be this:
|
||||
|
@ -39,7 +42,7 @@ $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/
|
|||
|
||||
In a Terminal window, execute the following statements:
|
||||
```
|
||||
$ brew install glew lz4 libjpeg libpng lzo pkg-config libusb cmake git-lfs libmypaint qt
|
||||
$ brew install glew lz4 libjpeg libpng lzo pkg-config libusb cmake git-lfs libmypaint qt opencv jpeg-turbo
|
||||
$ git lfs install
|
||||
```
|
||||
|
||||
|
@ -68,7 +71,7 @@ $ tar xvjf boost_1_72_0.tar.bz2
|
|||
$ cd ../lzo
|
||||
$ cp -r 2.03/include/lzo driver
|
||||
$ cd ../tiff-4.0.3
|
||||
$ ./configure && make
|
||||
$ ./configure --disable-lzma && make
|
||||
```
|
||||
|
||||
### Configure build for QT version
|
||||
|
@ -85,6 +88,7 @@ If you downloaded the QT installer and installed to `/Users/yourlogin/Qt`, your
|
|||
$ cd ~/Documents/opentoonz/toonz
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/jpeg-turbo/lib/pkgconfig"
|
||||
```
|
||||
|
||||
2. Set up build environment
|
||||
|
@ -124,6 +128,15 @@ $ sudo mkdir /Applications/OpenToonz
|
|||
$ sudo cp -r stuff /Applications/OpenToonz/OpenToonz_stuff
|
||||
$ sudo chmod -R 777 /Applications/OpenToonz
|
||||
```
|
||||
## Building with extended stop motion support for webcams and Canon DSLR cameras.
|
||||
You will need one additional library:
|
||||
- The Canon SDK. This requires applying for the Canon developer program and downloading the SDK.
|
||||
|
||||
Copy the Header and Framework folders from the Canon SDK to `$opentoonz/thirdparty/canon`
|
||||
|
||||
Edit the `/Users/yourlogin/Documents/opentoonz/toonz/sources/CMakeLists.txt` file at the end of line 104, changing the `WITH_CANON` build option from `OFF` to `ON`.
|
||||
|
||||
To run the program with stop motion support, you will need to copy the EDSDK.framework directory from the Canon SDK and place it in `Macintosh HD/Library/Frameworks`. It could also be placed in the same folder as `OpenToonz.app`. If opening OpenToonz.app fails because "EDSDK.framework can't be opened", go to `Preferences -> Security & Privacy -> General` and select "Open Anyway". Open OpenToonz again and select "Open" when the "EDSDK.framework can't be opened" warning appears.
|
||||
|
||||
### Running the build
|
||||
|
||||
|
|
|
@ -1570,6 +1570,12 @@ ProjectPopup QLabel {
|
|||
#GearButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#LiveViewButton {
|
||||
qproperty-icon: url('../Default/imgs/white/liveview.svg');
|
||||
}
|
||||
#LiveViewButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#SubfolderButton {
|
||||
qproperty-icon: url('../Default/imgs/white/subfolder.svg');
|
||||
padding-left: 6px;
|
||||
|
|
|
@ -1570,6 +1570,12 @@ ProjectPopup QLabel {
|
|||
#GearButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#LiveViewButton {
|
||||
qproperty-icon: url('../Default/imgs/white/liveview.svg');
|
||||
}
|
||||
#LiveViewButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#SubfolderButton {
|
||||
qproperty-icon: url('../Default/imgs/white/subfolder.svg');
|
||||
padding-left: 6px;
|
||||
|
|
|
@ -1570,6 +1570,12 @@ ProjectPopup QLabel {
|
|||
#GearButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#LiveViewButton {
|
||||
qproperty-icon: url('imgs/white/liveview.svg');
|
||||
}
|
||||
#LiveViewButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#SubfolderButton {
|
||||
qproperty-icon: url('imgs/white/subfolder.svg');
|
||||
padding-left: 6px;
|
||||
|
|
32
stuff/config/qss/Default/imgs/black/liveview.svg
Normal file
32
stuff/config/qss/Default/imgs/black/liveview.svg
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 18 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.4142;">
|
||||
<path id="path821" d="M2,8.5C2,8.5 4.6,4 9,4C13.4,4 16,8.5 16,8.5C16,8.5 13.4,13 9,13C4.6,13 2,8.5 2,8.5Z" style="fill:rgb(230,230,230);fill-rule:nonzero;stroke:rgb(48,48,48);stroke-width:2px;"/>
|
||||
<path id="path832" d="M2,8.5C2,8.5 4.6,4 9,4C13.4,4 16,8.5 16,8.5C16,8.5 13.4,13 9,13C4.6,13 2,8.5 2,8.5Z" style="fill:rgb(230,230,230);fill-rule:nonzero;"/>
|
||||
<ellipse id="path21" cx="9" cy="8.5" rx="3.5" ry="3.6" style="fill:rgb(48,48,48);"/>
|
||||
<circle id="path1450" cx="8" cy="7.5" r="1.5" style="fill:rgb(230,230,230);"/>
|
||||
<g transform="matrix(1,0,0,1,0.734235,0.518659)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,0.734235,0.518659)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(6.12323e-17,-1,1,6.12323e-17,0.489235,16.2887)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(6.12323e-17,-1,1,6.12323e-17,0.489235,16.2887)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1,-1.22465e-16,1.22465e-16,-1,17.2961,16.5337)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1,-1.22465e-16,1.22465e-16,-1,17.2961,16.5337)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1.83697e-16,1,-1,-1.83697e-16,17.5411,0.763694)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1.83697e-16,1,-1,-1.83697e-16,17.5411,0.763694)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
32
stuff/config/qss/Default/imgs/white/liveview.svg
Normal file
32
stuff/config/qss/Default/imgs/white/liveview.svg
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 18 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.4142;">
|
||||
<path id="path821" d="M2,8.5C2,8.5 4.6,4 9,4C13.4,4 16,8.5 16,8.5C16,8.5 13.4,13 9,13C4.6,13 2,8.5 2,8.5Z" style="fill:rgb(230,230,230);fill-rule:nonzero;stroke:rgb(48,48,48);stroke-width:2px;"/>
|
||||
<path id="path832" d="M2,8.5C2,8.5 4.6,4 9,4C13.4,4 16,8.5 16,8.5C16,8.5 13.4,13 9,13C4.6,13 2,8.5 2,8.5Z" style="fill:rgb(230,230,230);fill-rule:nonzero;"/>
|
||||
<ellipse id="path21" cx="9" cy="8.5" rx="3.5" ry="3.6" style="fill:rgb(48,48,48);"/>
|
||||
<circle id="path1450" cx="8" cy="7.5" r="1.5" style="fill:rgb(230,230,230);"/>
|
||||
<g transform="matrix(1,0,0,1,0.734235,0.518659)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1,0.734235,0.518659)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(6.12323e-17,-1,1,6.12323e-17,0.489235,16.2887)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(6.12323e-17,-1,1,6.12323e-17,0.489235,16.2887)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1,-1.22465e-16,1.22465e-16,-1,17.2961,16.5337)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1,-1.22465e-16,1.22465e-16,-1,17.2961,16.5337)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1.83697e-16,1,-1,-1.83697e-16,17.5411,0.763694)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(189,189,189);stroke-width:2px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
<g transform="matrix(-1.83697e-16,1,-1,-1.83697e-16,17.5411,0.763694)">
|
||||
<path d="M0.684,4L0.684,0.929L3.513,0.929" style="fill:none;stroke:rgb(48,48,48);stroke-width:1.5px;stroke-linecap:round;stroke-miterlimit:1.5;"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
|
@ -102,6 +102,13 @@ PencilTestPopup {
|
|||
}
|
||||
}
|
||||
|
||||
#LiveViewButton {
|
||||
qproperty-icon: url('@{img-url}/liveview.svg');
|
||||
&::menu-indicator{
|
||||
image:"";
|
||||
}
|
||||
}
|
||||
|
||||
#SubfolderButton {
|
||||
qproperty-icon: url('@{img-url}/subfolder.svg');
|
||||
padding-left: 6px;
|
||||
|
|
|
@ -1571,6 +1571,12 @@ ProjectPopup QLabel {
|
|||
#GearButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#LiveViewButton {
|
||||
qproperty-icon: url('../Default/imgs/black/liveview.svg');
|
||||
}
|
||||
#LiveViewButton::menu-indicator {
|
||||
image: "";
|
||||
}
|
||||
#SubfolderButton {
|
||||
qproperty-icon: url('../Default/imgs/black/subfolder.svg');
|
||||
padding-left: 6px;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
<menu title="Export">
|
||||
<command>MI_SoundTrack</command>
|
||||
<command>MI_ExportXDTS</command>
|
||||
<command>MI_StopMotionExportImageSequence</command>
|
||||
</menu>
|
||||
<separator/>
|
||||
<command>MI_PrintXsheet</command>
|
||||
|
|
2
thirdparty/libjpeg-turbo64/.gitignore
vendored
2
thirdparty/libjpeg-turbo64/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
include/*
|
||||
lib/*
|
0
thirdparty/libjpeg-turbo64/.gitkeep
vendored
0
thirdparty/libjpeg-turbo64/.gitkeep
vendored
|
@ -1 +0,0 @@
|
|||
Copy the lib and include folders from libjpeg-turbo64 into this folder.
|
3
thirdparty/libjpeg-turbo64/dist/turbojpeg.dll
vendored
Normal file
3
thirdparty/libjpeg-turbo64/dist/turbojpeg.dll
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d9f87d770b205312635a9d87ce862d0fa6a00b9f74fd9fb09449c38bd37cb2dd
|
||||
size 724480
|
316
thirdparty/libjpeg-turbo64/include/jerror.h
vendored
Normal file
316
thirdparty/libjpeg-turbo64/include/jerror.h
vendored
Normal file
|
@ -0,0 +1,316 @@
|
|||
/*
|
||||
* jerror.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* Modified 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2014, 2017, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file defines the error and message codes for the JPEG library.
|
||||
* Edit this file to add new codes, or to translate the message strings to
|
||||
* some other language.
|
||||
* A set of error-reporting macros are defined too. Some applications using
|
||||
* the JPEG library may wish to include this file to get the error codes
|
||||
* and/or the macros.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To define the enum list of message codes, include this file without
|
||||
* defining macro JMESSAGE. To create a message string table, include it
|
||||
* again with a suitable JMESSAGE definition (see jerror.c for an example).
|
||||
*/
|
||||
#ifndef JMESSAGE
|
||||
#ifndef JERROR_H
|
||||
/* First time through, define the enum list */
|
||||
#define JMAKE_ENUM_LIST
|
||||
#else
|
||||
/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
|
||||
#define JMESSAGE(code, string)
|
||||
#endif /* JERROR_H */
|
||||
#endif /* JMESSAGE */
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
typedef enum {
|
||||
|
||||
#define JMESSAGE(code, string) code,
|
||||
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
|
||||
|
||||
/* For maintenance convenience, list is alphabetical by message code name */
|
||||
#if JPEG_LIB_VERSION < 70
|
||||
JMESSAGE(JERR_ARITH_NOTIMPL, "Sorry, arithmetic coding is not implemented")
|
||||
#endif
|
||||
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
|
||||
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
|
||||
JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
|
||||
JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
|
||||
#endif
|
||||
JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
|
||||
JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
JMESSAGE(JERR_BAD_DROP_SAMPLING,
|
||||
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
|
||||
#endif
|
||||
JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
|
||||
JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
|
||||
JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
|
||||
JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
|
||||
JMESSAGE(JERR_BAD_LIB_VERSION,
|
||||
"Wrong JPEG library version: library is %d, caller expects %d")
|
||||
JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
|
||||
JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
|
||||
JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
|
||||
JMESSAGE(JERR_BAD_PROGRESSION,
|
||||
"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
|
||||
JMESSAGE(JERR_BAD_PROG_SCRIPT,
|
||||
"Invalid progressive parameters at scan script entry %d")
|
||||
JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
|
||||
JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
|
||||
JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
|
||||
JMESSAGE(JERR_BAD_STRUCT_SIZE,
|
||||
"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
|
||||
JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
|
||||
JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
|
||||
JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
|
||||
JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
|
||||
JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
|
||||
JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
|
||||
JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
|
||||
JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
|
||||
JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
|
||||
JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
|
||||
JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
|
||||
JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
|
||||
JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
|
||||
JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
|
||||
JMESSAGE(JERR_FILE_READ, "Input file read error")
|
||||
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
|
||||
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
|
||||
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
|
||||
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
|
||||
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
|
||||
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
|
||||
JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
|
||||
JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
|
||||
"Cannot transcode due to multiple use of quantization table %d")
|
||||
JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
|
||||
JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
|
||||
JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
|
||||
JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
|
||||
#endif
|
||||
JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
|
||||
JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
|
||||
JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
|
||||
JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
|
||||
JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
|
||||
JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
|
||||
JMESSAGE(JERR_QUANT_COMPONENTS,
|
||||
"Cannot quantize more than %d color components")
|
||||
JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
|
||||
JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
|
||||
JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
|
||||
JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
|
||||
JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
|
||||
JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
|
||||
JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
|
||||
JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
|
||||
JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
|
||||
JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
|
||||
JMESSAGE(JERR_TFILE_WRITE,
|
||||
"Write failed on temporary file --- out of disk space?")
|
||||
JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
|
||||
JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
|
||||
JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
|
||||
JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
|
||||
JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
|
||||
JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
|
||||
JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT_SHORT)
|
||||
JMESSAGE(JMSG_VERSION, JVERSION)
|
||||
JMESSAGE(JTRC_16BIT_TABLES,
|
||||
"Caution: quantization tables are too coarse for baseline JPEG")
|
||||
JMESSAGE(JTRC_ADOBE,
|
||||
"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
|
||||
JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
|
||||
JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
|
||||
JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
|
||||
JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
|
||||
JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
|
||||
JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
|
||||
JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
|
||||
JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
|
||||
JMESSAGE(JTRC_EOI, "End Of Image")
|
||||
JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
|
||||
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
|
||||
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
|
||||
"Warning: thumbnail image size does not match data length %u")
|
||||
JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u")
|
||||
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
|
||||
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
|
||||
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
|
||||
JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
|
||||
JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
|
||||
JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
|
||||
JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
|
||||
JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
|
||||
JMESSAGE(JTRC_RST, "RST%d")
|
||||
JMESSAGE(JTRC_SMOOTH_NOTIMPL,
|
||||
"Smoothing not supported with nonstandard sampling ratios")
|
||||
JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
|
||||
JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
|
||||
JMESSAGE(JTRC_SOI, "Start of Image")
|
||||
JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
|
||||
JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
|
||||
JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
|
||||
JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
|
||||
JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
|
||||
JMESSAGE(JTRC_THUMB_JPEG,
|
||||
"JFIF extension marker: JPEG-compressed thumbnail image, length %u")
|
||||
JMESSAGE(JTRC_THUMB_PALETTE,
|
||||
"JFIF extension marker: palette thumbnail image, length %u")
|
||||
JMESSAGE(JTRC_THUMB_RGB,
|
||||
"JFIF extension marker: RGB thumbnail image, length %u")
|
||||
JMESSAGE(JTRC_UNKNOWN_IDS,
|
||||
"Unrecognized component IDs %d %d %d, assuming YCbCr")
|
||||
JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
|
||||
JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
|
||||
JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
|
||||
#endif
|
||||
JMESSAGE(JWRN_BOGUS_PROGRESSION,
|
||||
"Inconsistent progression sequence for component %d coefficient %d")
|
||||
JMESSAGE(JWRN_EXTRANEOUS_DATA,
|
||||
"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
|
||||
JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
|
||||
JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
|
||||
JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
|
||||
JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
|
||||
JMESSAGE(JWRN_MUST_RESYNC,
|
||||
"Corrupt JPEG data: found marker 0x%02x instead of RST%d")
|
||||
JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
|
||||
JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
|
||||
#if JPEG_LIB_VERSION < 70
|
||||
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
|
||||
#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)
|
||||
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
|
||||
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
|
||||
#endif
|
||||
#endif
|
||||
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
JMSG_LASTMSGCODE
|
||||
} J_MESSAGE_CODE;
|
||||
|
||||
#undef JMAKE_ENUM_LIST
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
|
||||
#undef JMESSAGE
|
||||
|
||||
|
||||
#ifndef JERROR_H
|
||||
#define JERROR_H
|
||||
|
||||
/* Macros to simplify using the error and trace message stuff */
|
||||
/* The first parameter is either type of cinfo pointer */
|
||||
|
||||
/* Fatal errors (print message and exit) */
|
||||
#define ERREXIT(cinfo, code) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
#define ERREXIT1(cinfo, code, p1) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
#define ERREXIT2(cinfo, code, p1, p2) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(cinfo)->err->msg_parm.i[1] = (p2), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
#define ERREXIT3(cinfo, code, p1, p2, p3) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(cinfo)->err->msg_parm.i[1] = (p2), \
|
||||
(cinfo)->err->msg_parm.i[2] = (p3), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
#define ERREXIT4(cinfo, code, p1, p2, p3, p4) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(cinfo)->err->msg_parm.i[1] = (p2), \
|
||||
(cinfo)->err->msg_parm.i[2] = (p3), \
|
||||
(cinfo)->err->msg_parm.i[3] = (p4), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
#define ERREXITS(cinfo, code, str) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
|
||||
(*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
|
||||
|
||||
#define MAKESTMT(stuff) do { stuff } while (0)
|
||||
|
||||
/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
|
||||
#define WARNMS(cinfo, code) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
|
||||
#define WARNMS1(cinfo, code, p1) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
|
||||
#define WARNMS2(cinfo, code, p1, p2) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(cinfo)->err->msg_parm.i[1] = (p2), \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
|
||||
|
||||
/* Informational/debugging messages */
|
||||
#define TRACEMS(cinfo, lvl, code) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
|
||||
#define TRACEMS1(cinfo, lvl, code, p1) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
|
||||
#define TRACEMS2(cinfo, lvl, code, p1, p2) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
(cinfo)->err->msg_parm.i[0] = (p1), \
|
||||
(cinfo)->err->msg_parm.i[1] = (p2), \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
|
||||
#define TRACEMS3(cinfo, lvl, code, p1, p2, p3) \
|
||||
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
|
||||
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
|
||||
(cinfo)->err->msg_code = (code); \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
|
||||
#define TRACEMS4(cinfo, lvl, code, p1, p2, p3, p4) \
|
||||
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
|
||||
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
|
||||
(cinfo)->err->msg_code = (code); \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
|
||||
#define TRACEMS5(cinfo, lvl, code, p1, p2, p3, p4, p5) \
|
||||
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
|
||||
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
|
||||
_mp[4] = (p5); \
|
||||
(cinfo)->err->msg_code = (code); \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
|
||||
#define TRACEMS8(cinfo, lvl, code, p1, p2, p3, p4, p5, p6, p7, p8) \
|
||||
MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
|
||||
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
|
||||
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
|
||||
(cinfo)->err->msg_code = (code); \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
|
||||
#define TRACEMSS(cinfo, lvl, code, str) \
|
||||
((cinfo)->err->msg_code = (code), \
|
||||
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
|
||||
(*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
|
||||
|
||||
#endif /* JERROR_H */
|
1744
thirdparty/libjpeg-turbo64/include/turbojpeg.h
vendored
Normal file
1744
thirdparty/libjpeg-turbo64/include/turbojpeg.h
vendored
Normal file
File diff suppressed because it is too large
Load diff
3
thirdparty/libjpeg-turbo64/lib/turbojpeg.lib
vendored
Normal file
3
thirdparty/libjpeg-turbo64/lib/turbojpeg.lib
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24308f9e92d2e763507d6497d8121c21df59e9fb0e35a0c7f65553f1a4a6a029
|
||||
size 23028
|
|
@ -12,6 +12,8 @@
|
|||
<string>OpenToonz.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.github.opentoonz.OpenToonz</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>OpenToonz needs access to the camera in order to use Camera Capture</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
|
|
@ -101,7 +101,7 @@ endif()
|
|||
|
||||
option(WITH_SYSTEM_LZO "Use the system LZO library instead of 'thirdpary'" ${_init_SYSTEM_LZO})
|
||||
option(WITH_SYSTEM_SUPERLU "Use the system SuperLU library instead of 'thirdpary'" ${_init_SYSTEM_SUPERLU})
|
||||
option(WITH_STOPMOTION "Build with Stop Motion features - Requires Canon SDK" OFF)
|
||||
option(WITH_CANON "Build with Canon DSLR support - Requires Canon SDK" OFF)
|
||||
|
||||
# avoid using again
|
||||
option_defaults_clear()
|
||||
|
@ -166,6 +166,7 @@ elseif(BUILD_ENV_APPLE)
|
|||
add_definitions(
|
||||
-DMACOSX
|
||||
-Di386
|
||||
-D__MACOS__
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++11 -stdlib=libc++ -fno-implicit-templates")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
|
||||
|
@ -178,6 +179,7 @@ elseif(BUILD_ENV_APPLE)
|
|||
add_definitions(
|
||||
-DMACOSX
|
||||
-Di386
|
||||
-D__MACOS__
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -std=c++11 -stdlib=libc++ -fno-implicit-templates -D HAS_QUICKDRAW")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
||||
|
@ -226,6 +228,7 @@ if(BUILD_ENV_APPLE)
|
|||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_INSTALL_RPATH ${QT_LIB_PATH})
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${QT_LIB_PATH}" isSystemDir)
|
||||
if("${isSystemDir}" STREQUAL "-1")
|
||||
set(CMAKE_INSTALL_RPATH "${QT_LIB_PATH}")
|
||||
|
@ -250,6 +253,7 @@ find_package(Qt5 REQUIRED
|
|||
LinguistTools
|
||||
Multimedia
|
||||
MultimediaWidgets
|
||||
SerialPort
|
||||
)
|
||||
|
||||
set(QT_MINIMUM_VERSION 5.5.0)
|
||||
|
@ -259,7 +263,9 @@ if(Qt5Core_VERSION VERSION_LESS QT_MINIMUM_VERSION)
|
|||
endif()
|
||||
unset(QT_MINIMUM_VERSION)
|
||||
|
||||
if(BUILD_ENV_MSVC AND NOT WITH_STOPMOTION)
|
||||
|
||||
|
||||
if(BUILD_ENV_MSVC)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${SDKROOT}/glut/3.7.6/include
|
||||
|
@ -271,19 +277,23 @@ if(BUILD_ENV_MSVC AND NOT WITH_STOPMOTION)
|
|||
)
|
||||
endif()
|
||||
|
||||
if(BUILD_ENV_MSVC AND WITH_STOPMOTION)
|
||||
find_package(OpenCV 4.1 REQUIRED)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${SDKROOT}/glut/3.7.6/include
|
||||
${SDKROOT}/zlib-1.2.8
|
||||
${SDKROOT}/LibJPEG/jpeg-9
|
||||
${SDKROOT}/canon/Header
|
||||
${SDKROOT}/libjpeg-turbo64/include
|
||||
${OpenCV_INCLUDE_DIRS}
|
||||
if(BUILD_ENV_MSVC)
|
||||
find_package(OpenCV 4.1 REQUIRED
|
||||
PATHS "C:/OpenCV/opencv/build" "C:/opencv/build" "C:/Tools/opencv/build"
|
||||
)
|
||||
add_definitions(
|
||||
-DGLUT_NO_LIB_PRAGMA
|
||||
elseif(BUILD_ENV_UNIXLIKE)
|
||||
find_package(OpenCV 3.2 REQUIRED)
|
||||
else()
|
||||
find_package(OpenCV 4.1 REQUIRED)
|
||||
endif()
|
||||
include_directories(
|
||||
${SDKROOT}/libjpeg-turbo64/include
|
||||
${OpenCV_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(WITH_CANON)
|
||||
include_directories(
|
||||
${SDKROOT}/canon/Header
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -347,9 +357,13 @@ if(BUILD_ENV_MSVC)
|
|||
set(SUPERLU_LIB ${SDKROOT}/superlu/SuperLU_${MSVC_LIB_VERSION}_${PLATFORM}.lib)
|
||||
set(OPENBLAS_LIB ${SDKROOT}/openblas/libopenblas_${PLATFORM}.lib)
|
||||
set(USB_LIB) # unused
|
||||
if (WITH_STOPMOTION)
|
||||
set(CANON_LIB ${SDKROOT}/canon/library/EDSDK.lib)
|
||||
set(TURBOJPEG_LIB ${SDKROOT}/libjpeg-turbo64/lib/turbojpeg.lib)
|
||||
set(TURBOJPEG_LIB ${SDKROOT}/libjpeg-turbo64/lib/turbojpeg.lib)
|
||||
if (WITH_CANON)
|
||||
if(BUILD_ENV_APPLE)
|
||||
set(CANON_LIB ${SDKROOT}/canon/Framework/EDSDK.framework)
|
||||
else()
|
||||
set(CANON_LIB ${SDKROOT}/canon/library/EDSDK.lib)
|
||||
endif()
|
||||
endif()
|
||||
if(PLATFORM EQUAL 32)
|
||||
set(QT_LIB ${SDKROOT}/quicktime/QT73SDK/Libraries/QTMLClient.lib)
|
||||
|
@ -404,6 +418,19 @@ elseif(BUILD_ENV_APPLE)
|
|||
message("LZO:" ${LZO_INCLUDE_DIR})
|
||||
|
||||
pkg_check_modules(MYPAINT_LIB REQUIRED libmypaint)
|
||||
|
||||
pkg_check_modules(TURBOJPEG REQUIRED libturbojpeg)
|
||||
find_library(TURBOJPEG_LIB turbojpeg ${TURBOJPEG_LIBRARY_DIRS})
|
||||
message("**************** turbojpeg lib:" ${TURBOJPEG_LIB})
|
||||
|
||||
if (WITH_CANON)
|
||||
if(BUILD_ENV_APPLE)
|
||||
set(CANON_LIB ${SDKROOT}/canon/Framework/EDSDK.framework)
|
||||
else()
|
||||
set(CANON_LIB ${SDKROOT}/canon/library/EDSDK.lib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
elseif(BUILD_ENV_UNIXLIKE)
|
||||
if(BUILD_TARGET_WIN)
|
||||
find_library(GL_LIB opengl32)
|
||||
|
@ -464,6 +491,9 @@ elseif(BUILD_ENV_UNIXLIKE)
|
|||
endif()
|
||||
# Can be 'libmypaint' or 'libmypaint-1.x'
|
||||
pkg_search_module(MYPAINT_LIB REQUIRED libmypaint libmypaint-1.3>=1.3)
|
||||
|
||||
find_library(TURBOJPEG_LIB turbojpeg)
|
||||
message("**************** turbojpeg lib:" ${TURBOJPEG_LIB})
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
// TnzLib includes
|
||||
#include "toonz/imagepainter.h"
|
||||
#include "stageplayer.h"
|
||||
|
||||
#undef DVAPI
|
||||
#undef DVVAR
|
||||
|
@ -99,6 +100,8 @@ public:
|
|||
virtual void onImage(
|
||||
const Player &player) = 0; //!< The \a visitation function.
|
||||
|
||||
virtual void onRasterImage(TRasterImage *ri, const Stage::Player &data) = 0;
|
||||
|
||||
// I've not checked the actual meaning of the methods below. They are unused
|
||||
// in Toonz, but *are*
|
||||
// used in Toonz derivative works such as Tab or LineTest. They deal with
|
||||
|
@ -135,6 +138,10 @@ struct DVAPI VisitArgs {
|
|||
int m_isGuidedDrawingEnabled;
|
||||
int m_guidedFrontStroke;
|
||||
int m_guidedBackStroke;
|
||||
TRasterImageP m_liveViewImage = 0;
|
||||
TRasterImageP m_lineupImage = 0;
|
||||
Stage::Player m_liveViewPlayer;
|
||||
Stage::Player m_lineupPlayer;
|
||||
|
||||
public:
|
||||
VisitArgs()
|
||||
|
@ -265,7 +272,7 @@ public:
|
|||
|
||||
void onImage(const Stage::Player &data) override;
|
||||
void onVectorImage(TVectorImage *vi, const Stage::Player &data);
|
||||
void onRasterImage(TRasterImage *ri, const Stage::Player &data);
|
||||
void onRasterImage(TRasterImage *ri, const Stage::Player &data) override;
|
||||
void onToonzImage(TToonzImage *ri, const Stage::Player &data);
|
||||
|
||||
void beginMask() override;
|
||||
|
@ -306,6 +313,7 @@ public:
|
|||
void setDistance(double d);
|
||||
|
||||
void onImage(const Stage::Player &data) override;
|
||||
void onRasterImage(TRasterImage *ri, const Stage::Player &data) override{};
|
||||
void beginMask() override;
|
||||
void endMask() override;
|
||||
void enableMask() override;
|
||||
|
|
|
@ -64,7 +64,8 @@ enum CommandType {
|
|||
ZoomCommandType,
|
||||
MiscCommandType,
|
||||
MenuCommandType,
|
||||
VisualizationButtonCommandType
|
||||
VisualizationButtonCommandType,
|
||||
StopMotionCommandType
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
1850
toonz/sources/stopmotion/canon.cpp
Normal file
1850
toonz/sources/stopmotion/canon.cpp
Normal file
File diff suppressed because it is too large
Load diff
206
toonz/sources/stopmotion/canon.h
Normal file
206
toonz/sources/stopmotion/canon.h
Normal file
|
@ -0,0 +1,206 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef CANON_H
|
||||
#define CANON_H
|
||||
|
||||
#ifdef WITH_CANON
|
||||
// Canon Includes
|
||||
#include "EDSDK.h"
|
||||
#include "EDSDKErrors.h"
|
||||
#include "EDSDKTypes.h"
|
||||
#endif
|
||||
|
||||
#include "turbojpeg.h"
|
||||
|
||||
// Toonz Includes
|
||||
#include "traster.h"
|
||||
#include "toonzqt/gutil.h"
|
||||
#include "toonzqt/dvdialog.h"
|
||||
|
||||
#include "jpgconverter.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QCamera;
|
||||
class QCameraInfo;
|
||||
class QDialog;
|
||||
class QTimer;
|
||||
class QSerialPort;
|
||||
|
||||
#include <QThread>
|
||||
|
||||
class Canon : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static Canon* instance() {
|
||||
static Canon _instance;
|
||||
return &_instance;
|
||||
};
|
||||
|
||||
private:
|
||||
#ifdef WITH_CANON
|
||||
std::map<EdsUInt32, std::string> m_avMap, m_tvMap, m_isoMap, m_modeMap,
|
||||
m_exposureMap, m_whiteBalanceMap, m_imageQualityMap, m_pictureStyleMap;
|
||||
JpgConverter* m_converter;
|
||||
static EdsError EDSCALLBACK handleObjectEvent(EdsObjectEvent event,
|
||||
EdsBaseRef object,
|
||||
EdsVoid* context);
|
||||
|
||||
static EdsError EDSCALLBACK handlePropertyEvent(EdsPropertyEvent event,
|
||||
EdsPropertyID property,
|
||||
EdsUInt32 param,
|
||||
EdsVoid* context);
|
||||
|
||||
static EdsError EDSCALLBACK handleStateEvent(EdsStateEvent event,
|
||||
EdsUInt32 parameter,
|
||||
EdsVoid* context);
|
||||
static EdsError EDSCALLBACK handleCameraAddedEvent(EdsVoid* context);
|
||||
|
||||
void buildAvMap();
|
||||
void buildTvMap();
|
||||
void buildIsoMap();
|
||||
void buildModeMap();
|
||||
void buildExposureMap();
|
||||
void buildWhiteBalanceMap();
|
||||
void buildImageQualityMap();
|
||||
void buildPictureStyleMap();
|
||||
#endif
|
||||
|
||||
private:
|
||||
QStringList m_isoOptions, m_shutterSpeedOptions, m_apertureOptions,
|
||||
m_exposureOptions, m_whiteBalanceOptions, m_colorTempOptions,
|
||||
m_imageQualityOptions, m_pictureStyleOptions;
|
||||
|
||||
public:
|
||||
Canon();
|
||||
~Canon();
|
||||
|
||||
#ifdef WITH_CANON
|
||||
EdsError m_error = EDS_ERR_OK;
|
||||
EdsUInt32 m_count = 0;
|
||||
EdsCameraListRef m_cameraList = NULL;
|
||||
EdsCameraRef m_camera = NULL;
|
||||
EdsUInt32 m_liveViewZoom = 1;
|
||||
bool m_isSDKLoaded = false;
|
||||
bool m_sessionOpen = false;
|
||||
bool m_zooming = false;
|
||||
std::string m_cameraName;
|
||||
TDimension m_proxyImageDimensions = TDimension(0, 0);
|
||||
TPointD m_proxyDpi = TPointD(0.0, 0.0);
|
||||
TPoint m_liveViewZoomOffset = TPoint(0, 0);
|
||||
bool m_liveViewZoomReadyToPick = true;
|
||||
TPointD m_liveViewZoomPickPoint = TPointD(0.0, 0.0);
|
||||
TPoint m_zoomRectDimensions = TPoint(0, 0);
|
||||
TPoint m_calculatedZoomPoint = TPoint(0, 0);
|
||||
TPoint m_finalZoomPoint = TPoint(0, 0);
|
||||
TRect m_zoomRect = TRect(0, 0, 0, 0);
|
||||
#endif
|
||||
bool m_useScaledImages = true;
|
||||
bool m_converterSucceeded = false;
|
||||
bool m_pickLiveViewZoom = false;
|
||||
TDimension m_fullImageDimensions = TDimension(0, 0);
|
||||
TPointD m_fullImageDpi = TPointD(0.0, 0.0);
|
||||
|
||||
// Canon Commands
|
||||
#ifdef WITH_CANON
|
||||
void cameraAdded();
|
||||
void closeAll();
|
||||
void resetCanon(bool liveViewOpen);
|
||||
void closeCanonSDK();
|
||||
int getCameraCount();
|
||||
std::string getCameraName();
|
||||
EdsError initializeCanonSDK();
|
||||
EdsCameraListRef getCameraList();
|
||||
EdsError releaseCameraList();
|
||||
EdsError getCamera(int index);
|
||||
EdsError releaseCamera();
|
||||
EdsError openCameraSession();
|
||||
EdsError closeCameraSession();
|
||||
bool downloadImage(EdsBaseRef object);
|
||||
EdsError takePicture();
|
||||
EdsError startCanonLiveView();
|
||||
EdsError endCanonLiveView();
|
||||
bool downloadEVFData();
|
||||
QStringList getIsoOptions() { return m_isoOptions; }
|
||||
QStringList getShutterSpeedOptions() { return m_shutterSpeedOptions; }
|
||||
QStringList getApertureOptions() { return m_apertureOptions; }
|
||||
QStringList getExposureOptions() { return m_exposureOptions; }
|
||||
QStringList getWhiteBalanceOptions() { return m_whiteBalanceOptions; }
|
||||
QStringList getColorTemperatureOptions() { return m_colorTempOptions; }
|
||||
QStringList getImageQualityOptions() { return m_imageQualityOptions; }
|
||||
QStringList getPictureStyleOptions() { return m_pictureStyleOptions; }
|
||||
EdsError getAvailableShutterSpeeds();
|
||||
EdsError getAvailableIso();
|
||||
EdsError getAvailableApertures();
|
||||
EdsError getAvailableExposureCompensations();
|
||||
EdsError getAvailableWhiteBalances();
|
||||
EdsError getAvailableImageQualities();
|
||||
EdsError getAvailablePictureStyles();
|
||||
void buildColorTemperatures();
|
||||
QString getCurrentShutterSpeed();
|
||||
QString getCurrentIso();
|
||||
QString getCurrentAperture();
|
||||
QString getCurrentExposureCompensation();
|
||||
QString getCurrentWhiteBalance();
|
||||
QString getCurrentColorTemperature();
|
||||
QString getCurrentImageQuality();
|
||||
QString getCurrentPictureStyle();
|
||||
QString getCurrentBatteryLevel();
|
||||
EdsError setShutterSpeed(QString shutterSpeed);
|
||||
EdsError setIso(QString iso);
|
||||
EdsError setAperture(QString aperture);
|
||||
EdsError setExposureCompensation(QString exposure);
|
||||
EdsError setWhiteBalance(QString whiteBalance);
|
||||
EdsError setColorTemperature(QString temp);
|
||||
EdsError setImageQuality(QString quality);
|
||||
EdsError setPictureStyle(QString style);
|
||||
QString getMode();
|
||||
void refreshOptions();
|
||||
EdsError zoomLiveView();
|
||||
EdsError setZoomPoint();
|
||||
void makeZoomPoint(TPointD pos);
|
||||
void toggleZoomPicking();
|
||||
void calculateZoomPoint();
|
||||
EdsError focusNear();
|
||||
EdsError focusFar();
|
||||
EdsError focusNear2();
|
||||
EdsError focusFar2();
|
||||
EdsError focusNear3();
|
||||
EdsError focusFar3();
|
||||
void extendCameraOnTime();
|
||||
void setUseScaledImages(bool on);
|
||||
bool getUseScaledImages() { return m_useScaledImages; }
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
void onImageReady(const bool&);
|
||||
void onFinished();
|
||||
|
||||
signals:
|
||||
// canon signals
|
||||
void apertureOptionsChanged();
|
||||
void isoOptionsChanged();
|
||||
void shutterSpeedOptionsChanged();
|
||||
void exposureOptionsChanged();
|
||||
void whiteBalanceOptionsChanged();
|
||||
void colorTemperatureChanged();
|
||||
void imageQualityOptionsChanged();
|
||||
void pictureStyleOptionsChanged();
|
||||
void apertureChangedSignal(QString);
|
||||
void isoChangedSignal(QString);
|
||||
void shutterSpeedChangedSignal(QString);
|
||||
void exposureChangedSignal(QString);
|
||||
void whiteBalanceChangedSignal(QString);
|
||||
void colorTemperatureChangedSignal(QString);
|
||||
void imageQualityChangedSignal(QString);
|
||||
void pictureStyleChangedSignal(QString);
|
||||
void modeChanged();
|
||||
void focusCheckToggled(bool);
|
||||
void pickFocusCheckToggled(bool);
|
||||
void scaleFullSizeImagesSignal(bool);
|
||||
void newCanonImageReady();
|
||||
void canonCameraChanged(QString);
|
||||
};
|
||||
|
||||
#endif // CANON_H
|
181
toonz/sources/stopmotion/jpgconverter.cpp
Normal file
181
toonz/sources/stopmotion/jpgconverter.cpp
Normal file
|
@ -0,0 +1,181 @@
|
|||
#include "jpgconverter.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QDataStream>
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
|
||||
JpgConverter::JpgConverter() {}
|
||||
JpgConverter::~JpgConverter() {}
|
||||
|
||||
#ifdef WITH_CANON
|
||||
|
||||
void JpgConverter::setStream(EdsStreamRef stream) { m_stream = stream; }
|
||||
|
||||
void JpgConverter::convertFromJpg() {
|
||||
#ifdef MACOSX
|
||||
UInt64 mySize = 0;
|
||||
#else
|
||||
unsigned __int64 mySize = 0;
|
||||
#endif
|
||||
unsigned char* data = NULL;
|
||||
EdsError err = EdsGetPointer(m_stream, (EdsVoid**)&data);
|
||||
err = EdsGetLength(m_stream, &mySize);
|
||||
|
||||
int width, height, pixelFormat;
|
||||
int inSubsamp, inColorspace;
|
||||
tjhandle tjInstance = NULL;
|
||||
unsigned char* imgBuf = NULL;
|
||||
tjInstance = tjInitDecompress();
|
||||
tjDecompressHeader3(tjInstance, data, mySize, &width, &height, &inSubsamp,
|
||||
&inColorspace);
|
||||
|
||||
if (width < 0 || height < 0) {
|
||||
emit(imageReady(false));
|
||||
return;
|
||||
}
|
||||
|
||||
pixelFormat = TJPF_BGRX;
|
||||
imgBuf = (unsigned char*)tjAlloc(width * height * tjPixelSize[pixelFormat]);
|
||||
int flags = 0;
|
||||
flags |= TJFLAG_BOTTOMUP;
|
||||
|
||||
int factorsNum;
|
||||
tjscalingfactor scalingFactor = {1, 1};
|
||||
tjscalingfactor* factor = tjGetScalingFactors(&factorsNum);
|
||||
int i = 0;
|
||||
int tempWidth, tempHeight;
|
||||
while (i < factorsNum) {
|
||||
scalingFactor = factor[i];
|
||||
i++;
|
||||
tempWidth = TJSCALED(width, scalingFactor);
|
||||
tempHeight = TJSCALED(height, scalingFactor);
|
||||
}
|
||||
tjDecompress2(tjInstance, data, mySize, imgBuf, width,
|
||||
width * tjPixelSize[pixelFormat], height, pixelFormat, flags);
|
||||
|
||||
m_finalImage = TRaster32P(width, height);
|
||||
m_finalImage->lock();
|
||||
uchar* rawData = m_finalImage->getRawData();
|
||||
memcpy(rawData, imgBuf, width * height * tjPixelSize[pixelFormat]);
|
||||
m_finalImage->unlock();
|
||||
|
||||
tjFree(imgBuf);
|
||||
imgBuf = NULL;
|
||||
tjDestroy(tjInstance);
|
||||
tjInstance = NULL;
|
||||
|
||||
if (m_stream != NULL) {
|
||||
EdsRelease(m_stream);
|
||||
m_stream = NULL;
|
||||
}
|
||||
data = NULL;
|
||||
emit(imageReady(true));
|
||||
}
|
||||
|
||||
void JpgConverter::run() { convertFromJpg(); }
|
||||
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void JpgConverter::saveJpg(TRaster32P image, TFilePath path) {
|
||||
unsigned char* jpegBuf = NULL; /* Dynamically allocate the JPEG buffer */
|
||||
unsigned long jpegSize = 0;
|
||||
int pixelFormat = TJPF_BGRX;
|
||||
int outQual = 95;
|
||||
int subSamp = TJSAMP_411;
|
||||
bool success = false;
|
||||
tjhandle tjInstance;
|
||||
|
||||
int width = image->getLx();
|
||||
int height = image->getLy();
|
||||
int flags = 0;
|
||||
flags |= TJFLAG_BOTTOMUP;
|
||||
|
||||
image->lock();
|
||||
uchar* rawData = image->getRawData();
|
||||
if ((tjInstance = tjInitCompress()) != NULL) {
|
||||
if (tjCompress2(tjInstance, rawData, width, 0, height, pixelFormat,
|
||||
&jpegBuf, &jpegSize, subSamp, outQual, flags) >= 0) {
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
image->unlock();
|
||||
tjDestroy(tjInstance);
|
||||
tjInstance = NULL;
|
||||
|
||||
if (success) {
|
||||
/* Write the JPEG image to disk. */
|
||||
QFile fullImage(path.getQString());
|
||||
fullImage.open(QIODevice::WriteOnly);
|
||||
QDataStream dataStream(&fullImage);
|
||||
dataStream.writeRawData((const char*)jpegBuf, jpegSize);
|
||||
fullImage.close();
|
||||
}
|
||||
tjFree(jpegBuf);
|
||||
jpegBuf = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool JpgConverter::loadJpg(TFilePath path, TRaster32P& image) {
|
||||
long size;
|
||||
int inSubsamp, inColorspace, width, height;
|
||||
unsigned long jpegSize;
|
||||
unsigned char* jpegBuf;
|
||||
FILE* jpegFile;
|
||||
QString qPath = path.getQString();
|
||||
QByteArray ba = qPath.toLocal8Bit();
|
||||
const char* c_path = ba.data();
|
||||
bool success = true;
|
||||
tjhandle tjInstance;
|
||||
|
||||
/* Read the JPEG file into memory. */
|
||||
if ((jpegFile = fopen(c_path, "rb")) == NULL) success = false;
|
||||
if (success && fseek(jpegFile, 0, SEEK_END) < 0 ||
|
||||
((size = ftell(jpegFile)) < 0) || fseek(jpegFile, 0, SEEK_SET) < 0)
|
||||
success = false;
|
||||
if (success && size == 0) success = false;
|
||||
jpegSize = (unsigned long)size;
|
||||
if (success && (jpegBuf = (unsigned char*)tjAlloc(jpegSize)) == NULL)
|
||||
success = false;
|
||||
if (success && fread(jpegBuf, jpegSize, 1, jpegFile) < 1) success = false;
|
||||
fclose(jpegFile);
|
||||
jpegFile = NULL;
|
||||
|
||||
if (success && (tjInstance = tjInitDecompress()) == NULL) success = false;
|
||||
|
||||
if (success &&
|
||||
tjDecompressHeader3(tjInstance, jpegBuf, jpegSize, &width, &height,
|
||||
&inSubsamp, &inColorspace) < 0)
|
||||
success = false;
|
||||
|
||||
int pixelFormat = TJPF_BGRX;
|
||||
unsigned char* imgBuf = NULL;
|
||||
if (success &&
|
||||
(imgBuf = tjAlloc(width * height * tjPixelSize[pixelFormat])) == NULL)
|
||||
success = false;
|
||||
|
||||
int flags = 0;
|
||||
flags |= TJFLAG_BOTTOMUP;
|
||||
if (success &&
|
||||
tjDecompress2(tjInstance, jpegBuf, jpegSize, imgBuf, width, 0, height,
|
||||
pixelFormat, flags) < 0)
|
||||
success = false;
|
||||
tjFree(jpegBuf);
|
||||
jpegBuf = NULL;
|
||||
tjDestroy(tjInstance);
|
||||
tjInstance = NULL;
|
||||
|
||||
image = TRaster32P(width, height);
|
||||
image->lock();
|
||||
uchar* rawData = image->getRawData();
|
||||
memcpy(rawData, imgBuf, width * height * tjPixelSize[pixelFormat]);
|
||||
image->unlock();
|
||||
|
||||
tjFree(imgBuf);
|
||||
imgBuf = NULL;
|
||||
|
||||
return success;
|
||||
}
|
61
toonz/sources/stopmotion/jpgconverter.h
Normal file
61
toonz/sources/stopmotion/jpgconverter.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef JPGCONVERTER_H
|
||||
#define JPGCONVERTER_H
|
||||
|
||||
//#include "opencv2/opencv.hpp"
|
||||
#include "turbojpeg.h"
|
||||
|
||||
#ifdef WITH_CANON
|
||||
// Canon Includes
|
||||
#include "EDSDK.h"
|
||||
#include "EDSDKErrors.h"
|
||||
#include "EDSDKTypes.h"
|
||||
#endif
|
||||
|
||||
// Toonz Includes
|
||||
#include "traster.h"
|
||||
#include "tfilepath.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
|
||||
class QCamera;
|
||||
class QCameraInfo;
|
||||
|
||||
//=============================================================================
|
||||
// JpgConverter
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class JpgConverter : public QThread {
|
||||
Q_OBJECT
|
||||
#ifdef WITH_CANON
|
||||
EdsStreamRef m_stream;
|
||||
#endif
|
||||
TRaster32P m_finalImage;
|
||||
bool m_scale = false;
|
||||
int m_scaleWidth = 0;
|
||||
|
||||
public:
|
||||
JpgConverter();
|
||||
~JpgConverter();
|
||||
static void saveJpg(TRaster32P, TFilePath path);
|
||||
static bool loadJpg(TFilePath path, TRaster32P& image);
|
||||
#ifdef WITH_CANON
|
||||
void setStream(EdsStreamRef stream);
|
||||
void setScale(bool scale) { m_scale = scale; }
|
||||
void setScaleWidth(bool scaleWidth) { m_scaleWidth = scaleWidth; }
|
||||
TRaster32P getImage() { return m_finalImage; }
|
||||
void convertFromJpg();
|
||||
|
||||
protected:
|
||||
void run() override;
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void imageReady(bool);
|
||||
};
|
||||
|
||||
//#endif
|
||||
|
||||
#endif // JPGCONVERTER_H
|
File diff suppressed because it is too large
Load diff
|
@ -3,58 +3,36 @@
|
|||
#ifndef STOPMOTION_H
|
||||
#define STOPMOTION_H
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
#ifdef WITH_CANON
|
||||
// Canon Includes
|
||||
#include "EDSDK.h"
|
||||
#include "EDSDKErrors.h"
|
||||
#include "EDSDKTypes.h"
|
||||
#endif
|
||||
|
||||
#include "turbojpeg.h"
|
||||
#include "opencv2/opencv.hpp"
|
||||
|
||||
// Toonz Includes
|
||||
#include "traster.h"
|
||||
#include "toonzqt/gutil.h"
|
||||
#include "toonzqt/dvdialog.h"
|
||||
|
||||
#include "webcam.h"
|
||||
#include "jpgconverter.h"
|
||||
#include "canon.h"
|
||||
#include "stopmotionserial.h"
|
||||
#include "stopmotionlight.h"
|
||||
|
||||
#include "toonz/txshsimplelevel.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
|
||||
class QCamera;
|
||||
class QCameraInfo;
|
||||
class QDialog;
|
||||
class QTimer;
|
||||
|
||||
enum ASPECT_RATIO { FOUR_THREE = 0, THREE_TWO, SIXTEEN_NINE, OTHER_RATIO };
|
||||
#endif
|
||||
|
||||
#include <QThread>
|
||||
//=============================================================================
|
||||
// JpgConverter
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class JpgConverter : public QThread {
|
||||
Q_OBJECT
|
||||
#ifdef WITH_STOPMOTION
|
||||
EdsStreamRef m_stream;
|
||||
TRaster32P m_finalImage;
|
||||
bool m_scale = false;
|
||||
int m_scaleWidth = 0;
|
||||
|
||||
public:
|
||||
JpgConverter();
|
||||
~JpgConverter();
|
||||
void setStream(EdsStreamRef stream);
|
||||
void setScale(bool scale) { m_scale = scale; }
|
||||
void setScaleWidth(bool scaleWidth) { m_scaleWidth = scaleWidth; }
|
||||
TRaster32P getImage() { return m_finalImage; }
|
||||
void convertFromJpg();
|
||||
|
||||
protected:
|
||||
void run() override;
|
||||
|
||||
#endif
|
||||
signals:
|
||||
void imageReady(bool);
|
||||
};
|
||||
|
||||
class StopMotion : public QObject { // Singleton
|
||||
Q_OBJECT
|
||||
|
@ -64,65 +42,31 @@ public:
|
|||
static StopMotion _instance;
|
||||
return &_instance;
|
||||
};
|
||||
#ifdef WITH_STOPMOTION
|
||||
|
||||
private:
|
||||
StopMotion();
|
||||
~StopMotion();
|
||||
|
||||
int m_opacity = 255.0;
|
||||
int m_xSheetFrameNumber = 1;
|
||||
// file stuff
|
||||
int m_frameNumber = 1;
|
||||
int m_subsampling = 1;
|
||||
int m_xSheetFrameNumber = 1;
|
||||
QString m_levelName = "";
|
||||
QString m_fileType = "jpg";
|
||||
QString m_filePath = "+extras";
|
||||
QString m_frameInfoText = "";
|
||||
QString m_infoColorName = "";
|
||||
QString m_frameInfoToolTip = "";
|
||||
|
||||
// options
|
||||
int m_opacity = 255.0;
|
||||
int m_subsampling = 1;
|
||||
QSize m_allowedCameraSize;
|
||||
QStringList m_isoOptions, m_shutterSpeedOptions, m_apertureOptions,
|
||||
m_exposureOptions, m_whiteBalanceOptions, m_colorTempOptions,
|
||||
m_imageQualityOptions, m_pictureStyleOptions;
|
||||
std::map<EdsUInt32, std::string> m_avMap, m_tvMap, m_isoMap, m_modeMap,
|
||||
m_exposureMap, m_whiteBalanceMap, m_imageQualityMap, m_pictureStyleMap;
|
||||
QDialog *m_fullScreen1, *m_fullScreen2, *m_fullScreen3;
|
||||
int m_screenCount;
|
||||
bool m_useMjpg = true;
|
||||
bool m_useNumpadShortcuts = false;
|
||||
bool m_numpadForStyleSwitching = true;
|
||||
bool m_turnOnRewind = false;
|
||||
|
||||
QTimer* m_reviewTimer;
|
||||
std::map<std::string, QAction*> m_oldActionMap;
|
||||
|
||||
// Webcam Properties
|
||||
QList<QCameraInfo> m_webcams;
|
||||
QCamera* m_webcam;
|
||||
cv::VideoCapture m_cvWebcam;
|
||||
|
||||
static EdsError EDSCALLBACK handleObjectEvent(EdsObjectEvent event,
|
||||
EdsBaseRef object,
|
||||
EdsVoid* context);
|
||||
|
||||
static EdsError EDSCALLBACK handlePropertyEvent(EdsPropertyEvent event,
|
||||
EdsPropertyID property,
|
||||
EdsUInt32 param,
|
||||
EdsVoid* context);
|
||||
|
||||
static EdsError EDSCALLBACK handleStateEvent(EdsStateEvent event,
|
||||
EdsUInt32 parameter,
|
||||
EdsVoid* context);
|
||||
static EdsError EDSCALLBACK handleCameraAddedEvent(EdsVoid* context);
|
||||
|
||||
void buildAvMap();
|
||||
void buildTvMap();
|
||||
void buildIsoMap();
|
||||
void buildModeMap();
|
||||
void buildExposureMap();
|
||||
void buildWhiteBalanceMap();
|
||||
void buildImageQualityMap();
|
||||
void buildPictureStyleMap();
|
||||
std::map<int, TRaster32P> m_liveViewImageMap;
|
||||
|
||||
public:
|
||||
enum LiveViewStatus {
|
||||
|
@ -132,71 +76,39 @@ public:
|
|||
LiveViewPaused
|
||||
};
|
||||
|
||||
JpgConverter* m_converter;
|
||||
bool m_useScaledImages = true;
|
||||
bool m_usingWebcam = false;
|
||||
bool m_blackCapture = true;
|
||||
bool m_placeOnXSheet = true;
|
||||
int m_reviewTime = 2;
|
||||
int m_liveViewStatus = LiveViewClosed;
|
||||
bool m_hasLiveViewImage, m_hasLineUpImage, m_showLineUpImage;
|
||||
bool m_alwaysLiveView = false;
|
||||
bool m_active = false;
|
||||
bool m_userCalledPause = false;
|
||||
bool m_converterSucceeded = false;
|
||||
QString m_tempFile;
|
||||
QTimer* m_timer;
|
||||
QList<QSize> m_webcamResolutions;
|
||||
Webcam* m_webcam;
|
||||
Canon* m_canon;
|
||||
StopMotionSerial* m_serial;
|
||||
StopMotionLight* m_light;
|
||||
|
||||
// Canon Public Properties
|
||||
EdsError m_error = EDS_ERR_OK;
|
||||
bool m_isSDKLoaded = false;
|
||||
EdsUInt32 m_count = 0;
|
||||
EdsCameraListRef m_cameraList = NULL;
|
||||
EdsCameraRef m_camera = NULL;
|
||||
bool m_sessionOpen = false;
|
||||
bool m_zooming = false;
|
||||
std::string m_cameraName;
|
||||
bool m_usingWebcam = false;
|
||||
bool m_placeOnXSheet = true;
|
||||
bool m_alwaysLiveView = false;
|
||||
bool m_userCalledPause = false;
|
||||
bool m_drawBeneathLevels = true;
|
||||
bool m_isTimeLapse = false;
|
||||
int m_reviewTime = 2;
|
||||
QString m_tempFile;
|
||||
TXshSimpleLevel* m_sl;
|
||||
|
||||
// timers
|
||||
QTimer* m_timer;
|
||||
int m_intervalTime = 10;
|
||||
bool m_intervalStarted = false;
|
||||
QTimer* m_reviewTimer;
|
||||
QTimer *m_intervalTimer, *m_countdownTimer, *m_webcamOverlayTimer;
|
||||
|
||||
// live view and images
|
||||
int m_liveViewStatus = LiveViewClosed;
|
||||
bool m_hasLiveViewImage, m_hasLineUpImage, m_showLineUpImage;
|
||||
bool m_alwaysUseLiveViewImages = false;
|
||||
TRaster32P m_liveViewImage, m_newImage, m_lineUpImage;
|
||||
TDimension m_liveViewImageDimensions = TDimension(0, 0);
|
||||
TDimension m_fullImageDimensions = TDimension(0, 0);
|
||||
TDimension m_proxyImageDimensions = TDimension(0, 0);
|
||||
TPointD m_proxyDpi = TPointD(0.0, 0.0);
|
||||
TPointD m_liveViewDpi = TPointD(0.0, 0.0);
|
||||
TPointD m_fullImageDpi = TPointD(0.0, 0.0);
|
||||
TPoint m_liveViewZoomOffset = TPoint(0, 0);
|
||||
EdsUInt32 m_liveViewZoom = 1;
|
||||
bool m_pickLiveViewZoom = false;
|
||||
TPointD m_liveViewZoomPickPoint = TPointD(0.0, 0.0);
|
||||
TPoint m_zoomRect = TPoint(0, 0);
|
||||
TPoint m_calculatedZoomPoint = TPoint(0, 0);
|
||||
TPoint m_finalZoomPoint = TPoint(0, 0);
|
||||
|
||||
// Webcam Public Properties
|
||||
QString m_webcamDeviceName;
|
||||
QString m_webcamDescription;
|
||||
int m_webcamIndex = -1;
|
||||
bool m_useDirectShow = true;
|
||||
int m_webcamWidth = 0;
|
||||
int m_webcamHeight = 0;
|
||||
|
||||
void setOpacity(int opacity);
|
||||
int getOpacity() { return m_opacity; }
|
||||
void setUseScaledImages(bool on);
|
||||
bool getUseScaledImages() { return m_useScaledImages; }
|
||||
void setAlwaysLiveView(bool on);
|
||||
bool getAlwaysLiveView() { return m_alwaysLiveView; }
|
||||
void setBlackCapture(bool on);
|
||||
bool getBlackCapture() { return m_blackCapture; }
|
||||
void setPlaceOnXSheet(bool on);
|
||||
bool getPlaceOnXSheet() { return m_placeOnXSheet; }
|
||||
void setUseMjpg(bool on);
|
||||
bool getUseMjpg() { return m_useMjpg; }
|
||||
void setUseNumpadShortcuts(bool on);
|
||||
bool getUseNumpadShortcuts() { return m_useNumpadShortcuts; }
|
||||
void toggleNumpadShortcuts(bool on);
|
||||
void setReviewTime(int time);
|
||||
int getReviewTime() { return m_reviewTime; }
|
||||
// files and frames
|
||||
void setXSheetFrameNumber(int frameNumber);
|
||||
int getXSheetFrameNumber() { return m_xSheetFrameNumber; }
|
||||
void setFrameNumber(int frameNumber);
|
||||
|
@ -214,167 +126,122 @@ public:
|
|||
void lastFrame();
|
||||
void nextName();
|
||||
void previousName();
|
||||
|
||||
void refreshFrameInfo();
|
||||
QString getFrameInfoText() { return m_frameInfoText; }
|
||||
QString getInfoColorName() { return m_infoColorName; }
|
||||
QString getFrameInfoToolTip() { return m_frameInfoToolTip; }
|
||||
bool toggleLiveView();
|
||||
void pauseLiveView();
|
||||
void getSubsampling();
|
||||
void setSubsampling();
|
||||
int getSubsamplingValue() { return m_subsampling; }
|
||||
void setSubsamplingValue(int subsampling);
|
||||
void captureImage();
|
||||
void postImportProcess();
|
||||
void refreshFrameInfo();
|
||||
void refreshCameraList();
|
||||
void changeCameras(int index);
|
||||
void raiseOpacity();
|
||||
void lowerOpacity();
|
||||
void jumpToCameraFrame();
|
||||
|
||||
// cameras
|
||||
void setWebcamResolution(QString resolution);
|
||||
std::string getTEnvCameraName();
|
||||
void setTEnvCameraName(std::string name);
|
||||
std::string getTEnvCameraResolution();
|
||||
void setTEnvCameraResolution(std::string resolution);
|
||||
void disconnectAllCameras();
|
||||
void changeCameras(int index);
|
||||
void refreshCameraList();
|
||||
|
||||
void saveJpg(TRaster32P, TFilePath path);
|
||||
bool loadJpg(TFilePath path, TRaster32P& image);
|
||||
// commands
|
||||
void jumpToCameraFrame();
|
||||
void removeStopMotionFrame();
|
||||
|
||||
// live view and images
|
||||
bool toggleLiveView();
|
||||
void pauseLiveView();
|
||||
bool loadLineUpImage();
|
||||
bool loadLiveViewImage(int row, TRaster32P& image);
|
||||
void setLiveViewImage();
|
||||
void captureImage();
|
||||
void captureWebcamImage();
|
||||
void captureDslrImage();
|
||||
void postImportProcess();
|
||||
void toggleAlwaysUseLiveViewImages();
|
||||
bool buildLiveViewMap(TXshSimpleLevel* sl);
|
||||
|
||||
// Webcam Commands
|
||||
QList<QCameraInfo> getWebcams();
|
||||
QCamera* getWebcam() { return m_webcam; }
|
||||
void setWebcam(QCamera* camera);
|
||||
bool initWebcam(int index = 0);
|
||||
void releaseWebcam();
|
||||
void setWebcamResolution(QString resolution);
|
||||
void getWebcamImage();
|
||||
bool translateIndex(int index);
|
||||
bool getUseDirectShow() { return m_useDirectShow; }
|
||||
void setUseDirectShow(int state);
|
||||
QList<QSize> getWebcamResolutions() { return m_webcamResolutions; }
|
||||
// void changeResolutions(int index);
|
||||
// time lapse
|
||||
void toggleInterval(bool on);
|
||||
void startInterval();
|
||||
void stopInterval();
|
||||
void setIntervalAmount(int value);
|
||||
void restartInterval();
|
||||
|
||||
// Canon Commands
|
||||
EdsError initializeCanonSDK();
|
||||
void closeCanonSDK();
|
||||
EdsCameraListRef getCameraList();
|
||||
EdsError releaseCameraList();
|
||||
int getCameraCount();
|
||||
EdsError getCamera(int index);
|
||||
EdsError releaseCamera();
|
||||
void cameraAdded();
|
||||
EdsError openCameraSession();
|
||||
EdsError closeCameraSession();
|
||||
std::string getCameraName();
|
||||
EdsError downloadImage(EdsBaseRef object);
|
||||
EdsError takePicture();
|
||||
EdsError startLiveView();
|
||||
EdsError endLiveView();
|
||||
EdsError downloadEVFData();
|
||||
QStringList getIsoOptions() { return m_isoOptions; }
|
||||
QStringList getShutterSpeedOptions() { return m_shutterSpeedOptions; }
|
||||
QStringList getApertureOptions() { return m_apertureOptions; }
|
||||
QStringList getExposureOptions() { return m_exposureOptions; }
|
||||
QStringList getWhiteBalanceOptions() { return m_whiteBalanceOptions; }
|
||||
QStringList getColorTemperatureOptions() { return m_colorTempOptions; }
|
||||
QStringList getImageQualityOptions() { return m_imageQualityOptions; }
|
||||
QStringList getPictureStyleOptions() { return m_pictureStyleOptions; }
|
||||
EdsError getAvailableShutterSpeeds();
|
||||
EdsError getAvailableIso();
|
||||
EdsError getAvailableApertures();
|
||||
EdsError getAvailableExposureCompensations();
|
||||
EdsError getAvailableWhiteBalances();
|
||||
EdsError getAvailableImageQualities();
|
||||
EdsError getAvailablePictureStyles();
|
||||
void buildColorTemperatures();
|
||||
QString getCurrentShutterSpeed();
|
||||
QString getCurrentIso();
|
||||
QString getCurrentAperture();
|
||||
QString getCurrentExposureCompensation();
|
||||
QString getCurrentWhiteBalance();
|
||||
QString getCurrentColorTemperature();
|
||||
QString getCurrentImageQuality();
|
||||
QString getCurrentPictureStyle();
|
||||
EdsError setShutterSpeed(QString shutterSpeed);
|
||||
EdsError setIso(QString iso);
|
||||
EdsError setAperture(QString aperture);
|
||||
EdsError setExposureCompensation(QString exposure);
|
||||
EdsError setWhiteBalance(QString whiteBalance);
|
||||
EdsError setColorTemperature(QString temp);
|
||||
EdsError setImageQuality(QString quality);
|
||||
EdsError setPictureStyle(QString style);
|
||||
QString getMode();
|
||||
void refreshOptions();
|
||||
EdsError zoomLiveView();
|
||||
EdsError setZoomPoint();
|
||||
void makeZoomPoint(TPointD pos);
|
||||
EdsError focusNear();
|
||||
EdsError focusFar();
|
||||
EdsError focusNear2();
|
||||
EdsError focusFar2();
|
||||
EdsError focusNear3();
|
||||
EdsError focusFar3();
|
||||
// options
|
||||
void raiseOpacity();
|
||||
void lowerOpacity();
|
||||
void setOpacity(int opacity);
|
||||
int getOpacity() { return m_opacity; }
|
||||
void setAlwaysLiveView(bool on);
|
||||
bool getAlwaysLiveView() { return m_alwaysLiveView; }
|
||||
void setPlaceOnXSheet(bool on);
|
||||
bool getPlaceOnXSheet() { return m_placeOnXSheet; }
|
||||
void setUseNumpadShortcuts(bool on);
|
||||
bool getUseNumpadShortcuts() { return m_useNumpadShortcuts; }
|
||||
void toggleNumpadShortcuts(bool on);
|
||||
void toggleNumpadForFocusCheck(bool on);
|
||||
void setDrawBeneathLevels(bool on);
|
||||
void setReviewTime(int time);
|
||||
int getReviewTime() { return m_reviewTime; }
|
||||
void getSubsampling();
|
||||
void setSubsampling();
|
||||
int getSubsamplingValue() { return m_subsampling; }
|
||||
void setSubsamplingValue(int subsampling);
|
||||
|
||||
// saving and loading
|
||||
void saveXmlFile();
|
||||
bool loadXmlFile();
|
||||
bool exportImageSequence();
|
||||
|
||||
#endif // WITH_STOPMOTION
|
||||
public slots:
|
||||
void onImageReady(const bool&);
|
||||
void onFinished();
|
||||
// timers
|
||||
void onTimeout();
|
||||
void onReviewTimeout();
|
||||
void onIntervalCaptureTimerTimeout();
|
||||
void captureWebcamOnTimeout();
|
||||
void update();
|
||||
bool importImage();
|
||||
void onSceneSwitched();
|
||||
void onPlaybackChanged();
|
||||
void onCanonCameraChanged(QString);
|
||||
|
||||
signals:
|
||||
void newLiveViewImageReady();
|
||||
void liveViewStopped();
|
||||
void newImageReady();
|
||||
void cameraChanged();
|
||||
void optionsChanged();
|
||||
void liveViewChanged(bool);
|
||||
// camera stuff
|
||||
void cameraChanged(QString);
|
||||
void newCameraSelected(int, bool);
|
||||
void webcamResolutionsChanged();
|
||||
void newWebcamResolutionSelected(int);
|
||||
void updateCameraList(QString);
|
||||
|
||||
void apertureOptionsChanged();
|
||||
void isoOptionsChanged();
|
||||
void shutterSpeedOptionsChanged();
|
||||
void exposureOptionsChanged();
|
||||
void whiteBalanceOptionsChanged();
|
||||
void colorTemperatureChanged();
|
||||
void imageQualityOptionsChanged();
|
||||
void pictureStyleOptionsChanged();
|
||||
void apertureChangedSignal(QString);
|
||||
void isoChangedSignal(QString);
|
||||
void shutterSpeedChangedSignal(QString);
|
||||
void exposureChangedSignal(QString);
|
||||
void whiteBalanceChangedSignal(QString);
|
||||
void colorTemperatureChangedSignal(QString);
|
||||
void imageQualityChangedSignal(QString);
|
||||
void pictureStyleChangedSignal(QString);
|
||||
void modeChanged();
|
||||
|
||||
// live view and images
|
||||
void newLiveViewImageReady();
|
||||
void liveViewStopped();
|
||||
void newImageReady();
|
||||
void liveViewChanged(bool);
|
||||
void liveViewOnAllFramesSignal(bool);
|
||||
void newDimensions();
|
||||
void subsamplingChanged(int);
|
||||
void alwaysUseLiveViewImagesToggled(bool);
|
||||
|
||||
// file stuff
|
||||
void filePathChanged(QString);
|
||||
void levelNameChanged(QString);
|
||||
void fileTypeChanged(QString);
|
||||
void xSheetFrameNumberChanged(int);
|
||||
void frameNumberChanged(int);
|
||||
void frameInfoTextChanged(QString);
|
||||
void xSheetFrameNumberChanged(int);
|
||||
|
||||
// options
|
||||
void optionsChanged();
|
||||
void subsamplingChanged(int);
|
||||
void opacityChanged(int);
|
||||
void scaleFullSizeImagesSignal(bool);
|
||||
void blackCaptureSignal(bool);
|
||||
void liveViewOnAllFramesSignal(bool);
|
||||
void placeOnXSheetSignal(bool);
|
||||
void useMjpgSignal(bool);
|
||||
void useNumpadSignal(bool);
|
||||
void useDirectShowSignal(bool);
|
||||
void drawBeneathLevelsSignal(bool);
|
||||
void reviewTimeChangedSignal(int);
|
||||
void updateCameraList();
|
||||
|
||||
// time lapse
|
||||
void intervalToggled(bool);
|
||||
void intervalStarted();
|
||||
void intervalStopped();
|
||||
void intervalAmountChanged(int);
|
||||
};
|
||||
|
||||
#endif // STOPMOTION_H
|
File diff suppressed because it is too large
Load diff
|
@ -10,6 +10,7 @@
|
|||
// TnzQt includes
|
||||
#include "toonzqt/tabbar.h"
|
||||
#include "toonzqt/gutil.h"
|
||||
#include "toonzqt/colorfield.h"
|
||||
|
||||
// Qt includes
|
||||
#include <QWidget>
|
||||
|
@ -48,6 +49,7 @@ class QPushButton;
|
|||
class QTabWidget;
|
||||
class QToolBar;
|
||||
class QTimer;
|
||||
class QGroupBox;
|
||||
|
||||
//=============================================================================
|
||||
// StopMotionController
|
||||
|
@ -65,33 +67,50 @@ class StopMotionController final : public QWidget {
|
|||
QFrame *m_mainControlsPage;
|
||||
QFrame *m_cameraSettingsPage;
|
||||
QFrame *m_optionsPage;
|
||||
QFrame *m_motionPage;
|
||||
QFrame *m_lightPage;
|
||||
QFrame *m_dslrFrame;
|
||||
QFrame *m_webcamFrame;
|
||||
QFrame *m_noCameraFrame;
|
||||
QStackedWidget *m_stackedChooser;
|
||||
TabBarContainter *m_tabBarContainer; //!< Tabs container for style types.
|
||||
QPushButton *m_toggleLiveViewButton, *m_setToCurrentXSheetFrameButton;
|
||||
QPushButton *m_fileFormatOptionButton, *m_captureButton, *m_zoomButton,
|
||||
TabBarContainter *m_tabBarContainer; //!< Tabs container for pages
|
||||
QPushButton *m_toggleLiveViewButton, *m_setToCurrentXSheetFrameButton,
|
||||
*m_alwaysUseLiveViewImagesButton;
|
||||
QPushButton *m_captureButton, *m_zoomButton, *m_fileFormatOptionButton,
|
||||
*m_pickZoomButton, *m_focusNearButton, *m_focusFarButton,
|
||||
*m_focusNear2Button, *m_focusNear3Button, *m_focusFar2Button,
|
||||
*m_focusFar3Button, *m_captureFilterSettingsBtn;
|
||||
*m_focusFar3Button, *m_captureFilterSettingsBtn, *m_testLightsButton;
|
||||
QHBoxLayout *m_focusAndZoomLayout;
|
||||
QLabel *m_frameInfoLabel, *m_cameraSettingsLabel, *m_cameraModeLabel,
|
||||
*m_kelvinLabel, *m_resolutionLabel, *m_directShowLabel;
|
||||
*m_resolutionLabel, *m_directShowLabel, *m_cameraStatusLabel,
|
||||
*m_apertureLabel, *m_kelvinValueLabel, *m_isoLabel, *m_shutterSpeedLabel,
|
||||
*m_webcamLabel;
|
||||
QToolButton *m_previousLevelButton, *m_previousFrameButton,
|
||||
*m_previousXSheetFrameButton;
|
||||
|
||||
QComboBox *m_cameraListCombo, *m_fileTypeCombo, *m_isoCombo,
|
||||
*m_shutterSpeedCombo, *m_exposureCombo, *m_apertureCombo,
|
||||
*m_whiteBalanceCombo, *m_kelvinCombo, *m_resolutionCombo,
|
||||
*m_imageQualityCombo, *m_pictureStyleCombo;
|
||||
QSlider *m_apertureSlider, *m_shutterSpeedSlider, *m_isoSlider,
|
||||
*m_kelvinSlider, *m_webcamFocusSlider, *m_webcamWhiteBalanceSlider,
|
||||
*m_webcamExposureSlider, *m_webcamBrightnessSlider,
|
||||
*m_webcamContrastSlider, *m_webcamGainSlider, *m_webcamSaturationSlider;
|
||||
QComboBox *m_cameraListCombo, *m_exposureCombo, *m_fileTypeCombo,
|
||||
*m_whiteBalanceCombo, *m_resolutionCombo, *m_imageQualityCombo,
|
||||
*m_pictureStyleCombo, *m_controlDeviceCombo;
|
||||
LevelNameLineEdit *m_levelNameEdit;
|
||||
QCheckBox *m_blackScreenForCapture, *m_useScaledFullSizeImages,
|
||||
*m_placeOnXSheetCB, *m_directShowCB, *m_liveViewOnAllFramesCB,
|
||||
*m_useMjpgCB, *m_useNumpadCB;
|
||||
*m_useMjpgCB, *m_useNumpadCB, *m_drawBeneathCB, *m_timerCB;
|
||||
DVGui::FileField *m_saveInFileFld;
|
||||
DVGui::IntLineEdit *m_xSheetFrameNumberEdit;
|
||||
FrameNumberLineEdit *m_frameNumberEdit;
|
||||
DVGui::IntField *m_onionOpacityFld, *m_postCaptureReviewFld,
|
||||
*m_subsamplingFld;
|
||||
PencilTestSaveInFolderPopup *m_saveInFolderPopup;
|
||||
DVGui::IntField *m_timerIntervalFld;
|
||||
DVGui::ColorField *m_screen1ColorFld, *m_screen2ColorFld, *m_screen3ColorFld;
|
||||
QGroupBox *m_screen1Box;
|
||||
QGroupBox *m_screen2Box;
|
||||
QGroupBox *m_screen3Box;
|
||||
QGroupBox *m_webcamAutoFocusGB;
|
||||
QTimer *m_lightTestTimer;
|
||||
|
||||
public:
|
||||
StopMotionController(QWidget *parent = 0);
|
||||
|
@ -99,23 +118,16 @@ public:
|
|||
|
||||
protected:
|
||||
void updateStopMotion();
|
||||
void showEvent(QShowEvent *event);
|
||||
void hideEvent(QHideEvent *event);
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
// void mousePressEvent(QMouseEvent *event) override;
|
||||
// void keyPressEvent(QKeyEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
protected slots:
|
||||
void refreshCameraList();
|
||||
void refreshCameraList(QString activeCamera = "");
|
||||
void refreshCameraListCalled();
|
||||
void refreshOptionsLists();
|
||||
void refreshApertureList();
|
||||
void refreshShutterSpeedList();
|
||||
void refreshIsoList();
|
||||
void refreshExposureList();
|
||||
void refreshWhiteBalanceList();
|
||||
void refreshColorTemperatureList();
|
||||
void refreshImageQualityList();
|
||||
void refreshPictureStyleList();
|
||||
void onCameraListComboActivated(int index);
|
||||
void onResolutionComboActivated(const QString &itemText);
|
||||
void onCaptureFilterSettingsBtnPressed();
|
||||
|
@ -127,6 +139,7 @@ protected slots:
|
|||
void onPreviousFrame();
|
||||
void onNextNewLevel();
|
||||
void onLastFrame();
|
||||
|
||||
void onFileTypeActivated();
|
||||
void onFrameNumberChanged();
|
||||
void onXSheetFrameNumberChanged();
|
||||
|
@ -143,12 +156,44 @@ protected slots:
|
|||
void onUseDirectShowChanged(int checked);
|
||||
void onLiveViewOnAllFramesChanged(int checked);
|
||||
void onUseNumpadChanged(int checked);
|
||||
void onDrawBeneathChanged(int checked);
|
||||
void updateDimensions();
|
||||
void onSaveInPathEdited();
|
||||
void onSceneSwitched();
|
||||
void onPreviousXSheetFrame();
|
||||
void onNextXSheetFrame();
|
||||
void setToCurrentXSheetFrame();
|
||||
|
||||
// motion control
|
||||
void serialPortChanged(int);
|
||||
|
||||
// time lapse
|
||||
void onIntervalTimerCBToggled(bool);
|
||||
void onIntervalSliderValueChanged(bool);
|
||||
void onIntervalCaptureTimerTimeout();
|
||||
void onIntervalCountDownTimeout();
|
||||
void onIntervalAmountChanged(int);
|
||||
void onIntervalToggled(bool);
|
||||
void onIntervalStarted();
|
||||
void onIntervalStopped();
|
||||
|
||||
// lights and screens
|
||||
void setScreen1Color(const TPixel32 &value, bool isDragging);
|
||||
void setScreen2Color(const TPixel32 &value, bool isDragging);
|
||||
void setScreen3Color(const TPixel32 &value, bool isDragging);
|
||||
void onScreen1OverlayToggled(bool);
|
||||
void onScreen2OverlayToggled(bool);
|
||||
void onScreen3OverlayToggled(bool);
|
||||
void onTestLightsPressed();
|
||||
void onTestLightsTimeout();
|
||||
void onScreen1ColorChanged(TPixel32);
|
||||
void onScreen2ColorChanged(TPixel32);
|
||||
void onScreen3ColorChanged(TPixel32);
|
||||
void onScreen1OverlayChanged(bool);
|
||||
void onScreen2OverlayChanged(bool);
|
||||
void onScreen3OverlayChanged(bool);
|
||||
|
||||
// canon stuff
|
||||
void onApertureChanged(int index);
|
||||
void onShutterSpeedChanged(int index);
|
||||
void onIsoChanged(int index);
|
||||
|
@ -157,7 +202,6 @@ protected slots:
|
|||
void onColorTemperatureChanged(int index);
|
||||
void onImageQualityChanged(int index);
|
||||
void onPictureStyleChanged(int index);
|
||||
void refreshMode();
|
||||
void onZoomPressed();
|
||||
void onPickZoomPressed();
|
||||
void onFocusNear();
|
||||
|
@ -166,6 +210,28 @@ protected slots:
|
|||
void onFocusFar2();
|
||||
void onFocusNear3();
|
||||
void onFocusFar3();
|
||||
void onApertureChangedSignal(QString);
|
||||
void onIsoChangedSignal(QString);
|
||||
void onShutterSpeedChangedSignal(QString);
|
||||
void onExposureChangedSignal(QString);
|
||||
void onWhiteBalanceChangedSignal(QString);
|
||||
void onColorTemperatureChangedSignal(QString);
|
||||
void onImageQualityChangedSignal(QString);
|
||||
void onPictureStyleChangedSignal(QString);
|
||||
void refreshApertureList();
|
||||
void refreshShutterSpeedList();
|
||||
void refreshIsoList();
|
||||
void refreshExposureList();
|
||||
void refreshWhiteBalanceList();
|
||||
void refreshColorTemperatureList();
|
||||
void refreshImageQualityList();
|
||||
void refreshPictureStyleList();
|
||||
void refreshMode();
|
||||
void onFocusCheckToggled(bool on);
|
||||
void onPickFocusCheckToggled(bool on);
|
||||
void onAlwaysUseLiveViewImagesButtonClicked();
|
||||
void onAlwaysUseLiveViewImagesToggled(bool);
|
||||
|
||||
void onCaptureReviewFldEdited();
|
||||
void onCaptureReviewSliderChanged(bool ignore);
|
||||
void onSubsamplingFldEdited();
|
||||
|
@ -186,18 +252,21 @@ protected slots:
|
|||
void onUseDirectShowSignal(bool);
|
||||
void onReviewTimeChangedSignal(int);
|
||||
void onUseNumpadSignal(bool);
|
||||
void onDrawBeneathSignal(bool);
|
||||
void onLiveViewChanged(bool);
|
||||
void onNewCameraSelected(int, bool);
|
||||
|
||||
// webcam
|
||||
void onWebcamResolutionsChanged();
|
||||
void onNewWebcamResolutionSelected(int);
|
||||
void onApertureChangedSignal(QString);
|
||||
void onIsoChangedSignal(QString);
|
||||
void onShutterSpeedChangedSignal(QString);
|
||||
void onExposureChangedSignal(QString);
|
||||
void onWhiteBalanceChangedSignal(QString);
|
||||
void onColorTemperatureChangedSignal(QString);
|
||||
void onImageQualityChangedSignal(QString);
|
||||
void onPictureStyleChangedSignal(QString);
|
||||
void onWebcamAutofocusToggled(bool);
|
||||
void onWebcamFocusSliderChanged(int value);
|
||||
void onWebcamExposureSliderChanged(int value);
|
||||
void onWebcamBrightnessSliderChanged(int value);
|
||||
void onWebcamContrastSliderChanged(int value);
|
||||
void onWebcamGainSliderChanged(int value);
|
||||
void onWebcamSaturationSliderChanged(int value);
|
||||
void getWebcamStatus();
|
||||
|
||||
public slots:
|
||||
void openSaveInFolderPopup();
|
||||
|
|
178
toonz/sources/stopmotion/stopmotionlight.cpp
Normal file
178
toonz/sources/stopmotion/stopmotionlight.cpp
Normal file
|
@ -0,0 +1,178 @@
|
|||
#include "stopmotionlight.h"
|
||||
|
||||
#include "tenv.h"
|
||||
#include "stopmotion.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QWindow>
|
||||
|
||||
TEnv::IntVar StopMotionBlackCapture("StopMotionBlackCapture", 0);
|
||||
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
|
||||
StopMotionLight::StopMotionLight() {
|
||||
m_blackCapture = StopMotionBlackCapture;
|
||||
|
||||
m_fullScreen1 = new QDialog();
|
||||
m_fullScreen1->setModal(false);
|
||||
m_fullScreen1->setStyleSheet("background-color:black;");
|
||||
m_screenCount = QApplication::desktop()->screenCount();
|
||||
if (m_screenCount > 1) {
|
||||
m_fullScreen2 = new QDialog();
|
||||
m_fullScreen2->setModal(false);
|
||||
m_fullScreen2->setStyleSheet("background-color:black;");
|
||||
if (m_screenCount > 2) {
|
||||
m_fullScreen3 = new QDialog();
|
||||
m_fullScreen3->setModal(false);
|
||||
m_fullScreen3->setStyleSheet("background-color:black;");
|
||||
}
|
||||
}
|
||||
}
|
||||
StopMotionLight::~StopMotionLight() {}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::setBlackCapture(bool on) {
|
||||
m_blackCapture = on;
|
||||
StopMotionBlackCapture = int(on);
|
||||
emit(blackCaptureSignal(on));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::setScreen1Color(TPixel32 color) {
|
||||
m_screen1Color = color;
|
||||
emit(screen1ColorChanged(color));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::setScreen2Color(TPixel32 color) {
|
||||
m_screen2Color = color;
|
||||
emit(screen2ColorChanged(color));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::setScreen3Color(TPixel32 color) {
|
||||
m_screen3Color = color;
|
||||
emit(screen3ColorChanged(color));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::setScreen1UseOverlay(bool on) {
|
||||
m_useScreen1Overlay = on;
|
||||
emit(screen1OverlayChanged(on));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::setScreen2UseOverlay(bool on) {
|
||||
m_useScreen2Overlay = on;
|
||||
emit(screen2OverlayChanged(on));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::setScreen3UseOverlay(bool on) {
|
||||
m_useScreen3Overlay = on;
|
||||
emit(screen3OverlayChanged(on));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::showOverlays() {
|
||||
if (getBlackCapture()) {
|
||||
m_fullScreen1->setStyleSheet("background-color: rgb(0,0,0);");
|
||||
if (m_screenCount > 1) {
|
||||
m_fullScreen2->setStyleSheet("background-color: rgb(0,0,0);");
|
||||
}
|
||||
if (m_screenCount > 2) {
|
||||
m_fullScreen3->setStyleSheet("background-color: rgb(0,0,0);");
|
||||
}
|
||||
} else {
|
||||
QString style1 = QString("background-color: rgb(%1,%2,%3);")
|
||||
.arg(m_screen1Color.r)
|
||||
.arg(m_screen1Color.g)
|
||||
.arg(m_screen1Color.b);
|
||||
m_fullScreen1->setStyleSheet(style1);
|
||||
if (m_screenCount > 1) {
|
||||
QString style2 = QString("background-color: rgb(%1,%2,%3);")
|
||||
.arg(m_screen2Color.r)
|
||||
.arg(m_screen2Color.g)
|
||||
.arg(m_screen2Color.b);
|
||||
m_fullScreen2->setStyleSheet(style2);
|
||||
}
|
||||
if (m_screenCount > 2) {
|
||||
QString style3 = QString("background-color: rgb(%1,%2,%3);")
|
||||
.arg(m_screen3Color.r)
|
||||
.arg(m_screen3Color.g)
|
||||
.arg(m_screen3Color.b);
|
||||
m_fullScreen3->setStyleSheet(style3);
|
||||
}
|
||||
}
|
||||
bool shown = false;
|
||||
bool isTimeLapse = StopMotion::instance()->m_isTimeLapse;
|
||||
if ((getBlackCapture() || m_useScreen1Overlay) && !isTimeLapse) {
|
||||
m_fullScreen1->showFullScreen();
|
||||
m_fullScreen1->setGeometry(QApplication::desktop()->screenGeometry(0));
|
||||
shown = true;
|
||||
}
|
||||
if (m_screenCount > 1 && (getBlackCapture() || m_useScreen2Overlay) &&
|
||||
!isTimeLapse) {
|
||||
m_fullScreen2->showFullScreen();
|
||||
m_fullScreen2->setGeometry(QApplication::desktop()->screenGeometry(1));
|
||||
shown = true;
|
||||
}
|
||||
if (m_screenCount > 2 && (getBlackCapture() || m_useScreen3Overlay) &&
|
||||
!isTimeLapse) {
|
||||
m_fullScreen3->showFullScreen();
|
||||
m_fullScreen3->setGeometry(QApplication::desktop()->screenGeometry(2));
|
||||
shown = true;
|
||||
}
|
||||
|
||||
if (shown) {
|
||||
// this allows the full screen qdialogs to go full screen before
|
||||
// taking a photo
|
||||
qApp->processEvents(QEventLoop::AllEvents, 1500);
|
||||
}
|
||||
m_overlaysReady = true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionLight::hideOverlays() {
|
||||
if ((getBlackCapture() || m_useScreen1Overlay)) {
|
||||
#ifndef WIN32
|
||||
m_fullScreen1->showNormal();
|
||||
#endif
|
||||
m_fullScreen1->close();
|
||||
m_fullScreen1->windowHandle()->close();
|
||||
}
|
||||
if (m_screenCount > 1 && (getBlackCapture() || m_useScreen2Overlay)) {
|
||||
#ifndef WIN32
|
||||
m_fullScreen2->showNormal();
|
||||
#endif
|
||||
m_fullScreen2->close();
|
||||
m_fullScreen2->windowHandle()->close();
|
||||
}
|
||||
if (m_screenCount > 2 && (getBlackCapture() || m_useScreen3Overlay)) {
|
||||
#ifndef WIN32
|
||||
m_fullScreen3->showNormal();
|
||||
#endif
|
||||
m_fullScreen3->close();
|
||||
m_fullScreen3->windowHandle()->close();
|
||||
}
|
||||
m_overlaysReady = false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
bool StopMotionLight::useOverlays() {
|
||||
return m_blackCapture || m_useScreen1Overlay || m_useScreen2Overlay ||
|
||||
m_useScreen3Overlay;
|
||||
}
|
54
toonz/sources/stopmotion/stopmotionlight.h
Normal file
54
toonz/sources/stopmotion/stopmotionlight.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef STOPMOTIONLIGHT_H
|
||||
#define STOPMOTIONLIGHT_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "traster.h"
|
||||
|
||||
class QDialog;
|
||||
|
||||
//=============================================================================
|
||||
// StopMotionLight
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class StopMotionLight : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StopMotionLight();
|
||||
~StopMotionLight();
|
||||
|
||||
QDialog *m_fullScreen1, *m_fullScreen2, *m_fullScreen3;
|
||||
bool m_useScreen1Overlay = false;
|
||||
bool m_useScreen2Overlay = false;
|
||||
bool m_useScreen3Overlay = false;
|
||||
bool m_blackCapture = true;
|
||||
bool m_overlaysReady = false;
|
||||
int m_screenCount = 1;
|
||||
TPixel32 m_screen1Color, m_screen2Color,
|
||||
m_screen3Color = TPixel32(0, 0, 0, 255);
|
||||
|
||||
void setBlackCapture(bool on);
|
||||
bool getBlackCapture() { return m_blackCapture; }
|
||||
void setScreen1Color(TPixel32 color);
|
||||
void setScreen2Color(TPixel32 color);
|
||||
void setScreen3Color(TPixel32 color);
|
||||
void setScreen1UseOverlay(bool on);
|
||||
void setScreen2UseOverlay(bool on);
|
||||
void setScreen3UseOverlay(bool on);
|
||||
void showOverlays();
|
||||
void hideOverlays();
|
||||
bool useOverlays();
|
||||
|
||||
signals:
|
||||
void blackCaptureSignal(bool);
|
||||
void screen1ColorChanged(TPixel32);
|
||||
void screen2ColorChanged(TPixel32);
|
||||
void screen3ColorChanged(TPixel32);
|
||||
void screen1OverlayChanged(bool);
|
||||
void screen2OverlayChanged(bool);
|
||||
void screen3OverlayChanged(bool);
|
||||
};
|
||||
#endif // STOPMOTIONLIGHT_H
|
106
toonz/sources/stopmotion/stopmotionserial.cpp
Normal file
106
toonz/sources/stopmotion/stopmotionserial.cpp
Normal file
|
@ -0,0 +1,106 @@
|
|||
#include "stopmotionserial.h"
|
||||
#include "stopmotion.h"
|
||||
#include <QSerialPort>
|
||||
#include <QSerialPortInfo>
|
||||
//=============================================================================
|
||||
//=============================================================================
|
||||
|
||||
StopMotionSerial::StopMotionSerial() { m_serialPort = new QSerialPort(this); }
|
||||
StopMotionSerial::~StopMotionSerial() {}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
QStringList StopMotionSerial::getAvailableSerialPorts() {
|
||||
QList<QSerialPortInfo> list = QSerialPortInfo::availablePorts();
|
||||
QStringList ports;
|
||||
ports.push_back(tr("No Device"));
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
std::string desc = list.at(i).description().toStdString();
|
||||
std::string port = list.at(i).portName().toStdString();
|
||||
std::string maker = list.at(i).manufacturer().toStdString();
|
||||
ports.push_back(list.at(i).portName());
|
||||
if (list.at(i).hasProductIdentifier()) {
|
||||
std::string id =
|
||||
QString::number(list.at(i).productIdentifier()).toStdString();
|
||||
}
|
||||
if (list.at(i).hasVendorIdentifier()) {
|
||||
std::string id =
|
||||
QString::number(list.at(i).vendorIdentifier()).toStdString();
|
||||
}
|
||||
}
|
||||
return ports;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
bool StopMotionSerial::setSerialPort(QString port) {
|
||||
if (m_serialPort->isOpen()) m_serialPort->close();
|
||||
QList<QSerialPortInfo> list = QSerialPortInfo::availablePorts();
|
||||
QStringList ports;
|
||||
bool success = false;
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (port == list.at(i).portName()) {
|
||||
m_serialPort->setPort(list.at(i));
|
||||
}
|
||||
}
|
||||
// m_serialPort->setBaudRate(9600);
|
||||
bool connected = m_serialPort->open(QIODevice::ReadWrite);
|
||||
if (connected) {
|
||||
success = m_serialPort->setBaudRate(QSerialPort::Baud9600) &
|
||||
m_serialPort->setParity(QSerialPort::NoParity) &
|
||||
m_serialPort->setDataBits(QSerialPort::Data8) &
|
||||
m_serialPort->setStopBits(QSerialPort::OneStop) &
|
||||
m_serialPort->setFlowControl(QSerialPort::NoFlowControl);
|
||||
std::string fNumber =
|
||||
std::to_string(StopMotion::instance()->getXSheetFrameNumber());
|
||||
char const* fNumberChar = fNumber.c_str();
|
||||
m_serialPort->write(fNumberChar);
|
||||
m_serialPort->waitForBytesWritten(10);
|
||||
QByteArray DataReceive = m_serialPort->readLine();
|
||||
while (m_serialPort->waitForReadyRead(30)) {
|
||||
DataReceive += m_serialPort->readLine();
|
||||
}
|
||||
QByteArray response = DataReceive;
|
||||
QString s(response);
|
||||
std::string text = response.toStdString();
|
||||
//}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void StopMotionSerial::sendSerialData() {
|
||||
if (m_serialPort->isOpen()) {
|
||||
std::string fNumber =
|
||||
std::to_string(StopMotion::instance()->getXSheetFrameNumber());
|
||||
char const* fNumberChar = fNumber.c_str();
|
||||
m_serialPort->write(fNumberChar);
|
||||
m_serialPort->waitForBytesWritten(10);
|
||||
QByteArray DataReceive = m_serialPort->readLine();
|
||||
while (m_serialPort->waitForReadyRead(30)) {
|
||||
DataReceive += m_serialPort->readLine();
|
||||
}
|
||||
QByteArray response = DataReceive;
|
||||
QString s(response);
|
||||
std::string text = response.toStdString();
|
||||
}
|
||||
|
||||
// for not data sending is not implemented yet, just the frame number.
|
||||
// These lines are here to be a reference for using column data as movement.
|
||||
// TDoubleParam *param =
|
||||
// TApp::instance()->getCurrentScene()->getScene()->getXsheet()->getStageObjectTree()->getStageObject(0)->getParam(TStageObject::T_X);
|
||||
// double value =
|
||||
// TApp::instance()->getCurrentScene()->getScene()->getXsheet()->getStageObjectTree()->getStageObject(0)->getParam(TStageObject::T_X,
|
||||
// m_xSheetFrameNumber - 1);
|
||||
// QString isCam =
|
||||
// TApp::instance()->getCurrentScene()->getScene()->getXsheet()->getStageObjectTree()->getStageObject(0)->getId().isCamera()
|
||||
// ? "yep" : "nope";
|
||||
// std::string name =
|
||||
// TApp::instance()->getCurrentScene()->getScene()->getXsheet()->getStageObjectTree()->getStageObject(0)->getName();
|
||||
// TMeasure *measure =param->getMeasure();
|
||||
// const TUnit *unit = measure->getCurrentUnit();
|
||||
// double newValue = unit->convertTo(value);
|
||||
}
|
30
toonz/sources/stopmotion/stopmotionserial.h
Normal file
30
toonz/sources/stopmotion/stopmotionserial.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef STOPMOTIONSERIAL_H
|
||||
#define STOPMOTIONSERIAL_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QSerialPort;
|
||||
|
||||
//=============================================================================
|
||||
// StopMotionSerial
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class StopMotionSerial : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StopMotionSerial();
|
||||
~StopMotionSerial();
|
||||
|
||||
QStringList m_controlBaudRates, m_serialDevices;
|
||||
|
||||
QSerialPort* m_serialPort;
|
||||
|
||||
// motion control
|
||||
QStringList getAvailableSerialPorts();
|
||||
bool setSerialPort(QString port);
|
||||
void sendSerialData();
|
||||
};
|
||||
#endif // STOPMOTIONSERIAL_H
|
500
toonz/sources/stopmotion/webcam.cpp
Normal file
500
toonz/sources/stopmotion/webcam.cpp
Normal file
|
@ -0,0 +1,500 @@
|
|||
#include "webcam.h"
|
||||
#include "tenv.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#include <mfobjects.h>
|
||||
#include <mfapi.h>
|
||||
#include <mfidl.h>
|
||||
#pragma comment(lib, "Mfplat.lib")
|
||||
#pragma comment(lib, "Mf.lib")
|
||||
#pragma comment(lib, "Mfreadwrite.lib")
|
||||
#pragma comment(lib, "mfuuid.lib")
|
||||
#pragma comment(lib, "shlwapi.lib")
|
||||
#endif
|
||||
|
||||
#include <QCamera>
|
||||
#include <QCameraInfo>
|
||||
#include <QApplication>
|
||||
|
||||
TEnv::IntVar StopMotionUseDirectShow("StopMotionUseDirectShow", 1);
|
||||
TEnv::IntVar StopMotionUseMjpg("StopMotionUseMjpg", 1);
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Webcam::Webcam() {
|
||||
m_useDirectShow = StopMotionUseDirectShow;
|
||||
m_useMjpg = StopMotionUseMjpg;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
Webcam::~Webcam() {}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
QList<QCameraInfo> Webcam::getWebcams() {
|
||||
m_webcams.clear();
|
||||
m_webcams = QCameraInfo::availableCameras();
|
||||
return m_webcams;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setWebcam(QCamera* camera) { m_webcam = camera; }
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
bool Webcam::initWebcam(int index) {
|
||||
#ifdef WIN32
|
||||
if (!m_useDirectShow) {
|
||||
// the webcam order obtained from Qt isn't always the same order as
|
||||
// the one obtained from OpenCV without DirectShow
|
||||
translateIndex(index);
|
||||
m_cvWebcam.open(m_webcamIndex);
|
||||
} else {
|
||||
m_webcamIndex = index;
|
||||
m_cvWebcam.open(m_webcamIndex, cv::CAP_DSHOW);
|
||||
}
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
m_webcamIndex = index;
|
||||
m_cvWebcam.open(index);
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
// mjpg is used by many webcams
|
||||
// opencv runs very slow on some webcams without it.
|
||||
if (m_useMjpg) {
|
||||
m_cvWebcam.set(cv::CAP_PROP_FOURCC,
|
||||
cv::VideoWriter::fourcc('m', 'j', 'p', 'g'));
|
||||
m_cvWebcam.set(cv::CAP_PROP_FOURCC,
|
||||
cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));
|
||||
}
|
||||
m_cvWebcam.set(3, m_webcamWidth);
|
||||
m_cvWebcam.set(4, m_webcamHeight);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::releaseWebcam() { m_cvWebcam.release(); }
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
int Webcam::getIndexOfResolution() {
|
||||
return m_webcamResolutions.indexOf(QSize(m_webcamWidth, m_webcamHeight));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
bool Webcam::getWebcamImage(TRaster32P& tempImage) {
|
||||
bool error = false;
|
||||
cv::Mat imgOriginal;
|
||||
cv::Mat imgCorrected;
|
||||
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
// mjpg is used by many webcams
|
||||
// opencv runs very slow on some webcams without it.
|
||||
if (m_useMjpg) {
|
||||
m_cvWebcam.set(cv::CAP_PROP_FOURCC,
|
||||
cv::VideoWriter::fourcc('m', 'j', 'p', 'g'));
|
||||
m_cvWebcam.set(cv::CAP_PROP_FOURCC,
|
||||
cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));
|
||||
}
|
||||
m_cvWebcam.set(3, m_webcamWidth);
|
||||
m_cvWebcam.set(4, m_webcamHeight);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool blnFrameReadSuccessfully =
|
||||
m_cvWebcam.read(imgOriginal); // get next frame
|
||||
|
||||
if (!blnFrameReadSuccessfully ||
|
||||
imgOriginal.empty()) { // if frame not read successfully
|
||||
std::cout << "error: frame not read from webcam\n";
|
||||
error = true; // print error message to std out
|
||||
}
|
||||
|
||||
if (!error) {
|
||||
cv::cvtColor(imgOriginal, imgCorrected, cv::COLOR_BGR2BGRA);
|
||||
cv::flip(imgCorrected, imgCorrected, 0);
|
||||
int width = m_cvWebcam.get(3);
|
||||
int height = m_cvWebcam.get(4);
|
||||
int size = imgCorrected.total() * imgCorrected.elemSize();
|
||||
|
||||
tempImage = TRaster32P(width, height);
|
||||
// m_liveViewImage = TRaster32P(width, height);
|
||||
tempImage->lock();
|
||||
uchar* imgBuf = imgCorrected.data;
|
||||
uchar* rawData = tempImage->getRawData();
|
||||
memcpy(rawData, imgBuf, size);
|
||||
tempImage->unlock();
|
||||
}
|
||||
if (error) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setUseDirectShow(int state) {
|
||||
m_useDirectShow = state;
|
||||
StopMotionUseDirectShow = state;
|
||||
emit(useDirectShowSignal(state));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setUseMjpg(bool on) {
|
||||
m_useMjpg = on;
|
||||
StopMotionUseMjpg = int(on);
|
||||
emit(useMjpgSignal(on));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::clearWebcam() {
|
||||
m_webcamDescription = QString();
|
||||
m_webcamDeviceName = QString();
|
||||
m_webcamIndex = -1;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::clearWebcamResolutions() { m_webcamResolutions.clear(); }
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::refreshWebcamResolutions() {
|
||||
clearWebcamResolutions();
|
||||
m_webcamResolutions = getWebcam()->supportedViewfinderResolutions();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
bool Webcam::getWebcamAutofocusStatus() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = m_cvWebcam.get(cv::CAP_PROP_AUTOFOCUS);
|
||||
if (value > 0.0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
void Webcam::setWebcamAutofocusStatus(bool on) {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = on ? 1.0 : 0.0;
|
||||
m_cvWebcam.set(cv::CAP_PROP_AUTOFOCUS, value);
|
||||
value = m_cvWebcam.get(cv::CAP_PROP_AUTOFOCUS);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
int Webcam::getWebcamFocusValue() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = m_cvWebcam.get(cv::CAP_PROP_FOCUS);
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setWebcamFocusValue(int value) {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_cvWebcam.set(cv::CAP_PROP_FOCUS, value);
|
||||
value = m_cvWebcam.get(cv::CAP_PROP_FOCUS);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
int Webcam::getWebcamExposureValue() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = m_cvWebcam.get(cv::CAP_PROP_EXPOSURE);
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setWebcamExposureValue(int value) {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_cvWebcam.set(cv::CAP_PROP_AUTO_EXPOSURE, 0.25);
|
||||
m_cvWebcam.set(cv::CAP_PROP_EXPOSURE, value);
|
||||
value = m_cvWebcam.get(cv::CAP_PROP_EXPOSURE);
|
||||
getWebcamExposureValue();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
int Webcam::getWebcamBrightnessValue() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = m_cvWebcam.get(cv::CAP_PROP_BRIGHTNESS);
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setWebcamBrightnessValue(int value) {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_cvWebcam.set(cv::CAP_PROP_BRIGHTNESS, value);
|
||||
value = m_cvWebcam.get(cv::CAP_PROP_BRIGHTNESS);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
int Webcam::getWebcamContrastValue() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = m_cvWebcam.get(cv::CAP_PROP_CONTRAST);
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setWebcamContrastValue(int value) {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_cvWebcam.set(cv::CAP_PROP_CONTRAST, value);
|
||||
value = m_cvWebcam.get(cv::CAP_PROP_CONTRAST);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
int Webcam::getWebcamGainValue() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = m_cvWebcam.get(cv::CAP_PROP_GAIN);
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setWebcamGainValue(int value) {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_cvWebcam.set(cv::CAP_PROP_GAIN, value);
|
||||
value = m_cvWebcam.get(cv::CAP_PROP_GAIN);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
int Webcam::getWebcamSaturationValue() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (m_cvWebcam.isOpened()) {
|
||||
double value = m_cvWebcam.get(cv::CAP_PROP_SATURATION);
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::setWebcamSaturationValue(int value) {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_cvWebcam.set(cv::CAP_PROP_SATURATION, value);
|
||||
value = m_cvWebcam.get(cv::CAP_PROP_SATURATION);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
void Webcam::openSettingsWindow() {
|
||||
if (m_cvWebcam.isOpened() == false) {
|
||||
initWebcam(m_webcamIndex);
|
||||
|
||||
if (!m_cvWebcam.isOpened()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_cvWebcam.set(cv::CAP_PROP_SETTINGS, 1.0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
bool Webcam::translateIndex(int index) {
|
||||
// We are using Qt to get the camera info and supported resolutions, but
|
||||
// we are using OpenCV to actually get the images.
|
||||
// The camera index from OpenCV and from Qt don't always agree,
|
||||
// So this checks the name against the correct index.
|
||||
m_webcamIndex = index;
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
// Thanks to:
|
||||
// https://elcharolin.wordpress.com/2017/08/28/webcam-capture-with-the-media-foundation-sdk/
|
||||
// for the webcam enumeration here
|
||||
|
||||
#define CLEAN_ATTRIBUTES() \
|
||||
if (attributes) { \
|
||||
attributes->Release(); \
|
||||
attributes = NULL; \
|
||||
} \
|
||||
for (DWORD i = 0; i < count; i++) { \
|
||||
if (&devices[i]) { \
|
||||
devices[i]->Release(); \
|
||||
devices[i] = NULL; \
|
||||
} \
|
||||
} \
|
||||
CoTaskMemFree(devices); \
|
||||
return hr;
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
// this is important!!
|
||||
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
|
||||
|
||||
UINT32 count = 0;
|
||||
IMFAttributes* attributes = NULL;
|
||||
IMFActivate** devices = NULL;
|
||||
|
||||
if (FAILED(hr)) {
|
||||
CLEAN_ATTRIBUTES()
|
||||
}
|
||||
// Create an attribute store to specify enumeration parameters.
|
||||
hr = MFCreateAttributes(&attributes, 1);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
CLEAN_ATTRIBUTES()
|
||||
}
|
||||
|
||||
// The attribute to be requested is devices that can capture video
|
||||
hr = attributes->SetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE,
|
||||
MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID);
|
||||
if (FAILED(hr)) {
|
||||
CLEAN_ATTRIBUTES()
|
||||
}
|
||||
// Enummerate the video capture devices
|
||||
hr = MFEnumDeviceSources(attributes, &devices, &count);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
CLEAN_ATTRIBUTES()
|
||||
}
|
||||
// if there are any available devices
|
||||
if (count > 0) {
|
||||
WCHAR* nameString = NULL;
|
||||
// Get the human-friendly name of the device
|
||||
UINT32 cchName;
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
hr = devices[i]->GetAllocatedString(MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME,
|
||||
&nameString, &cchName);
|
||||
std::string desc = m_webcamDescription.toStdString();
|
||||
if (nameString == m_webcamDescription.toStdWString()) {
|
||||
m_webcamIndex = i;
|
||||
break;
|
||||
}
|
||||
// devices[0]->ShutdownObject();
|
||||
}
|
||||
|
||||
CoTaskMemFree(nameString);
|
||||
}
|
||||
// clean
|
||||
CLEAN_ATTRIBUTES()
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
104
toonz/sources/stopmotion/webcam.h
Normal file
104
toonz/sources/stopmotion/webcam.h
Normal file
|
@ -0,0 +1,104 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef WEBCAM_H
|
||||
#define WEBCAM_H
|
||||
|
||||
#include "opencv2/opencv.hpp"
|
||||
|
||||
// Toonz Includes
|
||||
#include "traster.h"
|
||||
#include "toonzqt/gutil.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QCamera;
|
||||
class QCameraInfo;
|
||||
|
||||
class Webcam : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Webcam();
|
||||
~Webcam();
|
||||
|
||||
void setWebcamDeviceName(QString name) { m_webcamDeviceName = name; }
|
||||
QString getWebcamDeviceName() { return m_webcamDeviceName; }
|
||||
|
||||
void setWebcamDescription(QString desc) { m_webcamDescription = desc; }
|
||||
QString getWebcamDescription() { return m_webcamDescription; }
|
||||
|
||||
void setWebcamIndex(int index) { m_webcamIndex = index; }
|
||||
int getWebcamIndex() { return m_webcamIndex; }
|
||||
|
||||
int getWebcamWidth() { return m_webcamWidth; }
|
||||
int getWebcamHeight() { return m_webcamHeight; }
|
||||
void setWebcamWidth(int width) { m_webcamWidth = width; }
|
||||
void setWebcamHeight(int height) { m_webcamHeight = height; }
|
||||
|
||||
void releaseWebcam();
|
||||
void clearWebcam();
|
||||
QList<QCameraInfo> getWebcams();
|
||||
QCamera* getWebcam() { return m_webcam; }
|
||||
void setWebcam(QCamera* camera);
|
||||
bool initWebcam(int index = 0);
|
||||
bool getWebcamImage(TRaster32P& tempImage);
|
||||
|
||||
bool translateIndex(int index);
|
||||
|
||||
QList<QSize> getWebcamResolutions() { return m_webcamResolutions; }
|
||||
int getIndexOfResolution();
|
||||
void clearWebcamResolutions();
|
||||
void refreshWebcamResolutions();
|
||||
|
||||
void setUseMjpg(bool on);
|
||||
bool getUseMjpg() { return m_useMjpg; }
|
||||
bool getUseDirectShow() { return m_useDirectShow; }
|
||||
void setUseDirectShow(int state);
|
||||
|
||||
bool getWebcamAutofocusStatus();
|
||||
void setWebcamAutofocusStatus(bool on);
|
||||
|
||||
int getWebcamFocusValue();
|
||||
void setWebcamFocusValue(int value);
|
||||
|
||||
int getWebcamExposureValue();
|
||||
void setWebcamExposureValue(int value);
|
||||
|
||||
int getWebcamBrightnessValue();
|
||||
void setWebcamBrightnessValue(int value);
|
||||
|
||||
int getWebcamContrastValue();
|
||||
void setWebcamContrastValue(int value);
|
||||
|
||||
int getWebcamGainValue();
|
||||
void setWebcamGainValue(int value);
|
||||
|
||||
int getWebcamSaturationValue();
|
||||
void setWebcamSaturationValue(int value);
|
||||
|
||||
void openSettingsWindow();
|
||||
|
||||
private:
|
||||
// Webcam Properties
|
||||
QList<QCameraInfo> m_webcams;
|
||||
QCamera* m_webcam;
|
||||
cv::VideoCapture m_cvWebcam;
|
||||
QList<QSize> m_webcamResolutions;
|
||||
// Webcam Public Properties
|
||||
QString m_webcamDeviceName;
|
||||
QString m_webcamDescription;
|
||||
int m_webcamIndex = -1;
|
||||
bool m_useDirectShow = true;
|
||||
int m_webcamWidth = 0;
|
||||
int m_webcamHeight = 0;
|
||||
bool m_useMjpg = true;
|
||||
|
||||
int m_webcamFocusValue = 0;
|
||||
bool m_webcamAutofocusStatus = true;
|
||||
|
||||
signals:
|
||||
void useMjpgSignal(bool);
|
||||
void useDirectShowSignal(bool);
|
||||
};
|
||||
|
||||
#endif // WEBCAM_H
|
|
@ -120,23 +120,16 @@ set(MOC_HEADERS
|
|||
xshrowviewer.h
|
||||
xshtoolbar.h
|
||||
xdtsimportpopup.h
|
||||
)
|
||||
|
||||
if(WITH_STOPMOTION)
|
||||
set(MOC_HEADERS
|
||||
${MOC_HEADERS}
|
||||
../stopmotion/stopmotion.h
|
||||
../stopmotion/stopmotioncontroller.h
|
||||
../stopmotion/webcam.h
|
||||
../stopmotion/jpgconverter.h
|
||||
../stopmotion/canon.h
|
||||
../stopmotion/stopmotionserial.h
|
||||
../stopmotion/stopmotionlight.h
|
||||
cameracapturelevelcontrol.h
|
||||
penciltestpopup.h
|
||||
)
|
||||
else()
|
||||
set(MOC_HEADERS
|
||||
${MOC_HEADERS}
|
||||
cameracapturelevelcontrol_qt.h
|
||||
penciltestpopup_qt.h
|
||||
)
|
||||
endif()
|
||||
|
||||
set(HEADERS
|
||||
${MOC_HEADERS}
|
||||
|
@ -362,23 +355,16 @@ set(SOURCES
|
|||
metnum.cpp
|
||||
ObjectTracker.cpp
|
||||
predict3d.cpp
|
||||
)
|
||||
|
||||
if(WITH_STOPMOTION)
|
||||
set(SOURCES
|
||||
${SOURCES}
|
||||
../stopmotion/stopmotion.cpp
|
||||
../stopmotion/stopmotioncontroller.cpp
|
||||
../stopmotion/webcam.cpp
|
||||
../stopmotion/jpgconverter.cpp
|
||||
../stopmotion/canon.cpp
|
||||
../stopmotion/stopmotionserial.cpp
|
||||
../stopmotion/stopmotionlight.cpp
|
||||
cameracapturelevelcontrol.cpp
|
||||
penciltestpopup.cpp
|
||||
)
|
||||
else()
|
||||
set(SOURCES
|
||||
${SOURCES}
|
||||
cameracapturelevelcontrol_qt.cpp
|
||||
penciltestpopup_qt.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
add_translation(toonz ${HEADERS} ${SOURCES})
|
||||
|
||||
|
@ -432,15 +418,18 @@ message("Bin: " ${CMAKE_CURRENT_BINARY_DIR})
|
|||
include_directories(
|
||||
../../sources/toonzfarm/include
|
||||
../../sources/toonzqt
|
||||
../../sources/stopmotion
|
||||
)
|
||||
|
||||
if (WITH_STOPMOTION)
|
||||
include_directories(../../sources/stopmotion)
|
||||
add_definitions(-DWITH_STOPMOTION)
|
||||
if (WITH_CANON)
|
||||
add_definitions(-DWITH_CANON)
|
||||
endif()
|
||||
|
||||
if(BUILD_ENV_APPLE)
|
||||
include_directories(../../sources/mousedragfilter)
|
||||
include_directories(
|
||||
../../sources/mousedragfilter
|
||||
${TURBOJPEG_INCLUDE_DIRS}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -454,10 +443,10 @@ if(BUILD_TARGET_WIN)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(BUILD_ENV_MSVC AND WITH_STOPMOTION)
|
||||
if(BUILD_ENV_MSVC AND WITH_CANON)
|
||||
target_link_libraries(OpenToonz
|
||||
Qt5::WinMain Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::SerialPort
|
||||
${GL_LIB} ${GLUT_LIB}
|
||||
${CANON_LIB} ${TURBOJPEG_LIB} ${OpenCV_LIBS} strmiids
|
||||
tnzcore tnzbase toonzlib colorfx tnzext image sound toonzqt tnztools tnzstdfx tfarm
|
||||
|
@ -465,10 +454,27 @@ if(BUILD_ENV_MSVC AND WITH_STOPMOTION)
|
|||
elseif(BUILD_ENV_MSVC)
|
||||
target_link_libraries(OpenToonz
|
||||
Qt5::WinMain Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia
|
||||
${GL_LIB} ${GLUT_LIB} strmiids
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::SerialPort
|
||||
${GL_LIB} ${GLUT_LIB} ${TURBOJPEG_LIB} ${OpenCV_LIBS} strmiids
|
||||
tnzcore tnzbase toonzlib colorfx tnzext image sound toonzqt tnztools tnzstdfx tfarm
|
||||
)
|
||||
elseif(BUILD_ENV_APPLE AND WITH_CANON)
|
||||
find_library(COCOA_LIB Cocoa)
|
||||
|
||||
_find_toonz_library(EXTRA_LIBS "tnzcore;tnzbase;toonzlib;colorfx;tnzext;image;sound;toonzqt;tnztools")
|
||||
|
||||
# 変なところにライブラリ生成するカスども
|
||||
set(EXTRA_LIBS ${EXTRA_LIBS} "$<TARGET_FILE:tnzstdfx>" "$<TARGET_FILE:tfarm>")
|
||||
|
||||
add_dependencies(OpenToonz tnzcore tnzbase toonzlib colorfx tnzext image sound toonzqt tnztools tnzstdfx tfarm)
|
||||
|
||||
target_link_libraries(OpenToonz
|
||||
Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::MultimediaWidgets Qt5::SerialPort
|
||||
${GL_LIB} ${GLUT_LIB} ${CANON_LIB} ${TURBOJPEG_LIB} ${OpenCV_LIBS}
|
||||
${COCOA_LIB} ${EXTRA_LIBS} mousedragfilter
|
||||
)
|
||||
|
||||
elseif(BUILD_ENV_APPLE)
|
||||
find_library(COCOA_LIB Cocoa)
|
||||
|
||||
|
@ -481,8 +487,8 @@ elseif(BUILD_ENV_APPLE)
|
|||
|
||||
target_link_libraries(OpenToonz
|
||||
Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::MultimediaWidgets
|
||||
${GL_LIB} ${GLUT_LIB}
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::MultimediaWidgets Qt5::SerialPort
|
||||
${GL_LIB} ${GLUT_LIB} ${TURBOJPEG_LIB} ${OpenCV_LIBS}
|
||||
${COCOA_LIB} ${EXTRA_LIBS} mousedragfilter
|
||||
)
|
||||
|
||||
|
@ -500,8 +506,8 @@ elseif(BUILD_ENV_UNIXLIKE)
|
|||
|
||||
target_link_libraries(
|
||||
OpenToonz Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia
|
||||
${GL_LIB} ${GLUT_LIB} ${GLU_LIB}
|
||||
Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::SerialPort
|
||||
${GL_LIB} ${GLUT_LIB} ${GLU_LIB} ${TURBOJPEG_LIB} ${OpenCV_LIBS}
|
||||
${EXTRA_LIBS}
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -5,12 +5,7 @@
|
|||
#include "menubarcommandids.h"
|
||||
#include "cellselection.h"
|
||||
#include "columnselection.h"
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
#include "penciltestpopup.h"
|
||||
#else
|
||||
#include "penciltestpopup_qt.h"
|
||||
#endif
|
||||
|
||||
// TnzQt includes
|
||||
#include "toonzqt/intfield.h"
|
||||
|
@ -277,7 +272,7 @@ AutoInputCellNumberPopup::AutoInputCellNumberPopup()
|
|||
bool ret = true;
|
||||
ret = ret && connect(m_overwriteBtn, SIGNAL(clicked()), this,
|
||||
SLOT(onOverwritePressed()));
|
||||
ret = ret &&
|
||||
ret = ret &&
|
||||
connect(m_insertBtn, SIGNAL(clicked()), this, SLOT(onInsertPressed()));
|
||||
ret = ret && connect(cancelBtn, SIGNAL(clicked()), this, SLOT(close()));
|
||||
assert(ret);
|
||||
|
|
|
@ -1256,7 +1256,8 @@ public:
|
|||
if (m_target == TARGET_SELECTED && !isSelected) continue;
|
||||
|
||||
/*-
|
||||
* Skip if target is "right side of current column" mode and i is left of current column
|
||||
* Skip if target is "right side of current column" mode and i is left of
|
||||
* current column
|
||||
* -*/
|
||||
if (m_target == TARGET_UPPER && i < cc) continue;
|
||||
|
||||
|
@ -1358,14 +1359,13 @@ ColumnsStatusCommand
|
|||
// pasting the newly created vector column.
|
||||
class ConvertToVectorUndo final : public PasteColumnsUndo {
|
||||
public:
|
||||
ConvertToVectorUndo(std::set<int> indices) : PasteColumnsUndo(indices) {};
|
||||
ConvertToVectorUndo(std::set<int> indices) : PasteColumnsUndo(indices){};
|
||||
|
||||
QString getHistoryString() override {
|
||||
return QObject::tr("Convert to Vectors");
|
||||
}
|
||||
};
|
||||
|
||||
void ColumnCmd::addConvertToVectorUndo(std::set<int> &newColumnIndices)
|
||||
{
|
||||
TUndoManager::manager()->add(new ConvertToVectorUndo(newColumnIndices));
|
||||
void ColumnCmd::addConvertToVectorUndo(std::set<int> &newColumnIndices) {
|
||||
TUndoManager::manager()->add(new ConvertToVectorUndo(newColumnIndices));
|
||||
}
|
||||
|
|
|
@ -189,7 +189,6 @@ void FileBrowserPopup::addFilterType(const QString &type) {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void FileBrowserPopup::setFileMode(bool isDirectoryOnly) {
|
||||
|
||||
m_isDirectoryOnly = isDirectoryOnly;
|
||||
if (isDirectoryOnly) {
|
||||
m_nameFieldLabel->setText(tr("Folder name:"));
|
||||
|
@ -469,13 +468,14 @@ bool GenericSaveFilePopup::execute() {
|
|||
// (yep, even if a DIFFERENT type was specified - next time do it right :P)
|
||||
const QStringList &extList = m_browser->getFilterTypes();
|
||||
|
||||
if (!extList.contains(QString::fromStdString(path.getType()))) {
|
||||
if (!m_isDirectoryOnly &&
|
||||
!extList.contains(QString::fromStdString(path.getType()))) {
|
||||
path =
|
||||
TFilePath(path.getWideString() + L"." + extList.first().toStdWString());
|
||||
}
|
||||
|
||||
// Ask for user permission to overwrite if necessary
|
||||
if (TFileStatus(path).doesExist()) {
|
||||
if (!m_isDirectoryOnly && TFileStatus(path).doesExist()) {
|
||||
const QString &question =
|
||||
QObject::tr("File %1 already exists.\nDo you want to overwrite it?")
|
||||
.arg(toQString(path));
|
||||
|
@ -1222,10 +1222,10 @@ bool LoadLevelPopup::execute() {
|
|||
args.frameIdsSet.push_back(tmp_fids);
|
||||
}
|
||||
|
||||
int xFrom = m_xFrom->text().toInt();
|
||||
int xFrom = m_xFrom->text().toInt();
|
||||
if (xFrom) args.xFrom = xFrom;
|
||||
int xTo = m_xTo->text().toInt();
|
||||
if (xTo) args.xTo = xTo;
|
||||
int xTo = m_xTo->text().toInt();
|
||||
if (xTo) args.xTo = xTo;
|
||||
|
||||
args.levelName = m_levelName->text().toStdWString();
|
||||
args.step = m_stepCombo->currentIndex();
|
||||
|
@ -1576,7 +1576,7 @@ bool SaveLevelAsPopup::execute() {
|
|||
TXshSimpleLevel *sl = dynamic_cast<TXshSimpleLevel *>(
|
||||
TApp::instance()->getCurrentLevel()->getLevel());
|
||||
if (!sl) return false;
|
||||
std::string ext = sl->getPath().getType();
|
||||
std::string ext = sl->getPath().getType();
|
||||
if (fp.getType() == "") fp = fp.withType(ext);
|
||||
|
||||
IoCmd::LoadResourceArguments args(fp);
|
||||
|
@ -2233,7 +2233,7 @@ void BrowserPopup::initFolder(TFilePath path) {
|
|||
}
|
||||
if (!TFileStatus(path).doesExist()) {
|
||||
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
|
||||
if (scene) path = scene->decodeFilePath(path);
|
||||
if (scene) path = scene->decodeFilePath(path);
|
||||
}
|
||||
|
||||
if (!path.getType().empty()) path = path.getParentDir();
|
||||
|
@ -2302,8 +2302,8 @@ void BrowserPopupController::openPopup(QStringList filters,
|
|||
QString BrowserPopupController::getPath(bool codePath) {
|
||||
m_isExecute = false;
|
||||
if (!m_browserPopup) return QString();
|
||||
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
|
||||
TFilePath fp = m_browserPopup->getPath();
|
||||
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
|
||||
TFilePath fp = m_browserPopup->getPath();
|
||||
if (scene && codePath) fp = scene->codeFilePath(fp);
|
||||
std::cout << ::to_string(fp) << std::endl;
|
||||
return toQString(fp);
|
||||
|
|
|
@ -1898,7 +1898,7 @@ void Filmstrip::setOrientation(bool isVertical) {
|
|||
m_frameArea->horizontalScrollBar()->setObjectName("LevelStripScrollBar");
|
||||
}
|
||||
m_frames->setOrientation(m_isVertical);
|
||||
dynamic_cast<TPanel*>(parentWidget())->setCanFixWidth(m_isVertical);
|
||||
dynamic_cast<TPanel *>(parentWidget())->setCanFixWidth(m_isVertical);
|
||||
}
|
||||
|
||||
// SaveLoadQSettings
|
||||
|
|
|
@ -1308,7 +1308,7 @@ void MainWindow::onMenuCheckboxChanged() {
|
|||
#endif
|
||||
else if (cm->getAction(MI_RasterizePli) == action) {
|
||||
if (!QGLPixelBuffer::hasOpenGLPbuffers()) isChecked = 0;
|
||||
RasterizePliToggleAction = isChecked;
|
||||
RasterizePliToggleAction = isChecked;
|
||||
} else if (cm->getAction(MI_SafeArea) == action)
|
||||
SafeAreaToggleAction = isChecked;
|
||||
else if (cm->getAction(MI_ViewColorcard) == action)
|
||||
|
@ -1631,6 +1631,13 @@ QAction *MainWindow::createToolOptionsAction(const char *id,
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
QAction *MainWindow::createStopMotionAction(const char *id, const QString &name,
|
||||
const QString &defaultShortcut) {
|
||||
return createAction(id, name, defaultShortcut, StopMotionCommandType);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
QAction *MainWindow::createToggle(const char *id, const QString &name,
|
||||
const QString &defaultShortcut,
|
||||
bool startStatus, CommandType type) {
|
||||
|
@ -1731,6 +1738,8 @@ void MainWindow::defineActions() {
|
|||
createMenuRenderAction(MI_FastRender, tr("&Fast Render to MP4"), "Alt+R");
|
||||
createMenuRenderAction(MI_Preview, tr("&Preview"), "Ctrl+R");
|
||||
createMenuFileAction(MI_SoundTrack, tr("&Export Soundtrack"), "");
|
||||
createStopMotionAction(MI_StopMotionExportImageSequence,
|
||||
tr("&Export Stop Motion Image Sequence"), "");
|
||||
createMenuRenderAction(MI_SavePreviewedFrames, tr("&Save Previewed Frames"),
|
||||
"");
|
||||
createRightClickMenuAction(MI_RegeneratePreview, tr("&Regenerate Preview"),
|
||||
|
@ -2125,11 +2134,8 @@ void MainWindow::defineActions() {
|
|||
createMenuWindowsAction(MI_OpenToolbar, tr("&Toolbar"), "");
|
||||
createMenuWindowsAction(MI_OpenToolOptionBar, tr("&Tool Option Bar"), "");
|
||||
createMenuWindowsAction(MI_OpenCommandToolbar, tr("&Command Bar"), "");
|
||||
#ifdef WITH_STOPMOTION
|
||||
createMenuWindowsAction(MI_OpenStopMotionPanel, tr("&Stop Motion Controls"),
|
||||
"");
|
||||
|
||||
#endif
|
||||
createMenuWindowsAction(MI_OpenLevelView, tr("&Viewer"), "");
|
||||
#ifdef LINETEST
|
||||
createMenuWindowsAction(MI_OpenLineTestCapture, tr("&LineTest Capture"), "");
|
||||
|
@ -2373,8 +2379,8 @@ void MainWindow::defineActions() {
|
|||
tr("Brush hardness - Increase"), "");
|
||||
createToolOptionsAction("A_DecreaseBrushHardness",
|
||||
tr("Brush hardness - Decrease"), "");
|
||||
createToolOptionsAction("A_ToolOption_SnapSensitivity", tr("Snap Sensitivity"),
|
||||
"");
|
||||
createToolOptionsAction("A_ToolOption_SnapSensitivity",
|
||||
tr("Snap Sensitivity"), "");
|
||||
createToolOptionsAction("A_ToolOption_AutoGroup", tr("Auto Group"), "");
|
||||
createToolOptionsAction("A_ToolOption_BreakSharpAngles",
|
||||
tr("Break sharp angles"), "");
|
||||
|
@ -2585,8 +2591,8 @@ void MainWindow::defineActions() {
|
|||
ToolCommandType);
|
||||
createAction(MI_TapeNextMode, tr("Tape Tool - Next Mode"), "",
|
||||
ToolCommandType);
|
||||
createAction(MI_TapeEndpointToEndpoint, tr("Tape Tool - Endpoint to Endpoint"),
|
||||
"", ToolCommandType);
|
||||
createAction(MI_TapeEndpointToEndpoint,
|
||||
tr("Tape Tool - Endpoint to Endpoint"), "", ToolCommandType);
|
||||
createAction(MI_TapeEndpointToLine, tr("Tape Tool - Endpoint to Line"), "",
|
||||
ToolCommandType);
|
||||
createAction(MI_TapeLineToLine, tr("Tape Tool - Line to Line"), "",
|
||||
|
@ -2637,20 +2643,33 @@ void MainWindow::defineActions() {
|
|||
ToolCommandType);
|
||||
|
||||
createMiscAction("A_FxSchematicToggle", tr("Toggle FX/Stage schematic"), "");
|
||||
#ifdef WITH_STOPMOTION
|
||||
createAction(MI_StopMotionCapture, tr("Capture Stop Motion Frame"), "");
|
||||
createAction(MI_StopMotionRaiseOpacity, tr("Raise Stop Motion Opacity"), "");
|
||||
createAction(MI_StopMotionLowerOpacity, tr("Lower Stop Motion Opacity"), "");
|
||||
createAction(MI_StopMotionToggleLiveView, tr("Toggle Stop Motion Live View"),
|
||||
"");
|
||||
createAction(MI_StopMotionToggleZoom, tr("Toggle Stop Motion Zoom"), "");
|
||||
createAction(MI_StopMotionLowerSubsampling,
|
||||
tr("Lower Stop Motion Level Subsampling"), "");
|
||||
createAction(MI_StopMotionRaiseSubsampling,
|
||||
tr("Raise Stop Motion Level Subsampling"), "");
|
||||
createAction(MI_StopMotionJumpToCamera, tr("Go to Stop Motion Insert Frame"),
|
||||
"");
|
||||
|
||||
createStopMotionAction(MI_StopMotionCapture, tr("Capture Stop Motion Frame"),
|
||||
"");
|
||||
createStopMotionAction(MI_StopMotionRaiseOpacity,
|
||||
tr("Raise Stop Motion Opacity"), "");
|
||||
createStopMotionAction(MI_StopMotionLowerOpacity,
|
||||
tr("Lower Stop Motion Opacity"), "");
|
||||
createStopMotionAction(MI_StopMotionToggleLiveView,
|
||||
tr("Toggle Stop Motion Live View"), "");
|
||||
#ifdef WITH_CANON
|
||||
createStopMotionAction(MI_StopMotionToggleZoom, tr("Toggle Stop Motion Zoom"),
|
||||
"");
|
||||
createStopMotionAction(MI_StopMotionPickFocusCheck,
|
||||
tr("Pick Focus Check Location"), "");
|
||||
#endif
|
||||
createStopMotionAction(MI_StopMotionLowerSubsampling,
|
||||
tr("Lower Stop Motion Level Subsampling"), "");
|
||||
createStopMotionAction(MI_StopMotionRaiseSubsampling,
|
||||
tr("Raise Stop Motion Level Subsampling"), "");
|
||||
createStopMotionAction(MI_StopMotionJumpToCamera,
|
||||
tr("Go to Stop Motion Insert Frame"), "");
|
||||
createStopMotionAction(MI_StopMotionRemoveFrame,
|
||||
tr("Remove frame before Stop Motion Camera"), "");
|
||||
createStopMotionAction(MI_StopMotionNextFrame,
|
||||
tr("Next Frame including Stop Motion Camera"), "");
|
||||
createStopMotionAction(MI_StopMotionToggleUseLiveViewImages,
|
||||
tr("Show original live view images."), "");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -3180,7 +3199,7 @@ void MainWindow::clearCacheFolder() {
|
|||
// 1. $CACHE/[Current ProcessID]
|
||||
// 2. $CACHE/temp/[Current scene folder] if the current scene is untitled
|
||||
|
||||
TFilePath cacheRoot = ToonzFolder::getCacheRootFolder();
|
||||
TFilePath cacheRoot = ToonzFolder::getCacheRootFolder();
|
||||
if (cacheRoot.isEmpty()) cacheRoot = TEnv::getStuffDir() + "cache";
|
||||
|
||||
TFilePathSet filesToBeRemoved;
|
||||
|
@ -3294,9 +3313,9 @@ RecentFiles::~RecentFiles() {}
|
|||
void RecentFiles::addFilePath(QString path, FileType fileType,
|
||||
QString projectName) {
|
||||
QList<QString> files =
|
||||
(fileType == Scene)
|
||||
? m_recentScenes
|
||||
: (fileType == Level) ? m_recentLevels : m_recentFlipbookImages;
|
||||
(fileType == Scene) ? m_recentScenes : (fileType == Level)
|
||||
? m_recentLevels
|
||||
: m_recentFlipbookImages;
|
||||
int i;
|
||||
for (i = 0; i < files.size(); i++)
|
||||
if (files.at(i) == path) {
|
||||
|
@ -3463,9 +3482,9 @@ void RecentFiles::saveRecentFiles() {
|
|||
|
||||
QList<QString> RecentFiles::getFilesNameList(FileType fileType) {
|
||||
QList<QString> files =
|
||||
(fileType == Scene)
|
||||
? m_recentScenes
|
||||
: (fileType == Level) ? m_recentLevels : m_recentFlipbookImages;
|
||||
(fileType == Scene) ? m_recentScenes : (fileType == Level)
|
||||
? m_recentLevels
|
||||
: m_recentFlipbookImages;
|
||||
QList<QString> names;
|
||||
int i;
|
||||
for (i = 0; i < files.size(); i++) {
|
||||
|
@ -3492,9 +3511,9 @@ void RecentFiles::refreshRecentFilesMenu(FileType fileType) {
|
|||
menu->setEnabled(false);
|
||||
else {
|
||||
CommandId clearActionId =
|
||||
(fileType == Scene)
|
||||
? MI_ClearRecentScene
|
||||
: (fileType == Level) ? MI_ClearRecentLevel : MI_ClearRecentImage;
|
||||
(fileType == Scene) ? MI_ClearRecentScene : (fileType == Level)
|
||||
? MI_ClearRecentLevel
|
||||
: MI_ClearRecentImage;
|
||||
menu->setActions(names);
|
||||
menu->addSeparator();
|
||||
QAction *clearAction = CommandManager::instance()->getAction(clearActionId);
|
||||
|
|
|
@ -272,6 +272,8 @@ private:
|
|||
const char *defaultShortcut);
|
||||
QAction *createToolOptionsAction(const char *id, const QString &name,
|
||||
const QString &defaultShortcut);
|
||||
QAction *createStopMotionAction(const char *id, const QString &name,
|
||||
const QString &defaultShortcut);
|
||||
|
||||
protected slots:
|
||||
void onCurrentRoomChanged(int newRoomIndex);
|
||||
|
|
|
@ -1105,6 +1105,7 @@ QMenuBar *StackedMenuBar::createFullMenuBar() {
|
|||
{
|
||||
addMenuItem(exportMenu, MI_SoundTrack);
|
||||
addMenuItem(exportMenu, MI_ExportXDTS);
|
||||
addMenuItem(exportMenu, MI_StopMotionExportImageSequence);
|
||||
}
|
||||
fileMenu->addSeparator();
|
||||
addMenuItem(fileMenu, MI_PrintXsheet);
|
||||
|
@ -1428,9 +1429,7 @@ QMenuBar *StackedMenuBar::createFullMenuBar() {
|
|||
addMenuItem(windowsMenu, MI_OpenTMessage);
|
||||
addMenuItem(windowsMenu, MI_OpenHistoryPanel);
|
||||
addMenuItem(windowsMenu, MI_AudioRecording);
|
||||
#ifdef WITH_STOPMOTION
|
||||
addMenuItem(windowsMenu, MI_OpenStopMotionPanel);
|
||||
#endif
|
||||
addMenuItem(windowsMenu, MI_StartupPopup);
|
||||
addMenuItem(windowsMenu, MI_OpenGuidedDrawingControls);
|
||||
#ifdef LINETEST
|
||||
|
|
|
@ -428,9 +428,15 @@
|
|||
#define MI_StopMotionLowerOpacity "MI_StopMotionLowerOpacity"
|
||||
#define MI_StopMotionToggleLiveView "MI_StopMotionToggleLiveView"
|
||||
#define MI_StopMotionToggleZoom "MI_StopMotionToggleZoom"
|
||||
#define MI_StopMotionToggleUseLiveViewImages \
|
||||
"MI_StopMotionToggleUseLiveViewImages"
|
||||
#define MI_StopMotionLowerSubsampling "MI_StopMotionLowerSubsampling"
|
||||
#define MI_StopMotionRaiseSubsampling "MI_StopMotionRaiseSubsampling"
|
||||
#define MI_StopMotionJumpToCamera "MI_StopMotionJumpToCamera"
|
||||
#define MI_StopMotionPickFocusCheck "MI_StopMotionPickFocusCheck"
|
||||
#define MI_StopMotionExportImageSequence "MI_StopMotionExportImageSequence"
|
||||
#define MI_StopMotionRemoveFrame "MI_StopMotionRemoveFrame"
|
||||
#define MI_StopMotionNextFrame "MI_StopMotionNextFrame"
|
||||
|
||||
#define MI_OpenOnlineManual "MI_OpenOnlineManual"
|
||||
#define MI_OpenWhatsNew "MI_OpenWhatsNew"
|
||||
|
|
|
@ -336,6 +336,7 @@ public:
|
|||
|
||||
m_flash.popMatrix();
|
||||
}
|
||||
void onRasterImage(TRasterImage *ri, const Stage::Player &data) override{};
|
||||
void beginMask() override { m_flash.beginMask(); }
|
||||
void endMask() override { m_flash.endMask(); }
|
||||
void enableMask() override { m_flash.enableMask(); }
|
||||
|
|
|
@ -1214,13 +1214,14 @@ void PencilTestSaveInFolderPopup::updateParentFolder() {
|
|||
|
||||
PencilTestPopup::PencilTestPopup()
|
||||
// set the parent 0 in order to enable the popup behind the main window
|
||||
: Dialog(0, false, false, "PencilTest")
|
||||
, m_currentCamera(NULL)
|
||||
, m_captureWhiteBGCue(false)
|
||||
, m_captureCue(false)
|
||||
, m_useMjpg(CamCapUseMjpg != 0)
|
||||
: Dialog(0, false, false, "PencilTest"),
|
||||
m_currentCamera(NULL),
|
||||
m_captureWhiteBGCue(false),
|
||||
m_captureCue(false),
|
||||
m_useMjpg(CamCapUseMjpg != 0)
|
||||
#ifdef _WIN32
|
||||
, m_useDirectShow(CamCapUseDirectShow != 0)
|
||||
,
|
||||
m_useDirectShow(CamCapUseDirectShow != 0)
|
||||
#endif
|
||||
{
|
||||
setWindowTitle(tr("Camera Capture"));
|
||||
|
@ -1282,7 +1283,11 @@ PencilTestPopup::PencilTestPopup()
|
|||
m_captureButton = new QPushButton(tr("Capture\n[Return key]"), this);
|
||||
QPushButton* closeButton = new QPushButton(tr("Close"), this);
|
||||
|
||||
#ifdef WIN32
|
||||
m_captureFilterSettingsBtn = new QPushButton(this);
|
||||
#else
|
||||
m_captureFilterSettingsBtn = 0;
|
||||
#endif
|
||||
|
||||
QPushButton* subfolderButton = new QPushButton(tr("Subfolder"), this);
|
||||
|
||||
|
@ -1341,11 +1346,13 @@ PencilTestPopup::PencilTestPopup()
|
|||
m_captureButton->setIcon(style.standardIcon(QStyle::SP_DialogOkButton));
|
||||
m_captureButton->setIconSize(QSize(30, 30));
|
||||
|
||||
m_captureFilterSettingsBtn->setObjectName("GearButton");
|
||||
m_captureFilterSettingsBtn->setFixedSize(23, 23);
|
||||
m_captureFilterSettingsBtn->setIconSize(QSize(15, 15));
|
||||
m_captureFilterSettingsBtn->setToolTip(tr("Options"));
|
||||
m_captureFilterSettingsBtn->setMenu(createOptionsMenu());
|
||||
if (m_captureFilterSettingsBtn) {
|
||||
m_captureFilterSettingsBtn->setObjectName("GearButton");
|
||||
m_captureFilterSettingsBtn->setFixedSize(23, 23);
|
||||
m_captureFilterSettingsBtn->setIconSize(QSize(15, 15));
|
||||
m_captureFilterSettingsBtn->setToolTip(tr("Options"));
|
||||
m_captureFilterSettingsBtn->setMenu(createOptionsMenu());
|
||||
}
|
||||
|
||||
subfolderButton->setObjectName("SubfolderButton");
|
||||
subfolderButton->setIconSize(QSize(15, 15));
|
||||
|
@ -1540,15 +1547,15 @@ PencilTestPopup::PencilTestPopup()
|
|||
bool ret = true;
|
||||
ret = ret && connect(refreshCamListButton, SIGNAL(pressed()), this,
|
||||
SLOT(refreshCameraList()));
|
||||
ret = ret && connect(m_cameraListCombo, SIGNAL(activated(int)), this,
|
||||
ret = ret && connect(m_cameraListCombo, SIGNAL(activated(int)), this,
|
||||
SLOT(onCameraListComboActivated(int)));
|
||||
ret = ret && connect(m_resolutionCombo, SIGNAL(activated(int)), this,
|
||||
ret = ret && connect(m_resolutionCombo, SIGNAL(activated(int)), this,
|
||||
SLOT(onResolutionComboActivated()));
|
||||
ret = ret && connect(m_fileFormatOptionButton, SIGNAL(pressed()), this,
|
||||
ret = ret && connect(m_fileFormatOptionButton, SIGNAL(pressed()), this,
|
||||
SLOT(onFileFormatOptionButtonPressed()));
|
||||
ret = ret && connect(m_levelNameEdit, SIGNAL(levelNameEdited()), this,
|
||||
ret = ret && connect(m_levelNameEdit, SIGNAL(levelNameEdited()), this,
|
||||
SLOT(onLevelNameEdited()));
|
||||
ret = ret &&
|
||||
ret = ret &&
|
||||
connect(nextLevelButton, SIGNAL(pressed()), this, SLOT(onNextName()));
|
||||
ret = ret && connect(m_previousLevelButton, SIGNAL(pressed()), this,
|
||||
SLOT(onPreviousName()));
|
||||
|
@ -1925,6 +1932,7 @@ void PencilTestPopup::onTimeout() { getWebcamImage(); }
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
int PencilTestPopup::translateIndex(int camIndex) {
|
||||
#ifdef WIN32
|
||||
// We are using Qt to get the camera info and supported resolutions, but
|
||||
// we are using OpenCV to actually get the images.
|
||||
// The camera index from OpenCV and from Qt don't always agree,
|
||||
|
@ -2000,6 +2008,8 @@ int PencilTestPopup::translateIndex(int camIndex) {
|
|||
}
|
||||
// clean
|
||||
CLEAN_ATTRIBUTES()
|
||||
#endif
|
||||
return camIndex;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -2012,6 +2022,7 @@ void PencilTestPopup::getWebcamImage() {
|
|||
if (m_cvWebcam.isOpened() == false) {
|
||||
if (m_cameraListCombo->currentIndex() <= 0) return;
|
||||
int camIndex = m_cameraListCombo->currentIndex() - 1;
|
||||
#ifdef WIN32
|
||||
if (!m_useDirectShow) {
|
||||
// the webcam order obtained from Qt isn't always the same order as
|
||||
// the one obtained from OpenCV without DirectShow
|
||||
|
@ -2019,6 +2030,9 @@ void PencilTestPopup::getWebcamImage() {
|
|||
} else {
|
||||
m_cvWebcam.open(camIndex, cv::CAP_DSHOW);
|
||||
}
|
||||
#else
|
||||
m_cvWebcam.open(translateIndex(camIndex));
|
||||
#endif
|
||||
// mjpg is used by many webcams
|
||||
// opencv runs very slow on some webcams without it.
|
||||
if (m_useMjpg) {
|
||||
|
@ -2438,8 +2452,9 @@ bool PencilTestPopup::importImage(QImage image) {
|
|||
|
||||
/* if the loaded level does not match in pixel size, then return */
|
||||
sl = level->getSimpleLevel();
|
||||
if (!sl || sl->getProperties()->getImageRes() !=
|
||||
TDimension(image.width(), image.height())) {
|
||||
if (!sl ||
|
||||
sl->getProperties()->getImageRes() !=
|
||||
TDimension(image.width(), image.height())) {
|
||||
error(tr(
|
||||
"The captured image size does not match with the existing level."));
|
||||
return false;
|
||||
|
@ -2464,7 +2479,7 @@ bool PencilTestPopup::importImage(QImage image) {
|
|||
else {
|
||||
TXshLevel* level = scene->createNewLevel(OVL_XSHLEVEL, levelName,
|
||||
TDimension(), 0, levelFp);
|
||||
sl = level->getSimpleLevel();
|
||||
sl = level->getSimpleLevel();
|
||||
sl->setPath(levelFp, true);
|
||||
sl->getProperties()->setDpiPolicy(LevelProperties::DP_CustomDpi);
|
||||
TPointD dpi;
|
||||
|
@ -2653,7 +2668,7 @@ void PencilTestPopup::refreshFrameInfo() {
|
|||
|
||||
// frame existence
|
||||
TFilePath frameFp(actualLevelFp.withFrame(frameNumber));
|
||||
bool frameExist = false;
|
||||
bool frameExist = false;
|
||||
if (levelExist) frameExist = TFileStatus(frameFp).doesExist();
|
||||
|
||||
// reset acceptable camera size
|
||||
|
|
|
@ -781,9 +781,8 @@ SceneViewer::SceneViewer(ImageUtils::FullScreenWidget *parent)
|
|||
, m_isBusyOnTabletMove(false) {
|
||||
m_visualSettings.m_sceneProperties =
|
||||
TApp::instance()->getCurrentScene()->getScene()->getProperties();
|
||||
#ifdef WITH_STOPMOTION
|
||||
m_stopMotion = StopMotion::instance();
|
||||
#endif
|
||||
|
||||
// Enables multiple key input.
|
||||
setAttribute(Qt::WA_KeyCompression);
|
||||
// Enables input methods for Asian languages.
|
||||
|
@ -1146,38 +1145,34 @@ double SceneViewer::getHGuide(int index) { return m_hRuler->getGuide(index); }
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void SceneViewer::onNewStopMotionImageReady() {
|
||||
#ifdef WITH_STOPMOTION
|
||||
if (m_stopMotion->m_hasLineUpImage) {
|
||||
// if (m_hasStopMotionLineUpImage) delete m_stopMotionLineUpImage;
|
||||
// is there a way to do this without cloning the image twice?
|
||||
// TRasterImageP image = m_stopMotion->m_lineUpImage->clone();
|
||||
m_stopMotionLineUpImage =
|
||||
(TRasterImageP)m_stopMotion->m_lineUpImage->clone();
|
||||
// m_stopMotionLineUpImage = (TRasterImage *)image->cloneImage();
|
||||
m_stopMotionLineUpImage->setDpi(m_stopMotion->m_liveViewDpi.x,
|
||||
m_stopMotion->m_liveViewDpi.y);
|
||||
m_hasStopMotionLineUpImage = true;
|
||||
}
|
||||
if (m_stopMotion->m_hasLiveViewImage) {
|
||||
// if (m_hasStopMotionImage) delete m_stopMotionImage;
|
||||
// is there a way to do this without cloning the image twice?
|
||||
// TRasterImageP image = m_stopMotion->m_liveViewImage->clone();
|
||||
m_stopMotionImage = m_stopMotion->m_liveViewImage->clone();
|
||||
// m_stopMotionImage = (TRasterImage *)image->cloneImage();
|
||||
m_stopMotionImage->setDpi(m_stopMotion->m_liveViewDpi.x,
|
||||
m_stopMotion->m_liveViewDpi.y);
|
||||
m_hasStopMotionImage = true;
|
||||
if (m_stopMotion->m_pickLiveViewZoom) {
|
||||
if (m_stopMotion->m_canon->m_pickLiveViewZoom) {
|
||||
setToolCursor(this, ToolCursor::ZoomCursor);
|
||||
}
|
||||
onSceneChanged();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void SceneViewer::onStopMotionLiveViewStopped() { onSceneChanged(); }
|
||||
void SceneViewer::onStopMotionLiveViewStopped() {
|
||||
m_hasStopMotionImage = false;
|
||||
m_hasStopMotionLineUpImage = false;
|
||||
onSceneChanged();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void SceneViewer::initializeGL() {
|
||||
|
@ -1589,6 +1584,41 @@ void SceneViewer::drawOverlay() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_CANON
|
||||
if (m_stopMotion->m_liveViewStatus == StopMotion::LiveViewOpen &&
|
||||
app->getCurrentFrame()->getFrame() ==
|
||||
m_stopMotion->getXSheetFrameNumber() - 1) {
|
||||
int x0, x1, y0, y1;
|
||||
rect().getCoords(&x0, &y0, &x1, &y1);
|
||||
x0 = (-(x1 / 2)) + 15;
|
||||
y0 = ((y1 / 2)) - 15;
|
||||
tglDrawDisk(TPointD(x0, y0), 10);
|
||||
}
|
||||
|
||||
// draw Stop Motion Zoom Box
|
||||
if (m_stopMotion->m_liveViewStatus == 2 &&
|
||||
m_stopMotion->m_canon->m_pickLiveViewZoom) {
|
||||
glPushMatrix();
|
||||
tglMultMatrix(m_drawCameraAff);
|
||||
m_pixelSize = sqrt(tglGetPixelSize2()) * getDevPixRatio();
|
||||
TRect rect = m_stopMotion->m_canon->m_zoomRect;
|
||||
|
||||
glColor3d(1.0, 0.0, 0.0);
|
||||
|
||||
// border
|
||||
glBegin(GL_LINE_STRIP);
|
||||
glVertex2d(rect.x0, rect.y0);
|
||||
glVertex2d(rect.x0, rect.y1 - m_pixelSize);
|
||||
glVertex2d(rect.x1 - m_pixelSize, rect.y1 - m_pixelSize);
|
||||
glVertex2d(rect.x1 - m_pixelSize, rect.y0);
|
||||
glVertex2d(rect.x0, rect.y0);
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// safe area
|
||||
if (safeAreaToggle.getStatus() && m_drawEditingLevel == false &&
|
||||
!is3DView()) {
|
||||
|
@ -1884,6 +1914,8 @@ void SceneViewer::drawScene() {
|
|||
} else
|
||||
xr = std::make_pair(xsh, frame);
|
||||
|
||||
TFrameHandle *frameHandle = TApp::instance()->getCurrentFrame();
|
||||
|
||||
Stage::VisitArgs args;
|
||||
args.m_scene = scene;
|
||||
args.m_xsh = xr.first;
|
||||
|
@ -1903,6 +1935,61 @@ void SceneViewer::drawScene() {
|
|||
args.m_guidedBackStroke = guidedBackStroke;
|
||||
|
||||
// args.m_currentFrameId = app->getCurrentFrame()->getFid();
|
||||
|
||||
if (m_stopMotion->m_alwaysUseLiveViewImages &&
|
||||
m_stopMotion->m_liveViewStatus > 0 &&
|
||||
frame != m_stopMotion->getXSheetFrameNumber() - 1 &&
|
||||
m_hasStopMotionImage && !m_stopMotion->m_reviewTimer->isActive()) {
|
||||
TRaster32P image;
|
||||
bool hasImage = m_stopMotion->loadLiveViewImage(frame, image);
|
||||
if (hasImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
smPlayer.m_opacity = 255;
|
||||
smPlayer.m_sl = m_stopMotion->m_sl;
|
||||
args.m_liveViewImage = static_cast<TRasterImageP>(image);
|
||||
args.m_liveViewPlayer = smPlayer;
|
||||
// painter.onRasterImage(static_cast<TRasterImageP>(image).getPointer(),
|
||||
// smPlayer);
|
||||
}
|
||||
}
|
||||
if (//!m_stopMotion->m_drawBeneathLevels &&
|
||||
m_stopMotion->m_liveViewStatus == 2 &&
|
||||
( //! frameHandle->isPlaying() ||
|
||||
frame == m_stopMotion->getXSheetFrameNumber() - 1)) {
|
||||
if (m_hasStopMotionLineUpImage && m_stopMotion->m_showLineUpImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionLineUpImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
smPlayer.m_opacity = 255;
|
||||
smPlayer.m_sl = m_stopMotion->m_sl;
|
||||
args.m_lineupImage = m_stopMotionLineUpImage;
|
||||
args.m_lineupPlayer = smPlayer;
|
||||
// painter.onRasterImage(m_stopMotionLineUpImage.getPointer(),
|
||||
// smPlayer);
|
||||
}
|
||||
if (m_hasStopMotionImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
bool hide_opacity = false;
|
||||
#ifdef WITH_CANON
|
||||
hide_opacity = m_stopMotion->m_canon->m_zooming ||
|
||||
m_stopMotion->m_canon->m_pickLiveViewZoom ||
|
||||
!m_hasStopMotionLineUpImage;
|
||||
#endif
|
||||
smPlayer.m_opacity = hide_opacity ? 255.0 : m_stopMotion->getOpacity();
|
||||
smPlayer.m_sl = m_stopMotion->m_sl;
|
||||
args.m_liveViewImage = m_stopMotionImage;
|
||||
args.m_liveViewPlayer = smPlayer;
|
||||
// painter.onRasterImage(m_stopMotionImage.getPointer(), smPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
Stage::visit(painter, args);
|
||||
|
||||
m_minZ = painter.getMinZ();
|
||||
|
@ -1930,6 +2017,7 @@ void SceneViewer::drawScene() {
|
|||
->isShowRasterImagesDarkenBlendedInViewerEnabled());
|
||||
|
||||
TFrameHandle *frameHandle = TApp::instance()->getCurrentFrame();
|
||||
|
||||
if (app->getCurrentFrame()->isEditingLevel()) {
|
||||
Stage::visit(painter, app->getCurrentLevel()->getLevel(),
|
||||
app->getCurrentFrame()->getFid(),
|
||||
|
@ -1963,32 +2051,63 @@ void SceneViewer::drawScene() {
|
|||
args.m_guidedFrontStroke = guidedFrontStroke;
|
||||
args.m_guidedBackStroke = guidedBackStroke;
|
||||
|
||||
if (m_stopMotion->m_alwaysUseLiveViewImages &&
|
||||
m_stopMotion->m_liveViewStatus > 0 &&
|
||||
frame != m_stopMotion->getXSheetFrameNumber() - 1 &&
|
||||
m_hasStopMotionImage && !m_stopMotion->m_reviewTimer->isActive()) {
|
||||
TRaster32P image;
|
||||
bool hasImage = m_stopMotion->loadLiveViewImage(frame, image);
|
||||
if (hasImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
smPlayer.m_opacity = 255;
|
||||
smPlayer.m_sl = m_stopMotion->m_sl;
|
||||
args.m_liveViewImage = static_cast<TRasterImageP>(image);
|
||||
args.m_liveViewPlayer = smPlayer;
|
||||
// painter.onRasterImage(static_cast<TRasterImageP>(image).getPointer(),
|
||||
// smPlayer);
|
||||
}
|
||||
}
|
||||
if (//!m_stopMotion->m_drawBeneathLevels &&
|
||||
m_stopMotion->m_liveViewStatus == 2 &&
|
||||
( //! frameHandle->isPlaying() ||
|
||||
frame == m_stopMotion->getXSheetFrameNumber() - 1)) {
|
||||
if (m_hasStopMotionLineUpImage && m_stopMotion->m_showLineUpImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionLineUpImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
smPlayer.m_opacity = 255;
|
||||
smPlayer.m_sl = m_stopMotion->m_sl;
|
||||
args.m_lineupImage = m_stopMotionLineUpImage;
|
||||
args.m_lineupPlayer = smPlayer;
|
||||
// painter.onRasterImage(m_stopMotionLineUpImage.getPointer(),
|
||||
// smPlayer);
|
||||
}
|
||||
if (m_hasStopMotionImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
bool hide_opacity = false;
|
||||
#ifdef WITH_CANON
|
||||
hide_opacity = m_stopMotion->m_canon->m_zooming ||
|
||||
m_stopMotion->m_canon->m_pickLiveViewZoom ||
|
||||
!m_hasStopMotionLineUpImage;
|
||||
#endif
|
||||
smPlayer.m_opacity =
|
||||
hide_opacity ? 255.0 : m_stopMotion->getOpacity();
|
||||
smPlayer.m_sl = m_stopMotion->m_sl;
|
||||
args.m_liveViewImage = m_stopMotionImage;
|
||||
args.m_liveViewPlayer = smPlayer;
|
||||
// painter.onRasterImage(m_stopMotionImage.getPointer(), smPlayer);
|
||||
}
|
||||
}
|
||||
Stage::visit(painter, args);
|
||||
}
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
if (!frameHandle->isPlaying() && m_stopMotion->m_liveViewStatus == 2) {
|
||||
if (m_hasStopMotionLineUpImage && m_stopMotion->m_showLineUpImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionLineUpImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
smPlayer.m_opacity = 255;
|
||||
painter.onRasterImage(m_stopMotionLineUpImage.getPointer(), smPlayer);
|
||||
}
|
||||
if (m_hasStopMotionImage) {
|
||||
Stage::Player smPlayer;
|
||||
double dpiX, dpiY;
|
||||
m_stopMotionImage->getDpi(dpiX, dpiY);
|
||||
smPlayer.m_dpiAff = TScale(Stage::inch / dpiX, Stage::inch / dpiY);
|
||||
bool hide_opacity =
|
||||
m_stopMotion->m_zooming || m_stopMotion->m_pickLiveViewZoom;
|
||||
smPlayer.m_opacity = hide_opacity ? 255.0 : m_stopMotion->getOpacity();
|
||||
painter.onRasterImage(m_stopMotionImage.getPointer(), smPlayer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(glGetError() == 0);
|
||||
painter.flushRasterImages();
|
||||
|
||||
|
|
|
@ -16,10 +16,7 @@
|
|||
#include "comboviewerpane.h"
|
||||
#include "locatorpopup.h"
|
||||
#include "cellselection.h"
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
#include "stopmotion.h"
|
||||
#endif
|
||||
|
||||
// TnzQt includes
|
||||
#include "toonzqt/tselectionhandle.h"
|
||||
|
@ -505,7 +502,7 @@ void SceneViewer::onMove(const TMouseEvent &event) {
|
|||
cursorSet = true;
|
||||
setToolCursor(this, ToolCursor::ScaleHCursor);
|
||||
} else if (std::abs((height() - curPos.y()) -
|
||||
height() * m_compareSettings.m_compareY) < 20) {
|
||||
height() * m_compareSettings.m_compareY) < 20) {
|
||||
cursorSet = true;
|
||||
setToolCursor(this, ToolCursor::ScaleVCursor);
|
||||
}
|
||||
|
@ -574,6 +571,15 @@ void SceneViewer::onMove(const TMouseEvent &event) {
|
|||
TPointD worldPos = winToWorld(curPos);
|
||||
TPointD pos = tool->getMatrix().inv() * worldPos;
|
||||
|
||||
#ifdef WITH_CANON
|
||||
// grab screen picking for stop motion live view zoom
|
||||
if ((event.buttons() & Qt::LeftButton) &&
|
||||
StopMotion::instance()->m_canon->m_pickLiveViewZoom) {
|
||||
StopMotion::instance()->m_canon->makeZoomPoint(pos);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_locator) {
|
||||
m_locator->onChangeViewAff(worldPos);
|
||||
}
|
||||
|
@ -610,8 +616,8 @@ void SceneViewer::onMove(const TMouseEvent &event) {
|
|||
}
|
||||
if (!cursorSet) setToolCursor(this, tool->getCursorId());
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
if (StopMotion::instance()->m_pickLiveViewZoom)
|
||||
#ifdef WITH_CANON
|
||||
if (StopMotion::instance()->m_canon->m_pickLiveViewZoom)
|
||||
setToolCursor(this, ToolCursor::ZoomCursor);
|
||||
#endif
|
||||
m_pos = curPos;
|
||||
|
@ -714,7 +720,7 @@ void SceneViewer::onPress(const TMouseEvent &event) {
|
|||
m_tabletState = None;
|
||||
return;
|
||||
} else if (std::abs((height() - m_pos.y()) -
|
||||
height() * m_compareSettings.m_compareY) < 20) {
|
||||
height() * m_compareSettings.m_compareY) < 20) {
|
||||
m_compareSettings.m_dragCompareY = true;
|
||||
m_compareSettings.m_dragCompareX = false;
|
||||
m_compareSettings.m_compareX = ImagePainter::DefaultCompareValue;
|
||||
|
@ -756,13 +762,11 @@ void SceneViewer::onPress(const TMouseEvent &event) {
|
|||
pos.y /= m_dpiScale.y;
|
||||
}
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
#ifdef WITH_CANON
|
||||
// grab screen picking for stop motion live view zoom
|
||||
if (StopMotion::instance()->m_pickLiveViewZoom) {
|
||||
StopMotion::instance()->m_pickLiveViewZoom = false;
|
||||
StopMotion::instance()->makeZoomPoint(pos);
|
||||
if (tool) setToolCursor(this, tool->getCursorId());
|
||||
if (m_mouseButton != Qt::RightButton) return;
|
||||
if (StopMotion::instance()->m_canon->m_pickLiveViewZoom) {
|
||||
StopMotion::instance()->m_canon->makeZoomPoint(pos);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1176,6 +1180,53 @@ bool SceneViewer::event(QEvent *e) {
|
|||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
int key = 0;
|
||||
if (e->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(e);
|
||||
key = keyEvent->key();
|
||||
#ifdef WITH_CANON
|
||||
if ((m_stopMotion->m_canon->m_pickLiveViewZoom ||
|
||||
m_stopMotion->m_canon->m_zooming) &&
|
||||
(key == Qt::Key_Left || key == Qt::Key_Right || key == Qt::Key_Up ||
|
||||
key == Qt::Key_Down || key == Qt::Key_2 || key == Qt::Key_4 ||
|
||||
key == Qt::Key_6 || key == Qt::Key_8)) {
|
||||
if (m_stopMotion->m_canon->m_liveViewZoomReadyToPick == true) {
|
||||
if (key == Qt::Key_Left || key == Qt::Key_4) {
|
||||
m_stopMotion->m_canon->m_liveViewZoomPickPoint.x -= 10;
|
||||
}
|
||||
if (key == Qt::Key_Right || key == Qt::Key_6) {
|
||||
m_stopMotion->m_canon->m_liveViewZoomPickPoint.x += 10;
|
||||
}
|
||||
if (key == Qt::Key_Up || key == Qt::Key_8) {
|
||||
m_stopMotion->m_canon->m_liveViewZoomPickPoint.y += 10;
|
||||
}
|
||||
if (key == Qt::Key_Down || key == Qt::Key_2) {
|
||||
m_stopMotion->m_canon->m_liveViewZoomPickPoint.y -= 10;
|
||||
}
|
||||
if (m_stopMotion->m_canon->m_zooming) {
|
||||
m_stopMotion->m_canon->setZoomPoint();
|
||||
}
|
||||
}
|
||||
m_stopMotion->m_canon->calculateZoomPoint();
|
||||
e->accept();
|
||||
return true;
|
||||
} else if (m_stopMotion->m_canon->m_pickLiveViewZoom &&
|
||||
(key == Qt::Key_Escape || key == Qt::Key_Enter ||
|
||||
key == Qt::Key_Return)) {
|
||||
m_stopMotion->m_canon->toggleZoomPicking();
|
||||
e->accept();
|
||||
return true;
|
||||
} else
|
||||
#endif
|
||||
if (m_stopMotion->m_liveViewStatus == 2 &&
|
||||
(key == Qt::Key_Enter || key == Qt::Key_Return)) {
|
||||
m_stopMotion->captureImage();
|
||||
e->accept();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (e->type() == QEvent::Gesture &&
|
||||
CommandManager::instance()
|
||||
->getAction(MI_TouchGestureControl)
|
||||
|
|
|
@ -227,6 +227,7 @@ ShortcutTree::ShortcutTree(QWidget *parent) : QTreeWidget(parent) {
|
|||
|
||||
addFolder(tr("Tools"), ToolCommandType);
|
||||
addFolder(tr("Tool Modifiers"), ToolModifierCommandType);
|
||||
addFolder(tr("Stop Motion"), StopMotionCommandType);
|
||||
addFolder(tr("Visualization"), ZoomCommandType);
|
||||
addFolder(tr("Misc"), MiscCommandType);
|
||||
addFolder(tr("RGBA Channels"), RGBACommandType);
|
||||
|
|
|
@ -23,12 +23,8 @@
|
|||
#include "comboviewerpane.h"
|
||||
#include "historypane.h"
|
||||
#include "cleanupsettingspane.h"
|
||||
|
||||
#include "vectorguideddrawingpane.h"
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
#include "stopmotioncontroller.h"
|
||||
#endif
|
||||
|
||||
#ifdef LINETEST
|
||||
#include "linetestpane.h"
|
||||
|
@ -1309,47 +1305,45 @@ OpenFloatingPanel openComboViewerCommand(MI_OpenComboViewer, "ComboViewer",
|
|||
// SceneViewer
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
SceneViewerPanelContainer::SceneViewerPanelContainer(QWidget* parent)
|
||||
SceneViewerPanelContainer::SceneViewerPanelContainer(QWidget *parent)
|
||||
: StyleShortcutSwitchablePanel(parent) {
|
||||
m_sceneViewer = new SceneViewerPanel(parent);
|
||||
setFocusProxy(m_sceneViewer);
|
||||
setWidget(m_sceneViewer);
|
||||
m_sceneViewer = new SceneViewerPanel(parent);
|
||||
setFocusProxy(m_sceneViewer);
|
||||
setWidget(m_sceneViewer);
|
||||
|
||||
m_sceneViewer->initializeTitleBar(getTitleBar());
|
||||
m_sceneViewer->initializeTitleBar(getTitleBar());
|
||||
}
|
||||
// reimplementation of TPanel::widgetInThisPanelIsFocused
|
||||
bool SceneViewerPanelContainer::widgetInThisPanelIsFocused() {
|
||||
return m_sceneViewer->hasFocus();
|
||||
return m_sceneViewer->hasFocus();
|
||||
}
|
||||
// reimplementation of TPanel::widgetFocusOnEnter
|
||||
void SceneViewerPanelContainer::widgetFocusOnEnter() {
|
||||
m_sceneViewer->onEnterPanel();
|
||||
m_sceneViewer->onEnterPanel();
|
||||
}
|
||||
void SceneViewerPanelContainer::widgetClearFocusOnLeave() {
|
||||
m_sceneViewer->onLeavePanel();
|
||||
m_sceneViewer->onLeavePanel();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class SceneViewerFactory final : public TPanelFactory {
|
||||
public:
|
||||
SceneViewerFactory() : TPanelFactory("SceneViewer") {}
|
||||
SceneViewerFactory() : TPanelFactory("SceneViewer") {}
|
||||
|
||||
TPanel* createPanel(QWidget* parent) override {
|
||||
SceneViewerPanelContainer* panel = new SceneViewerPanelContainer(parent);
|
||||
panel->setObjectName(getPanelType());
|
||||
panel->setWindowTitle(QObject::tr("Viewer"));
|
||||
panel->setMinimumSize(220, 280);
|
||||
//panel->resize(700, 600);
|
||||
return panel;
|
||||
}
|
||||
void initialize(TPanel* panel) override { assert(0); }
|
||||
TPanel *createPanel(QWidget *parent) override {
|
||||
SceneViewerPanelContainer *panel = new SceneViewerPanelContainer(parent);
|
||||
panel->setObjectName(getPanelType());
|
||||
panel->setWindowTitle(QObject::tr("Viewer"));
|
||||
panel->setMinimumSize(220, 280);
|
||||
return panel;
|
||||
}
|
||||
void initialize(TPanel *panel) override { assert(0); }
|
||||
} sceneViewerFactory;
|
||||
|
||||
//=============================================================================
|
||||
OpenFloatingPanel openSceneViewerCommand(MI_OpenLevelView, "SceneViewer",
|
||||
QObject::tr("Viewer"));
|
||||
QObject::tr("Viewer"));
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//=============================================================================
|
||||
|
@ -1393,7 +1387,6 @@ OpenFloatingPanel openHistoryPanelCommand(MI_OpenHistoryPanel, "HistoryPanel",
|
|||
QObject::tr("History"));
|
||||
//=============================================================================
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
//=============================================================================
|
||||
// StopMotion Controller
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1410,6 +1403,8 @@ public:
|
|||
panel->setWidget(stopMotionController);
|
||||
panel->setWindowTitle(QObject::tr("Stop Motion Controller"));
|
||||
panel->setIsMaximizable(false);
|
||||
panel->setMinimumWidth(320);
|
||||
panel->setMaximumWidth(350);
|
||||
}
|
||||
} stopMotionPanelFactory;
|
||||
|
||||
|
@ -1419,8 +1414,6 @@ OpenFloatingPanel openStopMotionPanelCommand(
|
|||
QObject::tr("Stop Motion Controller"));
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
// FxSettings
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -371,7 +371,6 @@ void RowArea::drawCurrentRowGadget(QPainter &p, int r0, int r1) {
|
|||
p.fillRect(header, m_viewer->getCurrentRowBgColor());
|
||||
}
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void RowArea::drawStopMotionCameraIndicator(QPainter &p) {
|
||||
|
@ -389,7 +388,6 @@ void RowArea::drawStopMotionCameraIndicator(QPainter &p) {
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
void RowArea::drawOnionSkinBackground(QPainter &p, int r0, int r1) {
|
||||
const Orientation *o = m_viewer->orientation();
|
||||
|
@ -849,15 +847,11 @@ void RowArea::paintEvent(QPaintEvent *event) {
|
|||
// current frame
|
||||
drawCurrentRowGadget(p, r0, r1);
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
StopMotion *stopMotion = StopMotion::instance();
|
||||
if (stopMotion->getPlaceOnXSheet() &&
|
||||
(stopMotion->m_liveViewStatus > 0)) {
|
||||
if (stopMotion->getPlaceOnXSheet() && (stopMotion->m_liveViewStatus > 0)) {
|
||||
drawStopMotionCameraIndicator(p);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (TApp::instance()->getCurrentFrame()->isEditingScene() &&
|
||||
Preferences::instance()->isCurrentTimelineIndicatorEnabled() &&
|
||||
!m_viewer->orientation()->isVerticalTimeline())
|
||||
|
|
|
@ -54,10 +54,7 @@ class RowArea final : public QWidget {
|
|||
void drawCurrentTimeIndicator(QPainter &p);
|
||||
void drawCurrentTimeLine(QPainter &p);
|
||||
void drawShiftTraceMarker(QPainter &p);
|
||||
|
||||
#ifdef WITH_STOPMOTION
|
||||
void drawStopMotionCameraIndicator(QPainter &p);
|
||||
#endif
|
||||
|
||||
DragTool *getDragTool() const;
|
||||
void setDragTool(DragTool *dragTool);
|
||||
|
|
|
@ -212,6 +212,11 @@ public:
|
|||
|
||||
const ImagePainter::VisualSettings *m_vs;
|
||||
|
||||
TRasterImageP m_liveViewImage;
|
||||
TRasterImageP m_lineupImage;
|
||||
Stage::Player m_liveViewPlayer;
|
||||
Stage::Player m_lineupPlayer;
|
||||
|
||||
public:
|
||||
StageBuilder();
|
||||
virtual ~StageBuilder();
|
||||
|
@ -361,7 +366,21 @@ void StageBuilder::addCell(PlayerSet &players, ToonzScene *scene, TXsheet *xsh,
|
|||
|
||||
TXshCell cell = xsh->getCell(row, col);
|
||||
TXshLevel *xl = cell.m_level.getPointer();
|
||||
if (!xl) return;
|
||||
// check the previous row for a stop motion layer
|
||||
if (!xl) {
|
||||
cell = xsh->getCell(row - 1, col);
|
||||
xl = cell.m_level.getPointer();
|
||||
if (!xl) {
|
||||
return;
|
||||
} else {
|
||||
xl = cell.m_level.getPointer();
|
||||
TXshSimpleLevel *sl = xl->getSimpleLevel();
|
||||
if (sl && m_liveViewImage && sl == m_liveViewPlayer.m_sl) {
|
||||
row -= 1;
|
||||
} else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ZPlacement cameraPlacement;
|
||||
if (m_subXSheetStack.empty())
|
||||
|
@ -801,7 +820,7 @@ void StageBuilder::addSimpleLevelFrame(PlayerSet &players,
|
|||
player.m_frame = level->guessIndex(fid);
|
||||
player.m_fid = fid;
|
||||
if (!m_onionSkinMask.isEmpty() && m_onionSkinMask.isEnabled())
|
||||
player.m_onionSkinDistance = 0;
|
||||
player.m_onionSkinDistance = 0;
|
||||
player.m_isCurrentColumn = true;
|
||||
player.m_isCurrentXsheetLevel = true;
|
||||
player.m_isEditingLevel = true;
|
||||
|
@ -813,8 +832,9 @@ void StageBuilder::addSimpleLevelFrame(PlayerSet &players,
|
|||
|
||||
void StageBuilder::visit(PlayerSet &players, Visitor &visitor, bool isPlaying) {
|
||||
std::vector<int> masks;
|
||||
int m = players.size();
|
||||
int h = 0;
|
||||
int m = players.size();
|
||||
int h = 0;
|
||||
bool stopMotionShown = false;
|
||||
for (; h < m; h++) {
|
||||
Player &player = players[h];
|
||||
unsigned int i = 0;
|
||||
|
@ -838,7 +858,30 @@ void StageBuilder::visit(PlayerSet &players, Visitor &visitor, bool isPlaying) {
|
|||
}
|
||||
}
|
||||
player.m_isPlaying = isPlaying;
|
||||
visitor.onImage(player);
|
||||
if (m_liveViewImage && player.m_sl == m_liveViewPlayer.m_sl) {
|
||||
if (m_lineupImage) {
|
||||
m_lineupPlayer.m_sl = NULL;
|
||||
visitor.onRasterImage(m_lineupImage.getPointer(), m_lineupPlayer);
|
||||
stopMotionShown = true;
|
||||
}
|
||||
if (m_liveViewImage) {
|
||||
m_liveViewPlayer.m_sl = NULL;
|
||||
visitor.onRasterImage(m_liveViewImage.getPointer(), m_liveViewPlayer);
|
||||
stopMotionShown = true;
|
||||
}
|
||||
} else {
|
||||
visitor.onImage(player);
|
||||
}
|
||||
}
|
||||
if (!stopMotionShown && (m_liveViewImage || m_lineupImage)) {
|
||||
if (m_lineupImage) {
|
||||
m_lineupPlayer.m_sl = NULL;
|
||||
visitor.onRasterImage(m_lineupImage.getPointer(), m_lineupPlayer);
|
||||
}
|
||||
if (m_liveViewImage) {
|
||||
m_liveViewPlayer.m_sl = NULL;
|
||||
visitor.onRasterImage(m_liveViewImage.getPointer(), m_liveViewPlayer);
|
||||
}
|
||||
}
|
||||
// vale solo per TAB pro
|
||||
for (h = 0; h < (int)masks.size(); h++) visitor.disableMask();
|
||||
|
@ -877,6 +920,14 @@ void Stage::visit(Visitor &visitor, const VisitArgs &args) {
|
|||
sb.m_isGuidedDrawingEnabled = args.m_isGuidedDrawingEnabled;
|
||||
sb.m_guidedFrontStroke = args.m_guidedFrontStroke;
|
||||
sb.m_guidedBackStroke = args.m_guidedBackStroke;
|
||||
if (args.m_liveViewImage) {
|
||||
sb.m_liveViewImage = args.m_liveViewImage;
|
||||
sb.m_liveViewPlayer = args.m_liveViewPlayer;
|
||||
}
|
||||
if (args.m_lineupImage) {
|
||||
sb.m_lineupImage = args.m_lineupImage;
|
||||
sb.m_lineupPlayer = args.m_lineupPlayer;
|
||||
}
|
||||
Player::m_onionSkinFrontSize = 0;
|
||||
Player::m_onionSkinBackSize = 0;
|
||||
Player::m_firstFrontOnionSkin = 0;
|
||||
|
|
|
@ -920,7 +920,6 @@ void TXshSimpleLevel::loadData(TIStream &is) {
|
|||
if (is.getTagParam("isStopMotionLevel", v))
|
||||
isStopMotionLevel = std::stoi(v);
|
||||
|
||||
|
||||
m_properties->setDpiPolicy(dpiPolicy);
|
||||
m_properties->setDpi(TPointD(xdpi, ydpi));
|
||||
m_properties->setSubsampling(subsampling);
|
||||
|
@ -1464,7 +1463,7 @@ void TXshSimpleLevel::save(const TFilePath &fp, const TFilePath &oldFp,
|
|||
// backup
|
||||
if (Preferences::instance()->isBackupEnabled() && dOldPath == dDstPath &&
|
||||
TSystem::doesExistFileOrLevel(dDstPath))
|
||||
saveBackup(dDstPath);
|
||||
if (!getProperties()->isStopMotionLevel()) saveBackup(dDstPath);
|
||||
|
||||
if (isAreadOnlyLevel(dDstPath)) {
|
||||
if (m_editableRange.empty() &&
|
||||
|
|
|
@ -424,7 +424,7 @@ void DockLayout::applyTransform(const QTransform &transform) {
|
|||
// check if the region will be with fixed width
|
||||
bool Region::checkWidgetsToBeFixedWidth(std::vector<QWidget *> &widgets) {
|
||||
if (m_item) {
|
||||
if ( (m_item->objectName() == "FilmStrip" && m_item->getCanFixWidth()) ||
|
||||
if ((m_item->objectName() == "FilmStrip" && m_item->getCanFixWidth()) ||
|
||||
m_item->objectName() == "StyleEditor") {
|
||||
widgets.push_back(m_item);
|
||||
return true;
|
||||
|
|
|
@ -189,7 +189,7 @@ protected:
|
|||
// Maximization
|
||||
bool m_maximized;
|
||||
|
||||
// Level Strip and Style Editor use a fixed width on
|
||||
// Level Strip and Style Editor use a fixed width on
|
||||
// window resize to minimize user frustration
|
||||
// This variable is only used by Level Strip right now.
|
||||
// This is only true if the level strip is vertical.
|
||||
|
|
|
@ -1712,6 +1712,13 @@ void FlipConsole::doButtonPressed(UINT button) {
|
|||
case eFilledRaster:
|
||||
return;
|
||||
|
||||
case eFlipHorizontal:
|
||||
case eFlipVertical:
|
||||
case eZoomIn:
|
||||
case eZoomOut:
|
||||
case eResetView:
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue