RFX-GIMP

Artifact [a750bfeff0]
Login

Artifact a750bfeff0204f8ef30d238ad7bb4d8d3034cf8e:

Wiki page [make-progressor] by saul 2012-03-30 04:28:39.
D 2012-03-30T04:28:39.035
L make-progressor
U saul
W 973
'make-progressor' is a Script-fu procedure that is available for all RFX-GIMP scripts to use for creating incremental counters.

The procedure requires two parameters: the initial value of the counter and the increment at each step. An optional third value can specify the period of the function.

'make-progressor' returns a function (i.e., a lambda) that evaluates to the next step in the series. 

For example, the following define a simple ramp function that increments from 0.0 to 1.0 over the range of selected frames:

<pre>(if (= $start $end)
  (define next-step (make-progressor 0 (/ (succ (- $end $start)))))</pre>


Each time through the loop, '(next-step)' would be evaluated to return the current value of the progressor. The first time '(next-step)' is evaluated, the initial value of the progressor is returned.

Negative initial values and negative increments are permitted, and you can make create as many progressors as you would like. </ul>
Z 763ee896aacf5147f483faa891326c09