Why not adopt me?
NAME
Music::Image::Chord - Perl extension for generating guitar tab chords
SYNOPSIS
use Music::Image::Chord;
$image = new Music::Image::Chord();
$old_font = $image->font('/path/to/my/TrueType/font.ttf');
$old_file = $image->file('/path/to/file/to/save.png');
$image->debug(1);
DESCRIPTION
Image::Chord is a simple package for creating images of guitar chords in any format that the Imager module can produce.
The object's API is as follows:
- new Image::Chord()
-
Creates and returns a new Image::Chord object.
- bar_thickness
-
Returns and optionally sets the thickness of the fret bar. Only used if on the first fret (which is the default).
- bounds
-
Returns and optionally sets the image boundaries. It accepts several formats:
$image->bounds($width, $height); $image->bounds(width=>$wid, height=>$hgt); $image->bounds(xmin=>$xmin, xmax=>$xmax, yMIN=>$ymin, YMax=>$ymax);
- crop_width
-
Returns and optionally sets the width/height of the crop marks on the image. If this value is not set or is <= 0, then crop marks will not be drawn.
$image->crop_width(5); # Crop marks will be 5 pixels wide. print $image->crop_width(); # Display the current crop mark width.
- debug
-
Returns and optionally sets the Imager debugging flag.
$image->debug(1); # Set debugging print $image->debug(); # Get the current debugging value
- font
-
Returns and optionally sets the font used to render the chord's title.
$image->font('/home/jgoff/Bach.ttf'); # Display in the Bach TrueType font $foo = $image->font(); # Assign $foo to the image's font
- file
-
Returns and optionally sets the file name to save the rendered image to. It also reads the extension of the file to determine how to save the image.
$image->file('/home/jgoff/chord.png');
- fret
-
Returns and optionally sets the beginning fret in the image. Defaults to 1.
$image->fret(5); print $image->fret(); # prints the current fret setting.
- draw([HASH])
-
Renders the chord described into the appropriate file.
- grid
-
Returns and optionally sets the grid coordinates. X and Y are the UL corner of the grid, and w and h control (for the moment, this will change) the inter-string and inter-fret spacing.
$image->grid($x,$y,$w,$h); # Set explicitly $image->grid(x=>$x,y=>$y,w=>$w,h=>$h); # Set through named parameters.
SEE ALSO
perl(1).
AUTHOR
Jeffrey Goff, <drforr@pobox.com> Inspiration by #perl
COPYRIGHT AND LICENSE
Copyright (C) 2003 by Jeffrey Goff
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.