NAME

layer_reorder - Reshuffle the order of layers in an image according to a function

SYNOPSIS

<Image>/Layer/Stack/Reorder Layers...

DESCRIPTION

This function re-orders the layer stack using either a builtin function (only reversal is available at the moment, contact me if you find another useful function) or a custom one.

REVERSE (1) will reverse the order of layers (it is equivalent to the custom function -i).

SHIFT (2) will shift the sequence by the amount (positive or negative) indicated in the custom field. It is equivalent to the custom function ( i + custom ) % n.

If you specify CUSTOM (0) as function than you can use the "custom" argument to specify any function you like. Any i is replaced by the index of the layer (0..n-1), any n is replaced by the total number of layers. The function returns the new position of the layer, which is measured relative to all other positions, i.e. your function can return values 0.1, 0.7 and 0.3 for layers 0, 1 and 2 respectively, and the new order will be 0, 2 and 1.

Examples:

 -i        # reverse the order of layers
 (i+5)%n   # shift the order of frames by 5

PARAMETERS

 [PF_RADIO, "function", "Which remapping function to use", 1,
  [Custom => 0, Reverse => 1, Shift => 2] ],
 [PF_STRING, "custom", "Optional custom function to use, e.g. 'n-i' reverses the order"],

IMAGE TYPES

*

AUTHOR

Marc Lehmann <pcg@goof.com>

DATE

19990708

LICENSE

Marc Lehmann <pcg@goof.com>

Distributed under the same terms as Gimp-Perl.