1 |
< |
/* Copyright (c) 1997 Regents of the University of California */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ LBL" */ |
4 |
< |
|
1 |
> |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
* Private header file for tone mapping routines. |
4 |
|
*/ |
5 |
+ |
#ifndef _RAD_TMPRIVAT_H_ |
6 |
+ |
#define _RAD_TMPRIVAT_H_ |
7 |
+ |
#ifdef __cplusplus |
8 |
+ |
extern "C" { |
9 |
+ |
#endif |
10 |
|
|
11 |
< |
#undef NOPROTO |
12 |
< |
#define NOPROTO 1 |
11 |
> |
#include "copyright.h" |
12 |
> |
|
13 |
> |
#ifndef MEM_PTR |
14 |
> |
#define MEM_PTR void * |
15 |
> |
#endif |
16 |
> |
#include "color.h" |
17 |
|
#include "tonemap.h" |
18 |
|
|
19 |
|
/* required constants */ |
31 |
|
#define MINLDMAX 1. |
32 |
|
#define DEFLDMAX 100. |
33 |
|
|
34 |
< |
/* private flags */ |
29 |
< |
#define TM_F_INITED 010000 /* initialized flag */ |
30 |
< |
#define TM_F_NEEDMAT 020000 /* need matrix conversion */ |
34 |
> |
#define BRT2SCALE(l2) (int)(M_LN2*TM_BRTSCALE*(l2) + ((l2)>0 ? .5 : -.5)) |
35 |
|
|
32 |
– |
#define BRT2SCALE ((int)(M_LN2*TM_BRTSCALE+.5)) |
33 |
– |
|
36 |
|
#define HISTEP 8 /* steps in BRTSCALE for each bin */ |
37 |
|
|
38 |
|
#define MINBRT (-16*TM_BRTSCALE) /* minimum usable brightness */ |
61 |
|
(int4)(SCO_bf*256.+.5)*(c)[BLU] ) >> 8 ) |
62 |
|
|
63 |
|
#ifndef malloc |
64 |
< |
extern char *malloc(), *calloc(); |
64 |
> |
MEM_PTR malloc(); |
65 |
> |
MEM_PTR calloc(); |
66 |
|
#endif |
67 |
|
extern int tmErrorReturn(); |
68 |
|
|
69 |
+ |
/* lookup for mesopic scaling */ |
70 |
+ |
extern BYTE tmMesofact[BMESUPPER-BMESLOWER]; |
71 |
+ |
|
72 |
+ |
extern void tmMkMesofact(); /* build tmMesofact */ |
73 |
+ |
|
74 |
|
#define returnErr(code) return(tmErrorReturn(funcName,code)) |
75 |
|
#define returnOK return(TM_E_OK) |
76 |
|
|
77 |
|
#define FEQ(a,b) ((a) < (b)+1e-5 && (b) < (a)+1e-5) |
78 |
|
|
79 |
< |
#define PRIMEQ(p1,p2) (FEQ((p1)[0][0],(p2)[0][0])&&FEQ((p1)[0][1],(p2)[0][2])\ |
80 |
< |
&&FEQ((p1)[1][0],(p2)[1][0])&&FEQ((p1)[1][1],(p2)[1][2])\ |
81 |
< |
&&FEQ((p1)[2][0],(p2)[2][0])&&FEQ((p1)[2][1],(p2)[2][2])\ |
82 |
< |
&&FEQ((p1)[3][0],(p2)[3][0])&&FEQ((p1)[3][1],(p2)[3][2])) |
79 |
> |
#define PRIMEQ(p1,p2) (FEQ((p1)[0][0],(p2)[0][0])&&FEQ((p1)[0][1],(p2)[0][1])\ |
80 |
> |
&&FEQ((p1)[1][0],(p2)[1][0])&&FEQ((p1)[1][1],(p2)[1][1])\ |
81 |
> |
&&FEQ((p1)[2][0],(p2)[2][0])&&FEQ((p1)[2][1],(p2)[2][1])\ |
82 |
> |
&&FEQ((p1)[3][0],(p2)[3][0])&&FEQ((p1)[3][1],(p2)[3][1])) |
83 |
> |
|
84 |
> |
|
85 |
> |
#ifdef __cplusplus |
86 |
> |
} |
87 |
> |
#endif |
88 |
> |
#endif /* _RAD_TMPRIVAT_H_ */ |
89 |
> |
|