GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  IMAGE::BASE::SVG (3)

.ds Aq ’

NAME

Image::Base::SVG -- SVG image file output

CONTENTS

SYNOPSIS



 use Image::Base::SVG;
 my $image = Image::Base::SVG->new (-width => 100,
                                                    -height => 100);
 $image->rectangle (0,0, 99,99, b);
 $image->xy (20,20, o);
 $image->line (50,50, 70,70, o);
 $image->line (50,50, 70,70, o);
 $image->save (/some/filename.svg);



CLASS HIERARCHY

Image::Base::SVG is a subclass of Image::Base,



    Image::Base
      Image::Base::SVG



DESCRIPTION

Image::Base::SVG extends Image::Base to create or update SVG format image files using the SVG.pm module (see SVG::Manual).

Image::Base is pixel oriented so isn’t really the sort of thing SVG is meant for, but this module can direct some Image::Base style code at an SVG object. Of course the SVG module has many more features if used natively.

It’s often fairly easy to spit out SVG directly too, and for instance the Image::Base::SVGout module can do that. The advantages of the SVG document object model comes when combining images or fragments, or going through elements for post-facto mangling.

In the current code the SVG elements emitted assume some default style attributes such as stroke-width 1. Perhaps that should be set explicitly on each element.

    Colours

Colour names are per the SVG spec, which is CSS style syntax



    #RGB                    hex, 1 digit
    #RRGGBB                 hex, 2 digit
    rgb(255,255,255)        integers 0 to 255
    rgb(100%,100%,100%)     percentages
    http://www.w3.org/TR/2008/REC-CSS2-20080411/syndata.html#value-def-color



plus extra names



    http://www.w3.org/TR/2003/REC-SVG11-20030114/types.html#ColorKeywords



FUNCTIONS

$image = Image::Base::SVG->new (key=>value,...) Create and return a new image object. A new image can be started with just



    $image = Image::Base::SVG->new;



Generally -width and -height should be set, but it works to do that later after creating.

Or an existing SVG object can be given,



    my $svg = SVG->new;
    ...
    $image = Image::Base::SVG->new (-svg_object => $svg);



$image->xy ($x, $y, $colour)
$colour = $image->xy ($x, $y) Get or set an individual pixel.

Currently for a get the return is always undef as there’s no support for picking out elements etc from the SVG. Perhaps the simple elements drawn by this Image::Base::SVG could be read back, but arbitrary SVG from a load() would need a full rasterize in the worst case.

$image->load ()
$image->load ($filename) Load an SVG file into $image, either from the current -file attribute, or set that to $filename then load.

This uses the SVG::Parser module. See that module for how to choose between Expat or SAX for its underlying XML parse, and in turn see XML::SAX for its further choice of libxml, pure perl, etc. LibXML might be unhelpfully strict.

$image->save ()
$image->save ($filename) Save the image to an SVG file, either the current -file option, or set that option to $filename and save to there.

ATTRIBUTES

-width (integer)
-height (integer) Setting -width or -height changes the SVG canvas size. In the current code it doesn’t affect the elements already drawn to it. Is that how it should be?

SEE ALSO

Image::Base, SVG, SVG::Manual, SVG::Parser

Image::Base::SVGout

HOME PAGE

http://user42.tuxfamily.org/image-base-svg/index.html

LICENSE

Image-Base-SVG is Copyright 2011 Kevin Ryde

Image-Base-SVG is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Image-Base-SVG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Image-Base-SVG. If not, see <http://www.gnu.org/licenses/>.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 IMAGE::BASE::SVG (3) 2011-07-13

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.