--- ray/src/common/tonemap.h 1997/04/21 15:23:42 3.5 +++ ray/src/common/tonemap.h 1998/08/17 17:58:47 3.8 @@ -1,12 +1,12 @@ -/* Copyright (c) 1997 Regents of the University of California */ +/* Copyright (c) 1998 Silicon Graphics, Inc. */ -/* SCCSid "$SunId$ LBL" */ +/* SCCSid "$SunId$ SGI" */ /* * Header file for tone mapping functions. + * + * Include after "color.h" */ - /* required non-system header files */ -#include "color.h" /**** Argument Macros ****/ @@ -32,6 +32,7 @@ #define TM_NOCHROMP (BYTE **)NULL /* indicate no chrominances */ #define TM_GETFILE (FILE *)NULL /* indicate file must be opened */ + /**** Error Return Values ****/ #define TM_E_OK 0 /* normal return status */ @@ -58,6 +59,8 @@ #endif extern char *tmErrorMessage[]; /* error messages */ +extern int tmLastError; /* last error incurred by library */ +extern char *tmLastFunction; /* error-generating function name */ typedef short TMbright; /* encoded luminance type */ @@ -71,8 +74,9 @@ extern struct tmStruct { RGBPRIMP inppri; /* current input primaries */ double inpsf; /* current input scalefactor */ COLORMAT cmat; /* color conversion matrix */ - TMbright brmin, brmax; /* input brightness limits */ + TMbright hbrmin, hbrmax; /* histogram brightness limits */ int *histo; /* input histogram */ + TMbright mbrmin, mbrmax; /* mapped brightness limits */ unsigned short *lumap; /* computed luminance map */ struct tmStruct *tmprev; /* previous tone mapping */ MEM_PTR pd[TM_MAXPKG]; /* pointers to private data */ @@ -195,7 +199,9 @@ tmAddHisto(TMbright *ls, int len, int wt); extern int tmComputeMapping(double gamval, double Lddyn, double Ldmax); /* - Compute tone mapping function. + Compute tone mapping function. This mapping will be used + in subsequent calls to tmMapPixels() until a new tone mapping + is computed. I.e., calls to tmAddHisto() have no immediate effect. gamval - display gamma response (0. for default). Lddyn - the display's dynamic range (0. for default).