summaryrefslogtreecommitdiff
path: root/gst/geometrictransform
diff options
context:
space:
mode:
authorFilippo Argiolas <filippo.argiolas@gmail.com>2010-08-05 12:29:16 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-08-09 19:25:53 +0200
commit1652a3ef5710a18d77a3c28498f5d6f84c2aee05 (patch)
tree0454d4a2fbeefaf212b802162da79b71d041687a /gst/geometrictransform
parent27134c6e389e6c8ea426888deb4f0ce0558e386c (diff)
downloadgstreamer-plugins-bad-1652a3ef5710a18d77a3c28498f5d6f84c2aee05.tar.gz
geometrictransform: make bulge "radius" customizable
https://bugzilla.gnome.org/show_bug.cgi?id=625908
Diffstat (limited to 'gst/geometrictransform')
-rw-r--r--gst/geometrictransform/gstbulge.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gst/geometrictransform/gstbulge.c b/gst/geometrictransform/gstbulge.c
index 13476e664..453e33b0f 100644
--- a/gst/geometrictransform/gstbulge.c
+++ b/gst/geometrictransform/gstbulge.c
@@ -95,16 +95,15 @@ bulge_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
norm_x = 2.0 * (x / width - cgt->x_center);
norm_y = 2.0 * (y / height - cgt->y_center);
- r = sqrt (norm_x * norm_x + norm_y * norm_y);
+ /* calculate radius, normalize to 1 for future convenience */
+ r = sqrt (0.5 * (norm_x * norm_x + norm_y * norm_y));
/* maps r to r^2 in the step region */
/* interpolating from negative values limits the amount of zoom at
* the center so the first edge could be used as intensity
* parameter */
- /* the second edge is the bulge radius, see gststretch.c for
- * comments about its customizability */
- norm_x *= smoothstep (-0.15, 0.6, r);
- norm_y *= smoothstep (-0.15, 0.6, r);
+ norm_x *= smoothstep (-0.15, cgt->radius, r);
+ norm_y *= smoothstep (-0.15, cgt->radius, r);
/* unnormalize */
*in_x = (0.5 * norm_x + cgt->x_center) * width;