| 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" |
| 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)) |
| 249 |
|
usexfm = (monpri != NULL ? rgbinp != monpri : |
| 250 |
|
rgbinp != TM_XYZPRIM && rgbinp != stdprims); |
| 251 |
|
if (usexfm) { |
| 252 |
< |
double expcomp = pow(2.0, (double)bradj); |
| 252 |
> |
RGBPRIMP destpri = monpri != NULL ? monpri : stdprims; |
| 253 |
> |
double expcomp = pow(2.0, (double)bradj); |
| 254 |
|
if (rgbinp == TM_XYZPRIM) |
| 255 |
< |
compxyz2rgbWBmat(xfm, monpri); |
| 255 |
> |
compxyz2rgbWBmat(xfm, destpri); |
| 256 |
|
else |
| 257 |
< |
comprgb2rgbWBmat(xfm, rgbinp, monpri); |
| 257 |
> |
comprgb2rgbWBmat(xfm, rgbinp, destpri); |
| 258 |
|
for (y = 0; y < 3; y++) |
| 259 |
|
for (x = 0; x < 3; x++) |
| 260 |
|
xfm[y][x] *= expcomp; |