see plug-ins/perl/Changes

This commit is contained in:
Marc Lehmann 1999-01-11 21:38:31 +00:00
parent 7d44059b50
commit 5e7d70556d
8 changed files with 140 additions and 124 deletions

View File

@ -1,5 +1,11 @@
Revision history for Gimp-Perl extension.
- corrected a minor typoe found by Stefan Traby <stefan@sime.com>
- added SPIRAL* constants for gimp_blend
- moved constants from Gimp.xs and extradefs.h to Gimp.pm, where
they belong (either there or into Gimp.xs)
- added view3d.pl to examples (untested)
1.05 Fri Dec 18 22:05:25 CET 1998
- some 5.006 compatibility fixes
- disabled some functionality for poor gtk-1.0 which

View File

@ -43,6 +43,7 @@ $VERSION = 1.05;
SHARPEN SQUARE STATUS_CALLING_ERROR STATUS_EXECUTION_ERROR
STATUS_PASS_THROUGH STATUS_SUCCESS SUBTRACT_MODE TRANS_IMAGE_FILL
VALUE_MODE DIVIDE_MODE PARASITE_PERSISTANT WHITE_IMAGE_FILL
SPIRAL_CLOCKWISE SPIRAL_ANTICLOCKWISE
TRACE_NONE TRACE_CALL TRACE_TYPE TRACE_NAME TRACE_DESC
TRACE_ALL
@ -61,6 +62,84 @@ $VERSION = 1.05;
bootstrap Gimp $VERSION;
# defs missing from libgimp
sub BEHIND_MODE (){ 2 };
sub FG_BG_RGB (){ 0 };
sub FG_BG_HSV (){ 1 };
sub FG_TRANS (){ 2 };
sub CUSTOM (){ 3 };
sub LINEAR (){ 0 };
sub BILINEAR (){ 1 };
sub RADIAL (){ 2 };
sub SQUARE (){ 3 };
sub CONICAL_SYMMETRIC (){ 4 };
sub CONICAL_ASYMMETRIC (){ 5 };
sub SHAPEBURST_ANGULAR (){ 6 };
sub SHAPEBURST_SPHERICAL(){ 7 };
sub SHAPEBURST_DIMPLED (){ 8 };
sub SPIRAL_CLOCKWISE (){ 9 };
sub SPIRAL_ANTICLOCKWISE(){10 };
sub REPEAT_NONE (){ 0 };
sub REPEAT_SAWTOOTH (){ 1 };
sub REPEAT_TRIANGULAR (){ 2 };
sub FG_BUCKET_FILL (){ 0 };
sub BG_BUCKET_FILL (){ 1 };
sub PATTERN_BUCKET_FILL (){ 2 };
sub RED_CHANNEL (){ 0 };
sub GREEN_CHANNEL (){ 1 };
sub BLUE_CHANNEL (){ 2 };
sub GRAY_CHANNEL (){ 3 };
sub INDEXED_CHANNEL (){ 4 };
sub WHITE_MASK (){ 0 };
sub BLACK_MASK (){ 1 };
sub ALPHA_MASK (){ 2 };
sub APPLY (){ 0 };
sub DISCARD (){ 1 };
sub EXPAND_AS_NECESSARY (){ 0 };
sub CLIP_TO_IMAGE (){ 1 };
sub CLIP_TO_BOTTOM_LAYER(){ 2 };
sub SELECTION_ADD (){ 0 };
sub SELECTION_SUB (){ 1 };
sub SELECTION_REPLACE (){ 2 };
sub SELECTION_INTERSECT (){ 3 };
sub PIXELS (){ 0 };
sub POINTS (){ 1 };
sub IMAGE_CLONE (){ 0 };
sub PATTERN_CLONE (){ 1 };
sub BLUR (){ 0 };
sub SHARPEN (){ 1 };
sub ALL_HUES (){ 0 };
sub RED_HUES (){ 1 };
sub YELLOW_HUES (){ 2 };
sub GREEN_HUES (){ 3 };
sub CYAN_HUES (){ 4 };
sub BLUE_HUES (){ 5 };
sub MAGENTA_HUES (){ 6 };
sub MESSAGE_BOX (){ 0 };
sub CONSOLE (){ 1 };
sub SHADOWS (){ 0 };
sub MIDTONES (){ 1 };
sub HIGHLIGHTS (){ 2 };
sub HORIZONTAL (){ 0 };
sub VERTICAL (){ 1 };
# internal constants shared with Perl-Server
sub _PS_FLAG_QUIET { 0000000001 }; # do not output messages

View File

