diff options
Diffstat (limited to 'lib/PDF/Builder/Resource/XObject/Image')
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/GD.pm | 13 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/GIF.pm | 19 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/JPEG.pm | 10 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/PNG.pm | 19 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/PNG_IPL.pm | 16 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/PNM.pm | 13 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/TIFF.pm | 35 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/TIFF/File.pm | 17 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/TIFF/File_GT.pm | 17 | ||||
-rw-r--r-- | lib/PDF/Builder/Resource/XObject/Image/TIFF_GT.pm | 18 |
10 files changed, 133 insertions, 44 deletions
diff --git a/lib/PDF/Builder/Resource/XObject/Image/GD.pm b/lib/PDF/Builder/Resource/XObject/Image/GD.pm index c3e091a..2514bde 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/GD.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/GD.pm @@ -5,8 +5,8 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.024'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use PDF::Builder::Util; use PDF::Builder::Basic::PDF::Utils; @@ -18,9 +18,11 @@ PDF::Builder::Resource::XObject::Image::GD - support routines for Graphics Devel =head1 METHODS -=over +=head2 new -=item $res = PDF::Builder::Resource::XObject::Image::GD->new($pdf, $file, %opts) + $res = PDF::Builder::Resource::XObject::Image::GD->new($pdf, $file, %opts) + +=over Options: @@ -36,6 +38,9 @@ Use lossless compression. =back +An image object is created from GD input. Note that this should be invoked +from Builder.pm's method. + =back =cut diff --git a/lib/PDF/Builder/Resource/XObject/Image/GIF.pm b/lib/PDF/Builder/Resource/XObject/Image/GIF.pm index 6617a48..e8e91b7 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/GIF.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/GIF.pm @@ -5,8 +5,8 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.024'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use IO::File; use PDF::Builder::Util; @@ -162,6 +162,21 @@ sub deGIF { return $out; } +=head1 METHODS + +=head2 new + + PDF::Builder::Resource::XObject::Image::GIF->new() + +=over + +Create an image object from a GIF input file. +Remember that this should be invoked via the Builder.pm method! + +=back + +=cut + sub new { my ($class, $pdf, $file, %opts) = @_; # copy dashed option names to preferred undashed names diff --git a/lib/PDF/Builder/Resource/XObject/Image/JPEG.pm b/lib/PDF/Builder/Resource/XObject/Image/JPEG.pm index ed2307e..86b1ef2 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/JPEG.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/JPEG.pm @@ -5,8 +5,8 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.024'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use IO::File; use PDF::Builder::Util; @@ -19,9 +19,11 @@ PDF::Builder::Resource::XObject::Image::JPEG - support routines for JPEG image l =head1 METHODS -=over +=head2 new + + $res = PDF::Builder::Resource::XObject::Image::JPEG->new($pdf, $file, %opts) -=item $res = PDF::Builder::Resource::XObject::Image::JPEG->new($pdf, $file, %opts) +=over Options: diff --git a/lib/PDF/Builder/Resource/XObject/Image/PNG.pm b/lib/PDF/Builder/Resource/XObject/Image/PNG.pm index ae04d3a..f44a8f6 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/PNG.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/PNG.pm @@ -5,8 +5,8 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.024'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use Compress::Zlib; use POSIX qw(ceil floor); @@ -24,9 +24,11 @@ Inherits from L<PDF::Builder::Resource::XObject::Image> =head1 METHODS -=over +=head2 new + + $res = PDF::Builder::Resource::XObject::Image::PNG->new($pdf, $file, %opts) -=item $res = PDF::Builder::Resource::XObject::Image::PNG->new($pdf, $file, %opts) +=over Returns a PNG-image object. C<$pdf> is the PDF object being added to, C<$file> is the input PNG file, and the optional C<$name> of the new parent image object @@ -51,6 +53,9 @@ This is the name you can give for the PNG image object. The default is Pxnnnn. =back +Remember that you need to invoke the image_png method from Builder.pm in +order to use this functionality. + =back =head2 Supported PNG types @@ -385,9 +390,11 @@ sub new { return($self); } -=over +=head2 usesLib + + $mode = $png->usesLib() -=item $mode = $png->usesLib() +=over Returns 1 if Image::PNG::Libpng installed and used, 0 if not installed, or -1 if installed but not used (nouseIPL option given to C<image_png>). diff --git a/lib/PDF/Builder/Resource/XObject/Image/PNG_IPL.pm b/lib/PDF/Builder/Resource/XObject/Image/PNG_IPL.pm index 0070633..00f20d4 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/PNG_IPL.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/PNG_IPL.pm @@ -5,7 +5,7 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION +our $VERSION = '3.026'; # VERSION our $LAST_UPDATE = '3.024'; # manually update whenever code is changed use Compress::Zlib; @@ -26,9 +26,11 @@ Inherits from L<PDF::Builder::Resource::XObject::Image> =head1 METHODS -=over +=head2 new + + $res = PDF::Builder::Resource::XObject::Image::PNG_IPL->new($pdf, $file, %opts) -=item $res = PDF::Builder::Resource::XObject::Image::PNG_IPL->new($pdf, $file, %opts) +=over Returns a PNG-image object. C<$pdf> is the PDF object being added to, C<$file> is the input PNG file, and the optional C<$name> of the new parent image object @@ -58,6 +60,8 @@ This is the name you can give for the PNG image object. The default is Pxnnnn. =back +Remember that you need to use Builder.pm's image_png to process PNG images. + =back =head2 Supported PNG types @@ -578,9 +582,11 @@ sub new { return($self); } -=over +=head2 usesLib + + $mode = $png->usesLib() -=item $mode = $png->usesLib() +=over Returns 1 if Image::PNG::Libpng installed and used, 0 if not installed, or -1 if installed but not used (nouseIPL option given to C<image_png>). diff --git a/lib/PDF/Builder/Resource/XObject/Image/PNM.pm b/lib/PDF/Builder/Resource/XObject/Image/PNM.pm index 87617c3..f36f10a 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/PNM.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/PNM.pm @@ -7,8 +7,8 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.024'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use IO::File; use PDF::Builder::Util; @@ -24,9 +24,11 @@ PDF::Builder::Resource::XObject::Image::PNM - support routines for PNM (Portable =head2 METHODS -=over +=head2 new + + $res = PDF::Builder::Resource::XObject::Image::PNM->new($pdf, $file, %opts) -=item $res = PDF::Builder::Resource::XObject::Image::PNM->new($pdf, $file, %opts) +=over Options: @@ -59,6 +61,9 @@ color) may be anything from 1 to 65535 (the same maximum for all three colors), with 0 being full black. If the maximum sample value is 255 or smaller, three bytes of raw binary data per pixel, otherwise six bytes. +Remember that you need to use Builder.pm's image_pnm method to use this +functionality. + =cut # ------------------------------------------------------------------- diff --git a/lib/PDF/Builder/Resource/XObject/Image/TIFF.pm b/lib/PDF/Builder/Resource/XObject/Image/TIFF.pm index 3391b69..0e28d26 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/TIFF.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/TIFF.pm @@ -5,8 +5,8 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.024'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use Compress::Zlib; @@ -21,9 +21,11 @@ PDF::Builder::Resource::XObject::Image::TIFF - TIFF image support =head1 METHODS -=over +=head2 new + + $res = PDF::Builder::Resource::XObject::Image::TIFF->new($pdf, $file, %opts) -=item $res = PDF::Builder::Resource::XObject::Image::TIFF->new($pdf, $file, %opts) +=over Returns a TIFF-image object. @@ -41,6 +43,11 @@ This is the name you can give for the TIFF image object. The default is Ixnnnn. =back +Remember that you need to use the Builder.pm method image_tiff in order to +display a TIFF file. + +=back + =cut sub new { @@ -89,7 +96,11 @@ sub new { return $self; } -=item $mode = $tif->usesLib() +=head2 usesLib + + $mode = $tif->usesLib() + +=over Returns 1 if Graphics::TIFF installed and used, 0 if not installed, or -1 if installed but not used (nouseGT option given to C<image_tiff>). @@ -100,6 +111,8 @@ advance of actually using it, in case you want to use some functionality available only in TIFF_GT. See the <PDF::Builder> LA_GT() call if you need to know in advance. +=back + =cut sub usesLib { @@ -313,7 +326,11 @@ sub read_tiff { return $self; } -=item $value = $tif->tiffTag($tag) +=head2 tiffTag + + $value = $tif->tiffTag($tag) + +=over returns the value of the internal tiff-tag. @@ -323,6 +340,8 @@ B<Useful Tags:> xRes, yRes (dpi; pixel/cm if resUnit==3) resUnit +=back + =cut sub tiffTag { @@ -330,8 +349,4 @@ sub tiffTag { return $self->{' tiff'}->{$tag}; } -=back - -=cut - 1; diff --git a/lib/PDF/Builder/Resource/XObject/Image/TIFF/File.pm b/lib/PDF/Builder/Resource/XObject/Image/TIFF/File.pm index c94aaab..37f960e 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/TIFF/File.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/TIFF/File.pm @@ -3,8 +3,8 @@ package PDF::Builder::Resource::XObject::Image::TIFF::File; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.023'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use IO::File; @@ -12,6 +12,19 @@ use IO::File; PDF::Builder::Resource::XObject::Image::TIFF::File - support routines for TIFF image library +=head1 METHODS + +=head2 new + + PDF::Builder::Resource::XObject::Image::TIFF::File->new() + +=over + +Create a TIFF image object, I<not> using the Graphics::TIFF library. +Remember to use the Builder.pm method image_tiff. + +=back + =cut sub new { diff --git a/lib/PDF/Builder/Resource/XObject/Image/TIFF/File_GT.pm b/lib/PDF/Builder/Resource/XObject/Image/TIFF/File_GT.pm index 8c15d8d..985c384 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/TIFF/File_GT.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/TIFF/File_GT.pm @@ -3,8 +3,8 @@ package PDF::Builder::Resource::XObject::Image::TIFF::File_GT; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.023'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use IO::File; use Graphics::TIFF ':all'; # already confirmed to be installed @@ -13,6 +13,19 @@ use Graphics::TIFF ':all'; # already confirmed to be installed PDF::Builder::Resource::XObject::Image::TIFF::File_GT - support routines for TIFF image library (Graphics::TIFF enabled) +=head1 METHODS + +=head2 new + + PDF::Builder::Resource::XObject::Image::TIFF::File_GT->new() + +=over + +Create an image object from TIFF input, using the Graphics::TIFF library. +Remember to use the Builder.pm method image_tiff for this functionality. + +=back + =cut sub new { diff --git a/lib/PDF/Builder/Resource/XObject/Image/TIFF_GT.pm b/lib/PDF/Builder/Resource/XObject/Image/TIFF_GT.pm index b3b8e46..c2c91e7 100644 --- a/lib/PDF/Builder/Resource/XObject/Image/TIFF_GT.pm +++ b/lib/PDF/Builder/Resource/XObject/Image/TIFF_GT.pm @@ -5,8 +5,8 @@ use base 'PDF::Builder::Resource::XObject::Image'; use strict; use warnings; -our $VERSION = '3.025'; # VERSION -our $LAST_UPDATE = '3.024'; # manually update whenever code is changed +our $VERSION = '3.026'; # VERSION +our $LAST_UPDATE = '3.026'; # manually update whenever code is changed use Compress::Zlib; @@ -23,9 +23,11 @@ PDF::Builder::Resource::XObject::Image::TIFF_GT - TIFF image support =head1 METHODS -=over +=head2 new + + $res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file, %opts) -=item $res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file, %opts) +=over Returns a TIFF-image object. C<$pdf> is the PDF object being added to, C<$file> is the input TIFF file, and the optional C<$name> of the new parent image object @@ -69,6 +71,8 @@ look into adding it as an option. According to Graphic::TIFF's owner (ticket RT 133955), this is coming directly from libtiff (as write to STDERR), so he can't do anything about it! +=back + =cut sub new { @@ -137,7 +141,11 @@ sub new { return $self; } # end of new() -=item $mode = $tif->usesLib() +=head2 usesLib + + $mode = $tif->usesLib() + +=over Returns 1 if Graphics::TIFF installed and used, 0 if not installed, or -1 if installed but not used (nouseGT option given to C<image_tiff>). |