Back to index

radiance  4R0+20100331
Defines | Functions | Variables
tmprivat.h File Reference
#include "color.h"
#include "tonemap.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MEM_PTR   void *
#define M_LN2   0.69314718055994530942
#define M_LN10   2.30258509299404568402
#define MINGAM   0.75
#define DEFGAM   2.2
#define MINLDDYN   2.
#define DEFLDDYN   32.
#define MINLDMAX   1.
#define DEFLDMAX   100.
#define BRT2SCALE(l2)   (int)(M_LN2*TM_BRTSCALE*(l2) + ((l2)>0 ? .5 : -.5))
#define HISTEP   8 /* steps in BRTSCALE for each bin */
#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 */
#define BMESLOWER   (-663) /* encoded LMESLOWER */
#define BMESUPPER   (221) /* encoded LMESUPPER */
#define SCO_rf   0.062
#define SCO_gf   0.608
#define SCO_bf   0.330
#define scotlum(c)   (SCO_rf*(c)[RED] + SCO_gf*(c)[GRN] + SCO_bf*(c)[BLU])
#define normscot(c)
#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)
#define PRIMEQ(p1, p2)

Functions

int tmNewMap (TMstruct *tms)
int tmErrorReturn (const char *, TMstruct *, int)
void tmMkMesofact (void)

Variables

BYTE tmMesofact [BMESUPPER-BMESLOWER]

Define Documentation

#define BMESLOWER   (-663) /* encoded LMESLOWER */

Definition at line 46 of file tmprivat.h.

#define BMESUPPER   (221) /* encoded LMESUPPER */

Definition at line 47 of file tmprivat.h.

#define BRT2SCALE (   l2)    (int)(M_LN2*TM_BRTSCALE*(l2) + ((l2)>0 ? .5 : -.5))

Definition at line 33 of file tmprivat.h.

#define DEFGAM   2.2

Definition at line 27 of file tmprivat.h.

#define DEFLDDYN   32.

Definition at line 29 of file tmprivat.h.

#define DEFLDMAX   100.

Definition at line 31 of file tmprivat.h.

#define FEQ (   a,
 
)    ((a) < (b)+1e-5 && (b) < (a)+1e-5)

Definition at line 73 of file tmprivat.h.

#define HISTEP   8 /* steps in BRTSCALE for each bin */

Definition at line 35 of file tmprivat.h.

#define HISTI (   li)    (((li)-MINBRT)/HISTEP)

Definition at line 40 of file tmprivat.h.

#define HISTV (   i)    (MINBRT + HISTEP/2 + (i)*HISTEP)

Definition at line 41 of file tmprivat.h.

#define LMESLOWER   (5.62e-3) /* lower mesopic limit */

Definition at line 43 of file tmprivat.h.

#define LMESUPPER   (5.62) /* upper mesopic limit */

Definition at line 44 of file tmprivat.h.

#define M_LN10   2.30258509299404568402

Definition at line 23 of file tmprivat.h.

#define M_LN2   0.69314718055994530942

Definition at line 20 of file tmprivat.h.

#define MEM_PTR   void *

Definition at line 9 of file tmprivat.h.

#define MINBRT   (-16*TM_BRTSCALE) /* minimum usable brightness */

Definition at line 37 of file tmprivat.h.

#define MINGAM   0.75

Definition at line 26 of file tmprivat.h.

#define MINLDDYN   2.

Definition at line 28 of file tmprivat.h.

#define MINLDMAX   1.

Definition at line 30 of file tmprivat.h.

#define MINLUM   (1.125352e-7) /* tmLuminance(MINBRT) */

Definition at line 38 of file tmprivat.h.

#define normscot (   c)
Value:
( (    (int32)(SCO_rf*256.+.5)*(c)[RED] + \
                            (int32)(SCO_gf*256.+.5)*(c)[GRN] + \
                            (int32)(SCO_bf*256.+.5)*(c)[BLU]   ) >> 8 )

Definition at line 57 of file tmprivat.h.

#define PRIMEQ (   p1,
  p2 
)
Value:
(FEQ((p1)[0][0],(p2)[0][0])&&FEQ((p1)[0][1],(p2)[0][1])\
                     &&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]))

Definition at line 75 of file tmprivat.h.

#define returnErr (   code)    return(tmErrorReturn(funcName,tms,code))

Definition at line 70 of file tmprivat.h.

#define returnOK   return(TM_E_OK)

Definition at line 71 of file tmprivat.h.

#define SCO_bf   0.330

Definition at line 55 of file tmprivat.h.

#define SCO_gf   0.608

Definition at line 54 of file tmprivat.h.

#define SCO_rf   0.062

Definition at line 53 of file tmprivat.h.

#define scotlum (   c)    (SCO_rf*(c)[RED] + SCO_gf*(c)[GRN] + SCO_bf*(c)[BLU])

Definition at line 56 of file tmprivat.h.


Function Documentation

int tmErrorReturn ( const char *  ,
TMstruct ,
int   
)

Definition at line 697 of file tonemap.c.

{
       if (tms != NULL) {
              tms->lastFunc = func;
              tms->lastError = err;
              if (tms->flags & TM_F_NOSTDERR)
                     return(err);
       }
       fputs(func, stderr);
       fputs(": ", stderr);
       fputs(tmErrorMessage[err], stderr);
       fputs("!\n", stderr);
       return(err);
}
void tmMkMesofact ( void  )

Definition at line 661 of file tonemap.c.

{
       int    i;

       if (tmMesofact[BMESUPPER-BMESLOWER-1])
              return;

       for (i = BMESLOWER; i < BMESUPPER; i++)
              tmMesofact[i-BMESLOWER] = 256. *
                            (tmLuminance(i) - LMESLOWER) /
                            (LMESUPPER - LMESLOWER);
}

Here is the caller graph for this function:

int tmNewMap ( TMstruct tms)

Definition at line 676 of file tonemap.c.

{
       if (tms->lumap != NULL && (tms->mbrmax - tms->mbrmin) !=
                                   (tms->hbrmax - tms->hbrmin)) {
              free((MEM_PTR)tms->lumap);
              tms->lumap = NULL;
       }
       tms->mbrmin = tms->hbrmin;
       tms->mbrmax = tms->hbrmax;
       if (tms->mbrmin > tms->mbrmax)
              return 0;
       if (tms->lumap == NULL)
              tms->lumap = (unsigned short *)malloc(sizeof(unsigned short)*
                                   (tms->mbrmax-tms->mbrmin+1));
       return(tms->lumap != NULL);
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 658 of file tonemap.c.