Term-Caca
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Term/Caca/Bitmap.pm view on Meta::CPAN
package Term::Caca::Bitmap;
our $AUTHORITY = 'cpan:YANICK';
#ABSTRACT: an OO-interface to caca_bitmap
$Term::Caca::Bitmap::VERSION = '3.1.0';
use strict;
use warnings;
use Term::Caca;
sub new {
my ($class, $bpp, $w, $h, $pitch, $rmask, $gmask, $bmask, $amask) = @_;
my $self = Term::Caca::_create_bitmap($bpp, $w, $h, $pitch, $rmask, $gmask, $bmask, $amask);
return bless($self => $class);
}
sub set_palette {
my ($self, $red, $green, $blue, $alpha) = @_;
return Term::Caca::_set_bitmap_palette($self, $red, $green, $blue, $alpha);
}
sub draw {
my ($self, $x1, $y1, $x2, $y2, $pixels) = @_;
return Term::Caca::_draw_bitmap_tied($x1, $y1, $x2, $y2, $self, $pixels);
}
sub DESTROY {
my ($self) = @_;
Term::Caca::_free_bitmap($self);
}
1;
=pod
=encoding UTF-8
=head1 NAME
Term::Caca::Bitmap - an OO-interface to caca_bitmap
=head1 VERSION
version 3.1.0
=head1 SYNOPSIS
Basic usage
use Term::Caca::Bitmap;
my $thing = Term::Caca::Bitmap->new();
=head1 DESCRIPTION
A L<Term::Caca::Bitmap|Term::Caca::Bitmap> object represents
a surface that pixels can be drawn on.
=head1 METHODS
=head2 new
...
B<Example>:
=head2 set_palette
...
B<Example>:
=head2 draw
...
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.754 second using v1.00-cache-2.02-grep-82fe00e-cpan-9e6bc14194b )