package Template::Plugin::GD; use strict; use warnings; use base 'Template::Plugin'; use GD; our $VERSION = 2.66; sub new { my $class = shift; my $context = shift; bless { context => $context, }, $class; } sub image { my $self = shift; return GD::Image->new(@_); } sub polygon { my $self = shift; return GD::Polygon->new(@_); } sub text { my $self = shift; $self->{ context }->plugin( 'GD.Text' => @_ ); } 1; __END__ =head1 NAME Template::Plugin::GD - GD plugin(s) for the Template Toolkit =head1 SYNOPSIS [% 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('example.png'); %] =head1 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. 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. For general information on the Template Toolkit see the documentation for the L