Imager::Fill - general fill types
my $fill1 = Imager::Fill->new(solid=>$color, combine=>$combine); my $fill2 = Imager::Fill->new(hatch=>'vline2', fg=>$color1, bg=>$color2, dx=>$dx, dy=>$dy); my $fill3 = Imager::Fill->new(fountain=>$type, ...); my $fill4 = Imager::Fill->new(image=>$img, ...);
All fills are created with the new method.
my $fill = Imager::Fill->new(...);
The parameters depend on the type of fill being created. See below for details.
The currently available fills are:
In general colors can be specified as Imager::Color or Imager::Color::Float objects. The fill object will typically store both types and convert from one to the other. If a fill takes 2 color objects they should have the same type.
my $fill = Imager::Fill->new(solid=>$color, $combine =>$combine)
Creates a solid fill, the only required parameter is "solid" which should be the color to fill with.
my $fill = Imager::Fill->new(hatch=>$type, fg=>$fgcolor, bg=>$bgcolor, dx=>$dx, $dy=>$dy);
Creates a hatched fill. You can specify the following keywords:
Hatches are represented as cells 8x8 arrays of bits, which limits their complexity.
Current hatch names are:
fg defaults to black, bg to white.
You can call Imager::Fill->hatches for a list of hatch names.
my $fill = Imager::Fill->new(fountain=>$ftype, xa=>$xa, ya=>$ya, xb=>$xb, yb=>$yb, segments=>$segments, repeat=>$repeat, combine=>$combine, super_sample=>$super_sample, ssample_param=>$ssample_param);
This fills the given region with a fountain fill. This is exactly the same fill as the "fountain" filter, but is restricted to the shape you are drawing, and the fountain parameter supplies the fill type, and is required.
my $fill = Imager::Fill->new(image=>$src, xoff=>$xoff, yoff=>$yoff, matrix=>$matrix, $combine);
Fills the given image with a tiled version of the given image. The first non-zero value of xoff or yoff will provide an offset along the given axis between rows or columns of tiles respectively.
The matrix parameter performs a co-ordinate transformation from the co-ordinates in the target image to the fill image co-ordinates. Linear interpolation is used to determine the fill pixel. You can use the Imager::Matrix2d class to create transformation matrices.
The matrix parameter will significantly slow down the fill.