.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PDF::Builder::Resource::XObject::Image::PNG 3pm" .TH PDF::Builder::Resource::XObject::Image::PNG 3pm "2021-03-28" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PDF::Builder::Resource::XObject::Image::PNG \- support routines for PNG image library (using pure Perl code). Inherits from PDF::Builder::Resource::XObject::Image .SH "METHODS" .IX Header "METHODS" .ie n .IP "$res = PDF::Builder::Resource::XObject::Image::PNG\->new($pdf, $file, $name, %opts)" 4 .el .IP "\f(CW$res\fR = PDF::Builder::Resource::XObject::Image::PNG\->new($pdf, \f(CW$file\fR, \f(CW$name\fR, \f(CW%opts\fR)" 4 .IX Item "$res = PDF::Builder::Resource::XObject::Image::PNG->new($pdf, $file, $name, %opts)" .PD 0 .ie n .IP "$res = PDF::Builder::Resource::XObject::Image::PNG\->new($pdf, $file, $name)" 4 .el .IP "\f(CW$res\fR = PDF::Builder::Resource::XObject::Image::PNG\->new($pdf, \f(CW$file\fR, \f(CW$name\fR)" 4 .IX Item "$res = PDF::Builder::Resource::XObject::Image::PNG->new($pdf, $file, $name)" .ie n .IP "$res = PDF::Builder::Resource::XObject::Image::PNG\->new($pdf, $file)" 4 .el .IP "\f(CW$res\fR = PDF::Builder::Resource::XObject::Image::PNG\->new($pdf, \f(CW$file\fR)" 4 .IX Item "$res = PDF::Builder::Resource::XObject::Image::PNG->new($pdf, $file)" .PD .PP Returns a PNG-image object. \f(CW$pdf\fR is the \s-1PDF\s0 object being added to, \f(CW$file\fR is the input \s-1PNG\s0 file, and the optional \f(CW$name\fR of the new parent image object defaults to PxAAA. .PP If the Image::PNG::Libpng package is installed, the \s-1PNG_IPL\s0 library will be used instead of the \s-1PNG\s0 library. In such a case, use of the \s-1PNG\s0 library may be forced via the \f(CW\*(C`\-nouseIPL\*(C'\fR flag (see Builder documentation for \f(CW\*(C`image_png()\*(C'\fR). .PP opts: \-notrans .PP .Vb 2 \& No transparency \-\- ignore tRNS chunk if provided, ignore Alpha channel \& if provided. .Ve .SS "Supported \s-1PNG\s0 types" .IX Subsection "Supported PNG types" .Vb 5 \& (0) Gray scale of depth 1, 2, 4, or 8 bits per pixel (2, 4, 16, or 256 \& gray levels). 16 bpp is not currently supported (a PNG with 16 bpp \& is a fatal error). Full transparency (of one 8\-bit gray value) via \& the tRNS chunk is allowed, unless the \-notrans option specifies \& that it be ignored. \& \& (2) RGB 24\-bit truecolor with 8 bits per sample (16.7 million colors). \& 16 bps is not currently supported (a PNG with 16 bps is a fatal \& error). Full transparency (of one 3x8\-bit RGB color value) via the \& tRNS chunk is allowed, unless the \-notrans option specifies that it \& be ignored. \& \& (3) Palette color with 1, 2, 4, or 8 bits per pixel (2, 4, 16, or 256 \& color table/palette entries). 16 bpp is not currently supported by \& PNG or PDF. Partial transparency (8\-bit Alpha) for each palette \& entry via the tRNS chunk is allowed, unless the \-notrans option \& specifies that it be ignored (all entries fully opaque). \& \& (4) Gray scale of depth 8 bits per pixel plus 8\-bit Alpha channel (256 \& gray levels and 256 levels of transparency). 16 bpp is not \& currently supported (a PNG with 16 bpp is a fatal error). The Alpha \& channel is ignored if the \-notrans option is given. The tRNS chunk \& is not permitted. \& \& (6) RGB 24\-bit truecolor with 8 bits per sample (16.7 million colors) \& plus 8\-bit Alpha channel (256 levels of transparency). 16 bps is not \& currently supported (a PNG with 16 bps is a fatal error). The Alpha \& channel is ignored if the \-notrans option is given. The tRNS chunk \& is not permitted. .Ve .PP In all cases, 16 bits per sample are not implemented. A fatal error will be returned if a \s-1PNG\s0 image with 16\-bps data is supplied. The code is assuming standard \*(L"network\*(R" bit ordering (Big Endian). Interlaced (progressive) display images are not supported. Use the \s-1PNG_IPL\s0 version if you need to support 16 bps or interlaced images. .PP The transparency chunk (tRNS) will specify one gray level entry or one \s-1RGB\s0 entry to be treated as transparent (Alpha = 0). For palette color, up to 256 palette entry 8\-bit Alpha values are specified (256 levels of transparency, from 0 = transparent to 255 = opaque). .PP Only a limited number of chunks are handled: \s-1IHDR, IDAT\s0 (internally), \s-1PLTE,\s0 tRNS, and \s-1IEND\s0 (internally). All other chunks are ignored at this time. Certain filters and compressions applied to data will be handled, but there may be unsupported methods. .ie n .IP "$mode = $png\->\fBusesLib()\fR" 4 .el .IP "\f(CW$mode\fR = \f(CW$png\fR\->\fBusesLib()\fR" 4 .IX Item "$mode = $png->usesLib()" Returns 1 if Image::PNG::Libpng installed and used, 0 if not installed, or \-1 if installed but not used (\-nouseIPL option given to \f(CW\*(C`image_png\*(C'\fR). .Sp \&\fBCaution:\fR this method can only be used \fIafter\fR the image object has been created. It can't tell you whether Image::PNG::Libpng is available in advance of actually using it, in case you want to use some functionality available only in \s-1PNG_IPL.\s0 See the PDF::Builder \s-1\fBLA_IPL\s0()\fR call if you need to know in advance.