Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

# Algorithm::Line::Bresenham 0.11

Date Added: July 07, 2010  |  Visits: 1.216

Algorithm::Line::Bresenham is a Perl module that contains a simple pixellated line-drawing algorithm. SYNOPSIS use Algorithm::Line::Bresenham qw/line/; my @points = line(3,3 => 5,0); # returns the list: [3,3], [4,2], [4,1], [5,0] line(3,3 => 5,0, &draw_line); # calls draw_line on each point in turn Bresenham is one of the canonical line drawing algorithms for pixellated grids. Given a start and an end-point, Bresenham calculates which points on the grid need to be filled to generate the line between them. Googling for Bresenham, and line drawing algorithms gives some good overview. The code here takes its starting point from Mark Feldmans Pascal code in his article Bresenhams Line and Circle Algorithms at http://www.gamedev.net/reference/articles/article767.asp. FUNCTIONS line line (\$from_y, \$from_x => \$to_y, \$to_x); Generates a list of all the intermediate points. This is returned as a list of array references. line (\$from_y, \$from_x => \$to_y, \$to_x, &callback); Calls the referenced function on each point in turn. The callback could be used to actually draw the point. Returns the collated return values from the callback. circle my @points = circle (\$y, \$x, \$radius) Returns the points to draw a circle with.

 Requirements: No special requirements Platforms: Linux Keyword: Algorithmlinebresenham,  Libraries,  Line,  Perl Module,  Pixellated,  Point,  Points,  Programming Users rating: 0/10

USER REVIEWS
 More Reviews or Write Review
ALGORITHM::LINE::BRESENHAM RELATED
 Libraries  -  Alien Perl module 0.91 Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just... 10.24 KB Libraries  -  OpenGeoDB Perl module 0.4 OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius.. 3.07 KB Network & Internet  -  MyCMS perl module 1.0 MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an... 16.38 KB Libraries  -  Geo::Lookup::ByTime 0.0.2 Geo::Lookup::ByTime is a Perl module to lookup location by time. SYNOPSIS use Geo::Lookup::ByTime; \$lookup = Geo::Lookup::ByTime->new( @points ); my \$pt = \$lookup->nearest( \$tm ); Given a set of timestamped locations guess the location at... 15.36 KB Libraries  -  Convert::Wiki::Node::Line 0.05 Convert::Wiki::Node::Line is a Perl module that represents a horizontal line (aka ruler). SYNOPSIS use Convert::Wiki::Node::Line; my \$hr = Convert::Wiki::Node::Line->new( ); print \$hr->as_wiki(); A Convert::Wiki::Node::Line represents a... 19.46 KB Libraries  -  Acme::Comment 1.02 Acme::Comment is a Perl module that allows multi-line comments which are filtered out. SYNOPSIS use Acme::Comment type=>C++, own_line=>1; /* if (ref \$mod) { \$bar->{do}->blat(msg => blarg); eval { im sooo sick of this time for some... 7.17 KB Libraries  -  Getopt::EvaP 2.3.5 Getopt::EvaP is a Perl module to evaluate Perl command line parameters. SYNOPSIS use vars qw/@PDT @MM %OPT/; use Getopt::EvaP; EvaP @PDT, @MM, %OPT; EXPORT use Getopt::EvaP exports the subs EvaP and EvaP_PAC into your name space. @PDT... 52.22 KB Programming  -  Perl Module Manager 1.2.0.18 Perl Module Manager helps you to install, un-install and manage Perl modules from a CPAN site and other sources in an easy and intuitive way. Allows you to search through thousands of useful modules and libraries on a CPAN site and its mirrors.... 1.44 MB Libraries  -  App::SimpleScan::Plugin::Snapshot 1.03 App::SimpleScan::Plugin::Snapshot is a Perl module to allow tests to snapshot results. SYNOPSIS use App::SimpleScan; my \$app = new App::SimpleScan; \$app->go; # plugin loaded automatically here Supports the %%snapshot_dir and %%snapshot... 8.19 KB Libraries  -  Scrape::USPS::ZipLookup Perl Module 2.4 The United States Postal Service (USPS) has on its web site an HTML form at http://www.usps.com/zip4/ for standardizing an address. Given a firm, urbanization, street address, city, state, and zip, it will put the address into standard form... 11.26 KB