Sets the pixel at (x,y) to color.
Returns 0 if the pixel was drawn, or -1 if not.
Does no alpha blending, just copies the channels from the supplied color to the image.
x
y
color
Retrieves the color of the pixel (x,y).
Returns 0 if the pixel was retrieved, or -1 if not.
fcolor
Sets the pixel at (x,y) to the floating point color fcolor.
Retrieves the color of the pixel (x,y) as a floating point color into fcolor.
Sets (r-l) pixels starting from (l,y) using (r-l) values from colors.
Returns the number of pixels set.
Retrieves (r-l) pixels starting from (l,y) into colors.
Returns the number of pixels retrieved.
left
right
fcolors
Sets (right-left) pixels starting from (left,y) using (right-left) floating point colors from fcolors.
Retrieves (r-l) pixels starting from (l,y) into colors as floating point colors.
Reads sample values from im for the horizontal line (left, y) to (right-1,y) for the channels specified by channels, an array of int with channel_count elements.
im
channels
channel_count
If channels is NULL then the first channels_count channels are retrieved for each pixel.
Returns the number of samples read (which should be (right-left) * channel_count)
Reads floating point sample values from im for the horizontal line (left, y) to (right-1,y) for the channels specified by channels, an array of int with channel_count elements.
If channels is NULL then the first channel_count channels are retrieved for each pixel.
Reads integer samples scaled to bits bits of precision into the unsigned int array samples.
bits
unsigned int
samples
Expect this to be slow unless bits == im->bits.
bits == im->bits
Returns the number of samples copied, or -1 on error.
Not all image types implement this method.
Pushes errors, but does not call i_clear_error().
i_clear_error()
Writes integer samples scaled to bits bits of precision from the unsigned int array samples.
Reads palette indexes for the horizontal line (left, y) to (right-1, y) into indexes.
indexes
Returns the number of indexes read.
Always returns 0 for direct color images.
Writes palette indexes for the horizontal line (left, y) to (right-1, y) from indexes.
Returns the number of indexes written.
Adds colors to the image's palette.
On success returns the index of the lowest color added.
On failure returns -1.
Always fails for direct color images.
Retrieves count colors starting from index in the image's palette.
On success stores the colors into colors and returns true.
On failure returns false.
Fails if there are less than index+count colors in the image's palette.
Returns the number of colors in the image's palette.
Returns -1 for direct images.
Returns the maximum number of colors the palette can hold for the image.
Returns -1 for direct color images.
Searches the images palette for the given color.
On success sets *entry to the index of the color, and returns true.
Always fails on direct color images.
Sets count colors starting from index in the image's palette.
On success returns true.
The image must have at least index+count colors in it's palette for this to succeed.
Retrieve the context object for the current thread.
Inside Imager itself this is just a function pointer, which the Imager.xs BOOT handler initializes for use within perl. If you're taking the Imager code and embedding it elsewhere you need to initialize the im_get_context pointer at some point.
im_get_context
19 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
=over without closing =back
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.