see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann
1999-07-30 20:51:19 +00:00
parent a3854b331c
commit aaedafae1d
16 changed files with 312 additions and 125 deletions

View File

@ -1,12 +1,18 @@
Revision history for Gimp-Perl extension.
1.1 Fri Jul 30 07:37:30 CEST 1999
- one of the most successful releases, in terms of features & bugfixes.
- it was also a long night. And expensive (irc).
- renamed gimp_drawable_mask to gimp_drawable_bounds to avoid clashes.
- new enums.pl, some changes: SELECTION_* becomes * again.
- compatibility fix for 5.005_58, also fixed a bug in Gimp::Pod.
- removed register_magic_load_handler from Lib.xs (is in PDB).
- preliminary <Load> and <Save> support (arguments are automatically
supplied).
- enabled limited pixel access functions even when PDL was not found.
- implemented and added examples/miff (a save filter for miff images).
- enabled limited pixel access functions even when PDL was not found,
just enough to re-enable magick and implement miff.
- implemented and added examples/miff (a load/save filter for miff
images).
- close DATA in Gimp unconditionally, saves one open filehandle.
- fixed the longstanding preview bug in Gimp::UI by reversing the
order of calls to draw_row. => something in gtk+ is really broken.
@ -14,10 +20,14 @@ Revision history for Gimp-Perl extension.
were not sever'ed created garbage.
- allow dummy dimension in grayscale pdls, i.e. pdl(1,width,height)
instead of pdl(width,height).
- improved gimpdoc.
- improved gimpdoc & pixelmap.
- removed debugging code from gouge. ouch!
- bug fixed: PDL::Core was not automatically required when not
already loaded.
- passing undef as PARAM_STRING passes a zero pointer in install_proc.
Required for load handlers. Ugh.
- fixed typoe in Parasite::is_persistent and implement "new" method.
- added new convinience function to Gimp::Util.
1.0981 Wed Jul 28 00:09:50 CEST 1999
- improved gouge ;) In a sense, it's actually pretty code now!
@ -27,6 +37,7 @@ Revision history for Gimp-Perl extension.
- fixed warnings in case no pod documentation is found.
- added examples/logulator.
- Carp is no longer loaded unless necessary. Reduces memory footprint.
- install embedxpm script by default.
1.098 Wed Jul 21 20:57:12 CEST 1999
- do not try to compile gimp_personal_rc_file without gimp-1.1.

View File

