forked from johannesgerer/jburkardt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid_to_bmp.html
235 lines (201 loc) · 5.51 KB
/
grid_to_bmp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<html>
<head>
<title>
GRID_TO_BMP - Microsoft BMP Image of 2D Grid Data
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
GRID_TO_BMP <br> Microsoft BMP Image of 2D Grid Data
</h1>
<hr>
<p>
<b>GRID_TO_BMP</b>
is a C++ program which
creates a Microsoft BMP color image file that represents
scalar data read from a text file.
</p>
<p>
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".
</p>
<p>
The first two records of the text file should contain the values of
M and N, respectively.
</p>
<p>
There should follow M records, each of length N, containing, in order,
the rows of U.
</p>
<h3 align = "center">
Usage:
</h3>
<p>
<blockquote>
<b>grid_to_bmp</b> <i>input_file</i> <i>output_file</i>
</blockquote>
where
<ul>
<li>
<i>input_file</i> 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.
</li>
<li>
<i>output_file</i> is the name of the output file, a BMP graphics file containing an image of
the data.
</li>
</ul>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>GRID_TO_BMP</b> is available in
<a href = "../../cpp_src/grid_to_bmp/grid_to_bmp.html">a C++ version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../data/bmp/bmp.html">
BMP</a>,
a data directory which
contains a few BMP files.
</p>
<p>
<a href = "../../cpp_src/bmp_io/bmp_io.html">
BMP_IO</a>,
a C++ library which
reads or writes BMP graphics files.
</p>
<p>
<a href = "../../cpp_src/bmp_to_ppma/bmp_to_ppma.html">
BMP_TO_PPMA</a>,
a C++ program which
converts BMP files to ASCII Portable Pixel Map (PPM) format.
</p>
<p>
<a href = "../../cpp_src/bmp_to_ppmb/bmp_to_ppmb.html">
BMP_TO_PPMB</a>,
a C++ program which
converts BMP files to binary Portable Pixel Map (PPM) format.
</p>
<p>
<a href = "../../c_src/heated_plate/heated_plate.html">
HEATED_PLATE</a>,
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.
</p>
<p>
<a href = "../../cpp_src/ppma_to_bmp/ppma_to_bmp.html">
PPMA_TO_BMP</a>,
a C++ program which
converts ASCII Portable Pixel Map (PPM) files to BMP format.
</p>
<p>
<a href = "../../cpp_src/ppmb_to_bmp/ppmb_to_bmp.html">
PPMB_TO_BMP</a>,
a C++ program
which converts binary Portable Pixel Map (PPM) files to BMP format.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
David Kay and John Levine,<br>
Graphics File Formats,<br>
Second Edition,<br>
McGraw Hill, 1995.
</li>
<li>
John Miano,<br>
Compressed Image File Formats,<br>
Addison Wesley, 1999.
</li>
<li>
Microsoft Corporation,<br>
Microsoft Windows Programmer's Reference,<br>
Volume 5; Messages, Structures, and Macros,<br>
Microsoft Press, 1993.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "grid_to_bmp.cpp">grid_to_bmp.cpp</a>, the source code;
</li>
<li>
<a href = "grid_to_bmp.sh">grid_to_bmp.sh</a>, commands to
compile and load the source code;
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<b>SOL_100x500</b> is a solution of the steady state heat equation on a 100x500 grid,
computed by the HEATED_PLATE program.
<ul>
<li>
<a href = "sol_100x500.txt">sol_100x500.txt</a>,
</li>
<li>
<a href = "sol_100x500.bmp">sol_100x500.bmp</a>,
the BMP image file.
</li>
<li>
<a href = "sol_100x500.png">sol_100x500.png</a>,
the PNG image file.
</li>
</ul>
</p>
<p>
<b>SOL_200x500</b> is a solution of the steady state heat equation on a 200x500 grid,
computed by the HEATED_PLATE program.
<ul>
<li>
<a href = "sol_200x500.txt">sol_200x500.txt</a>,
</li>
<li>
<a href = "sol_200x500.bmp">sol_200x500.bmp</a>,
the BMP image file.
</li>
<li>
<a href = "sol_200x500.png">sol_200x500.png</a>,
the PNG image file.
</li>
</ul>
</p>
<p>
<b>SOL_500x500</b> is a solution of the steady state heat equation on a 500x500 grid,
computed by the HEATED_PLATE program.
<ul>
<li>
<a href = "sol_500x500.txt">sol_500x500.txt</a>,
</li>
<li>
<a href = "sol_500x500.bmp">sol_500x500.bmp</a>,
the BMP image file.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../cpp_src.html">
the C++ source codes</a>.
</p>
<hr>
<i>
Last revised on 14 September 2010.
</i>
<!-- John Burkardt -->
</body>
</html>