Caca/Bitmap.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Caca/Event/Resize.pm ↑ Summary Caca/Sprite.pm »
1 package Term::Caca::Bitmap;
2 our $AUTHORITY = 'cpan:YANICK';
3 #ABSTRACT: an OO-interface to caca_bitmap
4 $Term::Caca::Bitmap::VERSION = '3.1.0';
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 0 ▶use Term::Caca;
Subroutine BEGIN: called CC=1 SCAR=2.6
8  
9 sub new {
10 my ($class, $bpp, $w, $h, $pitch, $rmask, $gmask, $bmask, $amask) = @_;
11 my $self = Term::Caca::_create_bitmap($bpp, $w, $h, $pitch, $rmask, $gmask, $bmask, $amask);
12 return bless($self => $class);
13 }
14  
15 sub set_palette {
16 my ($self, $red, $green, $blue, $alpha) = @_;
17 return Term::Caca::_set_bitmap_palette($self, $red, $green, $blue, $alpha);
18 }
19  
20 sub draw {
21 my ($self, $x1, $y1, $x2, $y2, $pixels) = @_;
22 return Term::Caca::_draw_bitmap_tied($x1, $y1, $x2, $y2, $self, $pixels);
23 }
24  
25 sub DESTROY {
26 my ($self) = @_;
27 Term::Caca::_free_bitmap($self);
28 }
29  
30 1;
31  
32 =pod
33  
34 =encoding UTF-8
35  
36 =head1 NAME
37  
38 Term::Caca::Bitmap - an OO-interface to caca_bitmap
39  
40 =head1 VERSION
41  
42 version 3.1.0
43  
44 =head1 SYNOPSIS
45  
46 Basic usage
47  
48 use Term::Caca::Bitmap;
49 my $thing = Term::Caca::Bitmap->new();
50  
51 =head1 DESCRIPTION
52  
53 A L<Term::Caca::Bitmap|Term::Caca::Bitmap> object represents
54 a surface that pixels can be drawn on.
55  
56 =head1 METHODS
57  
58 =head2 new
59  
60 ...
61  
62 B<Example>:
63  
64 =head2 set_palette
65  
66 ...
67  
68 B<Example>:
69  
70 =head2 draw
71  
72 ...
73  
74 B<Example>:
75  
76 =head2 DESTROY
77  
78 ...
79  
80 B<Example>:
81  
82 =head1 CLASS VARIABLES
83  
84 cvars
85  
86 =head1 DIAGNOSTICS
87  
88 no errors
89  
90 =head1 AUTHOR
91  
92 John BEPPU E<lt>beppu@cpan.orgE<gt>
93  
94 =head1 SEE ALSO
95  
96 perl(1)
97  
98 =head1 AUTHORS
99  
100 =over 4
101  
102 =item *
103  
104 John Beppu <beppu@cpan.org>
105  
106 =item *
107  
108 Yanick Champoux <yanick@cpan.org>
109  
110 =back
111  
112 =head1 COPYRIGHT AND LICENSE
113  
114 This software is Copyright (c) 2019, 2018, 2013, 2011 by John Beppu.
115  
116 This is free software, licensed under:
117  
118 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE, Version 2, December 2004
119  
120 =cut
121  
122 __END__
« Caca/Event/Resize.pm ↑ Summary Caca/Sprite.pm »