--- ray/src/common/tonemap.h 2021/01/07 19:13:57 3.29 +++ ray/src/common/tonemap.h 2024/11/21 17:15:54 3.33 @@ -1,4 +1,4 @@ -/* RCSid $Id: tonemap.h,v 3.29 2021/01/07 19:13:57 greg Exp $ */ +/* RCSid $Id: tonemap.h,v 3.33 2024/11/21 17:15:54 greg Exp $ */ /* * Header file for tone mapping functions. * @@ -63,9 +63,6 @@ extern "C" { /**** Global Data Types and Structures ****/ -#ifndef MEM_PTR -#define MEM_PTR void * -#endif #ifndef HIST_TYP #define HIST_TYP unsigned long #endif @@ -86,22 +83,21 @@ typedef struct { int cdiv[3]; /* computed color divisors */ RGBPRIMP inppri; /* current input primaries */ double inpsf; /* current input scalefactor */ - MEM_PTR inpdat; /* current input client data */ COLORMAT cmat; /* color conversion matrix */ TMbright hbrmin, hbrmax; /* histogram brightness limits */ HIST_TYP *histo; /* input histogram */ TMbright mbrmin, mbrmax; /* mapped brightness limits */ TMAP_TYP *lumap; /* computed luminance map */ - MEM_PTR pd[TM_MAXPKG]; /* pointers to private data */ + void *pd[TM_MAXPKG]; /* pointers to private data */ int lastError; /* last error incurred */ const char *lastFunc; /* error-generating function name */ } TMstruct; /* conversion package functions */ struct tmPackage { - MEM_PTR (*Init)(TMstruct *tms); + void * (*Init)(TMstruct *tms); void (*NewSpace)(TMstruct *tms); - void (*Free)(MEM_PTR pp); + void (*Free)(void *pp); }; /* our list of conversion packages */ extern struct tmPackage *tmPkg[TM_MAXPKG]; @@ -157,14 +153,13 @@ tmInit(int flags, RGBPRIMP monpri, double gamval); */ extern int -tmSetSpace(TMstruct *tms, RGBPRIMP pri, double sf, MEM_PTR dat); +tmSetSpace(TMstruct *tms, RGBPRIMP pri, double sf); /* Set color primaries and scale factor for incoming scanlines. tms - tone mapping structure pointer. pri - RGB color input primaries (Note 1). sf - scale factor to get to luminance in cd/m^2. - dat - application-specific data (NULL if not needed) returns - 0 on success, TM_E_* code on failure. */ @@ -191,7 +186,7 @@ tmAddHisto(TMstruct *tms, TMbright *ls, int len, int w */ extern int -tmFixedMapping(TMstruct *tms, double expmult, double gamval); +tmFixedMapping(TMstruct *tms, double expmult, double gamval, double Lddyn); /* Assign a fixed, linear tone-mapping using the given multiplier, which is the ratio of maximum output to uncalibrated input. @@ -202,6 +197,7 @@ tmFixedMapping(TMstruct *tms, double expmult, double g tms - tone mapping structure pointer. expmult - the fixed exposure multiplier to use. gamval - display gamma response (0. for default). + Lddyn - the display's dynamic range (0. for default). returns - 0 on success, TM_E_* on error. */