rvcrast.h

Go to the documentation of this file.
00001 /**
00002  * \file rvcrast.h <mi32/rvcrast.h>
00003  * \brief RVC Raster Definitions Header File
00004  *
00005  * \if NODOC
00006  * $Id: rvcrast.h_v 1.106 2004/09/07 13:57:23 mju Exp $
00007  *
00008  * $Log: rvcrast.h_v $
00009  * Revision 1.106  2004/09/07 13:57:23  mju
00010  * Another prototype removed.
00011  *
00012  * Revision 1.105  2004/09/07 13:51:39  mju
00013  * Remove unused prototype.
00014  *
00015  * Revision 1.104  2004/09/03 19:46:41  mju
00016  * Remove obsolete prototype.
00017  *
00018  * Revision 1.103  2004/09/02 15:51:30  mju
00019  * Move doThinRaster here.
00020  *
00021  * Revision 1.102  2004/07/15 19:28:43  mju
00022  * Use region2d for region computation functions.
00023  *
00024  * Revision 1.101  2004/07/14 19:52:01  scowan
00025  *  Removed lecagy compute region histogram function.
00026  *
00027  * Revision 1.100  2004/07/02 19:16:05  dwilliss
00028  * Prototypes for some new versions of functions that take REGION2D.
00029  *
00030  * Revision 1.99  2004/06/29 15:15:07  mju
00031  * Add histogram computation using region2d.
00032  *
00033  * Revision 1.98  2004/03/11 16:58:29  mju
00034  * Warn deprecated for legacy object selection dialogs.
00035  *
00036  * Revision 1.97  2004/03/10 17:20:56  mju
00037  * Remove dlgGetColorMap and dlgGetContrastTable.
00038  *
00039  * Revision 1.96  2004/02/16 21:07:05  scowan
00040  * Moved unused defined to private include file.
00041  *
00042  * Revision 1.95  2004/01/21 14:04:57  scowan
00043  * Moved raster set defines to own include file.
00044  *
00045  * Revision 1.94  2003/12/01 17:07:10  scowan
00046  * Removed legacy cache tile row flag.
00047  *
00048  * Revision 1.93  2003/11/21 20:33:34  mju
00049  * Change GetDftRastHist from macro to inline so has docs.
00050  *
00051  * Revision 1.92  2003/11/05 18:43:57  scowan
00052  * Added more conversion modes.
00053  *
00054  * Revision 1.91  2003/10/30 20:44:11  scowan
00055  * Removed unused function prototypes.
00056  *
00057  * Revision 1.90  2003/10/30 18:26:49  scowan
00058  * Added a flag.
00059  *
00060  * Revision 1.89  2003/10/23 22:53:26  scowan
00061  * Removed legacy get rast pyramid list.
00062  *
00063  * Revision 1.88  2003/10/20 20:45:21  scowan
00064  * Changed raster header member name.
00065  *
00066  * Revision 1.87  2003/10/15 17:39:28  mju
00067  * Deprecate groupkey.
00068  *
00069  * Revision 1.86  2003/09/26 19:55:54  scowan
00070  * Adjustment of include files.
00071  *
00072  * Revision 1.85  2003/09/26 16:17:46  scowan
00073  * Removed unuseg function prototypes and unnecessary header inclusion.
00074  *
00075  * Revision 1.84  2003/09/15 13:49:56  fileserver!dwilliss
00076  * Doxygen
00077  *
00078  * Revision 1.83  2003/08/28 20:37:42  scowan
00079  * Removed  unused prototype.
00080  *
00081  * Revision 1.82  2003/08/28 19:33:53  scowan
00082  * Removed targa link function prototype.
00083  *
00084  * Revision 1.81  2003/08/28 16:50:04  scowan
00085  * Removed make link functions.
00086  *
00087  * Revision 1.80  2003/08/27 21:31:55  scowan
00088  * Added new data types and numbits and removed function prototypes.
00089  *
00090  * Revision 1.79  2003/08/08 21:23:35  mju
00091  * Remove unused prototype.
00092  *
00093  * Revision 1.78  2003/07/31 16:01:11  scowan
00094  * Compute raster by query parameter change.
00095  *
00096  * Revision 1.77  2003/07/24 22:02:38  mju
00097  * Change TIFF link parms.
00098  *
00099  * Revision 1.76  2003/07/11 14:22:41  scowan
00100  * Deprecated the raster mode dependant functions.
00101  *
00102  * Revision 1.75  2003/04/30 16:32:49  mju
00103  * Don't define MakeRastLink... prototypes on unsupported platforms.
00104  *
00105  * Revision 1.74  2002/10/02 16:13:43  mju
00106  * Add associate-with for surveyor.
00107  *
00108  * Revision 1.73  2002/09/09 13:57:25  mju
00109  * Always prevent_memfunc.
00110  *
00111  * Revision 1.72  2002/08/28 16:09:29  mju
00112  * Add SocetSetDT link support.
00113  *
00114  * Revision 1.71  2002/08/21 20:39:52  scowan
00115  * Deprecate old object name define.
00116  *
00117  * Revision 1.70  2002/08/19 19:29:11  mju
00118  * Add RastSetCacheRect.
00119  *
00120  * Revision 1.69  2002/08/15 15:58:44  mju
00121  * Remove obsolete fft functions.
00122  *
00123  * Revision 1.68  2002/05/30 15:51:07  mju
00124  * nc.
00125  *
00126  * Revision 1.67  2002/05/29 15:40:06  mju
00127  * nc.
00128  *
00129  * Revision 1.66  2002/04/29 16:05:26  mju
00130  * Remove mfrastercontrastmatching prototype as not used.
00131  *
00132  * Revision 1.65  2002/03/19 17:02:43  mju
00133  * Add LINKTYPE_JP2.
00134  *
00135  * Revision 1.64  2002/03/19 15:59:07  mju
00136  * Add RASTLINK_JP2.
00137  *
00138  * Revision 1.63  2002/03/08 18:28:35  scowan
00139  * Gave clear method to info structs.
00140  * deprecated mem... for info structs.
00141  *
00142  * Revision 1.62  2002/02/20 16:20:29  scowan
00143  * More const.
00144  *
00145  * Revision 1.61  2001/12/28 18:30:43  mju
00146  * Use const in MfGetRastNullAsDouble.
00147  *
00148  * Revision 1.60  2001/12/28 18:08:54  mju
00149  * Use const in ResampleRasterTransParm.
00150  *
00151  * Revision 1.59  2001/11/02 17:16:35  mju
00152  * Remove obsolete NullValid flag.
00153  *
00154  * Revision 1.58  2001/10/16 23:15:08  vdronov
00155  * added extra argument colormap to MfCopyRasterAveraged
00156  *
00157  * Revision 1.57  2001/10/16 21:30:03  vdronov
00158  * added MAKEPYRAMID_UseColorMap flag for averaging by color
00159  * rather than by value in 8 bits or 16 bits rasters
00160  *
00161  * Revision 1.56  2001/09/14 14:58:28  mju
00162  * No Mdlg in win32native.
00163  *
00164  * Revision 1.55  2001/06/22 22:22:58  mju
00165  * Remove specialized link flags, use MAKELINKFLAGS instead.
00166  *
00167  * Revision 1.54  2001/06/20 19:34:54  mju
00168  * Add MAKEPYRAMID_UseParentTileSize.
00169  *
00170  * Revision 1.53  2001/06/19 17:00:25  mju
00171  * Add ECW.
00172  *
00173  * Revision 1.51  2001/05/18 16:18:26  mju
00174  * Add MrSID linking.
00175  * Add MfCopyRasterRect().
00176  * Make some Mf...Rast functions inline instead of macros.
00177  *
00178  * Revision 1.50  2000/12/20 23:24:43  polson
00179  * added flag for mfcomputeviewshed
00180  *
00181  * \endif
00182 **/
00183 
00184 #ifndef INC_MI32_RVCRAST_H
00185 #define INC_MI32_RVCRAST_H
00186 
00187 #ifndef  INC_MI32_RVCDEFNS_H
00188    #include <mi32/rvcdefns.h>
00189 #endif
00190 
00191 #ifndef  INC_MI32_ANYRASTV_H
00192    #include <mi32/anyrastv.h>
00193 #endif
00194 
00195 #ifndef INC_MI32_TRANSGEN_H         // For TRANSFUNC definition
00196    #include <mi32/transgen.h>
00197 #endif
00198 
00199 struct COLMAPINFO;
00200 struct TRANSPARM;
00201 
00202 /*----------------------------------------------------------------------------*/
00203 /*    Raster definitions                                                      */
00204 /*----------------------------------------------------------------------------*/
00205 
00206 struct RVCRASTINFO : public RVCGENLISTINFO {    //! Description of raster header
00207    DOUBLE linscale;                    //!< Line scale in units for given type
00208    DOUBLE colscale;                    //!< Column scale in units for given type
00209    DOUBLE datascale;                   //!< Scale factor for cell value
00210    DOUBLE dataoffset;                  //!< Offset for cell value
00211    ANYRASTVALUE nullvalue;
00212    INT32 numlins;                      //!< Number of lines in raster
00213    INT32 numcols;                      //!< Number of columns in raster
00214    INT32 TileLins;                     //!< Number of lines per tile
00215    INT32 TileCols;                     //!< Number of columns per tile
00216    UINT16 disktype;                    //!< Disk media type if separate file
00217    UINT16 m_UsedBits;                  //!< Number of bits actually used in the image, used for JP2 compression
00218    UINT16 flags;                       //!< Raster flags like inverted and compression
00219    UINT16 numbits;                     //!< Number of bits per cell, max = 256
00220    UINT32 datatype;                    //!< Raster data type
00221    UINT32 linktype;                    //!< Externally linked raster type
00222    UINT16 CompType;                    //!< Compression type
00223    UINT16 CompQuality;                 //!< Compression quality, 1-100, 0 == default
00224    INT32 Band;
00225    UINT16 Usage;                       //!< RASTUSAGE_..., Class, Average, PCA, Pyramid, ... */
00226    UINT16 Subusage;
00227    UINT8 spare[4];
00228    
00229    RVCRASTINFO (
00230       ) {Clear();}
00231    
00232    RVCRASTINFO (
00233       const RVCGENINFO& ginfo
00234       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00235    
00236    RVCRASTINFO& operator= (
00237       const RVCGENINFO& ginfo
00238       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00239 
00240    void Clear (
00241       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00242    
00243    };
00244 
00245 //! External raster types for .linktype */
00246 #define  RASTLINK_RVCInternal    0
00247 #define  RASTLINK_SimpleArray    1
00248 #define  RASTLINK_TIFF           2
00249 #define  RASTLINK_Generic        3
00250 #define  RASTLINK_MrSID          4
00251 #define  RASTLINK_ECW            5
00252 #define  RASTLINK_JP2            6
00253 #define  RASTLINK_SocetSetDT     7
00254 #define  RASTLINK_Last           7
00255 
00256 //! Raster I/O and buffering mode flag bits
00257 #define  RASTMODE_ModeMask          0xFF7F
00258 #define  RASTMODE_ConvMask          0xFE7F
00259 #define  RASTMODE_NoConversion      0x0000   //!< Don't perform any conversion on data
00260 #define  RASTMODE_ConvToByteSpread  0x0001   //!< Convert < 8-bit to 8-bit by spreading over 0-255 range
00261 #define  RASTMODE_ConvToWord        0x0002   //!< Convert binary to 16 bits/cell
00262 #define  RASTMODE_ConvToLong        0x0004   //!< Convert binary to 32 bits/cell
00263 #define  RASTMODE_ConvToByte        0x0008   //!< Convert 1/2/4 bits to 8-bit by copy
00264 #define  RASTMODE_ConvToByteL       RASTMODE_ConvToByte  //!< Historical definition
00265 #define  RASTMODE_ConvToDouble      0x0010   //!< Convert anything but RGB to doubles
00266 #define  RASTMODE_ConvToYellow      0x0020   //!< Convert CMYK to Yellow
00267 #define  RASTMODE_ConvToMagenta     0x0040   //!< Convert CMYK to Magenta
00268 #define  RASTMODE_ConvToFloat       0x0200   //!< Convert anything but RGB to floats
00269 #define  RASTMODE_ConvToCyan        0x0400   //!< Convert CMYK to Cyan
00270 #define  RASTMODE_ConvToRed         0x0800   //!< Convert RGB to Red
00271 #define  RASTMODE_ConvToAlpha       0x1000   //!< Convert RGBA or ARGB to Alpha
00272 #define  RASTMODE_ConvToGreen       0x2000   //!< Convert RGB to Green
00273 #define  RASTMODE_ConvToBlue        0x4000   //!< Convert RGB to Blue
00274 #define  RASTMODE_ConvToBlack       0x8000   //!< Convert CMYK to Black
00275 #define  RASTMODE_ConvToRGB         0x10000  //!< Convert BGR to RGB
00276 #define  RASTMODE_ConvToBGR         0x20000  //!< Convert RGB to BGR
00277 
00278 #define  RASTMODE_OpenMask          0x0080
00279 #define  RASTMODE_UseAltTile        0x0080   //!< Programmer will specify tile size OR set tile to raster size
00280 
00281 //! Raster flag bits
00282 #define  RASTER_Inverted         0x0001   //!< Raster is inverted top to bottom
00283 #define  RASTER_HasNullVal       0x0002   //!< raster has a null value set
00284 #define  RASTER_PackLSB          0x0004   //!< Pack cell bit(s) starting with the least sig. bits default is most sig. bits first
00285 #define  RASTER_Compressed       0x0010   //!< Raster is compressed
00286 #define  RASTER_LossyComp        0x0020   //!< Raster is using lossy compression
00287 //Other RASTER_ flag defines are now private, use RVC::RASTER
00288 
00289 //! MfRastSetCacheSize() flags
00290 #define  RASTCACHE_DiagonalRow   0x0001
00291 #define  RASTCACHE_TileRow       0x0002
00292 #define  RASTCACHE_NumTiles      0x0004
00293 
00294 //! Raster compression types, only used if RASTER_Compressed is set
00295 #define  RASTCOMP_RLE_DPCM       0
00296 #define  RASTCOMP_JPEG           1     //!< Sets RASTER_LossyComp flag, for 8 and 24 bit only
00297 #define  RASTCOMP_Huffman        2
00298 #define  RASTCOMP_DPCM_NEW       3
00299 //#define RASTCOMP_JP2 is defined elsewhere
00300 #define  RASTCOMP_MAX            4     //!< Maximum compression value
00301 
00302 //! Raster .Usage types
00303 #define  RASTUSAGE_Default       0     //!< Ordinary raster
00304 #define  RASTUSAGE_Pyramid       4     //!< Pyramid raster
00305 //Other RASTUSAGE defines are now private, use RVC::RASTER
00306 
00307 /*-------------------------------------------------------------------------*/
00308 /*    Raster-related object header definitions                             */
00309 /*-------------------------------------------------------------------------*/
00310 
00311 struct RVC2DHISTINFO : public RVCGENINFO {   //! Description of 2-D histogram header
00312    UINT16 EntryScale;                  //!< Scale for array entries (default = 1)
00313    UINT8 dummy[6];
00314    RVC::OBJECTNAME xrastname;             //!< Name of raster displayed on X-axis
00315    RVC::OBJECTNAME yrastname;             //!< Name of raster displayed on Y-axis
00316    DOUBLE xdatainit;                   //!< Initial data value for histogram range
00317    DOUBLE xdatalast;                   //!< Final data value in histogram range
00318    DOUBLE xdatasample;                 //!< Sampling rate for data range
00319    DOUBLE ydatainit;                   //!< Initial data value for histogram range
00320    DOUBLE ydatalast;                   //!< Final data value in histogram range
00321    DOUBLE ydatasample;                 //!< Sampling rate for data range
00322    DOUBLE correlation;                 //!< Statistical correlation between rasters
00323    DOUBLE regx0;                       //!< Points for regression equation
00324    DOUBLE regy0;
00325    DOUBLE regx1;
00326    DOUBLE regy1;
00327    
00328    RVC2DHISTINFO (
00329       ) {Clear();}
00330    
00331    RVC2DHISTINFO (
00332       const RVCGENINFO& ginfo
00333       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00334    
00335    RVC2DHISTINFO& operator= (
00336       const RVCGENINFO& ginfo
00337       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00338 
00339    void Clear (
00340       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00341    
00342    };
00343 
00344 struct RVCCMAPINFO : public RVCGENINFO {  //! Description of pseudo-color table header
00345    UINT16 numcolors;                   //!< Number of colors defined in this table
00346    UINT16 optcolors;                   //!< Number of colors used for optimization
00347    UINT16 usedcolors;                  //!< Number of colors used after optimization
00348    UINT16 redbits;                     //!< Number of significant bits for red
00349    UINT16 grnbits;                     //!< Number of significant bits for green
00350    UINT16 blubits;                     //!< Number of significant bits for blue
00351    INT32 offset;                       //!< Offset for 16 bit color maps
00352    
00353    RVCCMAPINFO (
00354       ) {Clear();}
00355    
00356    RVCCMAPINFO (
00357       const RVCGENINFO& ginfo
00358       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00359    
00360    RVCCMAPINFO& operator= (
00361       const RVCGENINFO& ginfo
00362       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00363 
00364    void Clear (
00365       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00366    
00367    };
00368 
00369 struct RVCHISTINFO : public RVCARRAYINFO {   //! Histogram information header
00370    DOUBLE minvalue;                    //!< Minimum value in area for histogram
00371    DOUBLE maxvalue;                    //!< Maximum value in area for histogram
00372    DOUBLE datainit;                    //!< Initial data value for histogram range
00373    DOUBLE datalast;                    //!< Final data value in histogram range
00374    DOUBLE datasample;                  //!< Sampling rate for data range
00375    DOUBLE mean;                        //!< Mean value within selected data range
00376    DOUBLE meanfull;                    //!< Mean value for entire data range
00377    DOUBLE stddev;                      //!< Standard Deviation within selected data range
00378    DOUBLE sum;                         //!< Sum of values
00379    DOUBLE sum2;                        //!< Sum of squares of values
00380    INT32 initlin;                      //!< Initial line of window
00381    INT32 lastlin;                      //!< Final line of window
00382    INT32 initcol;                      //!< Initial column of window
00383    INT32 lastcol;                      //!< Final column of window
00384    UINT32 countltmin;                  //!< Number of cells with values less than datainit
00385    UINT32 countgtmax;                  //!< Number of cells with values greater than datalast
00386    UINT16 linsamp;                     //!< Line sampling rate
00387    UINT16 colsamp;                     //!< Column sampling rate
00388    UINT16 EntryScale;                  //!< Scale for array entries (default = 1)
00389    UINT16 histflags;                   //!< HasMean and HasStdDev
00390    UINT32 countnull;                   //!< Number of NULL cells in the raster
00391    UINT8 spare[4];
00392    
00393    RVCHISTINFO (
00394       ) {Clear();}
00395    
00396    RVCHISTINFO (
00397       const RVCGENINFO& ginfo
00398       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00399    
00400    RVCHISTINFO& operator= (
00401       const RVCGENINFO& ginfo
00402       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00403 
00404    void Clear (
00405       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00406    
00407    };
00408 
00409 #define RVCHIST_HasMean       0x0001
00410 #define RVCHIST_HasStdDev     0x0002
00411 
00412 #define RVCHIST_ComplexMask   0x000C
00413 #define RVCHIST_ComplexM      0x0000   //!< Histogram of magnitude component
00414 #define RVCHIST_ComplexP      0x0004   //!< Histogram of phase component
00415 #define RVCHIST_ComplexR      0x0008   //!< Histogram of real component
00416 #define RVCHIST_ComplexI      0x000C   //!< Histogram of imaginary component
00417 
00418 #define RVCHIST_ColorMask     0x000C
00419 #define RVCHIST_ColorRed      0x0000   //!< Histogram of red component
00420 #define RVCHIST_ColorGreen    0x0004   //!< Histogram of green component
00421 #define RVCHIST_ColorBlue     0x0008   //!< Histogram of blue component
00422 
00423 struct RVCCONTINFO : public RVCARRAYINFO {   //! Contrasting table information header
00424    DOUBLE dinplowlim;                  //!< Lower input limit for stretch
00425    DOUBLE dinpuprlim;                  //!< Upper input limit for stretch
00426    DOUBLE power;                       //!< Power for log/exp (replaces interpi/o)
00427    UINT16 type;                        //!< Contrast table type
00428    UINT16 contflags;                   //!< RVCCONT_xxx flags defined below
00429    INT16 outlowlim, outuprlim;         //!< Lower and upper output limits
00430    INT16 mean, stdevl, stdevr;         //!< Output mean and st devs for normalization
00431    INT16 outltminval;                  //!< Output value if input < dinplowlim (>8 bit only)
00432    INT16 outgtmaxval;                  //!< Output value if input > dinpuprlin (>8 bit only)
00433    INT16 outnullval;                   //!< Value to output if input = nullvalue && HasNullVal is set
00434    UINT8 spare[4];                     //!< dword align the size of the structure
00435    DOUBLE datainit;
00436    DOUBLE datalast;
00437    DOUBLE datasample;
00438    
00439    RVCCONTINFO (
00440       ) {Clear();}
00441    
00442    RVCCONTINFO (
00443       const RVCGENINFO& ginfo
00444       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00445    
00446    RVCCONTINFO& operator= (
00447       const RVCGENINFO& ginfo
00448       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00449 
00450    void Clear (
00451       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00452    
00453    };
00454 
00455 #define  RVCCONT_Inverted     1
00456 
00457 //! Disallow memset/memcpy.
00458 PREVENT_MEMFUNC(RVCRASTINFO)
00459 PREVENT_MEMFUNC(RVC2DHISTINFO)
00460 PREVENT_MEMFUNC(RVCCMAPINFO)
00461 PREVENT_MEMFUNC(RVCHISTINFO)
00462 PREVENT_MEMFUNC(RVCCONTINFO)
00463 
00464 /*----------------------------------------------------------------------------*/
00465 /*    Definitions for generic raster I/O                                      */
00466 /*----------------------------------------------------------------------------*/
00467 
00468 typedef int RASTREADFUNC (INT32, INT32, INT32, void*, UINT8*, int*, void*);
00469 typedef int RASTWRITEFUNC (INT32, INT32, INT32, void*, UINT8*, int, void*);
00470 
00471 #define  MASKFLAG_Mixed       0
00472 #define  MASKFLAG_AllValid    1
00473 #define  MASKFLAG_AllNull     2
00474 
00475 /*-------------------------------------------------------------------------*/
00476 /*    Flags for MfMakeRastPyramidSetExt()                                  */
00477 /*-------------------------------------------------------------------------*/
00478 
00479 #define  MAKEPYRAMID_Rebuild           0x01  //!< Rebuild tiers even if exist
00480 #define  MAKEPYRAMID_Average           0x02  //!< Average raster cells instead of sampling
00481 #define  MAKEPYRAMID_Full              0x04  //!< Create "full" pyramid set (always 2x2 sample steps)
00482 #define  MAKEPYRAMID_UseParentTileSize 0x08  //!< Use parent raster's tile size.
00483 #define  MAKEPYRAMID_UseColorMap       0x10  //!< Use colormap for averaging
00484 
00485 /*----------------------------------------------------------------------------*/
00486 /*    Flags for MfChangeRasterNull()                                          */
00487 /*----------------------------------------------------------------------------*/
00488 
00489 #define  CHGRASTNULL_LeaveAlone  0
00490 #define  CHGRASTNULL_Increase    1
00491 #define  CHGRASTNULL_Decrease    2
00492 
00493 /*-------------------------------------------------------------------------*/
00494 /*    Definitions for Resample functions                                   */
00495 /*-------------------------------------------------------------------------*/
00496 
00497 #define  RESAMPLE_Nearest     0        //!< Nearest-neighbor
00498 #define  RESAMPLE_Bilinear    1        //!< Bilinear interpolation
00499 #define  RESAMPLE_CubicConv   2        //!< Cubic convolution
00500 
00501 /*----------------------------------------------------------------------------*/
00502 /*    Flags for MfThresholdRaster()                                           */
00503 /*----------------------------------------------------------------------------*/
00504 
00505 #define  THRESHRAST_Output1Below    0x0001
00506 #define  THRESHRAST_Output1Outside  0x0001
00507 #define  THRESHRAST_Output1Null     0x0002
00508 #define  THRESHRAST_NoPyramid       0x0004
00509 
00510 /*----------------------------------------------------------------------------*/
00511 /*    Flags for MfComputeRasterProperties()                                            */
00512 /*----------------------------------------------------------------------------*/
00513 
00514 #define  BOUNDCELLS_IncludeAll            1
00515 #define  BOUNDCELLS_IncludeLargest        2
00516 #define  BOUNDCELLS_Proportionally        3
00517 #define  BOUNDCELLS_ExcludeAll            4
00518 
00519 
00520 #define  RASTPROP_ComputeHisto         0x0001
00521 #define  RASTPROP_IncludeIslands       0x0002
00522 
00523 
00524 /*----------------------------------------------------------------------------*/
00525 /*    Structure used by MfComputeRasterSlantToGround()                           */
00526 /*----------------------------------------------------------------------------*/
00527 
00528 struct SLANTGROUNDPARMS {
00529    DOUBLE surf_elevation;              //!< surface elevation above sea level,(meters)
00530    DOUBLE altitude;                    //!< aircraft altitude above sea level,(meters)
00531    DOUBLE slant_spacing;               //!< resolution across radar track,(meters)
00532    DOUBLE azimuth_spacing;             //!< resolution along radar track,(meters)
00533    DOUBLE nearlook_angle;              //!< nadir angle to near side (rad)
00534    DOUBLE farlook_angle;               //!< nadir angle to far side (rad)
00535    };
00536 
00537 /*----------------------------------------------------------------------------*/
00538 /*    Flags for MfComputeClumpRaster() & MfComputeSieveRaster()               */
00539 /*----------------------------------------------------------------------------*/
00540 
00541 #define  CLUMPRAST_Larger     0x0001   //!< locate features larger than user-specified size
00542 #define  CLUMPRAST_Smaller    0x0002   //!< locate features smaller than user-specified size
00543 
00544 #define  CLUMPRAST_FillHoles  0x0008   //!< Fill holes in the "sieve" raster
00545 
00546 /*----------------------------------------------------------------------------*/
00547 /*    Flags for MfComputeViewshed()                                           */
00548 /*----------------------------------------------------------------------------*/
00549 
00550 #define  VIEWSHED_EarthCurvature          0x0001
00551 #define  VIEWSHED_InvertTransparency      0x0002
00552 
00553 /*-------------------------------------------------------------------------*/
00554 /*    Definitions for ContrastEnhanceWallis                                */
00555 /*-------------------------------------------------------------------------*/
00556 
00557 #define WALLISFLAG_NullValue 0x0001
00558 #define WALLISFLAG_Alpha     0x0002
00559 #define WALLISFLAG_Mean      0x0004
00560 #define WALLISFLAG_StDev     0x0008
00561 #define WALLISFLAG_Gain      0x0010
00562 
00563 #define WALLISCONV_NONE      0
00564 #define WALLISCONV_RATIO     1
00565 #define WALLISCONV_HIS       2
00566 
00567 #define BCETFLAG_NullValue 0x0001
00568 
00569 #define BCETFUNCTION_Start          0
00570 #define BCETFUNCTION_Parabolic      0
00571 #define BCETFUNCTION_Cubic          1
00572 #define BCETFUNCTION_Count          2
00573 
00574 /*-------------------------------------------------------------------------*/
00575 /*    Definitions for MfRasterClassification                               */
00576 /*-------------------------------------------------------------------------*/
00577 
00578 #define CLM_K_means              1
00579 #define CLM_FC_means             2
00580 #define CLM_MinDistAngle         3
00581 #define CLM_Isodata              4
00582 #define CLM_SelfOrganization     5
00583 #define CLM_AdaptiveResonance    6
00584 #define CLM_MinDistToMean        7
00585 #define CLM_MaximumLikelihood    8
00586 #define CLM_StepwiseLinear       9
00587 #define CLM_Suits               10
00588 
00589 struct CL_KMEANSPARM {
00590    UINT16 NumClasses;
00591    UINT16 MaxIterations;
00592    double InitMinDist;
00593    double MaxMoveSteady;
00594    double MinSteadyPct;
00595    };
00596    
00597 struct CL_FCMEANSPARM {
00598    UINT16 NumClasses;
00599    UINT16 MaxIterations;
00600    };
00601 
00602 struct CL_MDANGLEPARM {
00603    UINT16 NumClasses;
00604    UINT16 MaxIterations;
00605    double MaxMoveSteady;
00606    double MinSteadyPct;
00607    };
00608 
00609 struct CL_SELFORGPARM {
00610    UINT16 NumClasses;
00611    UINT16 MaxIterations;
00612    double InitMinDist;
00613    double MaxMoveSteady;
00614    double MinSteadyPct;
00615    };
00616 
00617 struct CL_ADRESPARM {
00618    UINT16 NumClasses;
00619    UINT16 MaxIterations;
00620    double InitMinDist;
00621    };
00622 
00623 struct CL_ISODATAPARM {
00624    UINT16 NumClasses;
00625    UINT16 MaxIterations;
00626    double SplitMaxStdDev;
00627    double CombMinDist;
00628    double ChainMinDist;
00629    INT32 MinClusterCells;
00630    };
00631 
00632 struct CL_TOMEANPARM {
00633    FNAMEINODEUC *train;
00634    int DistMethod;
00635    };
00636 
00637 struct CL_MAXLIKEPARM {
00638    FNAMEINODEUC *train;
00639    double MinLikelihoodPct;
00640    };
00641 
00642 struct CL_STEPLINPARM {
00643    FNAMEINODEUC *train;
00644    };
00645 
00646 struct CL_SUITSPARM {
00647    FNAMEINODEUC *train;
00648    double NumDevs;
00649    };
00650 
00651 struct CLASSIFYPARM {
00652    UINT32 method;
00653    CL_KMEANSPARM  kmparm;
00654    CL_FCMEANSPARM fmparm;
00655    CL_MDANGLEPARM maparm;
00656    CL_SELFORGPARM soparm;
00657    CL_ADRESPARM   arparm;
00658    CL_ISODATAPARM idparm;
00659    CL_TOMEANPARM  tmparm;
00660    CL_MAXLIKEPARM mlparm;
00661    CL_STEPLINPARM slparm;
00662    CL_SUITSPARM   suparm;
00663    };
00664 
00665 struct RASTLINKDATAGEN {
00666    //! DO NOT CHANGE THE SIZE OF THIS STRUCTURE as it is stored in the RVC file
00667    INT32 headerbytes;         //!<  Length of file header in bytes (to start of first line) 
00668    INT32 linetbytes;          //!<  Length of line trailer in bytes 
00669    INT32 bandtbytes;          //!<  Length of band trailer in bytes 
00670    INT32 intertbytes;            //!<  Interleave trailer in bytes (between lines of same band) 
00671    INT32 numbands;               //!<  Number of bands, needed if interleaved 
00672    INT16 inttype;             //!<  Interleave type: INTERLEAVE_XXX 
00673    INT16 intfact;             //!<  Interleave factor 
00674    INT16 intadd;              //!<  Value to add to line/column before using interleave factor 
00675    INT16 byteorder;           //!<  Byte/bit order: RASTLINK_LoHi or RASTLINK_HiLo 
00676    UINT8 reserved[36];        //!<  Reserved for future use, pad to 64 bytes 
00677    //! DO NOT CHANGE THE SIZE OF THIS STRUCTURE as it is stored in the RVC file
00678    };
00679 
00680 #define  INTERLEAVE_None      0  //!<  No interleaving, all data for one band is together 
00681 #define  INTERLEAVE_Line      1  //!<  Band interleaved by line 
00682 #define  INTERLEAVE_Pixel     2  //!<  Band interleaved by pixel 
00683 
00684 /*-------------------------------------------------------------------------*/
00685 /*    Definitions for MfCombineRastersLinear                               */
00686 /*-------------------------------------------------------------------------*/
00687 
00688 struct LINEARTRANS {
00689    DOUBLE *offset;                     //!< list of offsets of linear combination
00690    DOUBLE *coeff;                      //!< matrix of coefficients of linear combination
00691    INT16 idim;                         //!< number of input raster objects
00692    INT16 odim;                         //!< number of output raster objects
00693    };
00694 
00695 //!\addtogroup RvcRast RVC Raster Functions
00696 //!@{
00697 
00698 // Object selection dialogs
00699 #if (defined(X_NATIVE) || defined(WIN32_MFC)) && !defined(DEPRECATE_GROUPKEY)
00700 
00701 //! Get raster object.
00702 DEPRECATED inline int MdlgGetRasterObject (
00703    MDLGPARENT dlgparent,
00704    FILEPATH& filename,
00705    INT32 *inode,
00706    const void *prompt,
00707    RVCRASTINFO *objinfo,
00708    MfFiltFuncProto filter=0,
00709    void *filtuserdata=0,
00710    GETOBJFLAGS flags=GETOBJFLAG_None
00711    ) {
00712    return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_RASTER,RVCCONV_RASTER,objinfo,sizeof(RVCRASTINFO),filter,filtuserdata,flags));
00713    }
00714 
00715 //! Get raster object.
00716 DEPRECATED inline int MdlgGetRasterObject (
00717    MDLGPARENT dlgparent,
00718    UNICODE *filename,
00719    INT32 *inode,
00720    const void *prompt,
00721    RVCRASTINFO *objinfo,
00722    MfFiltFuncProto filter=0,
00723    void *filtuserdata=0,
00724    GETOBJFLAGS flags=GETOBJFLAG_None
00725    ) {
00726    return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_RASTER,RVCCONV_RASTER,objinfo,sizeof(RVCRASTINFO),filter,filtuserdata,flags));
00727    }
00728 
00729 //! Get multiple raster objects.
00730 DEPRECATED inline int MdlgGetRasterObjects (
00731    MDLGPARENT dlgparent,
00732    FILEPATH& filename,                 //!< Default filename
00733    const void *prompt,
00734    int minobjs,                        //!< Minimum number of objects required
00735    int maxobjs,                        //!< Maximum allowed to be selected, 0 if no limit
00736    RVCOBJITEMLIST& ItemList,
00737    MfFiltFuncProto filter=0,
00738    void *filtuserdata=0,
00739    MfValidListProto validfunc=0,
00740    GETOBJFLAGS flags=GETOBJFLAG_None
00741    ) {
00742    return (MdlgGetObjects(dlgparent,filename,0,prompt,OTYPE_RASTER,minobjs,maxobjs,ItemList,filter,filtuserdata,validfunc,flags));
00743    }
00744 
00745 //! Get multiple raster objects.
00746 DEPRECATED inline int MdlgGetRasterObjects (
00747    MDLGPARENT dlgparent,
00748    UNICODE *filename,                  //!< Default filename
00749    const void *prompt,
00750    int minobjs,                        //!< Minimum number of objects required
00751    int maxobjs,                        //!< Maximum allowed to be selected, 0 if no limit
00752    FNAMEINODEUC **fnameinoderet,
00753    MfFiltFuncProto filter=0,
00754    void *filtuserdata=0,
00755    MfValidMultiProto validfunc=0,
00756    GETOBJFLAGS flags=GETOBJFLAG_None
00757    ) {
00758    return (MdlgGetObjects(dlgparent,filename,0,prompt,OTYPE_RASTER,minobjs,maxobjs,fnameinoderet,filter,filtuserdata,validfunc,flags));
00759    }
00760 
00761 //! Pop-up dialog to prompt user to select raster object set.
00762 DEPRECATED inline int MdlgGetRasterObjectSet (
00763    MDLGPARENT dlgparent,
00764    FILEPATH& filename,                 //!< Default filename
00765    const void *prompt,
00766    int numobjs,                        //!< Number of objects to be selected
00767    RVCOBJITEMLIST& ItemList,
00768    void *objlabel[],                   //! Label names for each object
00769    MfFiltFuncProto filter=0,
00770    void *filtuserdata=0,
00771    MfValidListProto validfunc=0,
00772    GETOBJFLAGS flags=GETOBJFLAG_None
00773    ) {
00774    return (MdlgGetObjectSet(dlgparent,filename,0,prompt,OTYPE_RASTER,numobjs,ItemList,objlabel,filter,filtuserdata,validfunc,flags));
00775    }
00776 
00777 //! Pop-up dialog to prompt user to select raster object set.
00778 DEPRECATED inline int MdlgGetRasterObjectSet (
00779    MDLGPARENT dlgparent,
00780    UNICODE *filename,                  //!< Default filename
00781    const void *prompt,
00782    int numobjs,                        //!< Number of objects to be selected
00783    FNAMEINODEUC fnameinode[],
00784    void *objlabel[],                   //! Label names for each object
00785    MfFiltFuncProto filter=0,
00786    void *filtuserdata=0,
00787    MfValidMultiProto validfunc=0,
00788    GETOBJFLAGS flags=GETOBJFLAG_None
00789    ) {
00790    return (MdlgGetObjectSet(dlgparent,filename,0,prompt,OTYPE_RASTER,sizeof(RVCRASTINFO),numobjs,fnameinode,objlabel,filter,filtuserdata,validfunc,flags));
00791    }
00792 
00793 #endif   //!< X_NATIVE || WIN32_MFC
00794 
00795 
00796 #if defined(__cplusplus)
00797 extern "C" {
00798 #endif
00799 
00800 #ifndef GENERATING_DOXYGEN_OUTPUT
00801 RVCAPPLIBEXPORT int     _Mf2DHistRead (int fhandle, INT32 objinode, RVC2DHISTINFO*, int);
00802 RVCAPPLIBEXPORT int     _Mf2DHistWrite (int fhandle, INT32 objinode, RVC2DHISTINFO*, int);
00803 
00804 RVCAPPLIBEXPORT int     _MfColorMapRead (int fhandle, INT32 cmapinode, RVCCMAPINFO*, int, COLMAPINFO*, int);
00805 RVCAPPLIBEXPORT int     _MfColorMapWrite (int fhandle, INT32 cmapinode, RVCCMAPINFO*, int, COLMAPINFO*, int);
00806 
00807 RVCAPPLIBEXPORT int     _MfHistogramCompute (int fhandle, INT32 rastinode, RVCHISTINFO *histinfo, int HeaderSize, UINT32 **phisto);
00808 RVCAPPLIBEXPORT int     _MfHistogramComputeRegion2D (int fhandle, INT32 rastinode, const REGION2D& region, RVCHISTINFO *info, int HeaderSize, UINT32 **phisto);
00809 RVCAPPLIBEXPORT int     _MfHistogramGetDefault (int fhandle, INT32 rastinode, RVCHISTINFO *histinfo, int HeaderSize, UINT32 **phisto, int complexcomp);
00810 RVCAPPLIBEXPORT int     _MfHistogramRead (int fhandle, INT32 histinode, RVCHISTINFO*, int, UINT32**);
00811 RVCAPPLIBEXPORT int     _MfHistogramWrite (int fhandle, INT32 histinode, RVCHISTINFO*, int, UINT32*);
00812 
00813 RVCAPPLIBEXPORT int     _MfRasterClose (int, RVCRASTINFO*, int);
00814 RVCAPPLIBEXPORT int     _MfRasterHeaderRead (int findex, INT32 inode, RVCRASTINFO *info, int HeaderSize);
00815 RVCAPPLIBEXPORT int     _MfRasterHeaderWrite (int findex, INT32 inode, RVCRASTINFO *info, int HeaderSize);
00816 RVCAPPLIBEXPORT int     _MfRasterMake (int, RVCRASTINFO*, int, UINT32);
00817 RVCAPPLIBEXPORT int     _MfRasterMakeInitVal (int, RVCRASTINFO*, int, const ANYRASTVALUE*, UINT32);
00818 RVCAPPLIBEXPORT int     _MfRasterOpen (int, INT32, RVCRASTINFO*, int, UINT32);
00819 #endif //!< GENERATING_DOXYGEN_OUTPUT
00820 
00821 #define  MfReadColmapHeader(f,i,h)        _MfReadHeader((f),(i),(h),sizeof(RVCCMAPINFO),RVCCONV_COLMAP)
00822 #define  MfReadColorMap(_f,_c,_i,_d)      _MfColorMapRead((_f),(_c),(_i),sizeof(RVCCMAPINFO),(_d),sizeof(COLMAPINFO))
00823 #define  MfWriteColorMap(_f,_c,_i,_d)     _MfColorMapWrite((_f),(_c),(_i),sizeof(RVCCMAPINFO),(_d),sizeof(COLMAPINFO))
00824 #define  MfReadContabHeader(f,i,h)        _MfReadHeader((f),(i),(h),sizeof(RVCCONTINFO),RVCCONV_CONTAB)
00825 #define  MfReadHistoHeader(f,i,h)         _MfReadHeader((f),(i),(h),sizeof(RVCHISTINFO),RVCCONV_HISTO)
00826 
00827 //! Close previously opened raster.
00828 inline ERRVALUE MfCloseRast (
00829    int rhandle,                           //!< Raster object handle
00830    RVCRASTINFO *info = 0                  //!< Raster header
00831    ) { return (_MfRasterClose(rhandle,info,sizeof(RVCRASTINFO))); }
00832 
00833 //! Create new raster.
00834 //! @return Open raster handle.
00835 inline int MfMakeRast (
00836    int fhandle,
00837    RVCRASTINFO *rastinfo,
00838    UINT32 flags = 0
00839    ) { return (_MfRasterMake(fhandle,rastinfo,sizeof(RVCRASTINFO),flags)); }
00840 
00841 //! Create new raster with initial value.
00842 //! @return Open raster handle.
00843 inline int MfMakeRastI (
00844    int fhandle,
00845    RVCRASTINFO *rastinfo,
00846    const ANYRASTVALUE *value,
00847    UINT32 flags = 0
00848    ) { return (_MfRasterMakeInitVal(fhandle,rastinfo,sizeof(RVCRASTINFO),value,flags)); }
00849 
00850 //! Open raster object for read or write.
00851 inline int MfOpenRast (
00852    int fhandle,
00853    RVCINODENUM rastinode,
00854    RVCRASTINFO *rastinfo,
00855    UINT32 flags = 0
00856    ) { return (_MfRasterOpen(fhandle,rastinode,rastinfo,sizeof(RVCRASTINFO),flags)); }
00857 
00858 //! Read header for specified raster.
00859 inline ERRVALUE MfReadRastHeader (
00860    int fhandle,
00861    RVCINODENUM rastinode,
00862    RVCRASTINFO *rastinfo
00863    ) { return (_MfRasterHeaderRead(fhandle,rastinode,rastinfo,sizeof(RVCRASTINFO))); }
00864 
00865 #define  MfWriteRastHeader(_fi,_in,_info)                _MfRasterHeaderWrite((_fi),(_in),(_info),sizeof(RVCRASTINFO))
00866 
00867 #define  MfComputeRastHist(_f,_roi,_info,_ph)            _MfHistogramCompute((_f),(_roi),(_info),sizeof(RVCHISTINFO),(_ph))
00868 
00869 #if defined(__cplusplus)
00870 }  // End extern C
00871 #endif
00872 
00873 inline ERRVALUE MfComputeRastHistRegion (
00874    int fhandle,
00875    RVCINODENUM rastinode,
00876    const REGION2D& region,
00877    RVCHISTINFO *histinfo,
00878    UINT32 **phisto
00879    ) { return (_MfHistogramComputeRegion2D(fhandle,rastinode,region,histinfo,sizeof(RVCHISTINFO),phisto)); }
00880 
00881 #if defined(__cplusplus)
00882 extern "C" {
00883 #endif
00884 
00885 //! Get default raster histogram.
00886 inline ERRVALUE MfGetDftRastHist (
00887    int fhandle,                        //!< File handle
00888    RVCINODENUM rastinode,              //!< Raster inode
00889    RVCHISTINFO *histinfo,              //!< Histogram info returned
00890    UINT32 **phisto,                    //!< Histogram returned
00891    int complexcomp = 0,                //!< Complex raster component
00892    void *sdw = 0                       //!< Unused
00893    ) { return (_MfHistogramGetDefault(fhandle,rastinode,histinfo,sizeof(RVCHISTINFO),phisto,complexcomp)); }
00894 
00895 #define  MfReadHistogram(_f,_c,_i,_d)                    _MfHistogramRead((_f),(_c),(_i),sizeof(RVCHISTINFO),(_d))
00896 #define  MfWriteHistogram(_f,_c,_i,_d)                   _MfHistogramWrite((_f),(_c),(_i),sizeof(RVCHISTINFO),(_d))
00897 
00898 #define  Mf2DHistWrite(_f,_c,_i)             _Mf2DHistWrite((_f),(_c),(_i),sizeof(RVCHISTINFO))
00899 
00900 //! Get the default tile size for any raster.
00901 //!
00902 //! @return Size of one of the sides of the tile (Note: tiles are square).
00903 RVCAPPLIBEXPORT int MfGetDftTileSize (
00904    int numbits                         //!< Number of bits in the raster
00905    );
00906 
00907 //! Copy min/max extremes for a cell into ANYRASTVALUE structures.
00908 //!
00909 //! This function falls into the realm of MfSetDftNullVal() and MfSetRastNullValue.
00910 RVCAPPLIBEXPORT void MfGetRasterValueMinMax (
00911    RVCRASTINFO *info,                  //!< Information about the raster
00912    ANYRASTVALUE *min,                  //!< Minimum cell value for datatype and depth
00913    ANYRASTVALUE *max                   //!< Maximum cell value for datatype and depth
00914    );
00915 
00916 //! Obtain information about the sizes of tiles.
00917 RVCAPPLIBEXPORT int MfGetRastTileInfo (int, INT32*, INT32*, INT32*, INT32*, INT32*);
00918 
00919 //! 
00920 RVCAPPLIBEXPORT int MfGetRastTileSize (RVCRASTINFO *info);
00921 
00922 //! Create default histogram for a raster.
00923 RVCAPPLIBEXPORT int MfMakeDftRastHist (
00924    int fhandle,                        //!< Handle for open RVC file
00925    INT32 rastinode,                    //!< Inode of raster object
00926    void *notused = 0                   //!< OBSOLETE (will use default handle)
00927    );
00928 
00929 //! Get NUMTYPE value for raster datatype/numbits combination.
00930 //!
00931 //! @return NUMTYPE value or R_BadRastType.
00932 //!
00933 //!   See <mi32/stddefns.h> for a list of NUMTYPE values.
00934 RVCAPPLIBEXPORT int MfRastGetNumType (
00935    RVCRASTINFO *rastinfo               //!< Raster header
00936    );
00937 
00938 //! Set rectangle to cache.
00939 RVCAPPLIBEXPORT int MfRastSetCacheRect (
00940    int id, 
00941    const LRECT2D& cacherect
00942    );
00943 
00944 //! Set size of raster cache.
00945 //!
00946 //! Flags:     
00947 //!      \li\b RASTCACHE_DiagonalRow   Cache a diagonal row of tiles, num ignored
00948 //!      \li\b RASTCACHE_TileRow       Cache a row of tiles, num ignored
00949 //!      \li\b RASTCACHE_NumTiles      Cache a number of tiles, num is number of tiles
00950 //!      0                       Cache number of tiles that fit into 'num' Kbytes, num is KBytes.
00951 RVCAPPLIBEXPORT int MfRastSetCacheSize (
00952    int id, 
00953    INT32 num, 
00954    UINT32 flags
00955    );
00956 
00957 //! 
00958 RVCAPPLIBEXPORT int MfReadRastCol (int id, INT32 lin, INT32 col, INT32 len, void *buff, UINT32 iomode);
00959 
00960 //! Read data from a raster object with conversion.
00961 //!
00962 //! Raster modes:    
00963 //!      \li\b RASTMODE_ConvToByteSpread  Convert 1/2/4 bits to 8-bit by stretch
00964 //!      \li\b RASTMODE_ConvToByte        Convert 1/2/4 bits to 8-bit by copy
00965 //!      \li\b RASTMODE_ConvToWord        Convert to 16 bits/cell
00966 //!      \li\b RASTMODE_ConvToLong        Convert to 32 bits/cell
00967 //!      \li\b RASTMODE_ConvToFloat       Convert anything but RGB to floats
00968 //!      \li\b RASTMODE_ConvToDouble      Convert anything but RGB to doubles
00969 RVCAPPLIBEXPORT int MfReadRastConv (
00970    int handle,                         //!< Open raster handle
00971    INT32 lin,                          //!< Raster line
00972    INT32 col,                          //!< Raster column
00973    INT32 len,                          //!< Number of cells to read
00974    void *data,                         //!< Pointer to buffer to read into
00975    UINT32 mode                         //!< Conversion method, 0 for no conversion
00976    );
00977 
00978 //! Set the default NULL value in the raster header.
00979 //!
00980 //! This will also set the RASTER_HasNullVal flag.
00981 RVCAPPLIBEXPORT void MfSetDftNullVal (
00982    RVCRASTINFO *info                   //!< Raster header to set default NULL value for
00983    );
00984 
00985 //! Set NULL value for raster object from "double".
00986 //!
00987 //! This will also set the RASTER_HasNullVal flag.
00988 RVCAPPLIBEXPORT void MfSetRastNullValueDouble (
00989    RVCRASTINFO *info,                  //!< Raster header to set dft NULL value
00990    double nullvalue                    //!< Null value to set
00991    );
00992 
00993 //! Write data to a raster object with conversion.
00994 //!
00995 //! Raster modes:    
00996 //!      \li\b RASTMODE_ConvToByteSpread  Convert 1/2/4 bits to 8-bit by stretch
00997 //!      \li\b RASTMODE_ConvToByte        Convert 1/2/4 bits to 8-bit by copy
00998 //!      \li\b RASTMODE_ConvToWord        Convert to 16 bits/cell
00999 //!      \li\b RASTMODE_ConvToLong        Convert to 32 bits/cell
01000 //!      \li\b RASTMODE_ConvToFloat       Convert anything but RGB to floats
01001 //!      \li\b RASTMODE_ConvToDouble      Convert anything but RGB to doubles
01002 RVCAPPLIBEXPORT int MfWriteRastConv (
01003    int handle,                         //!< Open raster handle
01004    INT32 lin,                          //!< Raster line
01005    INT32 col,                          //!< Raster column
01006    INT32 len,                          //!< Number of cells to read
01007    void *data,                         //!< Pointer to data to be written
01008    UINT32 mode                         //!< Raster conversion mode, 0 for no conversion
01009    );
01010 
01011 //! Change raster null value and remap all null cells to new value.
01012 //!
01013 //! Flags:  
01014 //!   \li\b CHGRASTNULL_LeaveAlone     Leave cells matching new null value alone
01015 //!   \li\b CHGRASTNULL_Increase       Increase value of cells matching new null value (if possible)
01016 //!   \li\b CHGRASTNULL_Decrease       Decrease value of cells matching new null value (if possible)
01017 //!
01018 //!   This function will automatically recompute the raster histogram and pyramid tiers if necessary.
01019 int MfChangeRasterNull (
01020    int fhandle,                        //!< Open file handle
01021    INT32 rastinode,                    //!< Raster inode
01022    ANYRASTVALUE *newnull,              //!< New null value
01023    UINT32 flags                        //!< Flags
01024    );
01025 
01026 //! Compute linear combination of raster objects.
01027 int MfCombineRastersLinear (
01028    FNAMEINODEUC *ifnameinode,          //!< Input raster objects 
01029    FNAMEINODEUC *ofnameinode,          //!< Output raster objects
01030    RVCRASTINFO *orastinfo,             //!< Output rasters info
01031    LINEARTRANS *trans,                 //!< Parameters of linear transformation 
01032    UINT32 flags                        //!< 1 if doing autoscale for output rasters values, 0 if not
01033    );
01034 
01035 //! Compute CLUMP raster.
01036 int MfComputeClumpRaster (
01037    int ifhandle,                       //!< Input file handle
01038