Caa/DitherOrdered2.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 4 totaltotal 86.6% 26 / 30 CC 2 SCAR 2.5
CC
2
Cov
100%
init
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Caa/DriverANSI.pm ↑ Summary Caa/DitherOrdered4.pm »
1 package Image::Caa::DitherOrdered2;
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5
6 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
7 2 my ($class, $args) = @_;
8
9 2 my $self = bless {}, $class;
10
11 2 return $self;
12 }
13
14 2 ▶sub init {
Subroutine init: called CC=2 SCAR=6.9
Pod undocumented
15 2 my ($self, $line) = @_;
16
17 2 $self->{table} = [0x00, 0x80, 0xc0, 0x40];
18
19 2 my $skip = ($line % 2) * 2;
20 2 shift @{$self->{table}} for 1..$skip;
21
22 2 $self->{index} = 0;
23 }
24
25 16 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod undocumented
26 16 my ($self) = @_;
27
28 16 return $self->{table}->[$self->{index}];
29 }
30
31 4 ▶sub increment {
Subroutine increment: called CC=1 SCAR=0.0
Pod undocumented
32 4 my ($self) = @_;
33
34 4 $self->{index} = ($self->{index} + 1) % 2;
35 }
36
37 2 1;
« Caa/DriverANSI.pm ↑ Summary Caa/DitherOrdered4.pm »