GNOME Bugzilla – Bug 161131
Displace plug-in could also operate in polar-coords.
Last modified: 2005-08-25 19:54:49 UTC
Hi. I've worked on the displace plug-in so that it can do what it already does, but also can operate on polar coordinates base, meaning the mappings will make the target drawable pixels move along their distance to the center (vary radius), or their angle in relation to the drawable center. This is roughly equivalent to the Whirl and Pinch plug-in, but it is mapped by another drawable. I also implemented a version of the label changing interface from AlienMap2 on it. Of course this is not meant for the 2.2 cycle.
Created attachment 34785 [details] [review] Implements enhancement as described
Looks almost OK except for the change of the procedure call. Please make the newly introduced parameter optional so that the procedure can be still be called with the old number of parameters.
Created attachment 35859 [details] [review] Implements enhacement, leaving mode parameter as optional
Created attachment 36119 [details] [review] Updated patch implementing enhacement. The previous patch resulted in an incorrect offset for the angle when in polar mode. Fixed here.
2005-02-10 Sven Neumann <sven@gimp.org> * plug-ins/common/displace.c: applied a modified patch from Joao S. O. Bueno Calligaris that adds a polar mode to the Displace plug-in (bug #161131). I've fixed the resizing problem with the labels and changed the dialog layout a little so that it becomes more compact.
Optional parameters aren't supported by all language bindings, in particular not by Script-Fu. Thus I had to do the following change: 2005-08-24 Sven Neumann <sven@gimp.org> * plug-ins/script-fu/scripts/i26-gunya2.scm * plug-ins/script-fu/scripts/ripply-anim.scm: reverted the last change... * plug-ins/common/displace.c: ... and fixed the plug-in instead. The number of parameters must not change. Provide a new procedure for polar mode instead.
Optional parameters are supported in Script-Fu/Tiny-Fu. See the description for <Formals> (section 4.1.4. titled Procedures) in the right-hand column of page 9 of the R5RS.
Well, they may be supported by Scheme but AFAIK at least script-fu will not accept procedure calls with the wrong number of parameters. How does tiny-fu handle this?