alpha_fade - Fade the alpha channel of a layer from one side to another
<Image>/Layer/Transparency/_Fade...
Inspired by a mailing list question that asked how to do exactly what this does, which is fade the alpha from one side to another. Original by Seth Burgess, rewritten by Ed J to use Gimp::Fu as demo of PF_CUSTOM widget.
[PF_CUSTOM, "direction", "Direction to fade(0-8)", 4, sub { my $btnTable = new Gtk2::Table(3,3,1); $btnTable->set_border_width(6); my $btn = new Gtk2::RadioButton; my ($u_direction, @buttons); for (my $x=0;$x<3;$x++) { for (my $y=0;$y<3;$y++) { my $dir = $x*3 + $y; $buttons[$dir] = $btn = Gtk2::RadioButton->new_from_widget($btn); $btn->set_mode(0); $btn->signal_connect("clicked", sub { $u_direction = $_[1]; }, $dir); $btn->show; $btnTable->attach_defaults($btn, $x, $x+1, $y, $y+1); my $pixmap = Gtk2::Image->new_from_pixmap( Gtk2::Gdk::Pixmap->colormap_create_from_xpm_d( undef, $btn->get_colormap, $btn->style->bg('normal'), @{$::arr[$dir]} ) ); $pixmap->show; $btn->add($pixmap); } } $btnTable->show; ($btnTable, sub { $buttons[$_[0]]->clicked }, sub { $u_direction }); }, ]
*
2014/04/20 Ed J: rewrite to use Gimp::Fu and PF_CUSTOM 12/5/03: <sjburges@gimp.org> s/->mask/->get_mask 3/21/04: <sjburges@gimp.org> s/AlphaFade/alpha_fade/ to be compatible with PDB naming conventions
Seth Burgess
2000
Copyright Seth Burgess.
Distributed under the same terms as Gimp-Perl.
To install Gimp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gimp
CPAN shell
perl -MCPAN -e shell install Gimp
For more information on module installation, please visit the detailed CPAN module installation guide.