summaryrefslogtreecommitdiff
path: root/gst/geometrictransform/gsttwirl.c
diff options
context:
space:
mode:
authorFilippo Argiolas <filippo.argiolas@gmail.com>2010-08-03 10:08:34 +0200
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2010-08-04 20:09:09 -0300
commitc921067208414c47a0c961e604b4d777f2d40b34 (patch)
tree939cf08f7deb7246f29434446dd2a1a0c659d9c4 /gst/geometrictransform/gsttwirl.c
parent770194a8fcc638924b29e78e9f24c4c7e7ef4b83 (diff)
downloadgstreamer-plugins-bad-c921067208414c47a0c961e604b4d777f2d40b34.tar.gz
geometrictransform: make ciclegt "radius" property relative
Make the "radius" property of CircleGeometricTransform relative. This is more coherent with the way [x,y]-center properties are handled and allow to set a radius without knowing the video size. Radius is defined with respect to the circle circumscribed about the video rectangle so that a point in the center has radius 0.0 and one in a vertex has radius 1.0. Note that this is not a regression from the previous absolute way of defining the radius as a user who knows the video size can easily calculate the relative radius and set that. https://bugzilla.gnome.org/show_bug.cgi?id=625959
Diffstat (limited to 'gst/geometrictransform/gsttwirl.c')
-rw-r--r--gst/geometrictransform/gsttwirl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/geometrictransform/gsttwirl.c b/gst/geometrictransform/gsttwirl.c
index 51302d413..8d31d8ee5 100644
--- a/gst/geometrictransform/gsttwirl.c
+++ b/gst/geometrictransform/gsttwirl.c
@@ -155,7 +155,8 @@ twirl_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
*in_y = y;
} else {
gdouble d = sqrt (distance);
- gdouble a = atan2 (dy, dx) + twirl->angle * (cgt->radius - d) / cgt->radius;
+ gdouble a = atan2 (dy,
+ dx) + twirl->angle * (cgt->precalc_radius - d) / cgt->precalc_radius;
*in_x = cgt->precalc_x_center + d * cos (a);
*in_y = cgt->precalc_y_center + d * sin (a);