NAME
Games::Chess::Coverage::GD - Visualize chess coverage with GD
SYNOPSIS
use Games::Chess::Coverage::GD;
my $drawing = Games::Chess::Coverage::GD->new(
coverage => $coverage_object,
out_file => 'eg/foo',
image_type => 'gif',
);
while( my( $rule, $args ) = each %rule_set ) {
$drawing->add_rule( $rule, %$args );
}
$drawing->draw;
$drawing->write;
DESCRIPTION
Represent chess coverage with the GD
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 by 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 => [$red, $green, $blue] );
Create a new color object given an identifying name and an RGB array.
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.