Image::TextMode::Writer::Bin - Writes Bin files


Image-TextMode documentation Contained in the Image-TextMode distribution.

Index


Code Index:

NAME

Top

Image::TextMode::Writer::Bin - Writes Bin files

DESCRIPTION

Top

Provides writing capabilities for the Bin format.

AUTHOR

Top

Brian Cassidy <bricas@cpan.org>

COPYRIGHT AND LICENSE

Top


Image-TextMode documentation Contained in the Image-TextMode distribution.

package Image::TextMode::Writer::Bin;

use Moose;

extends 'Image::TextMode::Writer';

sub _write {
    my ( $self, $image, $fh, $options ) = @_;

    for my $row ( @{ $image->pixeldata } ) {
        print $fh
            join( '',
            map { pack( 'aC', @{ $_ }{ qw( char attr ) } ) } @$row );
    }
}

no Moose;

__PACKAGE__->meta->make_immutable;

1;