Templat...gin::GD(3)

πŸ’– NAME πŸ’–

Hey bestie, welcome to the User Contributed Perl Documentation page for Template::Plugin::GD(3). The name line is literally:

Template::Plugin::GD β€” GD plugin(s) for the Template Toolkit.


✨ SYNOPSIS ✨

Here's the whole plot in one Template Toolkit block β€” create an image, allocate some colors, draw a blue oval, fill it with red, and output a binary image in PNG format:

[% 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');
%]

🌸 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. Iconic behavior, honestly.

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. It's giving glow-up era. ✨

For general information on the Template Toolkit see the documentation for the Template module or <http://template-toolkit.org>. For information on using plugins, see Template::Plugins and "USE" in Template::Manual::Directives.

πŸŽ€ 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.

[% USE GD %]

Then you can call the following objects against it.

πŸ–ΌοΈ image(width, height) πŸ–ΌοΈ

Creates a new GD::Image object.

[% image = GD.image(100, 200) %]

πŸ”Ί polygon() πŸ”Ί

Creates a new GD::Polygon object.

[% poly = GD.polygon;
   poly.addPt(50,0);
   poly.addPt(99,99);
   poly.addPt(0,99);
   image.filledPolygon(poly, blue);
%]

✍️ text() ✍️

Creates a new GD::Text object.

[%  text = GD.text;
    text.set_text('Some text');
%]

🌈 GD PLUGINS 🌈

These are the GD plugins provided in this distribution. Collect them all, periodt.

πŸ’Ž Template::Plugin::GD πŸ’Ž

Front-end module to the GD plugin collection.

πŸ–ΌοΈ Template::Plugin::GD::Image πŸ–ΌοΈ

Plugin interface providing direct access to the GD::Image module.

[% USE image = GD.Image %]

πŸ”Ί Template::Plugin::GD::Polygon πŸ”Ί

Plugin interface providing direct access to the GD::Polygon module.

[% USE poly = GD.Polygon;
   poly.addPt(50,0);
   poly.addPt(99,99);
   poly.addPt(0,99);
   image.filledPolygon(poly, blue);
%]

✍️ Template::Plugin::GD::Text ✍️

Plugin interface providing direct access to the GD::Text module.

[%  USE text = GD.Text;
    text.set_text('Some text');
%]

πŸ“ Template::Plugin::GD::Text::Align πŸ“

Plugin interface to the GD::Text::Align module for creating aligned text.

πŸ“ Template::Plugin::GD::Text::Wrap πŸ“

Plugin interface to the GD::Text::Wrap module for creating wrapped text.

πŸ“Š Template::Plugin::GD::Graph::area πŸ“Š

Plugin interface to the GD::Graph::area module for creating area graphics with axes and legends.

🧊 Template::Plugin::GD::Graph::bars3d 🧊

Plugin interface to the GD::Graph::bars3d module for creating 3D bar graphs with axes and legends.

πŸ“Š Template::Plugin::GD::Graph::bars πŸ“Š

Plugin interface to the GD::Graph::bars module for creating bar graphs with axes and legends.

πŸ“ˆ Template::Plugin::GD::Graph::lines3d πŸ“ˆ

Plugin interface to the GD::Graph::lines3d module for creating 3D line graphs with axes and legends.

πŸ“ˆ Template::Plugin::GD::Graph::lines πŸ“ˆ

Plugin interface to the GD::Graph::lines module for creating line graphs with axes and legends.

πŸ“‰ Template::Plugin::GD::Graph::linespoints πŸ“‰

Plugin interface to the GD::Graph::linespoints module for creating line/point graphs with axes and legends.

πŸŽ›οΈ Template::Plugin::GD::Graph::mixed πŸŽ›οΈ

Plugin interface to the GD::Graph::mixed module for creating mixed graphs with axes and legends.

πŸ₯§ Template::Plugin::GD::Graph::pie3d πŸ₯§

Plugin interface to the GD::Graph::pie3d module for creating 3D pie charts with legends.

πŸ₯§ Template::Plugin::GD::Graph::pie πŸ₯§

Plugin interface to the GD::Graph::pie module for creating pie charts with legends.

πŸ”΅ Template::Plugin::GD::Graph::points πŸ”΅

Plugin interface to the GD::Graph::points module for creating point graphs with axes and legends.

πŸ”’ Template::Plugin::GD::Constants πŸ”’

Provides access to various GD constants.

[% USE gdc = GD.Constants;
   font = gdc.gdLargeFont
%]

🫢 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. The way this is a whole Unix family reunion. πŸ˜­πŸ’–

🏷️ VERSION 🏷️

This is version 2.66 of the Template::Plugin::GD module set.

Copyright (C) 2001 Craig Barratt, 2006 Andy Wardley.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

πŸ‘€ SEE ALSO πŸ‘€

Template, Template::Plugins, GD


okay that's the whole page, bestie πŸ’– β€” this one was served from perl v5.42.0, dated 2017-10-08, and the footer name was Templat...gin::GD(3). slay. πŸ’…βœ¨

πŸ“¦ where this page comes from