From 38f940e191d0aab8f09978c62ebaa5ae7a5fb298 Mon Sep 17 00:00:00 2001 From: Marc Lehmann Date: Thu, 11 May 2000 17:04:30 +0000 Subject: [PATCH] see plug-ins/perl/Changes --- plug-ins/perl/Changes | 6 +- plug-ins/perl/Gimp.pm | 2 +- plug-ins/perl/Gimp/Compat.pm | 2 +- plug-ins/perl/Gimp/Lib.pm | 2 +- plug-ins/perl/Gimp/Module.pm | 2 +- plug-ins/perl/Gimp/Pod.pm | 2 +- plug-ins/perl/Gimp/Util.pm | 2 +- plug-ins/perl/MANIFEST | 1 + plug-ins/perl/Makefile.PL | 3 +- plug-ins/perl/Net/Net.pm | 2 +- plug-ins/perl/UI/UI.pm | 2 +- plug-ins/perl/UI/basewidget.pm | 2 +- plug-ins/perl/config.pl.in | 1 + plug-ins/perl/configure | 11 +--- plug-ins/perl/configure.frag | 11 ++-- plug-ins/perl/examples/warp-sharp | 92 +++++++++++++++++++++++++++++++ 16 files changed, 119 insertions(+), 24 deletions(-) create mode 100755 plug-ins/perl/examples/warp-sharp diff --git a/plug-ins/perl/Changes b/plug-ins/perl/Changes index f8e300ed6f..0cb4b88453 100644 --- a/plug-ins/perl/Changes +++ b/plug-ins/perl/Changes @@ -1,6 +1,6 @@ Revision history for Gimp-Perl extension. -1.20 +1.2 Thu May 11 18:55:13 CEST 2000 - image types updated to reflect gimp's reality. - updated perlotine. - fixed logulator (bugs are actually in the script-fu parts). @@ -48,6 +48,10 @@ Revision history for Gimp-Perl extension. script-fu's. - added warning when using known-to-be-broken experimental threading feature. Maybe gimp-perl should refuse to build instead? + - added examples/warp-sharp. + - more $(CC) != perl's $(CC) fixes in configure.frag. + - Makefile.PL now uses $bindir to install programs. This is not optimal + for standalone installations, but gimp has priority ;) 1.19 Thu Jan 6 00:21:58 CET 2000 - used N_ to mark all the menu paths, since gimp now tries to diff --git a/plug-ins/perl/Gimp.pm b/plug-ins/perl/Gimp.pm index 3496920cf6..bd2b93e700 100644 --- a/plug-ins/perl/Gimp.pm +++ b/plug-ins/perl/Gimp.pm @@ -10,7 +10,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD %EXPORT_TAGS @EXPORT_FAIL use subs qw(init end lock unlock canonicalize_color); BEGIN { - $VERSION = 1.19; + $VERSION = 1.2; eval { require XSLoader; XSLoader::load Gimp $VERSION; diff --git a/plug-ins/perl/Gimp/Compat.pm b/plug-ins/perl/Gimp/Compat.pm index 433a5d005a..c44ae99b6c 100644 --- a/plug-ins/perl/Gimp/Compat.pm +++ b/plug-ins/perl/Gimp/Compat.pm @@ -43,7 +43,7 @@ Gimp-Perl extension (contact him to include new functions) is Marc Lehmann package Gimp::Compat; -$VERSION=1.19; +$VERSION=1.2; use Gimp ('croak', '__'); diff --git a/plug-ins/perl/Gimp/Lib.pm b/plug-ins/perl/Gimp/Lib.pm index f8dd8627cb..d9365d70f5 100644 --- a/plug-ins/perl/Gimp/Lib.pm +++ b/plug-ins/perl/Gimp/Lib.pm @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION @ISA); BEGIN { - $VERSION = 1.19; + $VERSION = 1.2; eval { require XSLoader; XSLoader::load Gimp::Lib $VERSION; diff --git a/plug-ins/perl/Gimp/Module.pm b/plug-ins/perl/Gimp/Module.pm index df958187a3..2e34d74b9f 100644 --- a/plug-ins/perl/Gimp/Module.pm +++ b/plug-ins/perl/Gimp/Module.pm @@ -19,7 +19,7 @@ package Gimp::Module; use base qw(DynaLoader); require DynaLoader; -$VERSION=1.19; +$VERSION=1.2; bootstrap Gimp::Module; diff --git a/plug-ins/perl/Gimp/Pod.pm b/plug-ins/perl/Gimp/Pod.pm index 38a6d588a5..2cb6677df6 100644 --- a/plug-ins/perl/Gimp/Pod.pm +++ b/plug-ins/perl/Gimp/Pod.pm @@ -1,6 +1,6 @@ package Gimp::Pod; -$VERSION=1.19; +$VERSION=1.2; sub myqx(&) { local $/; diff --git a/plug-ins/perl/Gimp/Util.pm b/plug-ins/perl/Gimp/Util.pm index c852075f8f..5b96c2ec2d 100644 --- a/plug-ins/perl/Gimp/Util.pm +++ b/plug-ins/perl/Gimp/Util.pm @@ -51,7 +51,7 @@ require Exporter; use Gimp; -$VERSION=1.19; +$VERSION=1.2; ############################################################################## =pod diff --git a/plug-ins/perl/MANIFEST b/plug-ins/perl/MANIFEST index f0edb2bbec..af6694edf4 100644 --- a/plug-ins/perl/MANIFEST +++ b/plug-ins/perl/MANIFEST @@ -130,6 +130,7 @@ examples/billboard examples/blended2 examples/dust examples/clear_alpha +examples/warp-sharp pxgettext po/ChangeLog po/Makefile.PL diff --git a/plug-ins/perl/Makefile.PL b/plug-ins/perl/Makefile.PL index 0bc1c6512a..339df4c509 100644 --- a/plug-ins/perl/Makefile.PL +++ b/plug-ins/perl/Makefile.PL @@ -36,7 +36,7 @@ if ($ARGV[0] ne "--writemakefile") { @pins = qw( windify prep4gif webify tex-to-float ditherize - xachlego xachshadow roundsel blended2 + xachlego xachshadow roundsel blended2 warp-sharp scratches blowinout terral_text xachvision perlcc translogo animate_cells image_tile yinyang stamps font_table sethspin perlotine randomblends innerbevel fit-text guidegrid @@ -318,6 +318,7 @@ WriteMakefile( 'DIR' => [@DIRS], 'NAME' => 'Gimp', 'VERSION_FROM' => 'Gimp.pm', + 'INSTALLBIN'=> $bindir, 'PM' => { 'Gimp.pm' => '$(INST_LIBDIR)/Gimp.pm', 'Gimp/Data.pm' => '$(INST_LIBDIR)/Gimp/Data.pm', diff --git a/plug-ins/perl/Net/Net.pm b/plug-ins/perl/Net/Net.pm index b394be4e47..2d3748b4a4 100644 --- a/plug-ins/perl/Net/Net.pm +++ b/plug-ins/perl/Net/Net.pm @@ -20,7 +20,7 @@ use Fcntl qw(F_SETFD); require DynaLoader; -$VERSION = 1.19; +$VERSION = 1.2; bootstrap Gimp::Net $VERSION; diff --git a/plug-ins/perl/UI/UI.pm b/plug-ins/perl/UI/UI.pm index 19e433a8dd..56480fa470 100644 --- a/plug-ins/perl/UI/UI.pm +++ b/plug-ins/perl/UI/UI.pm @@ -5,7 +5,7 @@ use Gimp::Fu; use base 'DynaLoader'; BEGIN { - $VERSION = 1.19; + $VERSION = 1.2; eval { require XSLoader; XSLoader::load Gimp::UI $VERSION; diff --git a/plug-ins/perl/UI/basewidget.pm b/plug-ins/perl/UI/basewidget.pm index 5221d656f1..317d7b1d30 100644 --- a/plug-ins/perl/UI/basewidget.pm +++ b/plug-ins/perl/UI/basewidget.pm @@ -3,7 +3,7 @@ package Gimp::basewidget; # pragma use Gtk; use Gimp; -$VERSION = 1.19; +$VERSION = 1.2; =head1 NAME diff --git a/plug-ins/perl/config.pl.in b/plug-ins/perl/config.pl.in index ec266a3f04..e9cde87305 100644 --- a/plug-ins/perl/config.pl.in +++ b/plug-ins/perl/config.pl.in @@ -62,6 +62,7 @@ sub expand { $cfg; } +# the next line should no longer be necessary, but... $cfg{_CFLAGS} =~ s/\B-Wall\b//g; # remove -Wall from cflags and pray... while (($k,$v)=each(%cfg)) { diff --git a/plug-ins/perl/configure b/plug-ins/perl/configure index 8b45d206e5..2f945261b4 100755 --- a/plug-ins/perl/configure +++ b/plug-ins/perl/configure @@ -1399,11 +1399,6 @@ echo $ac_n "checking for intelligent life""... $ac_c" 1>&6 echo "configure:1400: checking for intelligent life" >&5 echo "$ac_t""not found" 1>&6 -if test "x$GCC" = xyes; then - nowarn="-Wno-parentheses -Wno-unused -Wno-uninitialized" - GIMP_CFLAGS="$GIMP_CFLAGS $nowarn" - GIMP_CFLAGS_NOUI="$GIMP_CFLAGS" -fi @@ -1425,12 +1420,12 @@ fi for ac_func in _exit do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1429: checking for $ac_func" >&5 +echo "configure:1424: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/plug-ins/perl/configure.frag b/plug-ins/perl/configure.frag index 310fe15f9c..7f719375fc 100644 --- a/plug-ins/perl/configure.frag +++ b/plug-ins/perl/configure.frag @@ -6,11 +6,12 @@ AC_MSG_CHECKING(for intelligent life) AC_MSG_RESULT(not found) dnl disable some warnings I don't want to see -if test "x$GCC" = xyes; then - nowarn="-Wno-parentheses -Wno-unused -Wno-uninitialized" - GIMP_CFLAGS="$GIMP_CFLAGS $nowarn" - GIMP_CFLAGS_NOUI="$GIMP_CFLAGS_NOUI $nowarn" -fi +dnl disabled, since $GCC does not correspond to perl's $(CC) +dnl if test "x$GCC" = xyes; then +dnl nowarn="-Wno-parentheses -Wno-unused -Wno-uninitialized" +dnl GIMP_CFLAGS="$GIMP_CFLAGS $nowarn" +dnl GIMP_CFLAGS_NOUI="$GIMP_CFLAGS_NOUI $nowarn" +dnl fi AC_SUBST(EXTENSIVE_TESTS)dnl from Makefile.PL diff --git a/plug-ins/perl/examples/warp-sharp b/plug-ins/perl/examples/warp-sharp new file mode 100755 index 0000000000..91eb2bd4e9 --- /dev/null +++ b/plug-ins/perl/examples/warp-sharp @@ -0,0 +1,92 @@ +#!/usr/bin/perl + +# slightly edited by pcg@goof.com + +use Gimp qw(:auto); +use Gimp::Fu; + +sub warp_sharp { + my ($img, $drw, $edge_strength, $blur_strength, + $bump_depth, $displace_amount)=@_; + my $drawable_width=$drw->width; + my $drawable_height=$drw->height; + my $drawable_type=($drw->type); + my $edge_layer=gimp_layer_copy($drw,0); + my $x_displace_layer= + $img->layer_new($drawable_width, $drawable_height, + $drawable_type, "Displace X", 100, 0); + my $y_displace_layer= + $img->layer_new($drawable_width, $drawable_height, + $drawable_type, "Displace Y", 100, 0); + my @selection_info=$img->selection_bounds; + my $has_selection=$selection_info[0]; + my $old_selection; + my $bump_xoff; + my $bump_yoff; + my $version=1; + +# Gimp::set_trace(TRACE_ALL); + $img->undo_push_group_start; + if ($has_selection) { + $old_selection=$img->gimp_selection_save; + $img->selection_grow($blur_strength + $bump_depth + $displace_amount); + $bump_xoff=$selection_info[1]; + $bump_yoff=$selection_info[2]; + } + $x_displace_layer->fill(1 + $version); + $y_displace_layer->fill(1 + $version); + $img->add_layer($edge_layer,-1); + $img->add_layer($x_displace_layer,-1); + $img->add_layer($y_displace_layer,-1); + + plug_in_edge($img,$edge_layer,$edge_strength,1); + + plug_in_gauss_iir($img, $edge_layer, $blur_strength, 1, 1) + if ($blur_strength >= 1); + + plug_in_bump_map($img,$x_displace_layer,$edge_layer, 0, 30, + $bump_depth, $bump_xoff,$bump_yoff, 0,0,0,0,0); + + plug_in_bump_map($img,$y_displace_layer,$edge_layer, 270, 30, + $bump_depth, $bump_xoff,$bump_yoff, 0,0,0,0,0); + + if ($has_selection) { + $old_selection->gimp_selection_load; + $old_selection->remove_channel; + # will cause a crash: + # $old_selection->gimp_channel_delete; + } + + plug_in_displace($img,$drw, $displace_amount, $displace_amount, 1,1, + $x_displace_layer, $y_displace_layer, 1); + + $img->remove_layer($edge_layer); + $img->remove_layer($x_displace_layer); + $img->remove_layer($y_displace_layer); + $img->undo_push_group_end; + gimp_displays_flush(); + return undef; +} + + +register + "plug_in_warp_sharp", + "Sharpen the current drawable", + "Sharpen the current drawable by squeezing unsharp edges. Algorithm described by Joern Loviscach in c't 22/1999, p 236.", + "Simon Budig , Peter Daum ", + "Simon Budig, Peter Daum", + "2000-05-11", + N_"/Filters/Enhance/Warp Sharp...", + "RGB*, GRAY*", + [ + [PF_SLIDER, "edge_detection", "Edge detection", 7, [1, 10, 0.1]], + [PF_SLIDER, "blur_radius", "Blur radius", 3, [0, 10, 0.1]], + [PF_SLIDER, "bump_depth", "Bump depth", 2, [1, 10, 1]], + [PF_SLIDER, "intensity", "Displace Intensity", 2.5, [0.1, 10, 0.1]] + ], + [], + ['gimp-1.1'], + \&warp_sharp; + + +exit main;