fills.c - implements the basic general fills
i_fill_t *fill; i_color c1, c2; i_fcolor fc1, fc2; int combine; fill = i_new_fill_solidf(&fc1, combine); fill = i_new_fill_solid(&c1, combine); fill = i_new_fill_hatchf(&fc1, &fc2, combine, hatch, cust_hash, dx, dy); fill = i_new_fill_hatch(&c1, &c2, combine, hatch, cust_hash, dx, dy); fill = i_new_fill_image(im, matrix, xoff, yoff, combine); fill = i_new_fill_opacity(fill, alpha_mult); i_fill_destroy(fill);
Implements the basic general fills, which can be used for filling some shapes and for flood fills.
Each fill can implement up to 3 functions:
called for fills on 8-bit images. This can be NULL in which case the fill_with_colorf function is called.
called for fills on non-8-bit images or when fill_with_color is NULL.
called by i_fill_destroy() if non-NULL, to release any extra resources that the fill may need.
fill_with_color and fill_with_fcolor are basically the same function except that the first works with lines of i_color and the second with lines of i_fcolor.
If the combines member if non-zero the line data is populated from the target image before calling fill_with_*color.
fill_with_color needs to fill the data parameter with the fill pixels. If combines is non-zero it the fill pixels should be combined with the existing data.
The current fills are:
solid fill
hatched fill
fountain fill
Fountain fill is implemented by filters.c.
Other fills that could be implemented include:
image - an image tiled over the fill area, with an offset either horizontally or vertically.
checkerboard - combine 2 fills in a checkerboard
combine - combine the levels of 2 other fills based in the levels of an image
regmach - use the register machine to generate colors
Call to destroy any fill object.
Create a solid fill based on a float color.
If combine is non-zero then alpha values will be combined.
Create a solid fill based on an 8-bit color.
fg
bg
combine
hatch
cust_hatch
dx
dy
Creates a new hatched fill with the fg color used for the 1 bits in the hatch and bg for the 0 bits. If combine is non-zero alpha values will be combined.
If cust_hatch is non-NULL it should be a pointer to 8 bytes of the hash definition, with the high-bits to the left.
If cust_hatch is NULL then one of the standard hatches is used.
(dx, dy) are an offset into the hatch which can be used to hatch adjoining areas out of alignment, or to align the origin of a hatch with the side of a filled area.
im
matrix
xoff
yoff
Create an image based fill.
matrix is an array of 9 doubles representing a transformation matrix.
xoff and yoff are the offset into the image to start filling from.
The 8-bit sample fill function for non-combining solid fills.
The floating sample fill function for non-combining solid fills.
Implements creation of hatch fill objects.
The 8-bit sample fill function for hatched fills.
The floating sample fill function for hatched fills.
Tony Cook <tony@develop-help.com>
Imager(3)
5 POD Errors
The following errors were encountered while parsing the POD:
Unknown directive: =category
To install Imager, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Imager
CPAN shell
perl -MCPAN -e shell install Imager
For more information on module installation, please visit the detailed CPAN module installation guide.