jburkardt

BMP_IO\ Microsoft BMP bitmap files\ Read and Write Utilities {#bmp_io-microsoft-bmp-bitmap-files-read-and-write-utilities align=”center”} ===========================


BMP_IO is a C++ library which reads or writes 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.

Licensing: {#licensing align=”center”}

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages: {#languages align=”center”}

BMP_IO is available in a C++ version.

BMP, a data directory which contains example BMP files.

BMP_TO_PPMA, a C++ program which converts BMP files to ASCII PPM format.

BMP_TO_PPMB, a C++ program which converts BMP files to binary PPM format.

PPMA_TO_BMP, a C++ program which converts ASCII PPM files to BMP format.

PPMB_TO_BMP, a C++ program which converts binary PPM files to BMP format.

Reference: {#reference align=”center”}

  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: {#source-code align=”center”}

Examples and Tests: {#examples-and-tests align=”center”}

List of Routines: {#list-of-routines align=”center”}

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


Last revised on 09 December 2005.