see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann 1998-11-14 20:01:22 +00:00
parent a8abef068c
commit 5c52dcb85b
8 changed files with 104 additions and 9 deletions

View file

@ -1,5 +1,8 @@
Revision history for Gimp-Perl extension.
- updated configure to require 1.0.2
- added some more scripts to the dist
1.048 Fri Nov 13 20:39:52 CET 1998
- Gimp::Fu::save_image now correctly respects the quality setting
- allow layers/channels as drawables in typemap

View file

@ -12,7 +12,7 @@ use base qw(DynaLoader);
require DynaLoader;
$VERSION = 1.048;
$VERSION = 1.049;
@_param = qw(
PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE

View file

@ -13,6 +13,7 @@ typemap
Gimp.pm
Gimp.xs
t/load.t
t/loadlib.t
t/run.t
extradefs.h
Perl-Server
@ -31,6 +32,9 @@ Gimp/Fu.pm
Gimp/PDL.pm
Gimp/Pixel.pod
Gimp/UI.pm
examples/PDB
examples/alpha2color.pl
examples/tex-to-float
examples/README
examples/webify.pl
examples/border.pl
@ -43,4 +47,5 @@ examples/gimp-make-img-map
examples/homepage-logo.pl
examples/windy.pl
examples/prep4gif.pl
examples/ditherize.pl

View file

@ -131,7 +131,8 @@ install-plugins:
-cd examples && $GIMPTOOL2 --install-admin-bin PDB
-cd examples && $GIMPTOOL2 --install-admin-bin alpha2color.pl
-cd examples && $GIMPTOOL2 --install-admin-bin tex-to-float
# -cd examples && $GIMPTOOL2 --install-admin-bin border.pl
-cd examples && $GIMPTOOL2 --install-admin-bin ditherize
-cd examples && $GIMPTOOL2 --install-admin-bin border.pl
EOF
}

View file

@ -674,7 +674,7 @@ else
echo "$ac_t""no" 1>&6
fi
min_gimp_version=1.0.0
min_gimp_version=1.0.2
echo $ac_n "checking for GIMP - version >= $min_gimp_version""... $ac_c" 1>&6
echo "configure:680: checking for GIMP - version >= $min_gimp_version" >&5
no_gimp=""
@ -971,7 +971,10 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
cat >> confdefs.h <<\EOF
#define HAVE_VSNPRINTF 1
EOF
else
echo "$ac_t""no" 1>&6
echo "configure: warning: vsnprintf not found.. I hope you are using gcc..." 1>&2
@ -980,6 +983,15 @@ fi
done
if test "x$GCC" = xyes; then
nowarn="-Wno-parentheses -Wno-unused -Wno-uninitialized"
GIMP_CFLAGS="$GIMP_CFLAGS $nowarn"
GIMP_CFLAGS_NOUI="$GIMP_CFLAGS"
fi
@ -1138,7 +1150,6 @@ s%@GIMP_LIBS_NOUI@%$GIMP_LIBS_NOUI%g
s%@CPP@%$CPP%g
s%@EXTENSIVE_TESTS@%$EXTENSIVE_TESTS%g
s%@IN_GIMP@%$IN_GIMP%g
s%@CONFIG_H@%$CONFIG_H%g
s%@PERL@%$PERL%g
CEOF

View file

@ -18,8 +18,8 @@ AC_ARG_WITH(libs, [ --with-libs=DIR Additionally search for librarie
AC_CHECK_PROGS(GIMP,gimp,gimp)
AM_PATH_GIMP(1.0.0,, AC_MSG_ERROR(
** unable to find gimp, make sure it's in your path (version 1.0+ required!)
AM_PATH_GIMP(1.0.2,, AC_MSG_ERROR(
** unable to find gimp, make sure it's in your path (version 1.0.2+ required!)
** You can get the Gimp from ftp://ftp.gimp.org/pub/gimp.
))

View file

@ -0,0 +1,77 @@
#!/usr/bin/perl
use strict 'subs';
use Gimp;
use Gimp::Fu;
#
# this is quite convoluted, but I found no other way to do this than:
#
# create a new image & one layer
# copy & paste the layer
# ditherize new image
# copy & paste back
#
#Gimp::set_trace(TRACE_ALL);
my %imagetype2layertype = (
RGB, RGB_IMAGE,
GRAY, GRAY_IMAGE,
INDEXED, INDEXED_IMAGE,
);
register "plug_in_ditherize",
"dithers current selection",
"This script takes the current selection and dithers it just like convert to indexed",
"Marc Lehmann",
"Marc Lehmann",
"1.1",
"<Image>/Filters/Noise/Ditherize",
"RGB*, GRAY*",
[
[PF_SLIDER, "colours", "The number of colours to dither to", 10, [0, 256]],
],
sub {
my($image,$drawable,$colours)=@_;
$drawable->layer or die "this plug-in only works for layers";
# make sure somehting is selected
$drawable->mask_bounds or $image->selection_all;
my ($x1,$y1,$x2,$y2)=($drawable->mask_bounds)[1..4];
my ($w,$h)=($x2-$x1,$y2-$y1);
my $sel = $image->selection_save;
$image->rect_select($x1,$y1,$w,$h,SELECTION_REPLACE,0,0);
$drawable->edit_copy;
$sel->selection_load;
$sel->remove_channel;
my $copy = new Image($w, $h, $image->base_type);
my $draw = new Layer($copy, $w, $h,
$imagetype2layertype{$image->base_type},
"temporary layer",100,NORMAL_MODE);
$copy->add_layer ($draw, 1);
$draw->edit_paste(0)->anchor;
$copy->convert_indexed (1, $colours);
$draw->edit_copy;
$drawable->edit_paste(1)->anchor;
$copy->delete;
();
};
exit main;

View file

@ -14,8 +14,6 @@
=cut
Watch out for these:
=head1 NAME
scm2perl - convert script-fu to perl