@ -12,7 +12,7 @@ use subs qw(init end lock unlock canonicalize_color);
require DynaLoader;
@ISA=qw(DynaLoader);
$VERSION = 1.099;
$VERSION = 1.1;
@_param = qw(
PARAM_BOUNDARY PARAM_CHANNEL PARAM_COLOR PARAM_DISPLAY PARAM_DRAWABLE
@ -25,26 +25,25 @@ $VERSION = 1.099;
# constants that, in some earlier version, were autoloaded
@_consts = (@_param,
#ENUM_NAME#
'SOFT', 'PRESSURE', 'HARD', 'RGBA_IMAGE', 'INDEXED_IMAGE', 'GRAYA_IMAGE', 'RGB_IMAGE',
'PRESSURE', 'SOFT', 'HARD', 'RGBA_IMAGE', 'INDEXED_IMAGE', 'GRAYA_IMAGE', 'RGB_IMAGE',
'INDEXEDA_IMAGE', 'GRAY_IMAGE', 'CUSTOM', 'FG_BG_HSV', 'FG_TRANS', 'FG_BG_RGB', 'CONTINUOUS',
'INCREMENTAL', 'APPLY', 'DISCARD', 'BLUE_CHANNEL', 'GREEN_CHANNEL', 'GRAY_CHANNEL', 'INDEXED_CHANNEL',
'AUXILLARY_CHANNEL', 'RED_CHANNEL', 'DODGEBURN_HIGHLIGHTS','DODGEBURN_SHADOWS', 'DODGEBURN_MIDTONES', 'ALPHA_LUT', 'GREEN_LUT',
'BLUE_LUT', 'VALUE_LUT', 'RED_LUT', 'HORIZONTAL_GUIDE', 'VERTICAL_GUIDE', 'OFFSET_BACKGROUND', 'OFFSET_TRANSPARENT',
'FG_BUCKET_FILL', 'BG_BUCKET_FILL', 'PATTERN_BUCKET_FILL', 'PDB_CALLING_ERROR', 'PDB_SUCCESS', 'PDB_EXECUTION_ERROR', 'PDB_PASS_THROUGH',
'WHITE_IMAGE_FILL', 'FG_IMAGE_FILL', 'TRANS_IMAGE_FILL', 'BG_IMAGE_FILL', 'NO_IMAGE_FILL', 'ONCE_FORWARD', 'ONCE_BACKWARDS',
'LOOP_SAWTOOTH', 'ONCE_END_COLOR', 'LOOP_TRIANGLE', 'MONO_PALETTE', 'WEB_PALETTE', 'MAKE_PALETTE', 'REUSE_PALETTE',
'CUSTOM_PALETTE', 'DODGE', 'BURN', 'CYAN_HUES', 'RED_HUES', 'ALL_HUES', 'YELLOW_HUES',
'GREEN_HUES', 'BLUE_HUES', 'MAGENTA_HUES', 'POINTS', 'PIXELS', 'SATURATION_MODE', 'ADDITION_MODE',
'NORMAL_MODE', 'HUE_MODE', 'SUBTRACT_MODE', 'DIVIDE_MODE', 'SCREEN_MODE', 'BEHIND_MODE', 'MULTIPLY_MODE',
'DISSOLVE_MODE', 'DIFFERENCE_MODE', 'DARKEN_ONLY_MODE', 'VALUE_MODE', 'LIGHTEN_ONLY_MODE', 'REPLACE_MODE', 'COLOR_MODE',
'OVERLAY_MODE', 'ERASE_MODE', 'VERTICAL', 'HORIZONTAL', 'BLUR_CONVOLVE', 'CUSTOM_CONVOLVE', 'SHARPEN_CONVOLVE',
'SHADOWS', 'MIDTONES', 'HIGHLIGHTS', 'REPLACE', 'SUB', 'ADD', 'INTERSECT',
'IMAGE_CLONE', 'PATTERN_CLONE', 'INDEXED', 'RGB', 'GRAY', 'BLACK_MASK', 'WHITE_MASK',
'ALPHA_MASK', 'BILINEAR', 'SPIRAL_CLOCKWISE', 'SQUARE', 'RADIAL', 'CONICAL_SYMMETRIC', 'SHAPEBURST_DIMPLED',
'CONICAL_ASYMMETRIC', 'LINEAR', 'SHAPEBURST_ANGULAR', 'SPIRAL_ANTICLOCKWISE','SHAPEBURST_SPHERICAL','PDB_PLUGIN', 'PDB_EXTENSION',
'PDB_TEMPORARY', 'PDB_INTERNAL', 'MESSAGE_BOX', 'ERROR_CONSOLE', 'CONSOLE', 'EXPAND_AS_NECESSARY', 'CLIP_TO_BOTTOM_LAYER',
'CLIP_TO_IMAGE', 'FLATTEN_IMAGE', 'RUN_INTERACTIVE', 'RUN_NONINTERACTIVE', 'RUN_WITH_LAST_VALS', 'REPEAT_NONE', 'REPEAT_SAWTOOTH',
'REPEAT_TRIANGULAR',
'INCREMENTAL', 'APPLY', 'DISCARD', 'BLUE_CHANNEL', 'GREEN_CHANNEL', 'GRAY_CHANNEL', 'AUXILLARY_CHANNEL',
'INDEXED_CHANNEL', 'RED_CHANNEL', 'UNKNOWN', 'VERTICAL', 'HORIZONTAL', 'DODGEBURN_HIGHLIGHTS','DODGEBURN_SHADOWS',
'DODGEBURN_MIDTONES', 'ALPHA_LUT', 'GREEN_LUT', 'BLUE_LUT', 'VALUE_LUT', 'RED_LUT', 'OFFSET_BACKGROUND',
'OFFSET_TRANSPARENT', 'BG_BUCKET_FILL', 'FG_BUCKET_FILL', 'PATTERN_BUCKET_FILL', 'PDB_SUCCESS', 'PDB_CALLING_ERROR', 'PDB_EXECUTION_ERROR',
'PDB_PASS_THROUGH', 'WHITE_IMAGE_FILL', 'FG_IMAGE_FILL', 'TRANS_IMAGE_FILL', 'BG_IMAGE_FILL', 'NO_IMAGE_FILL', 'LOOP_SAWTOOTH',
'ONCE_BACKWARDS', 'ONCE_FORWARD', 'ONCE_END_COLOR', 'LOOP_TRIANGLE', 'MONO_PALETTE', 'WEB_PALETTE', 'MAKE_PALETTE',
'REUSE_PALETTE', 'CUSTOM_PALETTE', 'BURN', 'DODGE', 'CYAN_HUES', 'RED_HUES', 'GREEN_HUES',
'YELLOW_HUES', 'ALL_HUES', 'MAGENTA_HUES', 'BLUE_HUES', 'POINTS', 'PIXELS', 'DIVIDE_MODE',
'SUBTRACT_MODE', 'SATURATION_MODE', 'ADDITION_MODE', 'SCREEN_MODE', 'BEHIND_MODE', 'MULTIPLY_MODE', 'DARKEN_ONLY_MODE',
'DIFFERENCE_MODE', 'DISSOLVE_MODE', 'VALUE_MODE', 'LIGHTEN_ONLY_MODE', 'COLOR_MODE', 'NORMAL_MODE', 'HUE_MODE',
'OVERLAY_MODE', 'BLUR_CONVOLVE', 'CUSTOM_CONVOLVE', 'SHARPEN_CONVOLVE', 'SHADOWS', 'MIDTONES', 'HIGHLIGHTS',
'REPLACE', 'SUB', 'ADD', 'INTERSECT', 'IMAGE_CLONE', 'PATTERN_CLONE', 'INDEXED',
'RGB', 'GRAY', 'BLACK_MASK', 'WHITE_MASK', 'ALPHA_MASK', 'BILINEAR', 'SPIRAL_CLOCKWISE',
'SQUARE', 'RADIAL', 'CONICAL_SYMMETRIC', 'SHAPEBURST_DIMPLED', 'CONICAL_ASYMMETRIC', 'LINEAR', 'SPIRAL_ANTICLOCKWISE',
'SHAPEBURST_ANGULAR', 'SHAPEBURST_SPHERICAL','PLUGIN', 'EXTENSION', 'INTERNAL', 'MESSAGE_BOX', 'ERROR_CONSOLE',
'CONSOLE', 'EXPAND_AS_NECESSARY', 'CLIP_TO_BOTTOM_LAYER','CLIP_TO_IMAGE', 'FLATTEN_IMAGE', 'RUN_INTERACTIVE', 'RUN_WITH_LAST_VALS',
'RUN_NONINTERACTIVE', 'REPEAT_NONE', 'REPEAT_SAWTOOTH', 'REPEAT_TRIANGULAR',
#ENUM_NAME#
'STATUS_CALLING_ERROR', 'STATUS_EXECUTION_ERROR', 'STATUS_PASS_THROUGH',
'STATUS_SUCCESS', 'PARASITE_PERSISTENT', 'PARASITE_ATTACH_PARENT',
@ -55,44 +54,48 @@ $VERSION = 1.099;
'WRAP', 'SMEAR', 'BLACK',
'ADD_BLACK_MASK', 'ADD_WHITE_MASK', 'ADD_ALPHA_MASK',
'ORIENTATION_HORIZONTAL', 'ORIENTATION_VERTICAL', 'ORIENTATION_UNKNOWN',
);
sub ADD_WHITE_MASK () { &WHITE_MASK }
sub ADD_BLACK_MASK () { &BLACK_MASK }
sub ADD_ALPHA_MASK () { &ALPHA_MASK }
sub ORIENTATION_HORIZONTAL () { &HORIZONTAL }
sub ORIENTATION_VERTICAL () { &VERTICAL }
sub ORIENTATION_UNKNOWN () { &UNKNOWN }
@_procs = ('main','xlfd_size');
bootstrap Gimp $VERSION;
#ENUM_DEFS#
sub SOFT (){ 1} sub PRESSURE (){ 2} sub HARD (){ 0} sub RGBA_IMAGE (){ 1} sub INDEXED_IMAGE (){ 4}
sub PRESSURE (){ 2} sub SOFT (){ 1} sub HARD (){ 0} sub RGBA_IMAGE (){ 1} sub INDEXED_IMAGE (){ 4}
sub GRAYA_IMAGE (){ 3} sub RGB_IMAGE (){ 0} sub INDEXEDA_IMAGE (){ 5} sub GRAY_IMAGE (){ 2} sub CUSTOM (){ 3}
sub FG_BG_HSV (){ 1} sub FG_TRANS (){ 2} sub FG_BG_RGB (){ 0} sub CONTINUOUS (){ 0} sub INCREMENTAL (){ 1}
sub APPLY (){ 0} sub DISCARD (){ 1} sub BLUE_CHANNEL (){ 2} sub GREEN_CHANNEL (){ 1} sub GRAY_CHANNEL (){ 3}
sub INDEXED_CHANNEL (){ 4} sub AUXILLARY_CHANNEL (){ 5} sub RED_CHANNEL (){ 0} sub DODGEBURN_HIGHLIGHTS(){ 0} sub DODGEBURN_SHADOWS (){ 2}
sub DODGEBURN_MIDTONES (){ 1} sub ALPHA_LUT (){ 4} sub GREEN_LUT (){ 2} sub BLUE_LUT (){ 3} sub VALUE_LUT (){ 0}
sub RED_LUT (){ 1} sub HORIZONTAL_GUIDE (){ 1} sub VERTICAL_GUIDE (){ 2} sub OFFSET_BACKGROUND (){ 0} sub OFFSET_TRANSPARENT (){ 1}
sub FG_BUCKET_FILL (){ 0} sub BG_BUCKET_FILL (){ 1} sub PATTERN_BUCKET_FILL (){ 2} sub PDB_CALLING_ERROR (){ 1} sub PDB_SUCCESS (){ 3}
sub PDB_EXECUTION_ERROR (){ 0} sub PDB_PASS_THROUGH (){ 2} sub WHITE_IMAGE_FILL (){ 2} sub FG_IMAGE_FILL (){ 0} sub TRANS_IMAGE_FILL (){ 3}
sub BG_IMAGE_FILL (){ 1} sub NO_IMAGE_FILL (){ 4} sub ONCE_FORWARD (){ 0} sub ONCE_BACKWARDS (){ 1} sub LOOP_SAWTOOTH (){ 2}
sub ONCE_END_COLOR (){ 4} sub LOOP_TRIANGLE (){ 3} sub MONO_PALETTE (){ 3} sub WEB_PALETTE (){ 2} sub MAKE_PALETTE (){ 0}
sub REUSE_PALETTE (){ 1} sub CUSTOM_PALETTE (){ 4} sub DODGE (){ 0} sub BURN (){ 1} sub CYAN_HUES (){ 4}
sub RED_HUES (){ 1} sub ALL_HUES (){ 0} sub YELLOW_HUES (){ 2} sub GREEN_HUES (){ 3} sub BLUE_HUES (){ 5}
sub MAGENTA_HUES (){ 6} sub POINTS (){ 1} sub PIXELS (){ 0} sub SATURATION_MODE (){12} sub ADDITION_MODE (){ 7}
sub NORMAL_MODE (){ 0} sub HUE_MODE (){11} sub SUBTRACT_MODE (){ 8} sub DIVIDE_MODE (){15} sub SCREEN_MODE (){ 4}
sub BEHIND_MODE (){ 2} sub MULTIPLY_MODE (){ 3} sub DISSOLVE_MODE (){ 1} sub DIFFERENCE_MODE (){ 6} sub DARKEN_ONLY_MODE (){ 9}
sub VALUE_MODE (){14} sub LIGHTEN_ONLY_MODE (){10} sub REPLACE_MODE (){17} sub COLOR_MODE (){13} sub OVERLAY_MODE (){ 5}
sub ERASE_MODE (){16} sub VERTICAL (){ 1} sub HORIZONTAL (){ 0} sub BLUR_CONVOLVE (){ 0} sub CUSTOM_CONVOLVE (){ 2}
sub SHARPEN_CONVOLVE (){ 1} sub SHADOWS (){ 0} sub MIDTONES (){ 1} sub HIGHLIGHTS (){ 2} sub REPLACE (){ 2}
sub SUB (){ 1} sub ADD (){ 0} sub INTERSECT (){ 3} sub IMAGE_CLONE (){ 0} sub PATTERN_CLONE (){ 1}
sub INDEXED (){ 2} sub RGB (){ 0} sub GRAY (){ 1} sub BLACK_MASK (){ 1} sub WHITE_MASK (){ 0}
sub ALPHA_MASK (){ 2} sub BILINEAR (){ 1} sub SPIRAL_CLOCKWISE (){ 9} sub SQUARE (){ 3} sub RADIAL (){ 2}
sub CONICAL_SYMMETRIC (){ 4} sub SHAPEBURST_DIMPLED (){ 8} sub CONICAL_ASYMMETRIC (){ 5} sub LINEAR (){ 0} sub SHAPEBURST_ANGULAR (){ 6}
sub SPIRAL_ANTICLOCKWISE(){10} sub SHAPEBURST_SPHERICAL(){ 7} sub PDB_PLUGIN (){ 1} sub PDB_EXTENSION (){ 2} sub PDB_TEMPORARY (){ 3}
sub PDB_INTERNAL (){ 0} sub MESSAGE_BOX (){ 0} sub ERROR_CONSOLE (){ 2} sub CONSOLE (){ 1} sub EXPAND_AS_NECESSARY (){ 0}
sub CLIP_TO_BOTTOM_LAYER(){ 2} sub CLIP_TO_IMAGE (){ 1} sub FLATTEN_IMAGE (){ 3} sub RUN_INTERACTIVE (){bless \(my $x=0),'Gimp::run_mode'} sub RUN_NONINTERACTIVE (){bless \(my $x=1),'Gimp::run_mode'}
sub RUN_WITH_LAST_VALS (){bless \(my $x=2),'Gimp::run_mode'} sub REPEAT_NONE (){ 0} sub REPEAT_SAWTOOTH (){ 1} sub REPEAT_TRIANGULAR (){ 2}
sub AUXILLARY_CHANNEL (){ 5} sub INDEXED_CHANNEL (){ 4} sub RED_CHANNEL (){ 0} sub UNKNOWN (){ 2} sub VERTICAL (){ 1}
sub HORIZONTAL (){ 0} sub DODGEBURN_HIGHLIGHTS(){ 0} sub DODGEBURN_SHADOWS (){ 2} sub DODGEBURN_MIDTONES (){ 1} sub ALPHA_LUT (){ 4}
sub GREEN_LUT (){ 2} sub BLUE_LUT (){ 3} sub VALUE_LUT (){ 0} sub RED_LUT (){ 1} sub OFFSET_BACKGROUND (){ 0}
sub OFFSET_TRANSPARENT (){ 1} sub BG_BUCKET_FILL (){ 1} sub FG_BUCKET_FILL (){ 0} sub PATTERN_BUCKET_FILL (){ 2} sub PDB_SUCCESS (){ 3}
sub PDB_CALLING_ERROR (){ 1} sub PDB_EXECUTION_ERROR (){ 0} sub PDB_PASS_THROUGH (){ 2} sub WHITE_IMAGE_FILL (){ 2} sub FG_IMAGE_FILL (){ 0}
sub TRANS_IMAGE_FILL (){ 3} sub BG_IMAGE_FILL (){ 1} sub NO_IMAGE_FILL (){ 4} sub LOOP_SAWTOOTH (){ 2} sub ONCE_BACKWARDS (){ 1}
sub ONCE_FORWARD (){ 0} sub ONCE_END_COLOR (){ 4} sub LOOP_TRIANGLE (){ 3} sub MONO_PALETTE (){ 3} sub WEB_PALETTE (){ 2}
sub MAKE_PALETTE (){ 0} sub REUSE_PALETTE (){ 1} sub CUSTOM_PALETTE (){ 4} sub BURN (){ 1} sub DODGE (){ 0}
sub CYAN_HUES (){ 4} sub RED_HUES (){ 1} sub GREEN_HUES (){ 3} sub YELLOW_HUES (){ 2} sub ALL_HUES (){ 0}
sub MAGENTA_HUES (){ 6} sub BLUE_HUES (){ 5} sub POINTS (){ 1} sub PIXELS (){ 0} sub DIVIDE_MODE (){15}
sub SUBTRACT_MODE (){ 8} sub SATURATION_MODE (){12} sub ADDITION_MODE (){ 7} sub SCREEN_MODE (){ 4} sub BEHIND_MODE (){ 2}
sub MULTIPLY_MODE (){ 3} sub DARKEN_ONLY_MODE (){ 9} sub DIFFERENCE_MODE (){ 6} sub DISSOLVE_MODE (){ 1} sub VALUE_MODE (){14}
sub LIGHTEN_ONLY_MODE (){10} sub COLOR_MODE (){13} sub NORMAL_MODE (){ 0} sub HUE_MODE (){11} sub OVERLAY_MODE (){ 5}
sub BLUR_CONVOLVE (){ 0} sub CUSTOM_CONVOLVE (){ 2} sub SHARPEN_CONVOLVE (){ 1} sub SHADOWS (){ 0} sub MIDTONES (){ 1}
sub HIGHLIGHTS (){ 2} sub REPLACE (){ 2} sub SUB (){ 1} sub ADD (){ 0} sub INTERSECT (){ 3}
sub IMAGE_CLONE (){ 0} sub PATTERN_CLONE (){ 1} sub INDEXED (){ 2} sub RGB (){ 0} sub GRAY (){ 1}
sub BLACK_MASK (){ 1} sub WHITE_MASK (){ 0} sub ALPHA_MASK (){ 2} sub BILINEAR (){ 1} sub SPIRAL_CLOCKWISE (){ 9}
sub SQUARE (){ 3} sub RADIAL (){ 2} sub CONICAL_SYMMETRIC (){ 4} sub SHAPEBURST_DIMPLED (){ 8} sub CONICAL_ASYMMETRIC (){ 5}
sub LINEAR (){ 0} sub SPIRAL_ANTICLOCKWISE(){10} sub SHAPEBURST_ANGULAR (){ 6} sub SHAPEBURST_SPHERICAL(){ 7} sub PLUGIN (){ 1}
sub EXTENSION (){ 2} sub INTERNAL (){ 0} sub MESSAGE_BOX (){ 0} sub ERROR_CONSOLE (){ 2} sub CONSOLE (){ 1}
sub EXPAND_AS_NECESSARY (){ 0} sub CLIP_TO_BOTTOM_LAYER(){ 2} sub CLIP_TO_IMAGE (){ 1} sub FLATTEN_IMAGE (){ 3} sub RUN_INTERACTIVE (){bless \(my $x=0),'Gimp::run_mode'}
sub RUN_WITH_LAST_VALS (){bless \(my $x=2),'Gimp::run_mode'} sub RUN_NONINTERACTIVE (){bless \(my $x=1),'Gimp::run_mode'} sub REPEAT_NONE (){ 0} sub REPEAT_SAWTOOTH (){ 1} sub REPEAT_TRIANGULAR (){ 2}
#ENUM_DEFS#
sub WRAP (){ 0 }
@ -544,7 +547,7 @@ sub new($$$$$$$$) {
package Gimp::Parasite;
sub is_type($$) { $_[0]->[0] eq $_[1] }
sub is_persistant($) { $_[0]->[1] & &Gimp::PARASITE_PERSISTANT }
sub is_persistent($) { $_[0]->[1] & &Gimp::PARASITE_PERSISTENT }
sub is_error($) { !defined $_[0]->[0] }
sub has_flag($$) { $_[0]->[1] & $_[1] }
sub copy($) { [@{$_[0]}] }
@ -554,6 +557,7 @@ sub data($) { $_[0]->[2] }
sub compare($$) { $_[0]->[0] eq $_[1]->[0] and
$_[0]->[1] eq $_[1]->[1] and
$_[0]->[2] eq $_[1]->[2] }
sub new($$$$) { shift; [@_] }
package Gimp::run_mode;

View File

@ -648,6 +648,7 @@ sub this_script {
my @names;
for my $this (@scripts) {
my $fun = (split /\//,$this->[1])[-1];
$fun =~ s/^(?:perl_fu|plug_in)_//;
return $this if lc($exe) eq lc($fun);
push(@names,$fun);
}
@ -1088,8 +1089,11 @@ sub register($$$$$$$$$;@) {
@pre = (shift,shift);
} elsif ($menupath=~/^<Toolbox>\// or !defined $menupath) {
# valid ;)
} elsif ($menupath=~/^<(?:Load|Save)>\//) {
@_ >= 4 or die "<Load/Save> plug-in called without the 5 standard arguments!\n";
} elsif ($menupath=~/^<Load>\//) {
@_ >= 2 or die "<Load> plug-in called without the 5 standard arguments!\n";
@pre = (shift,shift);
} elsif ($menupath=~/^<Save>\//) {
@_ >= 4 or die "<Save> plug-in called without the 5 standard arguments!\n";
@pre = (shift,shift,shift,shift);
} else {
die "menupath _must_ start with <Image>, <Toolbox>, <Load> or <Save>!";
@ -1144,7 +1148,7 @@ sub register($$$$$$$$$;@) {
my @imgs = &$code(@pre,@_);
$old_trace = Gimp::set_trace (0);
if (@imgs) {
if (@imgs && $menupath !~ /^<Load>\//) {
for my $i (0..$#imgs) {
my $img = $imgs[$i];
next unless defined $img;
@ -1160,12 +1164,12 @@ sub register($$$$$$$$$;@) {
} elsif ($run_mode != &Gimp::RUN_NONINTERACTIVE) {
$img->display_new unless $input_image && $$img == $$input_image;
}
} elsif (!@$results) {
} elsif (!@$retvals) {
warn "WARNING: $function returned something that is not an image: \"$img\"\n";
}
}
Gimp->displays_flush;
}
Gimp->displays_flush;
Gimp::set_trace ($old_trace);
wantarray ? @imgs : $imgs[0];

View File

@ -912,7 +912,7 @@ push_gimp_sv (GParam *arg, int array_as_ref)
PUTBACK;
}
#define SvPv(sv) (SvOK(sv) ? SvPV_nolen(sv) : NULL)
#define SvPv(sv) (SvOK(sv) ? SvPV_nolen(sv) : 0)
#define Sv32(sv) unbless ((sv), PKG_ANY, croak_str)
#define av2gimp(arg,sv,datatype,type,svxv) { \
@ -950,8 +950,8 @@ convert_sv2gimp (char *croak_str, GParam *arg, SV *sv)
arg->data.d_int32 = sv2gimp_extract_noref (SvIV, "INT32");
case PARAM_INT16: arg->data.d_int16 = sv2gimp_extract_noref (SvIV, "INT16");
case PARAM_INT8: arg->data.d_int8 = sv2gimp_extract_noref (SvIV, "INT8");
case PARAM_FLOAT: arg->data.d_float = sv2gimp_extract_noref (SvNV, "FLOAT");;
case PARAM_STRING: arg->data.d_string = sv2gimp_extract_noref (SvPv, "STRING");;
case PARAM_FLOAT: arg->data.d_float = sv2gimp_extract_noref (SvNV, "FLOAT");
case PARAM_STRING: arg->data.d_string = sv2gimp_extract_noref (SvPv, "STRING");
case PARAM_DISPLAY:
case PARAM_IMAGE:
@ -1629,46 +1629,42 @@ gimp_call_procedure (proc_name, ...)
}
void
gimp_install_procedure(name, blurb, help, author, copyright, date, menu_path_sv, image_types, type, params, return_vals)
gimp_install_procedure(name, blurb, help, author, copyright, date, menu_path, image_types, type, params, return_vals)
char * name
char * blurb
char * help
char * author
char * copyright
char * date
SV * menu_path_sv
char * image_types
SV * menu_path
SV * image_types
int type
SV * params
SV * return_vals
ALIAS:
gimp_install_temp_proc = 1
CODE:
{
char *menu_path = SvPv (menu_path_sv);
if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVAV
&& SvROK(return_vals) && SvTYPE(SvRV(return_vals)) == SVt_PVAV)
{
GParamDef *apd; int nparams;
GParamDef *rpd; int nreturn_vals;
if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVAV
&& SvROK(return_vals) && SvTYPE(SvRV(return_vals)) == SVt_PVAV)
{
GParamDef *apd; int nparams;
GParamDef *rpd; int nreturn_vals;
nparams = convert_array2paramdef ((AV *)SvRV(params) , &apd);
nreturn_vals = convert_array2paramdef ((AV *)SvRV(return_vals), &rpd);
nparams = convert_array2paramdef ((AV *)SvRV(params) , &apd);
nreturn_vals = convert_array2paramdef ((AV *)SvRV(return_vals), &rpd);
if (ix)
gimp_install_temp_proc(name,blurb,help,author,copyright,date,SvPv(menu_path),SvPv(image_types),
type,nparams,nreturn_vals,apd,rpd,pii_run);
else
gimp_install_procedure(name,blurb,help,author,copyright,date,SvPv(menu_path),SvPv(image_types),
type,nparams,nreturn_vals,apd,rpd);
if (ix)
gimp_install_temp_proc(name,blurb,help,author,copyright,date,menu_path,image_types,
type,nparams,nreturn_vals,apd,rpd,pii_run);
else
gimp_install_procedure(name,blurb,help,author,copyright,date,menu_path,image_types,
type,nparams,nreturn_vals,apd,rpd);
g_free (rpd);
g_free (apd);
}
else
croak ("params and return_vals must be array refs (even if empty)!");
}
g_free (rpd);
g_free (apd);
}
else
croak ("params and return_vals must be array refs (even if empty)!");
void
gimp_uninstall_temp_proc(name)
@ -2003,6 +1999,19 @@ gimp_pixel_rgn_get_rect2(pr, x, y, width, height)
OUTPUT:
RETVAL
void
gimp_pixel_rgn_set_rect2(pr, data, x, y, w=pr->w)
GPixelRgn * pr
SV * data
int x
int y
int w
CODE:
{
STRLEN dlen; char *dta = SvPV (data, dlen);
gimp_pixel_rgn_set_rect (pr, dta, x, y, w, dlen / (w*pr->bpp));
}
#if HAVE_PDL
SV *

View File

@ -250,13 +250,13 @@ sub gimp_text_wh {
=pod
=item C<gimp_drawable_mask $drawable>
=item C<gimp_drawable_bounds $drawable>
returns an array (x,y,w,h) containing the upper left corner and the size of the
current mask, just as needed by pixelrgn and similar functions.
=cut
sub gimp_drawable_mask {
sub gimp_drawable_bounds {
my @b = (shift->mask_bounds)[1..4];
(@b[0,1],$b[2]-$b[0],$b[3]-$b[1]);
}
@ -268,6 +268,11 @@ sub gimp_drawable_mask {
returns the corresponding layer type for an image, alpha controls wether the layer type
is with alpha or not. Example: imagetype: RGB -> RGB_IMAGE (or RGBA_IMAGE).
=item C<gimp_layer2imagetype $layertype>
returns the corresponding layer type for an image, alpha controls wether the layer type
is with alpha or not. Example: imagetype: RGB -> RGB_IMAGE (or RGBA_IMAGE).
=item C<gimp_image_add_new_layer $image,$index,$fill_type,$alpha>
creates a new layer and adds it at position $index (default 0) to the
@ -296,6 +301,17 @@ sub gimp_image_layertype {
die;
}
sub gimp_layer2imagetype {
my $type = shift;
$type == RGB_IMAGE ? RGB :
$type == RGBA_IMAGE ? RGB :
$type == GRAY_IMAGE ? GRAY :
$type == GRAYA_IMAGE ? GRAY :
$type == INDEXED_IMAGE ? INDEXED :
$type == INDEXEDA_IMAGE ? INDEXED :
die;
}
sub gimp_image_add_new_layer {
my ($image,$index,$filltype,$alpha)=@_;
my $layer = new Layer ($image, $image->width, $image->height, $image->layertype (defined $alpha ? $alpha : 1), join(":",(caller)[1,2]), 100, NORMAL_MODE);

View File

@ -13,7 +13,7 @@ $|=1;
perlotine randomblends innerbevel fit-text guidegrid roundrectsel
repdup centerguide stampify goldenmean triangle billboard mirrorsplit
oneliners randomart1 pixelmap glowing_steel frame_reshuffle frame_filter
logulator miff
logulator miff magick
);
@shebang = (map("examples/$_",@examples),
qw(Perl-Server examples/example-net.pl examples/homepage-logo.pl
@ -263,7 +263,7 @@ WriteMakefile(
'LIBS' => [''],
'INC' => "$INC1 $GIMP_INC_NOUI $CPPFLAGS $CFLAGS",
'DEFINE' => "$DEFINE1 $DEFS",
'EXE_FILES' => [qw(scm2perl scm2scm gimpdoc xcftopnm)],
'EXE_FILES' => [qw(scm2perl scm2scm gimpdoc xcftopnm embedxpm)],
'macro' => \%cfg,
'realclean' => { FILES => "config.status config.cache config.pl config.log config.h Gimp/Config.pm" },
'clean' => { FILES => "Makefile.old stamp-h" },

View File

@ -16,6 +16,7 @@ script-fu 4.9 vs. 3.3
bugs
* /root/gimprelease && TODO -> publish!
* perl_require_pv with _59?
* scroll behaviour, use clist instead of list?
[DONE] * can_Default for oter OK-buttons

View File

@ -23,7 +23,7 @@ To only insert the xpm data, use this form:
Here is an example (taken from the Gimp/PDB program):
# create the logo pixmap for the given widget
C<# create the logo pixmap for the given widget
sub create_logo($) {
new Gtk::Pixmap(Gtk::Gdk::Pixmap->create_from_xpm_d(
$_[0]->window,
@ -32,7 +32,7 @@ Here is an example (taken from the Gimp/PDB program):
'xpm data', 'xpm data...',...
#%XPM%
))
}
}>
To insert the xpm with the name example.xpm into this source you would have
to use the following commandline:

View File

@ -26,7 +26,7 @@ register "colour_to_alpha",
Gimp->progress_init ("Replacing colour...");
my @bounds = $drawable->mask;
my @bounds = $drawable->bounds;
{
# $src and $dst must either be scoped or explicitly undef'ed
# before merge_shadow.
@ -62,7 +62,7 @@ register "colour_to_alpha",
Gimp->progress_update (1);
$drawable->merge_shadow (1);
$drawable->update ($drawable->mask);
$drawable->update ($drawable->bounds);
(); # wir haben kein neues Bild erzeugt
};

View File

@ -6,7 +6,7 @@ use Gimp::Fu;
use Gtk;
BEGIN { eval "use Image::Magick 1.45"; $@ and Gimp::Feature::missing ("Image::Magick version 1.45 or higher") };
$VERSION = '0.2';
$VERSION = '0.2.1';
$preview_size = 160; # max. size for image preview
@ -121,7 +121,7 @@ sub read_pixels {
for(my $y=0; $y<$y2; $y+=$th) {
# calling internal function, sorry folks!
Gimp->progress_update ($y/$y2*100);
print TEMP $region->rect2($region,0,$y,$x2,$y2-$y > $th ? $th : $y2-$y);
print TEMP $region->get_rect2(0,$y,$x2,$y2-$y > $th ? $th : $y2-$y);
}
close TEMP;
$im->Set(size => $x2.'x'.$y2);
@ -160,12 +160,13 @@ sub write_pixels {
# calling internal function, sorry folks!
Gimp->progress_update ($y/$y2*100);
read TEMP,$buf,$stride*$th;
Gimp::PixelRgn::_set_rect($region,$buf,0,$y,$x2);
$region->set_rect2($buf,0,$y);
}
close TEMP;
undef $region;
$drawable->merge_shadow (1);
$drawable->update ($x1, $y1, $x2, $y2);
Gimp->displays_flush;
}

View File

@ -16,7 +16,7 @@ sub iterate {
Gimp->progress_init ($message);
my @bounds = $drawable->mask;
my @bounds = $drawable->bounds;
my @off = $drawable->offsets;
$bounds[2]-- if $bounds[0]+$bounds[2] >= ($drawable->offsets)[0]+$drawable->width;
$bounds[3]-- if $bounds[1]+$bounds[3] >= ($drawable->offsets)[1]+$drawable->height;

View File

@ -82,7 +82,7 @@ sub write_logo {
gimp_image_add_layer ($img,$shadow,1);
gimp_shear ($shadow,1,HORIZONTAL,-$th);
gimp_shear ($shadow,1,ORIENTATION_HORIZONTAL,-$th);
gimp_layer_scale ($shadow, $tw, $th*0.3, 1);
gimp_layer_translate ($shadow, $th*0.1, $th*0.3);
plug_in_gauss_rle ($shadow, 1, 1, 1);

View File

@ -31,7 +31,7 @@ register "file_miff_save",
"RGB, RGBA, GRAY, INDEXED-NOT-YET", # weird, but no matte for !DirectColour
[],
sub {
my($img,$drawable,$filename) =@_;
my($img,$drawable,$filename) = @_;
my @layers = $img->get_layers;
sysopen FILE,$filename,O_CREAT|O_TRUNC|O_WRONLY or die "Unable to open '$filename' for writing: $!\n";
my $hdr = eval { $img->find_parasite("gimp-comment")->data };
@ -42,6 +42,9 @@ id=ImageMagick
CREATOR: file_miff_save gimp plug-in, see http://www.gimp.org/
$hdr}
EOF
Gimp->tile_cache_ntiles($img->width / Gimp->tile_width + 1);
init Progress "Saving '$filename' as MIFF...";
my $scene = 0;
for (@layers) {
@ -49,6 +52,7 @@ EOF
"scene=$scene\n",
"class=", $_->color ? "DirectClass" : "PseudoClass", "\n";
#"gamma=", Gimp->gamma, "\n";
# resolution etc..
write_layer(*FILE,$_);
$scene++;
update Progress $scene/@layers;
@ -57,8 +61,115 @@ EOF
();
};
sub read_layer {
my($img)=shift;
local $_=shift;
my($w,$h,$d)=($_->{columns},$_->{rows},$_->{_bpp});
my $l = new Layer $img, $w, $h,
(
$d == 1 ? GRAY_IMAGE
: $d == 2 ? GRAYA_IMAGE
: $d == 3 ? RGB_IMAGE
: $d == 4 ? RGBA_IMAGE
: die "Unsupported image depth ($d channels)\n"
),
$_->{scene}, 100, NORMAL_MODE;
$l->add_layer($_->{scene});
my $r = new PixelRgn $l,0,0,$w,$h,1,0;
seek FILE, $_->{_offset}, 0;
for my $y (0..$h-1) {
read FILE, $_, $w * $d;
$r->set_rect2($_,0,$y);
}
undef $r;
$l;
}
register "file_miff_load",
"load miff images (Magick Interchange File Format)",
"Loads images that were saved in the miff (Magick Interchange File Format) format used by the ImageMagick package",
"Marc Lehmann",
"Marc Lehmann <pcg\@goof.com>",
"1999-07-30",
"<Load>/MIFF",
undef,
[],
sub {
my($filename) = @_;
sysopen FILE,$filename,O_RDONLY or die "Unable to open '$filename' for reading: $!\n";
my(@scenes);
my $comment;
seek FILE, 0, 2; my $filesize = tell FILE; seek FILE, 0, 0;
local $/ = "\012";
init Progress "Loading MIFF image from '$filename'...";
do {
my %h;
header:
while (<FILE>) {
die "Unexpected end of file while reading from '$filename'\n" if eof;
while($_ =~ /\S/) {
if (/:\012$/) {
last header;
} elsif (s/^\s*(\w+)=(\S+|"(?:[^\\"]+|\\"|\\)*")//) {
$h{$1}=$2;
} elsif (s/\s*\{//) {
while(!s/([^}]*)}//) {
$comment .= $_;
$_ = <FILE>;
die "Unexpected end of file while reading comment block from '$filename'\n" if eof;
}
$comment .= $1;
} else {
die "Unparseable header line ($_) while reading '$filename'\n";
}
}
}
die "No ImageMagick header found in '$filename'\n" unless $h{id} eq "ImageMagick";
$h{_bpp} = ($h{class} =~ /PseudoClass/ ? 1 : 3)
+ ($h{matte} =~ /True/i ? 1 : 0);
$h{_size} = $h{rows} * $h{columns} * $h{_bpp};
$h{_offset} = tell;
push @scenes, \%h;
seek FILE, $h{_size}, 1;
update Progress tell()/$filesize*0.2;
} while !eof;
my ($w,$h,$d);
for (@scenes) {
$w = $_->{columns} if $_->{columns} > $w;
$h = $_->{rows} if $_->{rows} > $h;
$d = $_->{_bpp} if $_->{_bpp} > $d;
}
my $img = new Image $w, $h, $d >= 3 ? RGB : GRAY;
if ($comment) {
$comment =~ s/^\s+//s;
$comment =~ s/\s+$//s;
$img->attach_parasite (new Parasite "gimp-comment", PARASITE_PERSISTENT, $comment);
}
# resolution etc..
Gimp->tile_cache_ntiles($w / Gimp->tile_width + 1);
# horrors, reverse, and line-by-line (!!)
for (@scenes) {
my $layer = read_layer $img,$_;
update Progress tell()/$filesize*0.8 + 0.2;
}
$img;
};
Gimp::on_query {
##Gimp->register_magic_load_handler("file_miff_load", "miff", "", "0,string,id=ImageMagick");
Gimp->register_magic_load_handler("file_miff_load", "miff", "", "0,string,id=ImageMagick");
Gimp->register_save_handler("file_miff_save", "miff", "");
};

View File

@ -31,19 +31,19 @@ register "mirror_split",
my $temp1 = gimp_layer_copy($layer, 1);
if ($mirror == 0) { # upper half
$temp1 = gimp_flip($temp1, VERTICAL);
$temp1 = gimp_flip($temp1, ORIENTATION_VERTICAL);
gimp_rect_select($img, 0, $hspan, $w, $h - $hspan, REPLACE, 0, 0);
};
if ($mirror == 1) { # lower half
$temp1 = gimp_flip($temp1, VERTICAL);
$temp1 = gimp_flip($temp1, ORIENTATION_VERTICAL);
gimp_rect_select($img, 0, 0, $w, $hspan, REPLACE, 0, 0);
};
if ($mirror == 2) { # left half
$temp1 = gimp_flip($temp1, HORIZONTAL);
$temp1 = gimp_flip($temp1, ORIENTATION_HORIZONTAL);
gimp_rect_select($img, $wspan, 0, $w - $wspan, $h, REPLACE, 0, 0);
};
if ($mirror == 3) { # right half
$temp1 = gimp_flip($temp1, HORIZONTAL);
$temp1 = gimp_flip($temp1, ORIENTATION_HORIZONTAL);
gimp_rect_select($img, 0, 0, $wspan, $h, REPLACE, 0, 0);
};

View File

@ -15,7 +15,7 @@ sub get_vguides { # get back an ordered set of vertical guides
$i=0;
my @vguides;
while ($i=$img->find_next_guide($i)) {
if ($img->get_guide_orientation($i) == &Gimp::VERTICAL_GUIDE){
if ($img->get_guide_orientation($i) == ORIENTATION_VERTICAL){
$keyval = sprintf("%4d", $img->get_guide_position($i));
$vkeys{$keyval} = $i;
}
@ -32,7 +32,7 @@ sub get_hguides { # get back an ordered set of horizontal guides
$i=0;
my @hguides;
while ($i=$img->find_next_guide($i)) {
if ($img->get_guide_orientation($i) == &Gimp::HORIZONTAL_GUIDE){
if ($img->get_guide_orientation($i) == ORIENTATION_HORIZONTAL){
$keyval = sprintf("%4d", $img->get_guide_position($i));
$hkeys{$keyval} = $i;
}
@ -106,7 +106,7 @@ register "perlotine",
"Add guides to an image. Then run this. It will cut along the guides, and give you the html to reassemble the resulting images.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-03-19",
"1999-07-30",
"<Image>/Image/Transforms/Perl-o-tine",
"*",
[

View File

@ -1,25 +1,14 @@
#!/usr/bin/perl -w
use Gimp::Feature 'pdl';
use Gimp 1.092;
use Gimp 1.099;
use Gimp::Fu;
use Gimp::Util;
use PDL;
use constant PI => 4 * atan2 1,1;
register "pixelmap",
"Maps Pixel values and coordinates through general Perl expressions",
"=pod(DESCRIPTION)",
"Marc Lehmann",
"Marc Lehmann <pcg\@goof.com>",
"19990729",
"<Image>/Filters/Map/Pixelmap",
"*",
[
[PF_TEXT, "expression" , "The perl expression to use", "outer(\$x*0.1,\$y*0.2)\n->slice(\"*\$bpp\")"]
],
sub { # es folgt das eigentliche Skript...
sub pixelmap { # es folgt das eigentliche Skript...
my($image,$drawable,$_expr)=@_;
Gimp->progress_init ("Mapping pixels...");
@ -35,11 +24,11 @@ register "pixelmap",
$_expr = "sub{$init\n#line 1\n$_expr\n;}";
my @_bounds = $drawable->mask;
my @_bounds = $drawable->bounds;
{
# $src and $dst must either be scoped or explicitly undef'ed
# before merge_shadow.
my $src = new PixelRgn $drawable,@_bounds,0,0;
my $src = new PixelRgn $drawable->get,@_bounds,0,0;
my $_dst = new PixelRgn $drawable,@_bounds,1,1;
$_expr = eval $_expr; die "$@" if $@;
@ -56,9 +45,53 @@ register "pixelmap",
}
$drawable->merge_shadow (1);
$drawable->update ($drawable->mask);
$drawable->update (@_bounds);
(); # wir haben kein neues Bild erzeugt
}
register "pixelmap",
"Maps Pixel values and coordinates through general Perl expressions",
"=pod(DESCRIPTION)",
"Marc Lehmann",
"Marc Lehmann <pcg\@goof.com>",
"19990729",
"<Image>/Filters/Map/Pixelmap",
"*",
[
[PF_TEXT, "expression" , "The perl expression to use", "outer(\$x*0.1,\$y*0.2)\n->slice(\"*\$bpp\")"]
],
\&pixelmap;
register "pixelgen",
"Generate the pixels of an image by expressions (in PDL)",
"=pod(DESCRIPTION)",
"Marc Lehmann",
"Marc Lehmann <pcg\@goof.com>",
"19990730",
"<Toolbox>/Xtns/Render/Pixelgenerator",
"*",
[
[PF_SPINNER, "width" , "The width of the new image to generate", 512, [1, 4096, 1]],
[PF_SPINNER, "height" , "The height of the new image to generate", 512, [1, 4096, 1]],
[PF_RADIO, "type" , "The type of the layer to create (same as gimp_layer_new.type)",
RGB_IMAGE , [RGB => RGB_IMAGE, RGBA => RGBA_IMAGE, GRAY => GRAY_IMAGE,
GRAYA => GRAYA_IMAGE, INDEXED => INDEXED_IMAGE, INDEXEDA => INDEXEDA_IMAGE]],
[PF_TEXT, "expression" , "The perl expression to use", "outer(\$x*0.1,\$y*0.2)\n->slice(\"*\$bpp\")"]
],
[[PF_IMAGE, "image" , "The resulting image"]],
sub {
my($w,$h,$type,$expr)=@_;
my $image = new Image $w, $h, Gimp->layer2imagetype($type);
my $layer = new Layer $image, $w, $h, $type, $expr, 100, NORMAL_MODE;
$image->add_layer($layer, 0);
eval { pixelmap($image, $layer, $expr) };
if ($@) {
my $error = $@;
$image->delete;
die $error;
};
$image;
};
exit main;
@ -67,9 +100,6 @@ exit main;
Not yet written yet, sorry...
=head1 HI
x