Brian Cassidy > Image-TextMode > Image::TextMode::Canvas

Download:
Image-TextMode-0.24.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

Image::TextMode::Canvas - A canvas of text mode pixels

DESCRIPTION ^

This module represents the graphical portion of an image, i.e. a grid of pixels.

ACCESSORS ^

METHODS ^

new( %args )

Creates a new canvas.

getpixel( $x, $y )

Get raw pixel data at $x, $y.

getpixel_obj( $x, $y, \%options )

Create a pixel object data at $x, $y. Available options include:

putpixel( \%pixel, $x, $y )

Store pixel data at $x, $y.

dimensions( )

returns a list of the width and height of the image.

clear_screen( )

Clears the canvas pixel data.

clear_line( $y, [ \@range ] )

Clears the data at line $y. Specify a range to clear only a portion of line $y.

delete_line( $y )

Removes the line from the canvas, moving all subsquent lines up.

as_ascii( )

Returns only the character data stored in the canvas.

max_x( $line )

Finds the last defined pixel on a given line. Useful for optimizing writes in formats where width matters. Returns undef for a missing line.

ansiscale( $factor )

Perform nearest neighbor scaling in text mode. Returns a new textmode image.

    # scale down to 1/4 the original size
    my $scaled = $image->ansiscale( 0.25 );

AUTHOR ^

Brian Cassidy <bricas@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright 2008-2014 by Brian Cassidy

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: