bmp.c - read and write windows BMP files
i_img *im; io_glue *ig; if (!i_writebmp_wiol(im, ig)) { ... error ... } im = i_readbmp(ig);
Reads and writes Windows BMP files.
Writes the image as a BMP file. Uses 1-bit, 4-bit, 8-bit or 24-bit formats depending on the image.
Never compresses the image.
Reads a Windows format bitmap from the given file.
Handles BI_RLE4 and BI_RLE8 compressed images. Attempts to handle BI_BITFIELDS images too, but I need a test image.
Internal functions used in the implementation.
Reads from the specified "file" the specified sizes. The format codes match those used by perl's pack() function, though only a few are implemented. In all cases the vararg arguement is an int *.
Returns non-zero if all of the arguments were read.
Writes packed data to the specified io_glue.
Returns non-zero on success.
Writes a Windows BMP header to the file.
Writes the image data as a 1-bit/pixel image.
Writes the image data as a 4-bit/pixel image.
Writes the image data as a 8-bit/pixel image.
Writes the image data as a 24-bit/pixel image.
Reads count palette entries from the file and add them to the image.
Reads in the palette and image data for a 1-bit/pixel image.
Returns the image or NULL.
Reads in the palette and image data for a 4-bit/pixel image.
Hopefully this will be combined with the following function at some point.
Reads in the palette and image data for a 8-bit/pixel image.
Skips the palette and reads in the image data for a direct colour image.
Imager(3)
Tony Cook <tony@develop-help.com>
Cannot save as compressed BMP.
Doesn't handle OS/2 bitmaps.
16-bit/pixel images haven't been tested. (I need an image).
BI_BITFIELDS compression hasn't been tested (I need an image).
The header handling for paletted images needs to be refactored
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
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.