SVG::Rasterize::Engine::PangoCairo - rasterize output using Cairo
SVG::Rasterize::Engine::PangoCairo
Version 0.003007
# explicit construction (unusual) use SVG::Rasterize::Engine::PangoCairo; my $engine = SVG::Rasterize::Engine::PangoCairo->new (width => 640, height => 480);
This class provides a rasterization backend for SVG::Rasterize based on the Cairo and Pango libraries.
This class is only instantiated by the rasterize method of SVG::Rasterize.
SVG::Rasterize
This documentation focues on this specific implementation. For a more general description of the engine interface see SVG::Rasterize::Engine.
SVG::Rasterize::Engine::PangoCairo->new(%args)
Creates a new SVG::Rasterize::Engine::PangoCairo object and calls init(%args). If you subclass SVG::Rasterize::Engine::PangoCairo overload init, not new.
init(%args)
init
new
$cairo->init(%args)
If you overload init, your method should also call this one. It initializes the attributes width and height which are mandatory parameters and have to be non-negative integers.
Other backends are also required to validate their init parameters because the engine_args hash given by the user to SVG::Rasterize is handed over to the new constructor of the engine class without validation.
See <SVG::Rasterize::Engine|SVG::Rasterize::Engine>.
$engine->write(%args)
Writes the rendered image to a file.
Example:
$engine->write(type => 'png', file_name => 'foo.png');
type and file_name are the only supported parameters at the moment and the only supported type is "png". If file_name has a false value, no output is written and a warning is issued. Besides that, file_name is not validated at all. Make sure that you provide a sane value (whatever that means to you).
type
file_name
These methods are just documented for myself. You can read on to satisfy your voyeuristic desires, but be aware of that they might change or vanish without notice in a future version.
_prepare_fill
_prepare_stroke
_fill
_stroke
_fill_and_stroke
make_ro_accessor
This piece of documentation is mainly here to make the POD coverage test happy. SVG::Rasterize::State overloads make_ro_accessor to make the readonly accessors throw an exception object (of class SVG::Rasterize::Exception::Attribute) instead of just croaking.
POD
SVG::Rasterize::State
SVG::Rasterize::Exception::Attribute
Lutz Gehlen, <perl at lutzgehlen.de>
<perl at lutzgehlen.de>
Copyright 2010-2011 Lutz Gehlen.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install SVG::Rasterize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVG::Rasterize
CPAN shell
perl -MCPAN -e shell install SVG::Rasterize
For more information on module installation, please visit the detailed CPAN module installation guide.