image.h

Go to the documentation of this file.
00001 /**
00002  * \file rvc/image.h
00003  * \brief RVC::IMAGE class definitions.
00004  *
00005  * \if NODOC
00006  * $Id: image.h_v 1.48 2005/11/29 17:34:17 dwilliss Exp $
00007  *
00008  * $Log: image.h_v $
00009  * Revision 1.48  2005/11/29 17:34:17  dwilliss
00010  * added a couple methods that were in 72 but not 71
00011  *
00012  * Revision 1.47  2005/11/18 18:48:22  scowan
00013  * Added complex conversions.
00014  *
00015  * Revision 1.46  2005/08/24 19:46:42  dfriberg
00016  * Add ConvToCellType method to IMAGE::NULLVALUE
00017  *
00018  * Revision 1.45  2005/04/08 16:16:38  mju
00019  * Add nullvalue applyMask and extractMask methods.
00020  *
00021  * Revision 1.44  2005/04/05 16:51:55  scowan
00022  * Added cell type histogram valid.
00023  *
00024  * Revision 1.43  2005/02/03 22:20:05  scowan
00025  * Added changes suggested by Mike and Dave.
00026  *
00027  * Revision 1.42  2005/02/03 21:04:01  scowan
00028  *  Added fields to statistics.
00029  *
00030  * Revision 1.41  2005/02/03 18:37:05  scowan
00031  * Added image statistics class.
00032  *
00033  * Revision 1.40  2004/12/03 17:04:26  scowan
00034  * SequentialReadOptim.
00035  *
00036  * Revision 1.39  2004/12/03 16:08:25  scowan
00037  * Added image capability.
00038  *
00039  * Revision 1.38  2004/11/19 15:31:25  scowan
00040  * Setup database to exist under signed rasters.
00041  * I do not think that this is a good idea.
00042  *
00043  * Revision 1.37  2004/08/31 17:45:38  scowan
00044  * Moved chache size methods to here and made virtual methods from them.
00045  *
00046  * Revision 1.36  2004/08/30 14:10:48  mju
00047  * Add pyramid_default.
00048  *
00049  * Revision 1.35  2004/03/01 15:45:32  mju
00050  * Add pyramid_Partial flag.
00051  *
00052  * Revision 1.34  2004/02/24 16:09:20  scowan
00053  * Added two new filter cell types.
00054  *
00055  * Revision 1.33  2004/02/03 21:19:21  scowan
00056  * Added rgb spread conversion.
00057  *
00058  * Revision 1.32  2003/11/05 18:44:27  scowan
00059  * Added red blue conversion modes.
00060  *
00061  * Revision 1.31  2003/10/30 18:27:28  scowan
00062  * Added new celltype.
00063  *
00064  * Revision 1.30  2003/10/23 21:24:48  scowan
00065  * nc.
00066  *
00067  * Revision 1.29  2003/10/22 17:07:27  scowan
00068  * Removed deprecated method.
00069  *
00070  * Revision 1.28  2003/10/22 16:17:21  scowan
00071  * Added get objtype set static method.
00072  *
00073  * Revision 1.27  2003/10/15 15:08:37  scowan
00074  * Added method to convert legacy datatype and numbits to  celltype.
00075  *
00076  * Revision 1.26  2003/10/10 16:02:22  scowan
00077  * Added method to get i18n string from celltype.
00078  *
00079  * Revision 1.25  2003/09/30 16:52:06  dwilliss
00080  * Doxygen
00081  *
00082  * Revision 1.24  2003/09/25 21:56:58  dwilliss
00083  * doxygen
00084  *
00085  * Revision 1.23  2003/09/15 23:16:55  scowan
00086  * Added observer class and set null value pure virtual method.
00087  *
00088  * Revision 1.22  2003/09/15 13:49:45  fileserver!dwilliss
00089  * Doxygen
00090  *
00091  * Revision 1.21  2003/09/11 20:09:19  scowan
00092  * Added is image function.
00093  *
00094  * Revision 1.20  2003/08/27 21:26:06  scowan
00095  * Added more celltypes.
00096  *
00097  * Revision 1.19  2003/07/31 14:27:20  scowan
00098  * Added method to get celltype range.
00099  *
00100  * Revision 1.18  2003/06/27 20:39:05  scowan
00101  * Added pyramid enum.
00102  *
00103  * Revision 1.17  2003/05/07 22:19:41  scowan
00104  * Changed virtual method format.
00105  *
00106  * Revision 1.16  2002/10/17 15:23:22  mju
00107  * Add GetCellTypeFromColorSpace and GetColorSpaceFromCellType.
00108  *
00109  * Revision 1.15  2002/09/03 22:05:32  mju
00110  * Change CELLTYPE to use separable bits and add combined types for filter.
00111  *
00112  * Revision 1.14  2001/11/02 17:14:26  mju
00113  * Redesign null value.
00114  * Add CELLTYPE enum.
00115  * Add HasNullValue() pure virtual method.
00116  *
00117  * Revision 1.13  2001/10/26 13:47:58  scowan
00118  * Added default band number for get null value.
00119  *
00120  * Revision 1.12  2001/10/25 21:30:38  scowan
00121  * Added get null value as a method.
00122  *
00123  * Revision 1.11  2001/08/06 16:56:08  scowan
00124  * Nothing.
00125  *
00126  * Revision 1.10  2001/08/06 16:54:14  scowan
00127  * Temp promotion of static method for legacy applications.
00128  *
00129  * Revision 1.8  2001/06/15 15:35:10  scowan
00130  * Added get null value method that returs a double.
00131  *
00132  * Revision 1.7  2001/06/14 14:50:36  scowan
00133  * Added to RVC namespace.
00134  *
00135  * Revision 1.1  2000/10/02 17:22:56  scowan
00136  * Initial revision
00137  * \endif
00138 **/
00139 
00140 //!   \class RVC::IMAGE rvc/image.h
00141 //!   \brief Interface for RVC objects that support an multiple image band paradigm.
00142 //!
00143 //!   This includes methods to read and write to each individual image band
00144 //!
00145 //!   RVC Object Types that this class supports: Derived class
00146 //!
00147 //!   Default RVC Object Type for this class: Derived class
00148 //!
00149 //!   Valid parents for this class: Derived class
00150 
00151 #ifndef INC_RVC_IMAGE_H
00152 #define INC_RVC_IMAGE_H
00153 
00154 #ifndef INC_RVC_GEOSPATL_H
00155    #include <rvc/geospatl.h>
00156 #endif
00157 
00158 #ifndef INC_MI32_RVCRAST_H
00159    #include <mi32/rvcrast.h>
00160 #endif
00161 
00162 #ifndef INC_MI32_COLORSPC_H
00163    #include <mi32/colorspc.h>
00164 #endif
00165 
00166 #ifndef INC_MI32_RANGE_H
00167    #include <mi32/range.h>
00168 #endif
00169 
00170 
00171 namespace RVC {
00172 
00173 #ifndef GENERATING_DOXYGEN_OUTPUT
00174 //Forward Declarations
00175 class HISTOGRAM;
00176 struct AnyCallbackStruct;
00177 #endif
00178 
00179 class IMAGE : public RVC::GEOSPATIAL {
00180    public:
00181 
00182       enum CACHEMODE {           //! Raster cache values for SetCacheMode()
00183          CACHEMODE_Default = 0,     //!< Default cache size is 4 tiles unless compressed
00184          CACHEMODE_DiagonalRow,     //!< Sets raster cache to allocate a hypotenuse amount of tiles
00185          CACHEMODE_TileRow          //!< Default cache size if raster is compressed, caches a row of tiles
00186          };
00187 
00188       enum CAPABILITY {
00189          CAPABILITY_None =                   0,
00190          CAPABILITY_SequentialReadOptimal = 1024   //!< Image is best accessed one scanline at a time in top to bottom order
00191          };
00192 
00193       //! Possible type conversion modes for Read(), ReadColumn() and Write()
00194       enum CONVMODE {
00195          CONVMODE_None = 0,            //!< No conversion
00196          CONVMODE_ByteSpread,          //!< Convert < 8-bit to 8-bit by spreading over 0-255 range
00197          CONVMODE_INT8,                //!< Convert 1/2/4 bits to 8-bit by copy
00198          CONVMODE_INT16,               //!< Convert < INT16 to INT16 bits/cell
00199          CONVMODE_INT32,               //!< Convert < INT32 to INT32 bits/cell
00200          CONVMODE_Float,               //!< Convert to float
00201          CONVMODE_Double,              //!< Convert to double
00202          CONVMODE_RGB,                 //!< Convert to RGB, only for Read() method
00203          CONVMODE_BGR,                 //!< Convert to BGR, only for Read() method
00204          CONVMODE_RGBSpread,           //!< Convert to RGB and spread 16 to 24 bit, only for Read() method
00205          CONVMODE_BGRSpread,           //!< Convert to BGR and spread 16 to 24 bit, only for Read() method
00206          CONVMODE_ComplexRIFloat,      //!< Convert to Complex Real/Imaginary
00207          CONVMODE_ComplexMPFloat,      //!< Convert to Complex Magnitude/Phase
00208          CONVMODE_ComplexRIDouble,     //!< Convert to Complex Real/Imaginary
00209          CONVMODE_ComplexMPDouble      //!< Convert to Complex Magnitude/Phase
00210          };
00211 
00212       //! Valid image datatypes.
00213       enum DATATYPE {
00214          DATATYPE_Invalid = 0,         //!< Not a valid raster datatype
00215          DATATYPE_Unsigned,            //!< UINT8, UINT16, UINT32 and < 8 bit
00216          DATATYPE_Signed,              //!< INT8, INT16, INT32
00217          DATATYPE_Float,               //!< FLOAT, DOUBLE
00218          DATATYPE_BGR,                 //!< RED, GREEN, BLUE packed (blue first byte)
00219          DATATYPE_RGB,                 //!< RED, GREEN, BLUE packed (red first byte)
00220          DATATYPE_BGR16,               //!< RED, GREEN, BLUE packed (blue high bits)
00221          DATATYPE_RGB16,               //!< RED, GREEN, BLUE packed (red high bits)
00222          DATATYPE_ComplexRI,           //!< Real, Imaginary
00223          DATATYPE_ComplexMP,           //!< Magnitude, Phase
00224          DATATYPE_RGBA,                //!< RED, GREEN, BLUE packed (red first byte)
00225          DATATYPE_ARGB,                //!< RED, GREEN, BLUE packed (red first byte)
00226          DATATYPE_CMYK,                //!< RED, GREEN, BLUE packed (red first byte)
00227          DATATYPE_KCMY                 //!< RED, GREEN, BLUE packed (red first byte)
00228          };
00229 
00230       //! Image cell type enumerating valid data type and bit depth combinations.
00231       enum CELLTYPE {
00232          CELLTYPE_Invalid =                   0x00000000,
00233          CELLTYPE_Binary =                    0x00000001,
00234          CELLTYPE_Unsigned_4 =                0x00000002,
00235          CELLTYPE_Unsigned_8 =                0x00000004,
00236          CELLTYPE_Unsigned_32 =               0x00000008,
00237          CELLTYPE_Unsigned_16 =               0x00000010,
00238          CELLTYPE_Unsigned_64 =               0x00000020,
00239          CELLTYPE_Signed_8 =                  0x00000040,
00240          CELLTYPE_Signed_16 =                 0x00000080,
00241          CELLTYPE_Signed_32 =                 0x00000100,
00242          CELLTYPE_Signed_64 =                 0x00000200,
00243          CELLTYPE_Float_32 =                  0x00000400,
00244          CELLTYPE_Float_64 =                  0x00000800,
00245          CELLTYPE_ComplexRI_64 =              0x00001000,
00246          CELLTYPE_ComplexMP_64 =              0x00002000,
00247          CELLTYPE_ComplexRI_128 =             0x00004000,
00248          CELLTYPE_ComplexMP_128 =             0x00008000,
00249          CELLTYPE_X1R5G5B5_16 =               0x00010000,   //!< Packed into UINT16 with Red in high bits
00250          CELLTYPE_X1B5G5R5_16 =               0x00020000,   //!< Packed into UINT16 with Blue in high bits
00251          CELLTYPE_RedGreenBlue_24 =           0x00040000,   //!< 3 bytes, red first
00252          CELLTYPE_BlueGreenRed_24 =           0x00080000,   //!< 3 bytes, blue first
00253          CELLTYPE_RedGreenBlueAlpha_32 =      0x00100000,   //!< 4 bytes, red first
00254          CELLTYPE_AlphaRedGreenBlue_32 =      0x00200000,   //!< 4 bytes, alpha first
00255          CELLTYPE_CyanMagentaYellowBlack_32 = 0x00400000,   //!< 4 bytes, cyan first
00256          CELLTYPE_BlackCyanMagentaYellow_32 = 0x00800000,   //!< 4 bytes, black first
00257          // When add types add also to IMAGE::GetCellTypeResourceString(), IMAGE::GetCellTypeString() and IMAGE::GetCellTypeRange() in image.c.
00258          // New types should be added here
00259          // Multiple-type specifications for filters, etc.
00260          CELLTYPE_None =                      0x00000000,
00261          CELLTYPE_Unsigned_Max8 =             (CELLTYPE_Binary + CELLTYPE_Unsigned_4 + CELLTYPE_Unsigned_8),
00262          CELLTYPE_Unsigned_Max16 =            (CELLTYPE_Unsigned_Max8 + CELLTYPE_Unsigned_16),
00263          CELLTYPE_Unsigned_Max32 =            (CELLTYPE_Unsigned_Max16 + CELLTYPE_Unsigned_32),
00264          CELLTYPE_Unsigned_Max64 =            (CELLTYPE_Unsigned_Max32 + CELLTYPE_Unsigned_64),
00265          CELLTYPE_Signed_Max32 =              (CELLTYPE_Signed_8 + CELLTYPE_Signed_16 + CELLTYPE_Signed_32),
00266          CELLTYPE_Signed_Max64 =              (CELLTYPE_Signed_Max32 + CELLTYPE_Signed_64),
00267          CELLTYPE_Integer_Max32 =             (CELLTYPE_Unsigned_Max32 + CELLTYPE_Signed_Max32),
00268          CELLTYPE_Integer_Max64 =             (CELLTYPE_Unsigned_Max64 + CELLTYPE_Signed_Max64),
00269          CELLTYPE_Float =                     (CELLTYPE_Float_32 + CELLTYPE_Float_64),
00270          CELLTYPE_Scalar =                    (CELLTYPE_Integer_Max64 + CELLTYPE_Float),
00271          CELLTYPE_Complex =                   (CELLTYPE_ComplexRI_64 + CELLTYPE_ComplexMP_64 + CELLTYPE_ComplexRI_128 + CELLTYPE_ComplexMP_128),
00272          CELLTYPE_3Cell_Color =               (CELLTYPE_X1R5G5B5_16 + CELLTYPE_X1B5G5R5_16 + CELLTYPE_RedGreenBlue_24 + CELLTYPE_BlueGreenRed_24),
00273          CELLTYPE_4Cell_Color =               (CELLTYPE_RedGreenBlueAlpha_32 + CELLTYPE_AlphaRedGreenBlue_32 + CELLTYPE_CyanMagentaYellowBlack_32 + CELLTYPE_BlackCyanMagentaYellow_32),
00274          CELLTYPE_Color =                     (CELLTYPE_3Cell_Color + CELLTYPE_4Cell_Color),
00275          CELLTYPE_ColorMapValid =             (CELLTYPE_Unsigned_4 + CELLTYPE_Unsigned_8 + CELLTYPE_Unsigned_16),
00276          CELLTYPE_HasAlphaBand =              (CELLTYPE_RedGreenBlueAlpha_32 + CELLTYPE_AlphaRedGreenBlue_32),
00277          CELLTYPE_DatabaseValid =             (CELLTYPE_Integer_Max32),
00278          CELLTYPE_HistogramValid =            (CELLTYPE_Scalar + CELLTYPE_Complex),
00279          CELLTYPE_All =                       (CELLTYPE_Scalar + CELLTYPE_Complex + CELLTYPE_Color)
00280          };
00281 
00282       enum PACKORDER {
00283          PACKORDER_LeastSigBit = 0,
00284          PACKORDER_MostSigBit
00285          };
00286 
00287       enum PYRAMID {
00288          PYRAMID_Default =             0x00,
00289          PYRAMID_None =                PYRAMID_Default,
00290          PYRAMID_Rebuild =             0x01, //!< Rebuild tiers even if exist
00291          PYRAMID_Average =             0x02, //!< Average raster cells instead of sampling
00292          PYRAMID_Full =                0x04, //!< Create 'full' pyramid set (always 2x2 sample steps)
00293          PYRAMID_UseParentTileSize =   0x08, //!< Use parent raster's tile size.
00294          PYRAMID_UseColorMap =         0x10, //!< Use colormap for averaging
00295          PYRAMID_Partial =             0x20  //!< Create 'partial' pyramid set (some 4x4 sample steps)
00296          };
00297 
00298       #ifndef GENERATING_DOXYGEN_OUTPUT
00299       class BANDPARMS;  //!< Forward declarations
00300       class NULLVALUE;
00301       class OBSERVER;
00302       class STATISTICS;
00303       #endif // GENERATING_DOXYGEN_OUTPUT
00304 
00305       //! Default constructor
00306       IMAGE (
00307          );
00308 
00309       //! Copy constructor
00310       IMAGE (
00311          const IMAGE& rhs
00312          );
00313 
00314       //! Destructor
00315       virtual ~IMAGE (
00316          ) = 0;
00317 
00318       //! Get CELLTYPE corresponding to datatype and numbits
00319       //! @return CELLTYPE value or CELLTYPE_Invalid if no conversion possible.
00320       static CELLTYPE ComputeCellType (
00321          DATATYPE datatype,
00322          UINT16 numbits
00323          );
00324 
00325       //! Get CELLTYPE corresponding to legacy datatype and numbits
00326       //! @return CELLTYPE value or CELLTYPE_Invalid if no conversion possible.
00327       static CELLTYPE ComputeCellTypeFromLegacy (
00328          UINT32 datatype,
00329          UINT16 numbits
00330          );
00331 
00332       //! Obtain individual image band parameters.
00333       ERRVALUE GetBandParms (
00334          INT32 BandNum,
00335          BANDPARMS& BandParms
00336          ) const { return (v_GetBandParms(BandNum, BandParms)); }
00337 
00338       //! Get CELLTYPE corresponding to COLORSPACE.
00339       //! @return CELLTYPE value or CELLTYPE_Invalid if no conversion possible.
00340       static CELLTYPE GetCellTypeFromColorSpace (
00341          COLORSPACE ColorSpace
00342          );
00343 
00344       //! Get CELLTYPE corresponding to legacy datatype and numbits
00345       //! @return CELLTYPE value or CELLTYPE_Invalid if no conversion possible.
00346       static CELLTYPE GetCellTypeFromDataTypeAndNumBits (
00347          UINT32 datatype,
00348          UINT16 numbits
00349          );
00350 
00351       //! Get Image value range according to the CELLTYPE
00352       static void GetCellTypeRange (
00353          CELLTYPE CellType,
00354          DOUBLE_RANGE& Range
00355          );
00356 
00357       //! Get the string for the IMAGE::CELLTYPE specified.
00358       //! The string is determined from the 'CellType' and the resource file
00359       static MISTRING GetCellTypeString (
00360          CELLTYPE CellType
00361          );
00362 
00363       //! Get COLORSPACE corresponding to specified cell type.
00364       //! @return COLORSPACE value or COLORSPACE_Unknown if no conversion possible.
00365       static COLORSPACE GetColorSpaceFromCellType (
00366          CELLTYPE CellType,
00367          bool haspalette = false
00368          );
00369 
00370       //! Obtain the raster cell column scale value.
00371       //! @return raster cell column scale
00372       double GetColumnScale (
00373          ) const { return (v_GetColumnScale()); }
00374 
00375       //! Get the band number to use for composite image reading and writing in one image buffer
00376       //! Only useful for images of CELLTYPE_Complex and CELLTYPE_Color
00377       //! @return Band number to read(), write() for CELLTYPE_Complex and CELLTYPE_Color images in one image buffer
00378       static INT32 GetCompositeBandNum (
00379          ) { return (-1); }
00380 
00381       //! Get DATATYPE associated with specified CELLTYPE.
00382       static DATATYPE GetDataTypeFromCellType (
00383          CELLTYPE CellType
00384          );
00385 
00386       //! Get image object referred to by 'object'
00387       //! @return Allocated instance of RVC::IMAGE object (must be 'delete'd) or 0 if error
00388       static RVC::IMAGE* GetImage (
00389          const RVC::OBJECT& object
00390          );
00391 
00392       //! Get image object referred to by 'ObjItem'
00393       //! @return Allocated instance of RVC::IMAGE object (must be 'delete'd) or 0 if error
00394       static RVC::IMAGE* GetImage (
00395          const RVC::OBJITEM& ObjItem
00396          );
00397 
00398       //! Obtain the raster cell line scale value.
00399       //! @return raster cell line scale
00400       double GetLineScale (
00401          ) const { return (v_GetLineScale()); }
00402 
00403       //! Obtain raster band null value information.
00404       ERRVALUE GetNullValue (
00405          INT32 BandNum,                   //!< Raster band number to get NULLVALUE from
00406          NULLVALUE& NullValue             //!< Current NULLVALUE to get from raster
00407          ) const { return (v_GetNullValue(BandNum, NullValue)); }
00408 
00409       //! Determine the number of bands present in the raster
00410       //! @returns number of bands
00411       INT32 GetNumBands (
00412          ) const { return (v_GetNumBands()); }
00413 
00414       //! Get number of bits per cell for specified CELLTYPE.
00415       static UINT16 GetNumBitsFromCellType (
00416          CELLTYPE CellType
00417          );
00418 
00419       //! Obtain number of columns in the raster
00420       //! @return number of columns in the raster
00421       INT32 GetNumColumns (
00422          ) const { return (v_GetNumColumns()); }
00423 
00424       //! Obtain number of lines in the raster
00425       //! @return number of lines in the raster
00426       INT32 GetNumLines (
00427          ) const { return (v_GetNumLines()); }
00428 
00429       //! Get correct OBJTYPESET for all image OBJTYPE's
00430       //! @return OBJTYPESET for all image OBJTYPE's
00431       static RVC::OBJTYPESET GetObjTypeSet (
00432          );
00433 
00434       //! Determine if null value exists for specified band.
00435       //! @return 'true' if null value used, 'false' if not.
00436       bool HasNullValue (
00437          INT32 BandNum
00438          ) const { return (v_HasNullValue(BandNum)); }
00439 
00440       //! Determine if the object type is an image object
00441       static bool IsImage (
00442          RVC::OBJTYPE ObjType
00443          );
00444 
00445       //! Read a line of raster cells up to a certain length
00446       ERRVALUE ReadBand (
00447          INT32 Band,
00448          INT32 Line,                         //!< Raster line to read
00449          INT32 StartColumn,                  //!< Raster column to start reading on
00450          void *data,                         //!< Buffer to read into
00451          INT32 Length = 1,                   //!< Number of columns to read
00452          CONVMODE Convert = CONVMODE_None    //!< Data conversion mode
00453          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, Convert)); }
00454 
00455       //! Read a line of raster cells up to a certain length, converting to signed 8 bit
00456       ERRVALUE ReadBand (                       //! Read a raster line, signed 8 bit
00457          INT32 Band,                         //!< Image band number to read
00458          INT32 Line,                         //!< Raster line to read
00459          INT32 StartColumn,                     //!< Raster column to start reading on
00460          INT8 *data,                         //!< Buffer to read into
00461          INT32 Length = 1                    //!< Number of columns to read
00462          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_INT8)); }
00463 
00464       //! Read a line of raster cells up to a certain length, converting to unsigned 8 bit
00465       ERRVALUE ReadBand (                       //! Read a raster line, unsigned 8 bit
00466          INT32 Band,                         //!< Image band number to read
00467          INT32 Line,                         //!< Raster line to read
00468          INT32 StartColumn,                     //!< Raster column to start reading on
00469          UINT8 *data,                        //!< Buffer to read into
00470          INT32 Length = 1                    //!< Number of columns to read
00471          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_INT8)); }
00472 
00473       //! Read a line of raster cells up to a certain length, converting to signed 16 bit
00474       ERRVALUE ReadBand (                       //! Read a raster line, signed 16 bit
00475          INT32 Band,                         //!< Image band number to read
00476          INT32 Line,                         //!< Raster line to read
00477          INT32 StartColumn,                     //!< Raster column to start reading on
00478          INT16 *data,                        //!< Buffer to read into
00479          INT32 Length = 1                    //!< Number of columns to read
00480          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_INT16)); }
00481 
00482       //! Read a line of raster cells up to a certain length, converting to unsigned 16 bit
00483       ERRVALUE ReadBand (                       //! Read a raster line, unsigned 16 bit
00484          INT32 Band,                         //!< Image band number to read
00485          INT32 Line,                         //!< Raster line to read
00486          INT32 StartColumn,                     //!< Raster column to start reading on
00487          UINT16 *data,                       //!< Buffer to read into
00488          INT32 Length = 1                    //!< Number of columns to read
00489          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_INT16)); }
00490 
00491       //! Read a line of raster cells up to a certain length, converting to signed 32 bit
00492       ERRVALUE ReadBand (                       //! Read a raster line, signed 32 bit
00493          INT32 Band,                         //!< Image band number to read
00494          INT32 Line,                         //!< Raster line to read
00495          INT32 StartColumn,                     //!< Raster column to start reading on
00496          INT32 *data,                        //!< Buffer to read into
00497          INT32 Length = 1                    //!< Number of columns to read
00498          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_INT32)); }
00499 
00500       //! Read a line of raster cells up to a certain length, converting to unsigned 32 bit
00501       ERRVALUE ReadBand (                       //! Read a raster line, unsigned 32 bit
00502          INT32 Band,                         //!< Image band number to read
00503          INT32 Line,                         //!< Raster line to read
00504          INT32 StartColumn,                     //!< Raster column to start reading on
00505          UINT32 *data,                       //!< Buffer to read into
00506          INT32 Length = 1                    //!< Number of columns to read
00507          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_INT32)); }
00508 
00509       //! Read a line of raster cells up to a certain length, converting to 32 bit float
00510       ERRVALUE ReadBand (                       //! Read a raster line, 4 byte floats
00511          INT32 Band,                         //!< Image band number to read
00512          INT32 Line,                         //!< Raster line to read
00513          INT32 StartColumn,                     //!< Raster column to start reading on
00514          float *data,                        //!< Buffer to read into
00515          INT32 Length = 1                    //!< Number of columns to read
00516          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_Float)); }
00517 
00518       //! Read a line of raster cells up to a certain length, converting to 64 bit double
00519       ERRVALUE ReadBand (                       //! Read a raster line, 8 byte doubles
00520          INT32 Band,                         //!< Image band number to read
00521          INT32 Line,                         //!< Raster line to read
00522          INT32 StartColumn,                     //!< Raster column to start reading on
00523          double *data,                       //!< Buffer to read into
00524          INT32 Length = 1                    //!< Number of columns to read
00525          ) const { return (v_ReadBand(Band, Line, StartColumn, data, Length, CONVMODE_Double)); }
00526 
00527       //! Read a line of raster cells up to a certain length
00528       ERRVALUE ReadColumnBand (
00529          INT32 Band,
00530          INT32 Line,                         //!< Raster line to read
00531          INT32 StartColumn,                  //!< Raster column to start reading on
00532          void *data,                         //!< Buffer to read into
00533          INT32 Length = 1,                   //!< Number of columns to read
00534          CONVMODE Convert = CONVMODE_None    //!< Data conversion mode
00535          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, Convert)); }
00536 
00537       //! Read a column of raster cells up to a certain length, converting to signed 8 bit
00538       ERRVALUE ReadColumnBand (                 //! Read a raster column, signed 8 bit
00539          INT32 Band,                         //!< Image band number to read
00540          INT32 Line,                         //!< Raster line to start reading on
00541          INT32 StartColumn,                     //!< Raster column to read
00542          INT8 *data,                         //!< Buffer to read into
00543          INT32 Length = 1                    //!< Number of lines to read
00544          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_INT8)); }
00545 
00546       //! Read a column of raster cells up to a certain length, converting to unsigned 8 bit
00547       ERRVALUE ReadColumnBand (                 //! Read a raster column, unsigned 8 bit
00548          INT32 Band,                         //!< Image band number to read
00549          INT32 Line,                         //!< Raster line to start reading on
00550          INT32 StartColumn,                     //!< Raster column to read
00551          UINT8 *data,                        //!< Buffer to read into
00552          INT32 Length = 1                    //!< Number of lines to read
00553          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_INT8)); }
00554 
00555       //! Read a column of raster cells up to a certain length, converting to signed 16 bit
00556       ERRVALUE ReadColumnBand (                 //! Read a raster column, signed 16 bit
00557          INT32 Band,                         //!< Image band number to read
00558          INT32 Line,                         //!< Raster line to start reading on
00559          INT32 StartColumn,                     //!< Raster column to read
00560          INT16 *data,                        //!< Buffer to read into
00561          INT32 Length = 1                    //!< Number of lines to read
00562          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_INT16)); }
00563 
00564       //! Read a column of raster cells up to a certain length, converting to unsigned 16 bit
00565       ERRVALUE ReadColumnBand (                 //! Read a raster column, unsigned 16 bit
00566          INT32 Band,                         //!< Image band number to read
00567          INT32 Line,                         //!< Raster line to start reading on
00568          INT32 StartColumn,                     //!< Raster column to read
00569          UINT16 *data,                       //!< Buffer to read into
00570          INT32 Length = 1                    //!< Number of lines to read
00571          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_INT16)); }
00572 
00573       //! Read a column of raster cells up to a certain length, converting to signed 32 bit
00574       ERRVALUE ReadColumnBand (                 //! Read a raster column, signed 32 bit
00575          INT32 Band,                         //!< Image band number to read
00576          INT32 Line,                         //!< Raster line to start reading on
00577          INT32 StartColumn,                     //!< Raster column to read
00578          INT32 *data,                        //!< Buffer to read into
00579          INT32 Length = 1                    //!< Number of lines to read
00580          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_INT32)); }
00581 
00582       //! Read a column of raster cells up to a certain length, converting to unsigned 32 bit
00583       ERRVALUE ReadColumnBand (                 //! Read a raster column, unsigned 32 bit
00584          INT32 Band,                         //!< Image band number to read
00585          INT32 Line,                         //!< Raster line to start reading on
00586          INT32 StartColumn,                     //!< Raster column to read
00587          UINT32 *data,                       //!< Buffer to read into
00588          INT32 Length = 1                    //!< Number of lines to read
00589          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_INT32)); }
00590 
00591       //! Read a column of raster cells up to a certain length, converting to 32 bit float
00592       ERRVALUE ReadColumnBand (                 //! Read a raster column, 4 byte floats
00593          INT32 Band,                         //!< Image band number to read
00594          INT32 Line,                         //!< Raster line to start reading on
00595          INT32 StartColumn,                     //!< Raster column to read
00596          float *data,                        //!< Buffer to read into
00597          INT32 Length = 1                    //!< Number of lines to read
00598          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_Float)); }
00599 
00600       //! Read a column of raster cells up to a certain length, converting to 64 bit double
00601       ERRVALUE ReadColumnBand (                 //! Read a raster column, 8 byte doubles
00602          INT32 Band,                         //!< Image band number to read
00603          INT32 Line,                         //!< Raster line to start reading on
00604          INT32 StartColumn,                     //!< Raster column to read
00605          double *data,                       //!< Buffer to read into
00606          INT32 Length = 1                    //!< Number of lines to read
00607          ) const { return (v_ReadColumnBand(Band, Line, StartColumn, data, Length, CONVMODE_Double)); }
00608 
00609       //! Set the null value for the image
00610       //! If the 'NullValue' pointer is 'null', the image does not have a null value
00611       ERRVALUE SetNullValue (
00612          INT32 BandNum,
00613          const NULLVALUE* NullValue                //!< If pointer is 'null', the image has no null value, if not, the image has a null value
00614          ) { return (v_SetNullValue(BandNum, NullValue)); }
00615 
00616       //! Set the image tile cache to cache the number of tiles specified
00617       ERRVALUE SetCacheSize (
00618          INT32 NumTiles                      //!< Number of tiles to set cache
00619          ) { return (v_SetCacheSize(NumTiles)); }
00620 
00621       //! Set the image tile cache to cache a number of tiles specified by the RVC::IMAGE::CACHEMODE enumeration
00622       ERRVALUE SetCacheSize (
00623          CACHEMODE CacheFlags                //!< Tile row or diagonal tile cache sizes
00624          ) { return (v_SetCacheSize(CacheFlags)); }
00625 
00626       //! Write a line of raster cells up to a certain length
00627       ERRVALUE WriteBand (
00628          INT32 Band,                         //!< Image band number to write
00629          INT32 Line,                         //!< Raster line to write
00630          INT32 StartColumn,                     //!< Raster column to start writing on
00631          void *data,                         //!< Buffer to write into
00632          INT32 Length = 1,                   //!< Number of columns to write
00633          CONVMODE Convert = CONVMODE_None       //!< Data conversion mode
00634          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, Convert)); }
00635 
00636       //! Write a line of raster cells up to a certain length, converting from signed 8 bit
00637       ERRVALUE WriteBand (                   //! Write a raster line, signed 8 bit
00638          INT32 Band,                         //!< Image band number to write
00639          INT32 Line,                         //!< Raster line to write
00640          INT32 StartColumn,                     //!< Raster column to start writing on
00641          INT8 *data,                         //!< Buffer to write from
00642          INT32 Length = 1                    //!< Number of columns to write
00643          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_INT8)); }
00644 
00645       //! Write a line of raster cells up to a certain length, converting from unsigned 8 bit
00646       ERRVALUE WriteBand (                   //! Write a raster line, unsigned 8 bit
00647          INT32 Band,                         //!< Image band number to write
00648          INT32 Line,                         //!< Raster line to write
00649          INT32 StartColumn,                     //!< Raster column to start writing on
00650          UINT8 *data,                        //!< Buffer to write from
00651          INT32 Length = 1                    //!< Number of columns to write
00652          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_INT8)); }
00653 
00654       //! Write a line of raster cells up to a certain length, converting from signed 16 bit
00655       ERRVALUE WriteBand (                   //! Write a raster line, signed 16 bit
00656          INT32 Band,                         //!< Image band number to write
00657          INT32 Line,                         //!< Raster line to write
00658          INT32 StartColumn,                     //!< Raster column to start writing on
00659          INT16 *data,                        //!< Buffer to write from
00660          INT32 Length = 1                    //!< Number of columns to write
00661          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_INT16)); }
00662 
00663       //! Write a line of raster cells up to a certain length, converting from unsigned 16 bit
00664       ERRVALUE WriteBand (                   //! Write a raster line, unsigned 16 bit
00665          INT32 Band,                         //!< Image band number to write
00666          INT32 Line,                         //!< Raster line to write
00667          INT32 StartColumn,                     //!< Raster column to start writing on
00668          UINT16 *data,                       //!< Buffer to write from
00669          INT32 Length = 1                    //!< Number of columns to write
00670          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_INT16)); }
00671 
00672       //! Write a line of raster cells up to a certain length, converting from signed 32 bit
00673       ERRVALUE WriteBand (                   //! Write a raster line, signed 32 bit
00674          INT32 Band,                         //!< Image band number to write
00675          INT32 Line,                         //!< Raster line to write
00676          INT32 StartColumn,                     //!< Raster column to start writing on
00677          INT32 *data,                        //!< Buffer to write from
00678          INT32 Length = 1                    //!< Number of columns to write
00679          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_INT32)); }
00680 
00681       //! Write a line of raster cells up to a certain length, converting from unsigned 32 bit
00682       ERRVALUE WriteBand (                   //! Write a raster line, unsigned 32 bit
00683          INT32 Band,                         //!< Image band number to write
00684          INT32 Line,                         //!< Raster line to write
00685          INT32 StartColumn,                     //!< Raster column to start writing on
00686          UINT32 *data,                       //!< Buffer to write from
00687          INT32 Length = 1                    //!< Number of columns to write
00688          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_INT32)); }
00689 
00690       //! Write a line of raster cells up to a certain length, converting from 32 bit float
00691       ERRVALUE WriteBand (                   //! Write a raster line, 4 byte floats
00692          INT32 Band,                         //!< Image band number to write
00693          INT32 Line,                         //!< Raster line to write
00694          INT32 StartColumn,                     //!< Raster column to start writing on
00695          float *data,                        //!< Buffer to write from
00696          INT32 Length = 1                    //!< Number of columns to write
00697          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_Float)); }
00698 
00699       //! Write a line of raster cells up to a certain length, converting from 64 bit double
00700       ERRVALUE WriteBand (                   //! Write a raster line, 8 byte doubles
00701          INT32 Band,                         //!< Image band number to write
00702          INT32 Line,                         //!< Raster line to write
00703          INT32 StartColumn,                     //!< Raster column to start writing on
00704          double *data,                       //!< Buffer to write from
00705          INT32 Length = 1                    //!< Number of columns to write
00706          ) { return (v_WriteBand(Band, Line, StartColumn, data, Length, CONVMODE_Double)); }
00707 
00708    protected:
00709 
00710       static DATATYPE ConvToDATATYPE (
00711          int RvcType,
00712          UINT16 NumBits
00713          );
00714 
00715       static UINT32 ConvToRastMode (
00716          CONVMODE value
00717          );
00718 
00719       #ifndef GENERATING_DOXYGEN_OUTPUT
00720       static void ImageCallbackFunc (RVC::AnyCallbackStruct *cb, void *data);
00721       #endif // GENERATING_DOXYGEN_OUTPUT
00722 
00723    private:
00724       #ifndef GENERATING_DOXYGEN_OUTPUT
00725 
00726       virtual ERRVALUE v_GetBandParms (INT32 BandNum, BANDPARMS& BandParms) const = 0;
00727       virtual double v_GetColumnScale () const = 0;
00728       virtual double v_GetLineScale () const = 0;
00729       virtual ERRVALUE v_GetNullValue (INT32 BandNum, NULLVALUE& NullValue) const = 0;
00730       virtual INT32 v_GetNumBands () const = 0;
00731       virtual INT32 v_GetNumColumns () const = 0;
00732       virtual INT32 v_GetNumLines () const = 0;
00733       virtual bool v_HasNullValue (INT32 BandNum) const = 0;
00734       virtual ERRVALUE v_ReadBand (INT32 Band, INT32 Line, INT32 StartColumn, void *data, INT32 Length, CONVMODE Convert) const = 0;
00735       virtual ERRVALUE v_ReadColumnBand (INT32 Band, INT32 Line, INT32 StartColumn, void *data, INT32 Length, CONVMODE Convert) const = 0;
00736       virtual ERRVALUE v_SetCacheSize (INT32 NumTiles) = 0;
00737       virtual ERRVALUE v_SetCacheSize (CACHEMODE CacheFlags) = 0;
00738       virtual ERRVALUE v_SetNullValue (INT32 BandNum, const NULLVALUE* NullValue) = 0;
00739       virtual ERRVALUE v_WriteBand (INT32 Band, INT32 Line, INT32 StartColumn, void *data, INT32 Length, CONVMODE Convert) = 0;
00740       #endif // GENERATING_DOXYGEN_OUTPUT
00741 
00742    public:
00743       //! Temporary static method to convert IMAGE::DATATYPE's to legacy RVCTYPE flags
00744       //! @return: RVCTYPE_ flag
00745       static UINT16 ConvToRVCTYPE (
00746          DATATYPE type,
00747          UINT16 NumBits
00748          );
00749 
00750    };
00751 
00752 DEFINE_ENUM_OP_BITWISE(IMAGE::CELLTYPE)
00753 DEFINE_ENUM_OP_BITWISE(IMAGE::PYRAMID);
00754 
00755 //! Class to represent and manage band specific information.
00756 class IMAGE::BANDPARMS {
00757    public:
00758 
00759       //! Default constructor
00760       BANDPARMS (
00761          ) :
00762          m_CellType(CELLTYPE_Invalid),
00763          m_PackOrder(PACKORDER_MostSigBit)
00764          {}
00765 
00766       //! Destructor
00767       ~BANDPARMS (
00768          ) {}
00769 
00770       //! Obtain the number of bits in this band.
00771       //! @return Number of bits.
00772       UINT16 GetNumBits (
00773          ) const { return (IMAGE::GetNumBitsFromCellType(m_CellType)); }
00774 
00775       //! Obtain the celltype of the image band
00776       //! @return Celltype of the image band
00777       CELLTYPE GetCellType (
00778          ) const { return (m_CellType); }
00779 
00780       //! Obtain the datatype of the image band
00781       //! @return Datatype of the image band
00782       DATATYPE GetDataType (
00783          ) const { return (IMAGE::GetDataTypeFromCellType(m_CellType)); }
00784 
00785       //! Obtain the packing order of the band
00786       //! @return Packing order
00787       PACKORDER GetPackOrder (
00788          ) const { return (m_PackOrder); }
00789 
00790       //! Set image band cell type.
00791       void SetCellType (
00792          CELLTYPE CellType
00793          ) { m_CellType = CellType; }
00794 
00795       //! Set the image band name.
00796       void SetName (
00797          const RVCOBJECTNAME& name
00798          ) { m_Name = name; }
00799 
00800       //! Set the image band name.
00801       void SetName (
00802          const char *name
00803          ) { m_Name.Assign(name); }
00804 
00805       //! Set the image band packing order
00806       void SetPackOrder (
00807          PACKORDER PackOrder
00808          ) { m_PackOrder = PackOrder; }
00809 
00810    private:
00811       #ifndef GENERATING_DOXYGEN_OUTPUT
00812       OBJECTNAME m_Name;
00813       CELLTYPE m_CellType;
00814       PACKORDER m_PackOrder;
00815       #endif // GENERATING_DOXYGEN_OUTPUT
00816    }; // End BANDPARMS.
00817 
00818 
00819 //! Container for image null value.
00820 class IMAGE::NULLVALUE {
00821    public:
00822 
00823       //! Mode for adjusting non-null cells having null value in ApplyMask.
00824       enum CONFLICTADJUST {
00825          CONFLICTADJUST_Auto,       //!< If null value <= 0 adjust up, otherwise down
00826          CONFLICTADJUST_None,       //!< Don't adjust conflicting values
00827          CONFLICTADJUST_Down,       //!< Adjust down (if null value minimum per cell type will adjust up)
00828          CONFLICTADJUST_Up          //!< Adjust up (if null value maximum per cell type will adjust down)
00829          };
00830 
00831       //! Default constructor.
00832       NULLVALUE (
00833          ): m_CellType(CELLTYPE_Invalid)
00834          {
00835          SetDefault();
00836          }
00837 
00838       //! Construct for specified cell type and initialize to default.
00839       explicit NULLVALUE (
00840          CELLTYPE CellType
00841          ): m_CellType(CellType)
00842          {
00843          SetDefault();
00844          }
00845 
00846       //! Apply mask to image cell buffer.
00847       //! Cells with mask values of 0 will be set to the null value.
00848       //! Cells with non-zero mask values and having the null value will be adjusted as specified.
00849       ERRVALUE ApplyMask (
00850          void *cellbuffer,                   //!< Cell buffer to apply mask to, must match cell type set for null value
00851          const UINT8 *maskbuffer,            //!< Mask buffer containing 0 where null and non-0 where valid
00852          INT32 count,                        //!< Number of cells to process
00853          CONFLICTADJUST conflictadjust = CONFLICTADJUST_Auto
00854          ) const;
00855 
00856       //! Convert value to cell type of *this.
00857       //! @return Error if value cannot be converted.
00858       ERRVALUE ConvToCellType (
00859          double value
00860          );
00861 
00862       //! Extract mask from image cell buffer.
00863       ERRVALUE ExtractMask (
00864          const void *cellbuffer,             //!< Cell buffer to extract mask from, must match cell type set
00865          UINT8 *maskbuffer,                  //!< Mask buffer returned, will contain 0 where null and 255 where valid
00866          INT32 count                         //!< Number of cells to process
00867          ) const;
00868 
00869       //! Obtain raster null value as ANYRASTVALUE.
00870       void GetValue (
00871          ANYRASTVALUE& value
00872          ) const;
00873 
00874       //! Get null value as INT8.
00875       //! @return Error if value cannot be converted without truncation.
00876       ERRVALUE GetValue (
00877          INT8& value
00878          ) const;
00879 
00880       //! Get null value as UINT8.
00881       //! @return Error if value cannot be converted without truncation.
00882       ERRVALUE GetValue (
00883          UINT8& value
00884          ) const;
00885 
00886       //! Get null value as INT16.
00887       //! @return Error if value cannot be converted without truncation.
00888       ERRVALUE GetValue (
00889          INT16& value
00890          ) const;
00891 
00892       //! Get null value as UINT16, suitable for 16-bit RGB also.
00893       //! @return Error if value cannot be converted without truncation.
00894       ERRVALUE GetValue (
00895          UINT16& value
00896          ) const;
00897 
00898       //! Get null value as INT32.
00899       //! @return Error if value cannot be converted without truncation.
00900       ERRVALUE GetValue (
00901          INT32& value
00902          ) const;
00903 
00904       //! Get null value as UINT32.
00905       //! @return Error if value cannot be converted without truncation.
00906       ERRVALUE GetValue (
00907          UINT32& value
00908          ) const;
00909 
00910       //! Get null value as float.
00911       //! @return Error if value cannot be converted without truncation.
00912       ERRVALUE GetValue (
00913          float& value
00914          ) const;
00915 
00916       //! Get null value as double.
00917       //! @return Error if value cannot be converted without truncation.
00918       ERRVALUE GetValue (
00919          double& value
00920          ) const;
00921 
00922       //! Get null value as FCOMPLEXRI.
00923       //! @return Error if value cannot be converted without truncation.
00924       ERRVALUE GetValue (
00925          FCOMPLEXRI& value
00926          ) const;
00927 
00928       //! Get null value as FCOMPLEXMP.
00929       //! @return Error if value cannot be converted without truncation.
00930       ERRVALUE GetValue (
00931          FCOMPLEXMP& value
00932          ) const;
00933 
00934       //! Get null value as DCOMPLEXRI.
00935       //! @return Error if value cannot be converted without truncation.
00936       ERRVALUE GetValue (
00937          DCOMPLEXRI& value
00938          ) const;
00939 
00940       //! Get null value as DCOMPLEXMP.
00941       //! @return Error if value cannot be converted without truncation.
00942       ERRVALUE GetValue (
00943          DCOMPLEXMP& value
00944          ) const;
00945 
00946       //! Set cell type for null value.
00947       //! This will also set the null value to the default for the specified cell type.
00948       void SetCellType (
00949          CELLTYPE CellType
00950          ) { m_CellType = CellType; SetDefault(); }
00951 
00952       //! Set default null value for current cell type.
00953       void SetDefault (
00954          );
00955 
00956       //! Set cell type and value from ANYRASTVALUE.
00957       void SetValue (
00958          CELLTYPE CellType,
00959          const ANYRASTVALUE& value
00960          );
00961 
00962       //! Set value from signed integer.
00963       //! @return Error if out of range for current cell type.
00964       ERRVALUE SetValue (
00965          int value
00966          );
00967 
00968       //! Set value from unsigned integer.
00969       //! @return Error if out of range for current cell type.
00970       ERRVALUE SetValue (
00971          unsigned int value
00972          );
00973 
00974       //! Set value from float/double.
00975       //! @return Error if out of range for current cell type.
00976       ERRVALUE SetValue (
00977          double value
00978          );
00979 
00980       //! Set value from FCOMPLEXRI.
00981       //! @return Error if out of range for current cell type.
00982       ERRVALUE SetValue (
00983          const FCOMPLEXRI& value
00984          );
00985 
00986       //! Set value from FCOMPLEXMP.
00987       //! @return Error if out of range for current cell type.
00988       ERRVALUE SetValue (
00989          const FCOMPLEXMP& value
00990          );
00991 
00992       //! Set value from DCOMPLEXRI.
00993       //! @return Error if out of range for current cell type.
00994       ERRVALUE SetValue (
00995          const DCOMPLEXRI& value
00996          );
00997 
00998       //! Set value from DCOMPLEXMP.
00999       //! @return Error if out of range for current cell type.
01000       ERRVALUE SetValue (
01001          const DCOMPLEXMP& value
01002          );
01003 
01004    private:
01005       #ifndef GENERATING_DOXYGEN_OUTPUT
01006       double m_ValueD;
01007       double m_ValueD2;
01008       UINT8 m_ValueRGB[4];
01009       CELLTYPE m_CellType;
01010 
01011       bool ApplyAdjustment (CONFLICTADJUST adjustment);
01012       bool IsColor () const;
01013       bool IsComplex () const;
01014       bool IsInt () const;
01015       #endif // GENERATING_DOXYGEN_OUTPUT
01016 
01017    }; // End NULLVALUE
01018 
01019 
01020 //! OBSERVER class for RVC::IMAGE objects.
01021 class IMAGE::OBSERVER : public RVC::OBJECTOBSERVER {
01022    public:
01023       enum TYPE {
01024          TYPE_NullValueChange = 0x00000111
01025          };
01026 
01027       explicit OBSERVER (
01028          RVC::IMAGE& object
01029          ) : OBJECTOBSERVER(object) {}
01030 
01031       virtual ~OBSERVER (
01032          ) {}
01033 
01034    private:
01035       //! Called when the image object null value settings have changed
01036       virtual void v_OnNullValueChanged (
01037          const ANYRASTVALUE& NullValue,
01038          bool IsNullUsed
01039          ) { return; }
01040 
01041       #ifndef GENERATING_DOXYGEN_OUTPUT
01042       virtual void OnNotifyRaw (UINT32 reason, void *data);
01043       #endif // GENERATING_DOXYGEN_OUTPUT
01044    };
01045 
01046 
01047 class IMAGE::STATISTICS {
01048    public:
01049       STATISTICS (
01050          ) :
01051          m_MeanFull(0.0),
01052          m_StdDev(0.0),
01053          m_Sum(0.0),
01054          m_SumOfSquares(0.0),
01055          m_MinValue(0.0),
01056          m_MaxValue(0.0),
01057          m_CellCount(0),
01058          m_NullCount(0),
01059          m_IsEstimate(false)
01060          {}
01061 
01062       ~STATISTICS () {}
01063 
01064       //! Get the count of cells used in statistics
01065       //! @return Count of cells used in statistics
01066       INT64 GetCount (
01067          ) const { return (m_CellCount); }
01068 
01069       //! Get maximum value of the image
01070       //! @return Maximum value of the image
01071       double GetMaximum (
01072          ) const { return (m_MaxValue); }
01073 
01074       //! Get mean value of full image
01075       //! @return Mean value of full image
01076       double GetMean (
01077          ) const { return (m_MeanFull); }
01078 
01079       //! Get minimum value of the image
01080       //! @return Minimum value of the image
01081       double GetMinimum (
01082          ) const { return (m_MinValue); }
01083 
01084       //! Get the count of null cells in the image
01085       //! @return Count of null cells in the image
01086       INT64 GetNullCount (
01087          ) const { return (m_NullCount); }
01088 
01089       //! Get standard deviation of the image values
01090       //! @return Standard deviation of the image values
01091       double GetStandardDeviation (
01092          ) const { return (m_StdDev); }
01093 
01094       //! Get sum of the image values
01095       //! @return sum of the image values
01096       double GetSum (
01097          ) const { return (m_Sum); }
01098 
01099       //! Get sum of the image values
01100       //! @return sum of the image values
01101       double GetSumOfSquares (
01102          ) const { return (m_SumOfSquares); }
01103 
01104       bool IsEstimate (
01105          ) const { return (m_IsEstimate); }
01106 
01107    private:
01108       #ifndef GENERATING_DOXYGEN_OUTPUT
01109 
01110       double m_MeanFull;                     //!< Mean value for entire data range
01111       double m_StdDev;                       //!< Standard Deviation within selected bin range
01112       double m_Sum;                          //!< Sum of values
01113       double m_SumOfSquares;                 //!< Sum of squares of values
01114       double m_MinValue;                     //!< Minimum value in area for image
01115       double m_MaxValue;                     //!< Maximum value in area for image
01116       INT64 m_CellCount;
01117       INT64 m_NullCount;
01118       bool m_IsEstimate;
01119 
01120       friend class HISTOGRAM;
01121       #endif // GENERATING_DOXYGEN_OUTPUT
01122    };
01123 
01124 
01125 }     //! End of RVC namespace
01126 
01127 #endif      //!< INC_RVC_IMAGE_H

Generated on Wed May 31 15:27:15 2006 for TNTsdk by  doxygen 1.3.8-20040913