Re: [Gimp-user] gimp-drawable-curves-spline
> On 24 feb 2016, at 16:59, Simon Budig wrote: > > Maurizio Loreti (maurizio.lor...@gmail.com) wrote: >> (let* ((a (cons-array 8 'byte))) >> >> Just changing the procedure name in the last line to >> gimp-drawable-curves-spline is not enough. If I understand correctly, >> the program allocates an array of 8 bytes where 8 integer values (0,0; >> 63,60; 191,194; 155.255) are stored. > > To be more specific: the program allocates an 8 entry array, where each > entry contains a byte. > >> The memory to be allocated >> should be adequate for 8 floating point values (8 * 32 bytes?), and >> the values stored there. Is set-pt adequate? Or intended for integer >> values only? May somebody help me? > > Allocate an array with 8 entries where each entry contains a > "double"-float-value: > > (cons-array 8 'double) > > You might need to change the scale of the values in there - instead from > 0 to 255 they might be normalized to 0.0 to 1.0. It works indeed; the new code is the following: (define (spline) (let* ((a (cons-array 8 'double))) (set-pt a 0 0.0 0.0) (set-pt a 1 0.24706 0.23529) (set-pt a 2 0.74902 0.76078) (set-pt a 3 1.0 1.0) a)) (define (set-pt a index x y) (prog1 (aset a (* index 2) x) (aset a (+ (* index 2) 1) y))) (gimp-drawable-curves-spline inDrw 0 8 (spline)) (gimp-image-undo-group-end inImg) (gimp-displays-flush) ) Thank you for the quick answer, and thank you all for working on such a wonderful program as GIMP. -- Maurizio Loreti - maurizio.lor...@gmail.com ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list
Re: [Gimp-user] gimp-drawable-curves-spline
You can see the definition of all the avaliable functions on GIMP's PDB using the "Help->PDB Browser" menu option from inside GIMP On 24 February 2016 at 12:16, Maurizio Loreti wrote: > Hello - > I am using GIMP 2.9.3 from Partha’s Place, on a Mac running OS X; from time > to time I use a scheme plugin found in the gimpfx-foundry distribution > (http://gimpfx-foundry.sourceforge.net) called > "salonen-vivid-saturation.scm”. And, yes, I understand that gimpfx-foundry > is unmaintained since ?2008? - however that scheme procedure has always > worked well for me up to GIMP 2.8. > > With GIMP 2.9 I get al alert saying that gimp-curves-spline (called from line > 63 in the .scm procedure) is obsolete, and replaced now by > gimp-drawable-curves-spline. The procedure however works; but I know some > scheme and I would like to edit the .scm file in order to call > gimp-drawable-curves-spline - but I cannot find on the Internet the synopsis > for that new function. > > The synopsis for the old one is: gimp-curves-spline (drawable, channel, > num_points, control_pts) > > Can some kind soul tell me how gimp-drawable-curves-spline must be called? > > -- > Maurizio Loreti - maurizio.lor...@gmail.com > > > > > > > ___ > gimp-user-list mailing list > List address:gimp-user-list@gnome.org > List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list > List archives: https://mail.gnome.org/archives/gimp-user-list ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list
Re: [Gimp-user] gimp-drawable-curves-spline
Maurizio Loreti (maurizio.lor...@gmail.com) wrote: > (let* ((a (cons-array 8 'byte))) > > Just changing the procedure name in the last line to > gimp-drawable-curves-spline is not enough. If I understand correctly, > the program allocates an array of 8 bytes where 8 integer values (0,0; > 63,60; 191,194; 155.255) are stored. To be more specific: the program allocates an 8 entry array, where each entry contains a byte. > The memory to be allocated > should be adequate for 8 floating point values (8 * 32 bytes?), and > the values stored there. Is set-pt adequate? Or intended for integer > values only? May somebody help me? Allocate an array with 8 entries where each entry contains a "double"-float-value: (cons-array 8 'double) You might need to change the scale of the values in there - instead from 0 to 255 they might be normalized to 0.0 to 1.0. I hope this helps, Simon -- si...@budig.de http://simon.budig.de/ ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list
[Gimp-user] gimp-drawable-curves-spline
On 24 feb 2016, at 16:29, Kevin Payne mailto:payn...@hotmail.com>> wrote: > > (which appear to be mostly the same, other than the control points have > changed from being INT to FLOAT) OK - well, my scheme knowledge is not enough :-(Here is the relevant section of the code: (define (spline) (let* ((a (cons-array 8 'byte))) (set-pt a 0 0 0) (set-pt a 1 63 60) (set-pt a 2 191 194) (set-pt a 3 255 255) a)) (define (set-pt a index x y) (prog1 (aset a (* index 2) x) (aset a (+ (* index 2) 1) y))) (gimp-curves-spline inDrw 0 8 (spline)) Just changing the procedure name in the last line to gimp-drawable-curves-spline is not enough. If I understand correctly, the program allocates an array of 8 bytes where 8 integer values (0,0; 63,60; 191,194; 155.255) are stored. The memory to be allocated should be adequate for 8 floating point values (8 * 32 bytes?), and the values stored there. Is set-pt adequate? Or intended for integer values only? May somebody help me? -- Maurizio Loreti - maurizio.lor...@gmail.com ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list
Re: [Gimp-user] gimp-drawable-curves-spline
If you use the procedure-browser (at GIMP menu Help>>Procedure Browser) it shows the parameters required (which appear to be mostly the same, other than the control points have changed from being INT to FLOAT) Kevin Question for developers: Can you please make it possible to copy the text in the Procedure Browser for situations such as these. From: gimp-user-list on behalf of Maurizio Loreti Sent: 24 February 2016 15:16 To: gimp-user-list@gnome.org Subject: [Gimp-user] gimp-drawable-curves-spline Hello - I am using GIMP 2.9.3 from Partha’s Place, on a Mac running OS X; from time to time I use a scheme plugin found in the gimpfx-foundry distribution (http://gimpfx-foundry.sourceforge.net) called "salonen-vivid-saturation.scm”. And, yes, I understand that gimpfx-foundry is unmaintained since ?2008? - however that scheme procedure has always worked well for me up to GIMP 2.8. With GIMP 2.9 I get al alert saying that gimp-curves-spline (called from line 63 in the .scm procedure) is obsolete, and replaced now by gimp-drawable-curves-spline. The procedure however works; but I know some scheme and I would like to edit the .scm file in order to call gimp-drawable-curves-spline - but I cannot find on the Internet the synopsis for that new function. The synopsis for the old one is: gimp-curves-spline (drawable, channel, num_points, control_pts) Can some kind soul tell me how gimp-drawable-curves-spline must be called? -- Maurizio Loreti - maurizio.lor...@gmail.com ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list
[Gimp-user] gimp-drawable-curves-spline
Hello - I am using GIMP 2.9.3 from Partha’s Place, on a Mac running OS X; from time to time I use a scheme plugin found in the gimpfx-foundry distribution (http://gimpfx-foundry.sourceforge.net) called "salonen-vivid-saturation.scm”. And, yes, I understand that gimpfx-foundry is unmaintained since ?2008? - however that scheme procedure has always worked well for me up to GIMP 2.8. With GIMP 2.9 I get al alert saying that gimp-curves-spline (called from line 63 in the .scm procedure) is obsolete, and replaced now by gimp-drawable-curves-spline. The procedure however works; but I know some scheme and I would like to edit the .scm file in order to call gimp-drawable-curves-spline - but I cannot find on the Internet the synopsis for that new function. The synopsis for the old one is: gimp-curves-spline (drawable, channel, num_points, control_pts) Can some kind soul tell me how gimp-drawable-curves-spline must be called? -- Maurizio Loreti - maurizio.lor...@gmail.com ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list