Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

graphics::primitive::driver::cairo(3pm) [debian man page]

Graphics::Primitive::Driver::Cairo(3pm) 		User Contributed Perl Documentation		   Graphics::Primitive::Driver::Cairo(3pm)

NAME
Graphics::Primitive::Driver::Cairo - Cairo backend for Graphics::Primitive VERSION
version 0.44 SYNOPSIS
use Graphics::Primitive::Component; use Graphics::Primitive::Driver::Cairo; my $driver = Graphics::Primitive::Driver::Cairo->new; my $container = Graphics::Primitive::Container->new( width => 800, height => 600 ); my $black = Graphics::Primitive::Color->new(red => 0, green => 0, blue => 0); $container->border->width(1); $container->border->color($black); $container->padding( Graphics::Primitive::Insets->new(top => 5, bottom => 5, left => 5, right => 5) ); my $comp = Graphics::Primitive::Component->new; $comp->background_color($black); $container->add_component($comp, 'c'); my $lm = Layout::Manager::Compass->new; $lm->do_layout($container); my $driver = Graphics::Primitive::Driver::Cairo->new( format => 'PDF' ); $driver->draw($container); $driver->write('/Users/gphat/foo.pdf'); DESCRIPTION
This module draws Graphics::Primitive objects using Cairo. IMPLEMENTATION DETAILS
Borders Borders are drawn clockwise starting with the top one. Since cairo can't do line-joins on different colored lines, each border overlaps those before it. This is not the way I'd like it to work, but i'm opting to fix this later. Consider yourself warned. ATTRIBUTES
antialias_mode Set/Get the antialias mode of this driver. Options are default, none, gray and subpixel. cairo This driver's Cairo::Context object format Get the format for this driver. surface Get/Set the surface on which this driver is operating. METHODS
data Get the data in a scalar for this driver. write ($file) Write this driver's data to the specified file. get_text_bounding_box ($font, $text, $angle) Returns two Rectangles that encloses the supplied text. The origin's x and y maybe negative, meaning that the glyphs in the text extending left of x or above y. The first rectangle is the bounding box required for a container that wants to contain the text. The second box is only useful if an optional angle is provided. This second rectangle is the bounding box of the un-rotated text that allows for a controlled rotation. If no angle is supplied then the two rectangles are actually the same object. If the optional angle is supplied the text will be rotated by the supplied amount in radians. get_textbox_layout ($tb) Returns a Graphics::Primitive::Driver::TextLayout for the supplied textbox. reset Reset the driver. draw Draws the specified component. Container's components are drawn recursively. ACKNOWLEDGEMENTS
Danny Luna AUTHOR
Cory G Watson <gphat@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Cold Hard Code, LLC. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.12.4 2011-09-27 Graphics::Primitive::Driver::Cairo(3pm)

Check Out this Related Man Page

Graphics::Primitive::Path(3pm)				User Contributed Perl Documentation			    Graphics::Primitive::Path(3pm)

NAME
Graphics::Primitive::Path - Collection of primitives DESCRIPTION
Graphics::Primitive::Path is a shape defined by a list of primitives. SYNOPSIS
use Graphics::Primitive::Path; my $path = Graphics::Primitive::Path->new(); $path->add_primitive($line); $path->move_to($point); METHODS
Constructor new Creates a new Graphics::Primitive::Path Instance Methods add_primitive ($prim) Add a primitive to this Path. arc ($radius, $start, $end, [ $skip_line_to ]) $path->arc($radius, $start_angle_in_radians, $end_angle_in_radians); Draw an arc based at the current point with the given radius from the given start angle to the given end angle. A line will be drawn from the current_point to the start point of the described arc. If you do not want this to happen, supply a true value as the last argument. clear_current_point Clears the current point on this Path. clear_primitives Clears all primitives from this Path. NOTE: This does not clear the current point. close_path Close the current path by drawing a line from the current_point back to the first point in the path. contiguous Flag this path as being contiguous at this point. Continuity is important so some path-based drivers such as Cairo. You should not mess with this attribute unless you know what you are doing. It's used for driver hinting. current_point Returns the current -- or last -- point on this Path. curve_to ($control1, $control2, $end) Creates a cubic BA~Xzier curve from the current point to the $end point using $control1 and $control2 as control points. ellipse ($width, $height, [ $skip_line_to ]) Creates an ellipse at the current point with the specified width and height. Optional last argument, if true, skips drawing a line to the ellipse's starting point. get_points Get this path as a series of points. get_primitive Returns the primitive at the specified offset. hints List of hint hashrefs. This hint arrayref matches the primitives arrayref one-to-one. Hints are tidbits of information that may assist drivers in optimizing (or successfully handling) primitives in this path's list. You should not mess with this structure unless you know what you are doing. line_to ($point | $x, $y) Draw a line from the current point to the one provided. Accepts either a Geoemetry::Primitive::Point or two arguments for x and y. move_to ($point | $x, $y) Move the current point to the one specified. This will not add any primitives to the path. Accepts either a Geoemetry::Primitive::Point or two arguments for x and y. primitive_count Returns the number of primitives on this Path. rectangle ($width, $height) Draw a rectangle at current_position of the specified width and height. rel_curve_to ($x1, $y1, $x2, $y2, $x3, $y3) Creates a cubic BA~Xzier curve from the current point using the provided values as offsets: start = current point control1 = current point + $x1,$y1 control1 = current point + $x2,$y2 end = current point + $x3,$y3 rel_line_to ($x_amount, $y_amount) Draw a line by adding the supplied x and y values to the current one. For example if the current point is 5,5 then calling rel_line_to(2, 2) would draw a line from the current point to 7,7. rel_move_to ($x_amount, $y_amount) Move to a new point by adding the supplied x and y values to the current ones. AUTHOR
Cory Watson <gphat@cpan.org> COPYRIGHT &; LICENSE Copyright 2008-2010 by Cory G Watson. You can redistribute and/or modify this code under the same terms as Perl itself. perl v5.12.3 2010-08-21 Graphics::Primitive::Path(3pm)
Man Page