@ -77,43 +77,19 @@ BOOT:
HV *stash = gv_stashpvn("Gimp", 4, TRUE);
newCONSTSUB(stash,"ADDITION_MODE",newSViv(ADDITION_MODE));
newCONSTSUB(stash,"ALPHA_MASK",newSViv(ALPHA_MASK));
newCONSTSUB(stash,"APPLY",newSViv(APPLY));
newCONSTSUB(stash,"BEHIND_MODE",newSViv(BEHIND_MODE));
newCONSTSUB(stash,"BG_BUCKET_FILL",newSViv(BG_BUCKET_FILL));
newCONSTSUB(stash,"BG_IMAGE_FILL",newSViv(BG_IMAGE_FILL));
newCONSTSUB(stash,"BILINEAR",newSViv(BILINEAR));
newCONSTSUB(stash,"BLACK_MASK",newSViv(BLACK_MASK));
newCONSTSUB(stash,"BLUE_CHANNEL",newSViv(BLUE_CHANNEL));
newCONSTSUB(stash,"BLUR",newSViv(BLUR));
newCONSTSUB(stash,"CLIP_TO_BOTTOM_LAYER",newSViv(CLIP_TO_BOTTOM_LAYER));
newCONSTSUB(stash,"CLIP_TO_IMAGE",newSViv(CLIP_TO_IMAGE));
newCONSTSUB(stash,"COLOR_MODE",newSViv(COLOR_MODE));
newCONSTSUB(stash,"CONICAL_ASYMMETRIC",newSViv(CONICAL_ASYMMETRIC));
newCONSTSUB(stash,"CONICAL_SYMMETRIC",newSViv(CONICAL_SYMMETRIC));
newCONSTSUB(stash,"CUSTOM",newSViv(CUSTOM));
newCONSTSUB(stash,"DARKEN_ONLY_MODE",newSViv(DARKEN_ONLY_MODE));
newCONSTSUB(stash,"DIFFERENCE_MODE",newSViv(DIFFERENCE_MODE));
newCONSTSUB(stash,"DISCARD",newSViv(DISCARD));
newCONSTSUB(stash,"DISSOLVE_MODE",newSViv(DISSOLVE_MODE));
newCONSTSUB(stash,"EXPAND_AS_NECESSARY",newSViv(EXPAND_AS_NECESSARY));
newCONSTSUB(stash,"FG_BG_HSV",newSViv(FG_BG_HSV));
newCONSTSUB(stash,"FG_BG_RGB",newSViv(FG_BG_RGB));
newCONSTSUB(stash,"FG_BUCKET_FILL",newSViv(FG_BUCKET_FILL));
newCONSTSUB(stash,"FG_TRANS",newSViv(FG_TRANS));
newCONSTSUB(stash,"GRAY",newSViv(GRAY));
newCONSTSUB(stash,"GRAYA_IMAGE",newSViv(GRAYA_IMAGE));
newCONSTSUB(stash,"GRAY_CHANNEL",newSViv(GRAY_CHANNEL));
newCONSTSUB(stash,"GRAY_IMAGE",newSViv(GRAY_IMAGE));
newCONSTSUB(stash,"GREEN_CHANNEL",newSViv(GREEN_CHANNEL));
newCONSTSUB(stash,"HUE_MODE",newSViv(HUE_MODE));
newCONSTSUB(stash,"IMAGE_CLONE",newSViv(IMAGE_CLONE));
newCONSTSUB(stash,"INDEXED",newSViv(INDEXED));
newCONSTSUB(stash,"INDEXEDA_IMAGE",newSViv(INDEXEDA_IMAGE));
newCONSTSUB(stash,"INDEXED_CHANNEL",newSViv(INDEXED_CHANNEL));
newCONSTSUB(stash,"INDEXED_IMAGE",newSViv(INDEXED_IMAGE));
newCONSTSUB(stash,"LIGHTEN_ONLY_MODE",newSViv(LIGHTEN_ONLY_MODE));
newCONSTSUB(stash,"LINEAR",newSViv(LINEAR));
newCONSTSUB(stash,"MULTIPLY_MODE",newSViv(MULTIPLY_MODE));
newCONSTSUB(stash,"NORMAL_MODE",newSViv(NORMAL_MODE));
newCONSTSUB(stash,"OVERLAY_MODE",newSViv(OVERLAY_MODE));
@ -139,18 +115,9 @@ BOOT:
newCONSTSUB(stash,"PARAM_STATUS",newSViv(PARAM_STATUS));
newCONSTSUB(stash,"PARAM_STRING",newSViv(PARAM_STRING));
newCONSTSUB(stash,"PARAM_STRINGARRAY",newSViv(PARAM_STRINGARRAY));
newCONSTSUB(stash,"PATTERN_BUCKET_FILL",newSViv(PATTERN_BUCKET_FILL));
newCONSTSUB(stash,"PATTERN_CLONE",newSViv(PATTERN_CLONE));
newCONSTSUB(stash,"PIXELS",newSViv(PIXELS));
newCONSTSUB(stash,"POINTS",newSViv(POINTS));
newCONSTSUB(stash,"PROC_EXTENSION",newSViv(PROC_EXTENSION));
newCONSTSUB(stash,"PROC_PLUG_IN",newSViv(PROC_PLUG_IN));
newCONSTSUB(stash,"PROC_TEMPORARY",newSViv(PROC_TEMPORARY));
newCONSTSUB(stash,"RADIAL",newSViv(RADIAL));
newCONSTSUB(stash,"RED_CHANNEL",newSViv(RED_CHANNEL));
newCONSTSUB(stash,"REPEAT_NONE",newSViv(REPEAT_NONE));
newCONSTSUB(stash,"REPEAT_SAWTOOTH",newSViv(REPEAT_SAWTOOTH));
newCONSTSUB(stash,"REPEAT_TRIANGULAR",newSViv(REPEAT_TRIANGULAR));
newCONSTSUB(stash,"RGB",newSViv(RGB));
newCONSTSUB(stash,"RGBA_IMAGE",newSViv(RGBA_IMAGE));
newCONSTSUB(stash,"RGB_IMAGE",newSViv(RGB_IMAGE));
@ -159,15 +126,6 @@ BOOT:
newCONSTSUB(stash,"RUN_WITH_LAST_VALS",newSViv(RUN_WITH_LAST_VALS));
newCONSTSUB(stash,"SATURATION_MODE",newSViv(SATURATION_MODE));
newCONSTSUB(stash,"SCREEN_MODE",newSViv(SCREEN_MODE));
newCONSTSUB(stash,"SELECTION_ADD",newSViv(SELECTION_ADD));
newCONSTSUB(stash,"SELECTION_INTERSECT",newSViv(SELECTION_INTERSECT));
newCONSTSUB(stash,"SELECTION_REPLACE",newSViv(SELECTION_REPLACE));
newCONSTSUB(stash,"SELECTION_SUB",newSViv(SELECTION_SUB));
newCONSTSUB(stash,"SHAPEBURST_ANGULAR",newSViv(SHAPEBURST_ANGULAR));
newCONSTSUB(stash,"SHAPEBURST_DIMPLED",newSViv(SHAPEBURST_DIMPLED));
newCONSTSUB(stash,"SHAPEBURST_SPHERICAL",newSViv(SHAPEBURST_SPHERICAL));
newCONSTSUB(stash,"SHARPEN",newSViv(SHARPEN));
newCONSTSUB(stash,"SQUARE",newSViv(SQUARE));
newCONSTSUB(stash,"STATUS_CALLING_ERROR",newSViv(STATUS_CALLING_ERROR));
newCONSTSUB(stash,"STATUS_EXECUTION_ERROR",newSViv(STATUS_EXECUTION_ERROR));
newCONSTSUB(stash,"STATUS_PASS_THROUGH",newSViv(STATUS_PASS_THROUGH));
@ -182,7 +140,6 @@ BOOT:
newCONSTSUB(stash,"TRACE_ALL",newSViv(TRACE_ALL));
newCONSTSUB(stash,"VALUE_MODE",newSViv(VALUE_MODE));
newCONSTSUB(stash,"WHITE_IMAGE_FILL",newSViv(WHITE_IMAGE_FILL));
newCONSTSUB(stash,"WHITE_MASK",newSViv(WHITE_MASK));
#if HAVE_DIVIDE_MODE || IN_GIMP
newCONSTSUB(stash,"DIVIDE_MODE",newSViv(DIVIDE_MODE));
#endif
@ -194,22 +151,5 @@ BOOT:
newCONSTSUB(stash,"PARAM_PARASITE",newSViv(PARAM_PARASITE));
newCONSTSUB(stash,"PARASITE_PERSISTENT",newSViv(PARASITE_PERSISTENT));
#endif
newCONSTSUB(stash,"ALL_HUES", newSViv(0));
newCONSTSUB(stash,"RED_HUES", newSViv(1));
newCONSTSUB(stash,"YELLOW_HUES", newSViv(2));
newCONSTSUB(stash,"GREEN_HUES", newSViv(3));
newCONSTSUB(stash,"CYAN_HUES", newSViv(4));
newCONSTSUB(stash,"BLUE_HUES", newSViv(5));
newCONSTSUB(stash,"MAGENTA_HUES", newSViv(6));
newCONSTSUB(stash,"MESSAGE_BOX", newSViv(0));
newCONSTSUB(stash,"CONSOLE", newSViv(1));
newCONSTSUB(stash,"SHADOWS", newSViv(0));
newCONSTSUB(stash,"MIDTONES", newSViv(1));
newCONSTSUB(stash,"HIGHLIGHTS", newSViv(2));
newCONSTSUB(stash,"HORIZONTAL", newSViv(0));
newCONSTSUB(stash,"VERTICAL", newSViv(1));
}

