| 1 | package Image::Magick; |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | use strict; |
|---|
| 7 | use Carp; |
|---|
| 8 | use vars qw($VERSION @ISA @EXPORT $AUTOLOAD); |
|---|
| 9 | |
|---|
| 10 | require 5.002; |
|---|
| 11 | require Exporter; |
|---|
| 12 | require DynaLoader; |
|---|
| 13 | require AutoLoader; |
|---|
| 14 | |
|---|
| 15 | @ISA = qw(Exporter DynaLoader); |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 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 | |
|---|
| 35 | sub AUTOLOAD { |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 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 | |
|---|
| 57 | bootstrap Image::Magick $VERSION; |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | sub 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 | |
|---|
| 71 | sub 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 | |
|---|
| 82 | |
|---|
| 83 | END { UNLOAD () }; |
|---|
| 84 | |
|---|
| 85 | 1; |
|---|
| 86 | __END__ |
|---|
| 87 | |
|---|
| 88 | =head1 NAME |
|---|
| 89 | |
|---|
| 90 | Image::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 | |
|---|
| 105 | This Perl extension allows the reading, manipulation and writing of |
|---|
| 106 | a large number of image file formats using the ImageMagick library. |
|---|
| 107 | It was originally developed to be used by CGI scripts for Web pages. |
|---|
| 108 | |
|---|
| 109 | A 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 | |
|---|
| 116 | Kyle Shorter magick-users@imagemagick.org |
|---|
| 117 | |
|---|
| 118 | =head1 BUGS |
|---|
| 119 | |
|---|
| 120 | Has all the bugs of ImageMagick and much, much more! |
|---|
| 121 | |
|---|
| 122 | =head1 SEE ALSO |
|---|
| 123 | |
|---|
| 124 | perl(1). |
|---|
| 125 | |
|---|
| 126 | =cut |
|---|