BMP_IO
Microsoft BMP bitmap files
Read and Write Utilities


BMP_IO is a C++ library to read or write the graphics information in a Microsoft BMP file.

A user program can employ these routines to read a BMP file and extract and return the graphics information (RGB pixel arrays), or to write internal RGB pixel arrays into a properly formatted BMP file. The BMP file format is used for many of the icons seen cluttering up the desktop of a Windows machine, for instance.

Of course, another interesting application is to read in a BMP file, and write out the RGB information to a file in another format.

Since some of the data is multibyte, the format of the file can depend on whether such data is written with the bytes in "little-endian" or "big-endian" order. The program maintains a variable called BMP_BYTE_SWAP which controls how the program assumes the bytes are ordered. Setting this variable to true show be the appropriate value for little-endian ordering, while false is for big-endian. This variable can be read by calling the function bmp_byte_swap_get, or set by calling bmp_byte_swap_set.

Related Data and Programs:

BMP is a data directory containing a few BMP files.

BMP_2_PPMA is a C program which uses BMP_IO to convert BMP files to PPMA format.

BMP_TO_PPMB is a C program which uses BMP_IO to convert BMP files to PPMB format.

PPMA_TO_BMP is a C program which uses BMP_IO to convert PPMA files to BMP format.

PPMB_TO_BMP is a C program which uses BMP_IO to convert PPMB files to BMP format.

Reference:

  1. David Kay and John Levine,
    Graphics File Formats,
    Second Edition,
    McGraw Hill, 1995.
  2. John Miano,
    Compressed Image File Formats,
    Addison Wesley, 1999.
  3. Microsoft Corporation,
    Microsoft Windows Programmer's Reference,
    Volume 5; Messages, Structures, and Macros,
    Microsoft Press, 1993.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the C++ source codes.


Last revised on 09 December 2005.