summaryrefslogtreecommitdiff
path: root/gst/geometrictransform/geometricmath.c
diff options
context:
space:
mode:
authorFilippo Argiolas <filippo.argiolas@gmail.com>2010-08-02 09:17:03 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-08-02 20:09:26 +0200
commit2edd185a9a3f03280d4184ddd5a81c20f52845f7 (patch)
treeb624030016eb61d8014c50cd1d75f188e128d553 /gst/geometrictransform/geometricmath.c
parent8f47c060d759021425305235ae512be78759b8fd (diff)
downloadgstreamer-plugins-bad-2edd185a9a3f03280d4184ddd5a81c20f52845f7.tar.gz
geometrictransform: new filter "stretch"
Ports gleffects "stretch" filter to geometrictransform. Shrinks the image around the center and gradually return to normal zoom creating funny caricatures. https://bugzilla.gnome.org/show_bug.cgi?id=625722
Diffstat (limited to 'gst/geometrictransform/geometricmath.c')
-rw-r--r--gst/geometrictransform/geometricmath.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/geometrictransform/geometricmath.c b/gst/geometrictransform/geometricmath.c
index dbdfe97bf..3185e101d 100644
--- a/gst/geometrictransform/geometricmath.c
+++ b/gst/geometrictransform/geometricmath.c
@@ -189,3 +189,13 @@ geometric_math_triangle (gdouble x)
return 2.0 * (r < 0.5 ? r : 1 - r);
}
+
+/**
+ * Hermite interpolation
+ */
+gdouble
+smoothstep (gdouble edge0, gdouble edge1, gdouble x)
+{
+ gdouble t = CLAMP ((x - edge0) / (edge1 - edge0), 0.0, 1.0);
+ return t * t * (3.0 - 2.0 * t);
+}