root / ImageMagick / trunk / PerlMagick / Magick.pm

Revision 11951, 3.2 kB (checked in by cristy, 10 days ago)
Line 
1package Image::Magick;
2
3# Released Feb. 17, 1997  by Kyle Shorter (magick@wizards.dupont.com)
4# Public Domain
5
6use strict;
7use Carp;
8use vars qw($VERSION @ISA @EXPORT $AUTOLOAD);
9
10require 5.002;
11require Exporter;
12require DynaLoader;
13require AutoLoader;
14
15@ISA = qw(Exporter DynaLoader);
16# Items to export into callers namespace by default. Note: do not export
17# names by default without a very good reason. Use EXPORT_OK instead.
18# Do not simply export all your public functions/methods/constants.
19@EXPORT =
20  qw(
21      Success Transparent Opaque QuantumDepth QuantumRange MaxRGB
22      WarningException ResourceLimitWarning TypeWarning OptionWarning
23      DelegateWarning MissingDelegateWarning CorruptImageWarning
24      FileOpenWarning BlobWarning StreamWarning CacheWarning CoderWarning
25      ModuleWarning DrawWarning ImageWarning XServerWarning RegistryWarning
26      ConfigureWarning ErrorException ResourceLimitError TypeError
27      OptionError DelegateError MissingDelegateError CorruptImageError
28      FileOpenError BlobError StreamError CacheError CoderError
29      ModuleError DrawError ImageError XServerError RegistryError
30      ConfigureError FatalErrorException
31    );
32
33$VERSION = '6.4.3';
34
35sub AUTOLOAD {
36    # This AUTOLOAD is used to 'autoload' constants from the constant()
37    # XS function.  If a constant is not found then control is passed
38    # to the AUTOLOAD in AutoLoader.
39
40    my $constname;
41    ($constname = $AUTOLOAD) =~ s/.*:://;
42    my $val = constant($constname, @_ ? $_[0] : 0);
43    if ($! != 0) {
44        if ($! =~ /Invalid/) {
45            $AutoLoader::AUTOLOAD = $AUTOLOAD;
46            goto &AutoLoader::AUTOLOAD;
47        }
48        else {
49            my($pack,$file,$line) = caller;
50            die "Your vendor has not defined PerlMagick macro $pack\:\:$constname, used at $file line $line.\n";
51        }
52    }
53    eval "sub $AUTOLOAD { $val }";
54    goto &$AUTOLOAD;
55}
56
57bootstrap Image::Magick $VERSION;
58
59# Preloaded methods go here.
60
61sub new
62{
63    my $this = shift;
64    my $class = ref($this) || $this || "Image::Magick";
65    my $self = [ ];
66    bless $self, $class;
67    $self->set(@_) if @_;
68    return $self;
69}
70
71sub New
72{
73    my $this = shift;
74    my $class = ref($this) || $this || "Image::Magick";
75    my $self = [ ];
76    bless $self, $class;
77    $self->set(@_) if @_;
78    return $self;
79}
80
81# Autoload methods go after =cut, and are processed by the autosplit program.
82
83END { UNLOAD () };
84
851;
86__END__
87
88=head1 NAME
89
90Image::Magick - Perl extension for calling ImageMagick's libMagick methods
91
92=head1 SYNOPSIS
93
94  use Image::Magick;
95  $p = new Image::Magick;
96  $p->Read("imagefile");
97  $p->Set(attribute => value, ...)
98  ($a, ...) = $p->Get("attribute", ...)
99  $p->routine(parameter => value, ...)
100  $p->Mogrify("Routine", parameter => value, ...)
101  $p->Write("filename");
102
103=head1 DESCRIPTION
104
105This Perl extension allows the reading, manipulation and writing of
106a large number of image file formats using the ImageMagick library.
107It was originally developed to be used by CGI scripts for Web pages.
108
109A Web page has been set up for this extension. See:
110
111         file:///usr/local/share/doc/ImageMagick-6.4.3/www/perl-magick.html
112         http://www.imagemagick.org/script/perl-magick.php
113
114=head1 AUTHOR
115
116Kyle Shorter    magick-users@imagemagick.org
117
118=head1 BUGS
119
120Has all the bugs of ImageMagick and much, much more!
121
122=head1 SEE ALSO
123
124perl(1).
125
126=cut
Note: See TracBrowser for help on using the browser.