Back to index

radiance  4R0+20100331
falsecolor.h
Go to the documentation of this file.
00001 /* RCSid $Id: falsecolor.h,v 3.3 2005/11/15 20:04:50 greg Exp $ */
00002 /*
00003  * Header file for false color tone-mapping.
00004  *
00005  * Include after "color.h" and "tonemap.h"
00006  */
00007 #ifndef _RAD_FALSECOLOR_H_
00008 #define _RAD_FALSECOLOR_H_
00009 
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013                             /* false color mapping data structure */
00014 typedef struct {
00015        TMbright      mbrmin, mbrmax;      /* mapped min. & max. brightnesses */
00016        BYTE          *lumap;              /* false color luminance map */
00017        BYTE          (*scale)[3];  /* false color ordinal scale */
00018 } FCstruct;
00019 
00020 extern BYTE   fcDefaultScale[256][3];            /* default false color scale */
00021 
00022 extern FCstruct *
00023 fcInit(BYTE fcscale[256][3]);
00024 /*
00025        Allocate and initialize false color mapping data structure.
00026        
00027        fcscale       -      false color ordinal scale.
00028        
00029        returns       -      new false color mapping pointer, or NULL if no memory.
00030  */
00031 
00032 extern int
00033 fcFixedLinear(FCstruct *fcs, double Lwmax);
00034 /*
00035        Assign fixed linear false color map.
00036        
00037        fcs    -      false color structure pointer.
00038        Lwmax  -      maximum luminance for scaling
00039        
00040        returns       -      0 on success, TM_E_* on failure.
00041  */
00042 
00043 extern int
00044 fcFixedLog(FCstruct *fcs, double Lwmin, double Lwmax);
00045 /*
00046        Assign fixed logarithmic false color map.
00047        
00048        fcs    -      false color structure pointer.
00049        Lwmin  -      minimum luminance for scaling
00050        Lwmax  -      maximum luminance for scaling
00051        
00052        returns       -      0 on success, TM_E_* on failure.
00053  */
00054 
00055 extern int
00056 fcLinearMapping(FCstruct *fcs, TMstruct *tms, double pctile);
00057 /*
00058        Compute linear false color map.
00059        
00060        fcs    -      false color structure pointer.
00061        tms    -      tone mapping structure pointer, with histogram.
00062        pctile -      percentile to ignore on top
00063        
00064        returns       -      0 on success, TM_E_* on failure.
00065  */
00066 
00067 extern int
00068 fcLogMapping(FCstruct *fcs, TMstruct *tms, double pctile);
00069 /*
00070        Compute logarithmic false color map.
00071        
00072        fcs    -      false color structure pointer.
00073        tms    -      tone mapping structure pointer, with histogram.
00074        pctile -      percentile to ignore on top and bottom
00075        
00076        returns       -      0 on success, TM_E_* on failure.
00077  */
00078  
00079 extern int
00080 fcMapPixels(FCstruct *fcs, BYTE *ps, TMbright *ls, int len);
00081 /*
00082        Apply false color mapping to pixel values.
00083        
00084        fcs    -      false color structure pointer.
00085        ps     -      returned RGB pixel values.
00086        ls     -      encoded luminance values.
00087        len    -      number of pixels.
00088        
00089        returns       -      0 on success, TM_E_* on failure.
00090  */
00091 
00092 extern int
00093 fcIsLogMap(FCstruct *fcs);
00094 /*
00095        Determine if false color mapping is logarithmic.
00096 
00097        fcs     -       false color structure pointer.
00098 
00099        returns       -      1 if map follows logarithmic mapping, -1 on error.
00100 */
00101 
00102 extern FCstruct *
00103 fcDup(FCstruct *fcs);
00104 /*
00105        Duplicate a false color structure.
00106 
00107        fcs     -       false color structure pointer.
00108 
00109        returns       -      duplicate structure, or NULL if no memory.
00110 */
00111 
00112 extern void
00113 fcDone(FCstruct *fcs);
00114 /*
00115        Free data associated with the given false color mapping structure.
00116 
00117        fcs    -      false color mapping structure to free.
00118 */
00119 
00120 #ifdef __cplusplus
00121 }
00122 #endif
00123 #endif /* _RAD_FALSECOLOR_H_ */