1 |
– |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Program to convert between RADIANCE and TIFF files. |
6 |
< |
* Added experimental LogLuv encodings 7/97 (GWL). |
6 |
> |
* Added LogLuv encodings 7/97 (GWL). |
7 |
> |
* Added white-balance adjustment 10/01 (GW). |
8 |
|
*/ |
9 |
|
|
10 |
|
#include <stdio.h> |
11 |
|
#include <math.h> |
12 |
+ |
#include <time.h> |
13 |
|
#include "tiffio.h" |
14 |
|
#include "color.h" |
15 |
|
#include "resolu.h" |
16 |
|
|
17 |
|
#define GAMCOR 2.2 /* default gamma */ |
18 |
|
|
20 |
– |
#ifndef malloc |
21 |
– |
extern char *malloc(); |
22 |
– |
#endif |
19 |
|
/* conversion flags */ |
20 |
|
#define C_CXFM 0x1 /* needs color transformation */ |
21 |
|
#define C_GAMUT 0x2 /* needs gamut mapping */ |
264 |
|
SET(C_GAMMA); |
265 |
|
setcolrgam(cvts.gamcor); |
266 |
|
if (CHK(C_XYZE)) { |
267 |
< |
comprgb2xyzmat(cvts.cmat, |
267 |
> |
comprgb2xyzWBmat(cvts.cmat, |
268 |
|
CHK(C_PRIM) ? cvts.prims : stdprims); |
269 |
|
SET(C_CXFM); |
270 |
|
} |
421 |
|
SET(C_RFLT|C_TFLT); |
422 |
|
CLR(C_GRY); |
423 |
|
if (!CHK(C_XYZE)) { |
424 |
< |
cpcolormat(cvts.cmat, rgb2xyzmat); |
424 |
> |
comprgb2xyzWBmat(cvts.cmat, |
425 |
> |
CHK(C_PRIM) ? cvts.prims : stdprims); |
426 |
|
SET(C_CXFM); |
427 |
|
} |
428 |
|
if (cvts.comp != COMPRESSION_SGILOG && |
445 |
|
CLR(C_GRY); |
446 |
|
setcolrgam(cvts.gamcor); |
447 |
|
if (CHK(C_XYZE)) { |
448 |
< |
compxyz2rgbmat(cvts.cmat, |
448 |
> |
compxyz2rgbWBmat(cvts.cmat, |
449 |
|
CHK(C_PRIM) ? cvts.prims : stdprims); |
450 |
|
SET(C_CXFM); |
451 |
|
} |