From c921067208414c47a0c961e604b4d777f2d40b34 Mon Sep 17 00:00:00 2001 From: Filippo Argiolas Date: Tue, 3 Aug 2010 10:08:34 +0200 Subject: 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 --- gst/geometrictransform/gsttwirl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gst/geometrictransform/gsttwirl.c') 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); -- cgit v1.2.1