call plug-in-curve-bend

View: New views
3 Messages — Rating Filter:   Alert me  

call plug-in-curve-bend

by michaelhoelzende :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello everybody,
i'm currently writing a little python plugin which calls the
plug-in-curve-bend.
Purpose of my plugin is to let the user nominate a channel with a shape
to which a
selection shall be bent to.
I take this shape and hand over 256 generated y-values (each lower and
upper values) to the curve-bend-plug-in with curve type freehand.
pdb.plug_in_curve_bend(image, drawable, rotation, smoothing, antialias,
work-on-copy, curve-type, argc-upper-point-x, upper-point-x,
argc-upper-point-y, upper-point-y, argc-lower-point-x, lower-point-x,
argc-lower-point-y, lower-point-y, argc-upper-val-y, upper-val-y,
argc-lower-val-y, lower-val-y)
Unfortunately the lower-vals are ignored. No bending of the lower part
occurs. Only the upper-vals work fine.
But the generated data are correct. To test that my plugin has written
them parallel into a curve_bend.points - file.
Using this file with Filters -> Distorts -> Curve Bend (Load the curves
from a file) works in the expected way:
Both upper-vals and lower-vals are used to bend the upper and the lower
part of the selection corresponding to the respective values.
Has anybody a hint what possibly goes wrong calling the plug-in-curve-bend?


Regards

Michael


_______________________________________________
Gimp-developer mailing list
Gimp-developer@...
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Re: call plug-in-curve-bend

by Sven Neumann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Sun, 2008-04-20 at 13:08 +0200, Michael Hölzen wrote:

> I take this shape and hand over 256 generated y-values (each lower and
> upper values) to the curve-bend-plug-in with curve type freehand.
> pdb.plug_in_curve_bend(image, drawable, rotation, smoothing, antialias,
> work-on-copy, curve-type, argc-upper-point-x, upper-point-x,
> argc-upper-point-y, upper-point-y, argc-lower-point-x, lower-point-x,
> argc-lower-point-y, lower-point-y, argc-upper-val-y, upper-val-y,
> argc-lower-val-y, lower-val-y)
> Unfortunately the lower-vals are ignored. No bending of the lower part
> occurs. Only the upper-vals work fine.

Looks like a simple bug in the curve-bend plug-in. Below is a patch that
should fix it. I will apply this to both branches...

Index: plug-ins/common/curve-bend.c
===================================================================
--- plug-ins/common/curve-bend.c (revision 25501)
+++ plug-ins/common/curve-bend.c (working copy)
@@ -745,7 +745,7 @@ run (const gchar      *name,
               p_copy_yval (cd, OUTLINE_UPPER,
                            param[16].data.d_int32,
                            param[17].data.d_int8array);
-              p_copy_yval (cd, OUTLINE_UPPER,
+              p_copy_yval (cd, OUTLINE_LOWER,
                            param[18].data.d_int32,
                            param[19].data.d_int8array);
             }



Sven


_______________________________________________
Gimp-developer mailing list
Gimp-developer@...
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Re: call plug-in-curve-bend

by michaelhoelzende :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sven Neumann schrieb:

> Hi,
> Looks like a simple bug in the curve-bend plug-in. Below is a patch that
> should fix it. I will apply this to both branches...
>
> Index: plug-ins/common/curve-bend.c
> ===================================================================
> --- plug-ins/common/curve-bend.c    (revision 25501)
> +++ plug-ins/common/curve-bend.c    (working copy)
> @@ -745,7 +745,7 @@ run (const gchar      *name,
>                p_copy_yval (cd, OUTLINE_UPPER,
>                             param[16].data.d_int32,
>                             param[17].data.d_int8array);
> -              p_copy_yval (cd, OUTLINE_UPPER,
> +              p_copy_yval (cd, OUTLINE_LOWER,
>                             param[18].data.d_int32,
>                             param[19].data.d_int8array);
>              }
>
>
>
> Sven
>  
Thanks a lot for that fast solution!

Regards

Michael
_______________________________________________
Gimp-developer mailing list
Gimp-developer@...
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer