5 |
|
* program to convert between RADIANCE and Windows BMP file |
6 |
|
*/ |
7 |
|
|
8 |
– |
#include <stdio.h> |
8 |
|
#include <math.h> |
10 |
– |
#include <string.h> |
9 |
|
|
10 |
+ |
#include "rtio.h" |
11 |
|
#include "platform.h" |
12 |
|
#include "color.h" |
13 |
|
#include "tonemap.h" |
159 |
|
if (rgbp == NULL) { |
160 |
|
hdr = BMPmappedHeader(scanlen(&rs), |
161 |
|
numscans(&rs), 0, 256); |
162 |
+ |
/* |
163 |
|
if (outfile != NULL) |
164 |
|
hdr->compr = BI_RLE8; |
165 |
+ |
*/ |
166 |
|
} else |
167 |
|
hdr = BMPtruecolorHeader(scanlen(&rs), |
168 |
|
numscans(&rs), 0); |
210 |
|
static int |
211 |
|
headline(char *s, void *p) |
212 |
|
{ |
213 |
< |
char fmt[32]; |
213 |
> |
char fmt[MAXFMTLEN]; |
214 |
|
|
215 |
|
if (formatval(fmt, s)) { /* check if format string */ |
216 |
|
if (!strcmp(fmt,COLRFMT)) |
351 |
|
BMPWriter *wtr; |
352 |
|
FILE *fp; |
353 |
|
int xr, yr; |
354 |
< |
BYTE *pa; |
354 |
> |
uby8 *pa; |
355 |
|
int i; |
356 |
|
/* check tone-mapping spec */ |
357 |
|
i = strlen(expec); |
396 |
|
quiterr("cannot allocate writer structure"); |
397 |
|
/* write to BMP file */ |
398 |
|
while (wtr->yscan < yr) { |
399 |
< |
BYTE *scn = pa + xr*((tmflags & TM_F_BW) ? 1 : 3)* |
399 |
> |
uby8 *scn = pa + xr*((tmflags & TM_F_BW) ? 1 : 3)* |
400 |
|
(yr-1 - wtr->yscan); |
401 |
|
if (tmflags & TM_F_BW) |
402 |
|
memcpy((void *)wtr->scanline, (void *)scn, xr); |