Imager
view release on metacpan or search on metacpan
Changes.old view on Meta::CPAN
some color like white is in the pallete. This method
also allows some ditherding and gives better colormap
than the mediancut from the gif libraries. It does
need much more cpu power though. Hopefully later versions
will be faster.
0.23 **************** Internal release only
- Fixed the %instances bug - caused ALL memory to be leaked.
Added real noise function - need feedback on how it should
be used. Also box(), and polyline are now in place. Polygon
is missing but antialiased line drawing with integer endpoints are
done but should be replaced with a version that can have
floating point endvalues. Two noise filters addded.
0.24 **************** Internal release only
- Converted i_color into an object from a reference, so now it's
giving an object instead of a void ptr or an integer or something.
0.25 **************** Internal release only
- Added basic Truetype functionality - still needs a rewrite
to be decent. Currently it's a port of a demo program that
}
unless ($good) {
$self->_set_error($self->_error_as_msg);
return;
}
return $self;
}
# Draws a line from one point to the other
# the endpoint is set if the endp parameter is set which it is by default.
# to turn of the endpoint being set use endp=>0 when calling line.
sub line {
my $self=shift;
my $dflcl=i_color_new(0,0,0,0);
my %opts=(color=>$dflcl,
endp => 1,
@_);
$self->_valid_image("line")
or return;
=for stopwords Bresenham's
Draw a line to image using Bresenham's line drawing algorithm
im - image to draw to
x1 - starting x coordinate
y1 - starting x coordinate
x2 - starting x coordinate
y2 - starting x coordinate
color - color to write to image
endp - endpoint flag (boolean)
=cut
*/
void
i_line(i_img *im, i_img_dim x1, i_img_dim y1, i_img_dim x2, i_img_dim y2, const i_color *val, int endp) {
i_img_dim x, y;
i_img_dim dx, dy;
i_img_dim p;
lib/Imager/APIRef.pod view on Meta::CPAN
=for stopwords Bresenham's
Draw a line to image using Bresenham's line drawing algorithm
im - image to draw to
x1 - starting x coordinate
y1 - starting x coordinate
x2 - starting x coordinate
y2 - starting x coordinate
color - color to write to image
endp - endpoint flag (boolean)
=for comment
From: File draw.c
=item i_line_aa(C<im>, C<x1>, C<x2>, C<y1>, C<y2>, C<color>, C<endp>)
Anti-alias draws a line from (x1,y1) to (x2, y2) in color.
lib/Imager/Draw.pod view on Meta::CPAN
=head2 List of primitives
=over
=item line()
$img->line(color=>$green, x1=>10, x2=>100,
y1=>20, y2=>50, aa=>1, endp=>1 );
X<line method>
Draws a line from (x1,y1) to (x2,y2). The endpoint
(x2,y2) is drawn by default. If C<endp> of 0 is specified then the
endpoint will not be drawn. If C<aa> is set then the line will be
drawn anti-aliased. The C<antialias> parameter is still available for
backwards compatibility.
Parameters:
=over
=item *
C<x1>, C<y1> - starting point of the line. Required.
( run in 3.451 seconds using v1.01-cache-2.11-cpan-524268b4103 )