Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
7c8de1f6
Commit
7c8de1f6
authored
Aug 05, 2020
by
Jean-Baptiste Mardelle
Browse files
Add MLT's Pillar Echo effect
parent
7d0b60c9
Pipeline
#29744
passed with stage
in 28 minutes and 30 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
data/effects/CMakeLists.txt
View file @
7c8de1f6
...
...
@@ -28,6 +28,7 @@ mute.xml
normalise.xml
oldfilm.xml
pan_zoom.xml
pillar_echo.xml
obscure.xml
region.xml
rotation.xml
...
...
data/effects/pillar_echo.xml
0 → 100644
View file @
7c8de1f6
<!DOCTYPE kpartgui>
<effect
tag=
"pillar_echo"
id=
"pillar_echo"
>
<name>
Pillar Echo
</name>
<description>
Create an echo effect (blur) outside of an area of interest.
</description>
<author>
Meltytech, LLC
</author>
<parameter
type=
"animatedrect"
name=
"rect"
default=
"25% 0% 50% 100%"
fixed=
"1"
opacity=
"false"
>
<name>
Rectangle
</name>
</parameter>
<parameter
type=
"constant"
name=
"blur"
max=
"50"
min=
"0"
default=
"4"
suffix=
"%"
>
<name>
Blur
</name>
</parameter>
</effect>
src/assets/model/assetparametermodel.cpp
View file @
7c8de1f6
...
...
@@ -544,7 +544,7 @@ ParamType AssetParameterModel::paramTypeFromStr(const QString &type)
return
ParamType
::
Switch
;
}
else
if
(
type
==
QLatin1String
(
"simplekeyframe"
))
{
return
ParamType
::
KeyframeParam
;
}
else
if
(
type
==
QLatin1String
(
"animatedrect"
))
{
}
else
if
(
type
==
QLatin1String
(
"animatedrect"
)
||
type
==
QLatin1String
(
"rect"
)
)
{
return
ParamType
::
AnimatedRect
;
}
else
if
(
type
==
QLatin1String
(
"geometry"
))
{
return
ParamType
::
Geometry
;
...
...
@@ -628,8 +628,30 @@ QVariant AssetParameterModel::parseAttribute(const ObjectId &owner, const QStrin
.
replace
(
QLatin1String
(
"%height"
),
QString
::
number
(
height
))
.
replace
(
QLatin1String
(
"%out"
),
QString
::
number
(
out
))
.
replace
(
QLatin1String
(
"%fade"
),
QString
::
number
(
frame_duration
));
if
(
type
==
ParamType
::
Double
||
type
==
ParamType
::
Hidden
)
{
if
(
type
==
ParamType
::
AnimatedRect
&&
attribute
==
QLatin1String
(
"default"
))
{
if
(
content
.
contains
(
QLatin1Char
(
'%'
)))
{
// This is a generic default like: "25% 0% 50% 100%". Parse values
QStringList
numbers
=
content
.
split
(
QLatin1Char
(
' '
));
content
.
clear
();
int
ix
=
0
;
for
(
QString
&
val
:
numbers
)
{
if
(
val
.
endsWith
(
QLatin1Char
(
'%'
)))
{
val
.
chop
(
1
);
double
n
=
val
.
toDouble
()
/
100.
;
if
(
ix
%
2
==
0
)
{
n
*=
width
;
}
else
{
n
*=
height
;
}
ix
++
;
content
.
append
(
QString
(
"%1 "
).
arg
(
qRound
(
n
)));
}
else
{
content
.
append
(
QString
(
"%1 "
).
arg
(
val
));
}
}
}
}
else
if
(
type
==
ParamType
::
Double
||
type
==
ParamType
::
Hidden
)
{
// Use a Mlt::Properties to parse mathematical operators
Mlt
::
Properties
p
;
p
.
set
(
"eval"
,
content
.
prepend
(
QLatin1Char
(
'@'
)).
toLatin1
().
constData
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment