File Coverage

/root/.cpan/build/Imager-1.017-0/blib/lib/Imager/File/SGI.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Imager::File::SGI;
2 1     1   15 use 5.006;
  1         3  
3 1     1   5 use strict;
  1         4  
  1         16  
4 1     1   3 use Imager;
  1         1  
  1         4  
5              
6             BEGIN {
7 1     1   3 our $VERSION = "0.05";
8            
9 1         3 require XSLoader;
10 1         584 XSLoader::load('Imager::File::SGI', $VERSION);
11             }
12              
13             Imager->register_reader
14             (
15             type=>'sgi',
16             single =>
17             sub {
18             my ($im, $io, %hsh) = @_;
19             $im->{IMG} = i_readsgi_wiol($io, $hsh{page} || 0);
20              
21             unless ($im->{IMG}) {
22             $im->_set_error(Imager->_error_as_msg);
23             return;
24             }
25             return $im;
26             },
27             );
28              
29             Imager->register_writer
30             (
31             type=>'sgi',
32             single =>
33             sub {
34             my ($im, $io, %hsh) = @_;
35              
36             $im->_set_opts(\%hsh, "i_", $im);
37             $im->_set_opts(\%hsh, "sgi_", $im);
38              
39             unless (i_writesgi_wiol($io, $im->{IMG})) {
40             $im->_set_error(Imager->_error_as_msg);
41             return;
42             }
43             return $im;
44             },
45             );
46              
47             __END__