View File

@ -48,3 +48,4 @@ examples/homepage-logo.pl
examples/windy.pl
examples/prep4gif.pl
examples/ditherize.pl
examples/view3d.pl

View File

@ -133,6 +133,7 @@ install-plugins:
-cd examples && $GIMPTOOL2 --install-admin-bin tex-to-float
-cd examples && $GIMPTOOL2 --install-admin-bin ditherize
-cd examples && $GIMPTOOL2 --install-admin-bin border.pl
-cd examples && $GIMPTOOL2 --install-admin-bin view3d.pl
EOF
}

View File

@ -0,0 +1,52 @@
#!/usr/bin/perl -w
BEGIN { $^W=1 }
use strict;
use Gimp;
use Gimp::Fu;
use Gimp::PDL;
use PDL;
use PDL::Core;
use PDL::Math;
use PDL::Graphics::TriD;
register (
'view3d',
'View grayscale drawable in 3D',
'This script uses PDL::Graphics:TriD to view a grayscale drawable in 3D. You can choose a Cartesian (default) or Polar projection, toggle the drawing of lines, and toggle normal smoothing.',
'Tom Rathborne', 'GPLv2', 'v0.0:1998-11-28',
'<Image>/View/3D Surface',
'GRAY', [
[ PF_BOOL, 'Polar', 'Radial view', 0],
[ PF_BOOL, 'Lines', 'Draw grid lines', 0],
[ PF_BOOL, 'Smooth', 'Smooth surface normals', 1]
], [ ],
sub {
my ($img, $dwb, $polar, $lines, $smooth) = @_;
my $w = $dwb->width;
my $h = $dwb->height;
my $gdwb = $dwb->get;
my $regn = $gdwb->pixel_rgn (0, 0, $w, $h, 0, 0);
my $rect = $regn->get_rect (0, 0, $w, $h);
my $surf = $rect->slice('(0)');
imag3d [ $polar ? 'POLAR2D' : 'SURF2D', $surf ],
{ 'Lines' => $lines, 'Smooth' => $smooth };
0;
}
);
exit main;

