--- ray/src/common/tmprivat.h 2003/06/27 06:53:22 3.10 +++ ray/src/common/tmprivat.h 2008/07/03 03:35:10 3.17 @@ -1,20 +1,20 @@ -/* RCSid $Id: tmprivat.h,v 3.10 2003/06/27 06:53:22 greg Exp $ */ +/* RCSid $Id: tmprivat.h,v 3.17 2008/07/03 03:35:10 greg Exp $ */ /* * Private header file for tone mapping routines. */ #ifndef _RAD_TMPRIVAT_H_ #define _RAD_TMPRIVAT_H_ -#ifdef __cplusplus -extern "C" { -#endif #ifndef MEM_PTR #define MEM_PTR void * #endif #include "color.h" #include "tonemap.h" -#include "tifftypes.h" +#ifdef __cplusplus +extern "C" { +#endif + /* required constants */ #ifndef M_LN2 #define M_LN2 0.69314718055994530942 @@ -37,6 +37,9 @@ extern "C" { #define MINBRT (-16*TM_BRTSCALE) /* minimum usable brightness */ #define MINLUM (1.125352e-7) /* tmLuminance(MINBRT) */ +#define HISTI(li) (((li)-MINBRT)/HISTEP) +#define HISTV(i) (MINBRT + HISTEP/2 + (i)*HISTEP) + #define LMESLOWER (5.62e-3) /* lower mesopic limit */ #define LMESUPPER (5.62) /* upper mesopic limit */ #if (TM_BRTSCALE==128) @@ -59,14 +62,14 @@ extern "C" { MEM_PTR malloc(); MEM_PTR calloc(); #endif -extern int tmErrorReturn(); +extern int tmErrorReturn(const char *, TMstruct *, int); /* lookup for mesopic scaling */ extern BYTE tmMesofact[BMESUPPER-BMESLOWER]; -extern void tmMkMesofact(); /* build tmMesofact */ +extern void tmMkMesofact(void); /* build tmMesofact */ -#define returnErr(code) return(tmErrorReturn(funcName,code)) +#define returnErr(code) return(tmErrorReturn(funcName,tms,code)) #define returnOK return(TM_E_OK) #define FEQ(a,b) ((a) < (b)+1e-5 && (b) < (a)+1e-5) @@ -75,7 +78,6 @@ extern void tmMkMesofact(); /* build tmMesofact */ &&FEQ((p1)[1][0],(p2)[1][0])&&FEQ((p1)[1][1],(p2)[1][1])\ &&FEQ((p1)[2][0],(p2)[2][0])&&FEQ((p1)[2][1],(p2)[2][1])\ &&FEQ((p1)[3][0],(p2)[3][0])&&FEQ((p1)[3][1],(p2)[3][1])) - #ifdef __cplusplus }