Fix brush hardness set and get.
This commit is contained in:
parent
d236673e51
commit
3225887464
2
.gitignore
vendored
2
.gitignore
vendored
@ -35,4 +35,4 @@ Makefile*
|
|||||||
|
|
||||||
# QtCtreator CMake
|
# QtCtreator CMake
|
||||||
CMakeLists.txt.user
|
CMakeLists.txt.user
|
||||||
|
*.blend1
|
||||||
|
13
changelog.md
13
changelog.md
@ -1,7 +1,18 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [Unreleased] - 2019-06-28
|
|
||||||
|
## [git] - 2020-10-07
|
||||||
|
### Changed
|
||||||
|
- (examples.blend) Upgrade blend to 2.83.5 (paste objects into a new file)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- (examples.blend) Turn on "Soft Shadows" render option to avoid
|
||||||
|
large aliasing artifacts on shadows.
|
||||||
|
- Calculate and change brush hardness correctly.
|
||||||
|
|
||||||
|
|
||||||
|
## [git] - 2019-06-28
|
||||||
- Add potential references from local directories.
|
- Add potential references from local directories.
|
||||||
- Add note regarding new documents to README.md.
|
- Add note regarding new documents to README.md.
|
||||||
- Name and sort documents better.
|
- Name and sort documents better.
|
||||||
|
Binary file not shown.
25
readme.md
25
readme.md
@ -1,8 +1,8 @@
|
|||||||
# RotoCanvas
|
# RotoCanvas
|
||||||
For now this repository serves as a collection of terminal commands for
|
For now this repository serves as a collection of terminal commands for
|
||||||
manipulating videos and DVDs, but if you can get the code working, let
|
manipulating videos and DVDs, but if you can get the code working, let
|
||||||
me know. I'll change this message if I make more progress. See [FFMpeg
|
me know. I'll change this message if I make more progress. See [FFmpeg
|
||||||
Notes](#FFMpeg Notes) below, and the "more" directory. Upstream ideas
|
Notes](#FFmpeg Notes) below, and the "more" directory. Upstream ideas
|
||||||
and code from "more" directory that are implemented will be moved to
|
and code from "more" directory that are implemented will be moved to
|
||||||
"references". Please read "Purpose" and "Why aren't there more
|
"references". Please read "Purpose" and "Why aren't there more
|
||||||
rotoscoping applications?" below before commenting on the code or
|
rotoscoping applications?" below before commenting on the code or
|
||||||
@ -192,6 +192,9 @@ rotoscoped out, there will be both the error and a corrected blotch
|
|||||||
that is the error's original position & shape), which in such cases
|
that is the error's original position & shape), which in such cases
|
||||||
would require redoing the rotoscoping.
|
would require redoing the rotoscoping.
|
||||||
|
|
||||||
|
### Alternate names
|
||||||
|
See "~/Nextcloud/d.cs/RotoCanvas/1.RotoCanvas (SEE GitHub instead).txt"
|
||||||
|
|
||||||
### Backends
|
### Backends
|
||||||
#### Python
|
#### Python
|
||||||
(Not Tried Yet)
|
(Not Tried Yet)
|
||||||
@ -205,6 +208,22 @@ would require redoing the rotoscoping.
|
|||||||
- <https://github.com/mattrobenolt/colors.py>: "Convert colors between
|
- <https://github.com/mattrobenolt/colors.py>: "Convert colors between
|
||||||
rgb, hsv, and hex, perform arithmetic, blend modes, and generate
|
rgb, hsv, and hex, perform arithmetic, blend modes, and generate
|
||||||
random colors within boundaries"
|
random colors within boundaries"
|
||||||
|
- VapourSynth
|
||||||
|
- Python equivalent to AviSynth
|
||||||
|
- has a cli tool for piping output into ffmpeg or other tools
|
||||||
|
- ffmpeg
|
||||||
|
- See also: the "ffmpeg Notes" section.
|
||||||
|
- Possibly bake changes to png files then overlay them onto the video
|
||||||
|
(to use frame rate from video automatically):
|
||||||
|
`ffmpeg -i foo.mkv -i bar%04d.png -filter_complex "[1:v]format=argb,geq=r='r(X,Y)':a='alpha(X,Y)'[zork]; [0:v][zork]overlay" -vcodec libx264 myresult.mkv`
|
||||||
|
- based on
|
||||||
|
<https://stackoverflow.com/questions/38753739/ffmpeg-overlay-a-png-image-on-a-video-with-custom-transparency>
|
||||||
|
answered Aug 3 '16 at 22:00 RocketNuts
|
||||||
|
- overall opacity can be multiplied by prepending a value such
|
||||||
|
as `0.5*`, for example: `a=0.5*'alpha(X,Y)'`
|
||||||
|
- For no custom opacity (only 2nd layer's alpha), simplify to the
|
||||||
|
line in the question at that link:
|
||||||
|
`ffmpeg -i foo.mkv -i bar.png -filter_complex "[0:v][1:v]overlay" -vcodec libx264 myresult.mkv`
|
||||||
|
|
||||||
### RotoCanvas Paint Notes
|
### RotoCanvas Paint Notes
|
||||||
* The save method is used by both the Save and the Save As actions. The
|
* The save method is used by both the Save and the Save As actions. The
|
||||||
@ -278,7 +297,7 @@ kind. Use this software at your own risk.*
|
|||||||
- or download and unzip **megui** to `C:\PortableApps\Video` and add
|
- or download and unzip **megui** to `C:\PortableApps\Video` and add
|
||||||
`C:\PortableApps\Video\megui\tools\mencoder` to your PATH.
|
`C:\PortableApps\Video\megui\tools\mencoder` to your PATH.
|
||||||
|
|
||||||
### FFMpeg Notes
|
### FFmpeg Notes
|
||||||
- For a program that has a narrow use case but has additional video
|
- For a program that has a narrow use case but has additional video
|
||||||
conversion commands embedded in the Python code as strings, see
|
conversion commands embedded in the Python code as strings, see
|
||||||
<https://github.com/poikilos/IntroCompatiblizer>.
|
<https://github.com/poikilos/IntroCompatiblizer>.
|
||||||
|
@ -538,9 +538,14 @@ void RotoCanvas::setBrushRadius(double newWidth)
|
|||||||
|
|
||||||
void RotoCanvas::setBrushHardness(double new_value)
|
void RotoCanvas::setBrushHardness(double new_value)
|
||||||
{
|
{
|
||||||
if (new_value>1.0) new_value=1.0;
|
// brushHardRadius is the part that is hard, 0 for softest brush.
|
||||||
else if (new_value<0.0) new_value=0.0f;
|
if (new_value > 1.0)
|
||||||
brushHardRadius = brushRadius-(brushRadius*(1.0-new_value));
|
new_value = 1.0;
|
||||||
|
else if (new_value < 0.0)
|
||||||
|
new_value = 0.0f;
|
||||||
|
brushHardRadius = brushRadius * new_value;
|
||||||
|
if (brushHardRadius < 0.0)
|
||||||
|
brushHardRadius = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RotoCanvas::setBrushOpacity(double new_value)
|
void RotoCanvas::setBrushOpacity(double new_value)
|
||||||
|
@ -48,13 +48,13 @@ public:
|
|||||||
QString getFramePath(int frameNumber);
|
QString getFramePath(int frameNumber);
|
||||||
|
|
||||||
static QString getFramePath(QString folderPath, QString seqName, int frameNumber, int minDigitCount, QString format);
|
static QString getFramePath(QString folderPath, QString seqName, int frameNumber, int minDigitCount, QString format);
|
||||||
//QString getFramePath(int frameNumber);
|
// QString getFramePath(int frameNumber);
|
||||||
static QString getZeroPadded(int frameNumber, int minDigitCount);
|
static QString getZeroPadded(int frameNumber, int minDigitCount);
|
||||||
static void drawAlphaPix(QImage* destImage, int x, int y, QColor sourceColor, double this_opacity);
|
static void drawAlphaPix(QImage* destImage, int x, int y, QColor sourceColor, double this_opacity);
|
||||||
|
|
||||||
bool getIsModified();
|
bool getIsModified();
|
||||||
bool openImage(const QString &fileName);
|
bool openImage(const QString &fileName);
|
||||||
bool saveFrame();//const QString &fileName, const char *fileFormat);
|
bool saveFrame(); // const QString &fileName, const char *fileFormat);
|
||||||
bool exportFrame(QDir destinationDir, const QString &sequenceName, const char *fileFormat, int frameNumber);
|
bool exportFrame(QDir destinationDir, const QString &sequenceName, const char *fileFormat, int frameNumber);
|
||||||
int exportFrames(QDir destinationDir, const QString &sequenceName, const char *fileFormat);
|
int exportFrames(QDir destinationDir, const QString &sequenceName, const char *fileFormat);
|
||||||
void setBrushColor(const QColor &newColor);
|
void setBrushColor(const QColor &newColor);
|
||||||
@ -64,7 +64,7 @@ public:
|
|||||||
|
|
||||||
QColor getBrushColor() const { return brushColor; }
|
QColor getBrushColor() const { return brushColor; }
|
||||||
double getBrushRadius() const { return brushRadius; }
|
double getBrushRadius() const { return brushRadius; }
|
||||||
double getBrushHardness() const { return (brushRadius-brushHardRadius)/brushRadius; }
|
double getBrushHardness() const { return brushHardRadius / brushRadius; }
|
||||||
double getBrushOpacity() const { return brushOpacity; }
|
double getBrushOpacity() const { return brushOpacity; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user