View File

@ -9,66 +9,3 @@
#define TRACE_DESC 0x41
#define TRACE_ALL 0xff
/* defs missing from libgimp */
#define BEHIND_MODE 2
#define FG_BG_RGB 0
#define FG_BG_HSV 1
#define FG_TRANS 2
#define CUSTOM 3
#define LINEAR 0
#define BILINEAR 1
#define RADIAL 2
#define SQUARE 3
#define CONICAL_SYMMETRIC 4
#define CONICAL_ASYMMETRIC 5
#define SHAPEBURST_ANGULAR 6
#define SHAPEBURST_SPHERICAL 7
#define SHAPEBURST_DIMPLED 8
#define REPEAT_NONE 0
#define REPEAT_SAWTOOTH 1
#define REPEAT_TRIANGULAR 2
#define FG_BUCKET_FILL 0
#define BG_BUCKET_FILL 1
#define PATTERN_BUCKET_FILL 2
#define RED_CHANNEL 0
#define GREEN_CHANNEL 1
#define BLUE_CHANNEL 2
#define GRAY_CHANNEL 3
#define INDEXED_CHANNEL 4
#define WHITE_MASK 0
#define BLACK_MASK 1
#define ALPHA_MASK 2
#define APPLY 0
#define DISCARD 1
#define EXPAND_AS_NECESSARY 0
#define CLIP_TO_IMAGE 1
#define CLIP_TO_BOTTOM_LAYER 2
#define SELECTION_ADD 0
#define SELECTION_SUB 1
#define SELECTION_REPLACE 2
#define SELECTION_INTERSECT 3
#define PIXELS 0
#define POINTS 1
#define IMAGE_CLONE 0
#define PATTERN_CLONE 1
#define BLUR 0
#define SHARPEN 1
/*
#define TRUE 1
#define FALSE 0
*/

View File

@ -58,7 +58,7 @@ use Parse::RecDescent;
$RD_HINT=1;
unless(@ARGV) {
print STDERR "Script-Fu to Perl Translater 1.0\n";
print STDERR "Script-Fu to Perl Translator 1.0\n";
print STDERR "Usage: $0 file.scm ...\n";
exit(1);
}