1 |
< |
/* Copyright (c) 1997 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
< |
/* SCCSid "$SunId$ LBL" */ |
3 |
> |
/* SCCSid "$SunId$ SGI" */ |
4 |
|
|
5 |
|
/* |
6 |
|
* Private header file for tone mapping routines. |
8 |
|
|
9 |
|
#undef NOPROTO |
10 |
|
#define NOPROTO 1 |
11 |
+ |
#ifndef MEM_PTR |
12 |
+ |
#define MEM_PTR char * |
13 |
+ |
#endif |
14 |
+ |
#include "color.h" |
15 |
|
#include "tonemap.h" |
16 |
+ |
|
17 |
+ |
/* required constants */ |
18 |
+ |
#ifndef M_LN2 |
19 |
+ |
#define M_LN2 0.69314718055994530942 |
20 |
+ |
#endif |
21 |
+ |
#ifndef M_LN10 |
22 |
+ |
#define M_LN10 2.30258509299404568402 |
23 |
+ |
#endif |
24 |
|
/* minimum values and defaults */ |
25 |
|
#define MINGAM 0.75 |
26 |
|
#define DEFGAM 2.2 |
29 |
|
#define MINLDMAX 1. |
30 |
|
#define DEFLDMAX 100. |
31 |
|
|
20 |
– |
/* private flags */ |
21 |
– |
#define TM_F_INITED 010000 /* initialized flag */ |
22 |
– |
#define TM_F_NEEDMAT 020000 /* need matrix conversion */ |
23 |
– |
|
32 |
|
#define BRT2SCALE ((int)(M_LN2*TM_BRTSCALE+.5)) |
33 |
|
|
34 |
|
#define HISTEP 8 /* steps in BRTSCALE for each bin */ |
37 |
|
#define MINLUM (1.125352e-7) /* tmLuminance(MINBRT) */ |
38 |
|
|
39 |
|
#define LMESLOWER (5.62e-3) /* lower mesopic limit */ |
32 |
– |
#define BMESLOWER ((int)(-5.18*TM_BRTSCALE-.5)) |
40 |
|
#define LMESUPPER (5.62) /* upper mesopic limit */ |
41 |
+ |
#if (TM_BRTSCALE==128) |
42 |
+ |
#define BMESLOWER (-663) /* encoded LMESLOWER */ |
43 |
+ |
#define BMESUPPER (221) /* encoded LMESUPPER */ |
44 |
+ |
#else |
45 |
+ |
#define BMESLOWER ((int)(-5.18*TM_BRTSCALE-.5)) |
46 |
|
#define BMESUPPER ((int)(1.73*TM_BRTSCALE+.5)) |
47 |
+ |
#endif |
48 |
|
|
49 |
|
#ifndef int4 |
50 |
|
#define int4 int /* assume 32-bit integers */ |
59 |
|
(int4)(SCO_bf*256.+.5)*(c)[BLU] ) >> 8 ) |
60 |
|
|
61 |
|
#ifndef malloc |
62 |
< |
extern char *malloc(), *calloc(); |
62 |
> |
MEM_PTR malloc(); |
63 |
> |
MEM_PTR calloc(); |
64 |
|
#endif |
65 |
|
extern int tmErrorReturn(); |
66 |
|
|