Image::XBin - (DEPRECATED) Load, create, manipulate and save XBin image files
This module has been replaced by Image:TextMode.
use Image::XBin; # Read in a file... my $img = Image::XBin->new( file => 'myxbin.xb' ); # Image width and height my $w = $img->width; my $h = $img->height; # get and put "pixels" my $pixel = $img->getpixel( $x, $y ); $img->putpixel( $x, $y, $pixel ); # font (XBin::Font) my $font = $img->font; # palette (XBin::Palette) my $palette = $img->palette; # save the data to a file $img->write( file => 'x.xb' );
XBin stands for "eXtended BIN" -- an extention to the normal raw-image BIN files.
XBin file stucture:
+------------+ | Header | +------------+ | Palette | +------------+ | Font | +------------+ | Image Data | +------------+
Note, the only required element is a header. See the XBin specs for for information. http://www.acid.org/info/xbin/xbin.htm
To install this module via Module::Build:
perl Build.PL ./Build # or `perl Build` ./Build test # or `perl Build test` ./Build install # or `perl Build install`
To install this module via ExtUtils::MakeMaker:
perl Makefile.PL make make test make install
Creates a new XBin image. Currently only reads in data.
# filename $xbin = Image::XBin->new( file => 'file.xb' ); # file handle $xbin = Image::XBin->new( handle => $handle ); # string $xbin = Image::XBin->new( string => $string );
Clears any in-memory data.
Explicitly reads in an XBin.
Write the XBin data to a file, handle of string.
Returns the XBin data as a string - suitable for saving.
Returns a binary PNG version of the image.
# Thumbnail -- Default $xbin->as_png( mode => 'thumbnail' ); # Full size $xbin->as_png( mode => 'full' );
This function is just a wrapper around as_png_thumbnail() and as_png_full().
Creates a thumbnail version of the XBin.
Creates a full-size replica of the image. You can pass a "crop" option to crop the image at certain height.
# Crop it after 25 (text-mode) rows $xbin->as_png_full( crop => 25 );
Returns true if the file has a palette defined.
Returns true if the file has a font defined.
Returns true if the data was (or is to be) compressed
Returns true if the file is in non-blink mode.
Returns true if the font associated with the XBin has 512 characters
Gets / sets the SAUCE object associated with the XBin.
Sets the pixel at $x, $y with $pixel (which should be an Image::XBin::Pixel).
Returns the Image::XBin::Pixel object at $x, $y (or undef).
Generic get / set method used by both getpixel and putpixel.
Gets or sets the font. Must be of type Image::XBin::Font. Passing anything but that type will remove the font and change related header data.
Gets or sets the palette. Must be of type Image::XBin::Palette. Passing anything but that type will remove the font and related header data.
Get / sets the compression header value to true or false. Affect the output from as_string() and write().
Returns the image width.
Returns the image height.
Copyright 2003-2009 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.