lib/Image/Info/XBM.pm

filter: Statementstmt 88.8% 24 / 27 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 85.2% 29 / 34 CC 2 SCAR 4.8
CC
2
Cov
86%
process_file
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.6
« blib/lib/Bundle/Image/Info/XPM.pm ↑ Summary lib/Image/Info/SVG.pm »
1 package Image::Info::XBM;
2 3 $VERSION = '1.08';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Image::Xbm 1.07;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶sub process_file {
Subroutine process_file: called CC=2 SCAR=7.1
Pod documented
7 5 my($info, $source, $opts) = @_;
8  
9 0 ▶ local $SIG{__WARN__} = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
10 0 $info->push_info(0, "Warn", shift);
11 5 };
12  
13 5 my $i = Image::Xbm->new(-width => 0, -height => 0);
14 # loading the file as a separate step avoids a "-r" test, this would
15 # file with in-memory strings (aka fake files)
16 5 $i->load($source);
17  
18 5 $info->push_info(0, "color_type" => "Grey");
19 5 $info->push_info(0, "file_ext" => "xbm");
20 5 $info->push_info(0, "file_media_type" => "image/x-xbitmap");
21 5 $info->push_info(0, "height", $i->get(-height));
22 5 $info->push_info(0, "resolution", "1/1");
23 5 $info->push_info(0, "width", $i->get(-width));
24 5 $info->push_info(0, "BitsPerSample" => 1);
25 5 $info->push_info(0, "SamplesPerPixel", 1);
26  
27 5 $info->push_info(0, "ColorTableSize" => 2 );
28 5 ▶ if( $opts->{L1D_Histogram} ){
Branch: 1 branch
BranchTrueFalseTotal
if ($opts->{"L1D_Histogram"}) 0 5 5
29 #Do Histogram
30 0 my $imgdata = $i->as_binstring();
31 0 $info->push_info(0, "L1D_Histogram", [$imgdata =~ tr/0//d,
32 $imgdata =~ tr/1//d ]);
33 }
34 5 $info->push_info(0, "HotSpotX" => $i->get(-hotx) );
35 5 $info->push_info(0, "HotSpotY" => $i->get(-hoty) );
36 }
37 3 1;
38 __END__
« blib/lib/Bundle/Image/Info/XPM.pm ↑ Summary lib/Image/Info/SVG.pm »