.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 "Template::Plugin::GD 3" .TH Template::Plugin::GD 3 2024-07-13 "perl v5.38.2" "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 Template::Plugin::GD \- GD plugin(s) for the Template Toolkit .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& [% USE GD; \& \& # create an image \& img = GD.image(width, height) \& \& # allocate some colors \& black = img.colorAllocate(0, 0, 0); \& red = img.colorAllocate(255, 0, 0); \& blue = img.colorAllocate(0, 0, 255); \& \& # draw a blue oval \& img.arc(50, 50, 95, 75, 0, 360, blue); \& \& # fill it with red \& img.fill(50, 50, red); \& \& # output binary image in PNG format \& img.png | redirect(\*(Aqexample.png\*(Aq); \& %] .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The Template-GD distribution provides a number of Template Toolkit plugin modules to interface with Lincoln Stein's GD modules. These in turn provide an interface to Thomas Boutell's GD graphics library. .PP These plugins were distributed as part of the Template Toolkit until version 2.15 released in February 2006. At this time they were extracted into this separate distribution. .PP For general information on the Template Toolkit see the documentation for the Template module or . For information on using plugins, see Template::Plugins and "USE" in Template::Manual::Directives. .SH METHODS .IX Header "METHODS" The GD plugin module provides a number of methods to create various other GD objects. But first you need to load the GD plugin. .PP .Vb 1 \& [% USE GD %] .Ve .PP Then you can call the following objects against it. .SS "image(width, height)" .IX Subsection "image(width, height)" Creates a new GD::Image object. .PP .Vb 1 \& [% image = GD.image(100, 200) %] .Ve .SS \fBpolygon()\fP .IX Subsection "polygon()" Creates a new GD::Polygon object. .PP .Vb 6 \& [% poly = GD.polygon; \& poly.addPt(50,0); \& poly.addPt(99,99); \& poly.addPt(0,99); \& image.filledPolygon(poly, blue); \& %] .Ve .SS \fBtext()\fP .IX Subsection "text()" Creates a new GD::Text object. .PP .Vb 3 \& [% text = GD.text; \& text.set_text(\*(AqSome text\*(Aq); \& %] .Ve .SH "GD PLUGINS" .IX Header "GD PLUGINS" These are the GD plugins provided in this distribution. .SS Template::Plugin::GD .IX Subsection "Template::Plugin::GD" Front-end module to the GD plugin collection. .SS Template::Plugin::GD::Image .IX Subsection "Template::Plugin::GD::Image" Plugin interface providing direct access to the GD::Image module. .PP .Vb 1 \& [% USE image = GD.Image %] .Ve .SS Template::Plugin::GD::Polygon .IX Subsection "Template::Plugin::GD::Polygon" Plugin interface providing direct access to the GD::Polygon module. .PP .Vb 6 \& [% USE poly = GD.Polygon; \& poly.addPt(50,0); \& poly.addPt(99,99); \& poly.addPt(0,99); \& image.filledPolygon(poly, blue); \& %] .Ve .SS Template::Plugin::GD::Text .IX Subsection "Template::Plugin::GD::Text" Plugin interface providing direct access to the GD::Text module. .PP .Vb 3 \& [% USE text = GD.Text; \& text.set_text(\*(AqSome text\*(Aq); \& %] .Ve .SS Template::Plugin::GD::Text::Align .IX Subsection "Template::Plugin::GD::Text::Align" Plugin interface to the GD::Text::Align module for creating aligned text. .SS Template::Plugin::GD::Text::Wrap .IX Subsection "Template::Plugin::GD::Text::Wrap" Plugin interface to the GD::Text::Wrap module for creating wrapped text. .SS Template::Plugin::GD::Graph::area .IX Subsection "Template::Plugin::GD::Graph::area" Plugin interface to the GD::Graph::area module for creating area graphics with axes and legends. .SS Template::Plugin::GD::Graph::bars3d .IX Subsection "Template::Plugin::GD::Graph::bars3d" Plugin interface to the GD::Graph::bars3d module for creating 3D bar graphs with axes and legends. .SS Template::Plugin::GD::Graph::bars .IX Subsection "Template::Plugin::GD::Graph::bars" Plugin interface to the GD::Graph::bars module for creating bar graphs with axes and legends. .SS Template::Plugin::GD::Graph::lines3d .IX Subsection "Template::Plugin::GD::Graph::lines3d" Plugin interface to the GD::Graph::lines3d module for creating 3D line graphs with axes and legends. .SS Template::Plugin::GD::Graph::lines .IX Subsection "Template::Plugin::GD::Graph::lines" Plugin interface to the GD::Graph::lines module for creating line graphs with axes and legends. .SS Template::Plugin::GD::Graph::linespoints .IX Subsection "Template::Plugin::GD::Graph::linespoints" Plugin interface to the GD::Graph::linespoints module for creating line/point graphs with axes and legends .SS Template::Plugin::GD::Graph::mixed .IX Subsection "Template::Plugin::GD::Graph::mixed" Plugin interface to the GD::Graph::mixed module for creating mixed graphs with axes and legends. .SS Template::Plugin::GD::Graph::pie3d .IX Subsection "Template::Plugin::GD::Graph::pie3d" Plugin interface to the GD::Graph::pie3d module for creating 3D pie charts with legends. .SS Template::Plugin::GD::Graph::pie .IX Subsection "Template::Plugin::GD::Graph::pie" Plugin interface to the GD::Graph::pie module for creating pie charts with legends. .SS Template::Plugin::GD::Graph::points .IX Subsection "Template::Plugin::GD::Graph::points" Plugin interface to the GD::Graph::points module for creating point graphs with axes and legends .SS Template::Plugin::GD::Constants .IX Subsection "Template::Plugin::GD::Constants" Provides access to various GD constants. .PP .Vb 3 \& [% USE gdc = GD.Constants; \& font = gdc.gdLargeFont \& %] .Ve .SH AUTHORS .IX Header "AUTHORS" Thomas Boutell wrote the GD graphics library. Lincoln D. Stein wrote the Perl GD modules and Martien Verbruggen wrote the GD::Text and GD::Graph modules that interface with it. Craig Barratt wrote the GD plugins for the Template Toolkit. Andy Wardley wrote the Template Toolkit. Larry wrote Perl. Brian and Dennis wrote C. Dennis and Ken wrote Unix. .SH VERSION .IX Header "VERSION" This is version 2.66 of the Template::Plugin::GD module set. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2001 Craig Barratt, 2006 Andy Wardley. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" Template, Template::Plugins, GD