update Changes
[imager.git] / SGI / SGI.pm
CommitLineData
d5477d3d
TC
1package Imager::File::SGI;
2use strict;
3use Imager;
4use vars qw($VERSION @ISA);
5
6BEGIN {
e1c06929 7 $VERSION = "0.04";
d5477d3d 8
a5919365
TC
9 require XSLoader;
10 XSLoader::load('Imager::File::SGI', $VERSION);
d5477d3d
TC
11}
12
13Imager->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
29Imager->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__
48
49=head1 NAME
50
51Imager::File::ICO - read MS Icon files
52
53=head1 SYNOPSIS
54
55 use Imager;
56
57 my $img = Imager->new;
58 $img->read(file=>"foo.ico")
59 or die $img->errstr;
60
61 my @imgs = Imager->read_multi(file => "foo.ico")
62 or die Imager->errstr;
63
64 $img->write(file => "foo.ico")
65 or die $img->errstr;
66
67 Imager->write_multi({ file => "foo.ico" }, @imgs)
68 or die Imager->errstr;
69
70=head1 DESCRIPTION
71
72Imager's MS Icon support is documented in L<Imager::Files>.
73
74=head1 AUTHOR
75
5b480b14 76Tony Cook <tonyc@cpan.org>
d5477d3d
TC
77
78=head1 SEE ALSO
79
80Imager, Imager::Files.
81
82=cut