NAME
Games::Chess::Coverage::Imager - Visualize chess coverage with Imager
SYNOPSIS
use Games::Chess::Coverage::Imager;
my $drawing = Games::Chess::Coverage::Imager->new(
coverage => $coverage_object,
out_file => 'eg/foo',
image_type => 'png',
);
while( my( $rule, $args ) = each %rule_set ) {
$drawing->add_rule( $rule, %$args );
}
$drawing->draw;
$drawing->write;
DESCRIPTION
Represent chess coverage with the Imager
drawing module and plug-in rules based on board settings.
Please see the examples in the distribution eg/
directory.
METHODS
_init
Create an image based on the settings computed in the Games::Chess::Coverage::Draw
parent.
add_rule
$drawing->add_rule( $rule, %args );
Add a rule to the drawing. This method is required and must call the add_rule
method of the parent followed by this module's set_color
method for all /_color$/ arguments provided.
Please see the method source code for the specific details.
set_color
$drawing->set_color( $name => $definition );
Return a color object given an identifying name and a valid Imager
color definition. If the color does not exist yet, create it.
write
$drawing->write;
$drawing->write( $filename );
Write the image object to a file based on the out_file
and image_type
settings.
SEE ALSO
AUTHOR
Gene Boggs <gene@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2004, Gene Boggs
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.