ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/falsecolor.h
Revision: 3.4
Committed: Fri May 20 02:06:38 2011 UTC (12 years, 11 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R1, rad4R2P1, rad5R3, HEAD
Changes since 3.3: +6 -6 lines
Log Message:
Changed every instance of BYTE to uby8 to avoid conflicts

File Contents

# Content
1 /* RCSid $Id: falsecolor.h,v 3.3 2005/11/15 20:04:50 greg Exp $ */
2 /*
3 * Header file for false color tone-mapping.
4 *
5 * Include after "color.h" and "tonemap.h"
6 */
7 #ifndef _RAD_FALSECOLOR_H_
8 #define _RAD_FALSECOLOR_H_
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 /* false color mapping data structure */
14 typedef struct {
15 TMbright mbrmin, mbrmax; /* mapped min. & max. brightnesses */
16 uby8 *lumap; /* false color luminance map */
17 uby8 (*scale)[3]; /* false color ordinal scale */
18 } FCstruct;
19
20 extern uby8 fcDefaultScale[256][3]; /* default false color scale */
21
22 extern FCstruct *
23 fcInit(uby8 fcscale[256][3]);
24 /*
25 Allocate and initialize false color mapping data structure.
26
27 fcscale - false color ordinal scale.
28
29 returns - new false color mapping pointer, or NULL if no memory.
30 */
31
32 extern int
33 fcFixedLinear(FCstruct *fcs, double Lwmax);
34 /*
35 Assign fixed linear false color map.
36
37 fcs - false color structure pointer.
38 Lwmax - maximum luminance for scaling
39
40 returns - 0 on success, TM_E_* on failure.
41 */
42
43 extern int
44 fcFixedLog(FCstruct *fcs, double Lwmin, double Lwmax);
45 /*
46 Assign fixed logarithmic false color map.
47
48 fcs - false color structure pointer.
49 Lwmin - minimum luminance for scaling
50 Lwmax - maximum luminance for scaling
51
52 returns - 0 on success, TM_E_* on failure.
53 */
54
55 extern int
56 fcLinearMapping(FCstruct *fcs, TMstruct *tms, double pctile);
57 /*
58 Compute linear false color map.
59
60 fcs - false color structure pointer.
61 tms - tone mapping structure pointer, with histogram.
62 pctile - percentile to ignore on top
63
64 returns - 0 on success, TM_E_* on failure.
65 */
66
67 extern int
68 fcLogMapping(FCstruct *fcs, TMstruct *tms, double pctile);
69 /*
70 Compute logarithmic false color map.
71
72 fcs - false color structure pointer.
73 tms - tone mapping structure pointer, with histogram.
74 pctile - percentile to ignore on top and bottom
75
76 returns - 0 on success, TM_E_* on failure.
77 */
78
79 extern int
80 fcMapPixels(FCstruct *fcs, uby8 *ps, TMbright *ls, int len);
81 /*
82 Apply false color mapping to pixel values.
83
84 fcs - false color structure pointer.
85 ps - returned RGB pixel values.
86 ls - encoded luminance values.
87 len - number of pixels.
88
89 returns - 0 on success, TM_E_* on failure.
90 */
91
92 extern int
93 fcIsLogMap(FCstruct *fcs);
94 /*
95 Determine if false color mapping is logarithmic.
96
97 fcs - false color structure pointer.
98
99 returns - 1 if map follows logarithmic mapping, -1 on error.
100 */
101
102 extern FCstruct *
103 fcDup(FCstruct *fcs);
104 /*
105 Duplicate a false color structure.
106
107 fcs - false color structure pointer.
108
109 returns - duplicate structure, or NULL if no memory.
110 */
111
112 extern void
113 fcDone(FCstruct *fcs);
114 /*
115 Free data associated with the given false color mapping structure.
116
117 fcs - false color mapping structure to free.
118 */
119
120 #ifdef __cplusplus
121 }
122 #endif
123 #endif /* _RAD_FALSECOLOR_H_ */