cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | package Image::Magick; |
| 2 | |
| 3 | # Released Feb. 17, 1997 by Kyle Shorter (magick@wizards.dupont.com) |
| 4 | # Public Domain |
| 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 | # 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 | |
cristy | d934d10 | 2009-10-10 12:55:13 +0000 | [diff] [blame] | 33 | $VERSION = '6.5.7'; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 34 | |
| 35 | sub 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 | die "&${AUTOLOAD} not defined. The required ImageMagick libraries are not installed or not installed properly.\n" if $constname eq 'constant'; |
| 43 | my $val = constant($constname, @_ ? $_[0] : 0); |
| 44 | if ($! != 0) { |
| 45 | if ($! =~ /Invalid/) { |
| 46 | $AutoLoader::AUTOLOAD = $AUTOLOAD; |
| 47 | goto &AutoLoader::AUTOLOAD; |
| 48 | } |
| 49 | else { |
| 50 | my($pack,$file,$line) = caller; |
| 51 | die "Your vendor has not defined PerlMagick macro $pack\:\:$constname, used at $file line $line.\n"; |
| 52 | } |
| 53 | } |
| 54 | eval "sub $AUTOLOAD { $val }"; |
| 55 | goto &$AUTOLOAD; |
| 56 | } |
| 57 | |
| 58 | bootstrap Image::Magick $VERSION; |
| 59 | |
| 60 | # Preloaded methods go here. |
| 61 | |
| 62 | sub new |
| 63 | { |
| 64 | my $this = shift; |
| 65 | my $class = ref($this) || $this || "Image::Magick"; |
| 66 | my $self = [ ]; |
| 67 | bless $self, $class; |
| 68 | $self->set(@_) if @_; |
| 69 | return $self; |
| 70 | } |
| 71 | |
| 72 | sub New |
| 73 | { |
| 74 | my $this = shift; |
| 75 | my $class = ref($this) || $this || "Image::Magick"; |
| 76 | my $self = [ ]; |
| 77 | bless $self, $class; |
| 78 | $self->set(@_) if @_; |
| 79 | return $self; |
| 80 | } |
| 81 | |
| 82 | # Autoload methods go after =cut, and are processed by the autosplit program. |
| 83 | |
| 84 | END { UNLOAD () }; |
| 85 | |
| 86 | 1; |
| 87 | __END__ |
| 88 | |
| 89 | =head1 NAME |
| 90 | |
| 91 | Image::Magick - Perl extension for calling ImageMagick's libMagick methods |
| 92 | |
| 93 | =head1 SYNOPSIS |
| 94 | |
| 95 | use Image::Magick; |
| 96 | $p = new Image::Magick; |
| 97 | $p->Read("imagefile"); |
| 98 | $p->Set(attribute => value, ...) |
| 99 | ($a, ...) = $p->Get("attribute", ...) |
| 100 | $p->routine(parameter => value, ...) |
| 101 | $p->Mogrify("Routine", parameter => value, ...) |
| 102 | $p->Write("filename"); |
| 103 | |
| 104 | =head1 DESCRIPTION |
| 105 | |
| 106 | This Perl extension allows the reading, manipulation and writing of |
| 107 | a large number of image file formats using the ImageMagick library. |
| 108 | It was originally developed to be used by CGI scripts for Web pages. |
| 109 | |
| 110 | A Web page has been set up for this extension. See: |
| 111 | |
cristy | d934d10 | 2009-10-10 12:55:13 +0000 | [diff] [blame] | 112 | file:///usr/local/share/doc/ImageMagick-6.5.7/www/perl-magick.html |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 113 | http://www.imagemagick.org/script/perl-magick.php |
| 114 | |
| 115 | =head1 AUTHOR |
| 116 | |
| 117 | Kyle Shorter magick-users@imagemagick.org |
| 118 | |
| 119 | =head1 BUGS |
| 120 | |
| 121 | Has all the bugs of ImageMagick and much, much more! |
| 122 | |
| 123 | =head1 SEE ALSO |
| 124 | |
| 125 | perl(1). |
| 126 | |
| 127 | =cut |