GRID_TO_BMP
Microsoft BMP Image of 2D Grid Data {#grid_to_bmp-microsoft-bmp-image-of-2d-grid-data align="center"}
GRID_TO_BMP is a C++ program which creates a Microsoft BMP color image file that represents scalar data read from a text file.
The text file should contain the values of a quantity on an M by N grid, stored as an M by N array, which we will call "U".
The first two records of the text file should contain the values of M and N, respectively.
There should follow M records, each of length N, containing, in order, the rows of U.
grid_to_bmp input_file output_file
where
- input_file is the text file whose first two lines record the values of M and N, with each succeeding line containing the N values of the next row of data.
- output_file is the name of the output file, a BMP graphics file containing an image of the data.
GRID_TO_BMP is available in a C++ version.
BMP, a data directory which contains a few BMP files.
BMP_IO, a C++ library which reads or writes BMP graphics files.
BMP_TO_PPMA, a C++ program which converts BMP files to ASCII Portable Pixel Map (PPM) format.
BMP_TO_PPMB, a C++ program which converts BMP files to binary Portable Pixel Map (PPM) format.
HEATED_PLATE, a C program which solves the steady state heat equation in a 2D rectangular region, and writes the data to a file suitable for input to GRID_TO_BMP.
PPMA_TO_BMP, a C++ program which converts ASCII Portable Pixel Map (PPM) files to BMP format.
PPMB_TO_BMP, a C++ program which converts binary Portable Pixel Map (PPM) files to BMP format.
- David Kay and John Levine,
Graphics File Formats,
Second Edition,
McGraw Hill, 1995. - John Miano,
Compressed Image File Formats,
Addison Wesley, 1999. - Microsoft Corporation,
Microsoft Windows Programmer's Reference,
Volume 5; Messages, Structures, and Macros,
Microsoft Press, 1993.
- grid_to_bmp.cpp, the source code;
SOL_100x500 is a solution of the steady state heat equation on a 100x500 grid, computed by the HEATED_PLATE program.
- sol_100x500.txt,
- sol_100x500.bmp, the BMP image file.
- sol_100x500.png, the PNG image file.
SOL_200x500 is a solution of the steady state heat equation on a 200x500 grid, computed by the HEATED_PLATE program.
- sol_200x500.txt,
- sol_200x500.bmp, the BMP image file.
- sol_200x500.png, the PNG image file.
SOL_500x500 is a solution of the steady state heat equation on a 500x500 grid, computed by the HEATED_PLATE program.
- sol_500x500.txt,
- sol_500x500.bmp, the BMP image file.
You can go up one level to the C++ source codes.
Last revised on 14 September 2010.