Different graphics file formats are best at handling different types of images. PNG's are the only format that has a built-in alpha channel. JPG's provide excellent compression for photographic images. BMP's don't have an alpha channel, and don't have compression, so there's seldom any reason to use them except perhaps for very tiny images. Also, the image reading functions provided by PModeLib are much more full-featured for PNG's and JPG's than for BMP's.
However, the only format currently supported by PModeLib for saving images is BMP.
Reads a PNG (Portable Network Graphics) image into a 32 BPP (RGBA) buffer.
Filename, (pathname) of the PNG file.
ImageBuf, starting address of 32 BPP image buffer to read image into.
Width, the width of the loaded image, in pixels.
Height, the height of the loaded image, in pixels.
Returns 1 on error, 0 on success.
Assumes destination image buffer is large enough to hold entire loaded 32 BPP image.
Some outputs are passed as parameters; pass the address of a variable, and after a successful call, the variable will be filled with the output information. If an output is not desired, pass 0 as the address.
Reads a PNG (Portable Network Graphics) image into a 32 BPP (RGBA) buffer.
Filename, (pathname) of the PNG file.
ImageSel, selector of memory segment containing image buffer.
ImageBuf, starting address (within memory segment selected by ImageSel) of 32 BPP image buffer to read image into.
Width, the width of the loaded image, in pixels.
Height, the height of the loaded image, in pixels.
Returns 1 on error, 0 on success.
Assumes destination image buffer is large enough to hold entire loaded 32 BPP image.
Some outputs are passed as parameters; pass the address of a variable, and after a successful call, the variable will be filled with the output information. If an output is not desired, pass 0 as the address.
Reads a JPG (or JPEG) image into a 32 BPP (RGBx) buffer.
Filename, (pathname) of the JPG file.
ImageBuf, starting address of 32 BPP image buffer to read image into.
Width, the width of the loaded image, in pixels.
Height, the height of the loaded image, in pixels.
Returns 1 on error, 0 on success.
Assumes destination image buffer is large enough to hold entire loaded 32 BPP image.
Some outputs are passed as parameters; pass the address of a variable, and after a successful call, the variable will be filled with the output information. If an output is not desired, pass 0 as the address.
Reads an 8-bits-per-pixel or 24 BPP BMP (Windows Bitmap) image into a 32 BPP (RGBx) buffer.
Filename, (pathname) of the BMP file.
ImageBuf, starting address of 32 BPP image buffer to read image into.
Returns nonzero on error, 0 on success.
Assumes destination image buffer is large enough to hold entire loaded 32 BPP image.
Doesn't return size of loaded image (e.g., width and height).
Reads an 8-bits-per-pixel or 24 BPP BMP (Windows Bitmap) image into a 32 BPP (RGBx) buffer.
Filename, (pathname) of the BMP file.
ImageSel, selector of memory segment containing image buffer.
ImageBuf, starting address (within memory segment selected by ImageSel) of 32 BPP image buffer to read image into.
Returns nonzero on error, 0 on success.
Assumes destination image buffer is large enough to hold entire loaded 32 BPP image.
Doesn't return size of loaded image (e.g., width and height).
Saves a 32 BPP (RGBx) image into a 24 BPP BMP (Windows Bitmap) file.
Filename, (path)name of the BMP file.
ImageBuf, starting address of 32 BPP image buffer containing image to save.
Width, the width of the image, in pixels.
Height, the height of the image, in pixels.
Returns nonzero on error, 0 on success.
Saves a 32 BPP (RGBx) image into a 24 BPP BMP (Windows Bitmap) file.
Filename, (path)name of the BMP file.
ImageSel, selector of memory segment containing image buffer.
ImageBuf, starting address (within memory segment selected by ImageSel) of 32 BPP image buffer containing image to save.
Width, the width of the image, in pixels.
Height, the height of the image, in pixels.
Returns nonzero on error, 0 on success.