| 1 | package Image::TextMode::Writer::Bin; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | extends 'Image::TextMode::Writer'; | |
| 6 | |||
| 7 | sub _write { | ||
| 8 | 1 | ▶ | my ( $self, $image, $fh, $options ) = @_; |
|
Subroutine
_write: called CC=2 SCAR=6.9
| |||
| 9 | |||
| 10 | 1 | for my $row ( @{ $image->pixeldata } ) { | |
| 11 | print $fh | ||
| 12 | join( '', | ||
| 13 | 1 | map { pack( 'aC', @{ $_ }{ qw( char attr ) } ) } @$row ); | |
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | =head1 NAME | ||
| 18 | |||
| 19 | Image::TextMode::Writer::Bin - Writes Bin files | ||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | Provides writing capabilities for the Bin format. | ||
| 24 | |||
| 25 | =head1 AUTHOR | ||
| 26 | |||
| 27 | Brian Cassidy E<lt>bricas@cpan.orgE<gt> | ||
| 28 | |||
| 29 | =head1 COPYRIGHT AND LICENSE | ||
| 30 | |||
| 31 | Copyright 2008-2014 by Brian Cassidy | ||
| 32 | |||
| 33 | This library is free software; you can redistribute it and/or modify | ||
| 34 | it under the same terms as Perl itself. | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | 1 | 1; | |