raster.h

Go to the documentation of this file.
00001 /***
00002  * \file rvc/raster.h 
00003  * \brief interface for the RVC::RASTER class.
00004  *
00005  * \if NODOC
00006  * $Id: raster.h_v 1.48 2004/11/10 18:25:19 mju Exp $
00007  *
00008  * $Log: raster.h_v $
00009  * Revision 1.48  2004/11/10 18:25:19  mju
00010  * Add getComponents.
00011  *
00012  * Revision 1.47  2004/11/10 14:45:50  mju
00013  * Change method for setting whether to include embedded pyramid tiers to match actual meaning.
00014  *
00015  * Revision 1.46  2004/08/31 17:46:00  scowan
00016  * Moved cache size methods to image class.
00017  *
00018  * Revision 1.45  2004/07/07 19:49:51  scowan
00019  * Added set embedded pyramid method.
00020  *
00021  * Revision 1.44  2004/03/04 18:45:21  scowan
00022  * Added virtual dtors to filter classes.
00023  *
00024  * Revision 1.43  2004/03/01 15:45:43  mju
00025  * Add validatePyramidFlags.
00026  *
00027  * Revision 1.42  2004/02/24 18:39:43  scowan
00028  * Added opacity usage.
00029  *
00030  * Revision 1.41  2004/01/28 20:24:05  scowan
00031  * Added new link types.
00032  *
00033  * Revision 1.40  2004/01/19 17:01:50  scowan
00034  * Added makeparm method.
00035  *
00036  * Revision 1.39  2003/12/04 23:43:52  scowan
00037  * Fixed ecw link ctor.
00038  *
00039  * Revision 1.38  2003/12/03 14:52:17  mju
00040  * Remove hasPyramids.
00041  * If skip sample when make pyramid tier then skip tier number too.
00042  *
00043  * Revision 1.37  2003/11/21 22:17:08  scowan
00044  * Support new Capabilities system.
00045  *
00046  * Revision 1.36  2003/10/31 23:01:57  scowan
00047  * SOmething.
00048  *
00049  * Revision 1.35  2003/10/30 18:27:54  scowan
00050  * Added copy raster methods.
00051  *
00052  * Revision 1.34  2003/10/23 21:25:09  scowan
00053  * Changed get pyramid list function.
00054  *
00055  * Revision 1.33  2003/10/23 16:55:49  scowan
00056  * Allow JP2 links to be pyramids.
00057  *
00058  * Revision 1.32  2003/10/22 22:22:23  scowan
00059  * Added new makeparm method.
00060  *
00061  * Revision 1.31  2003/10/20 20:57:51  scowan
00062  * Added used bits setting.
00063  *
00064  * Revision 1.30  2003/10/15 15:05:25  scowan
00065  * nc.
00066  *
00067  * Revision 1.29  2003/10/07 17:30:46  scowan
00068  * Object virtual method changes.
00069  *
00070  * Revision 1.28  2003/10/01 22:08:10  scowan
00071  * Made more items const.
00072  *
00073  * Revision 1.27  2003/09/30 16:52:06  dwilliss
00074  * Doxygen
00075  *
00076  * Revision 1.26  2003/09/25 21:20:04  dwilliss
00077  * Fixed doxygen comment
00078  *
00079  * Revision 1.25  2003/09/15 23:17:17  scowan
00080  * Support new set null value virtual method.
00081  *
00082  * Revision 1.24  2003/09/15 13:49:45  fileserver!dwilliss
00083  * Doxygen
00084  *
00085  * Revision 1.23  2003/08/28 16:49:50  scowan
00086  * added to generic link parms class.
00087  *
00088  * Revision 1.22  2003/08/28 15:59:33  scowan
00089  * Added static method for auto link tiff's.
00090  *
00091  * Revision 1.21  2003/08/27 21:26:11  scowan
00092  * Uses new rvc raster class interface and handle.
00093  *
00094  * Revision 1.20  2003/06/27 20:38:56  scowan
00095  * Added composite band reading.
00096  *
00097  * Revision 1.19  2003/05/07 22:19:55  scowan
00098  * Changed virtual method format.
00099  *
00100  * Revision 1.18  2002/09/05 21:31:17  scowan
00101  * Changed inclide file name.
00102  *
00103  * Revision 1.17  2002/04/26 22:44:45  scowan
00104  * Added more virtual methods.
00105  *
00106  * Revision 1.16  2002/04/24 22:37:30  scowan
00107  * Added more methods.
00108  *
00109  * Revision 1.15  2002/01/30 15:56:51  scowan
00110  * Added sml context creation method.
00111  *
00112  * Revision 1.14  2002/01/09 23:05:06  scowan
00113  * Added methods to get compression type from makeparms.
00114  *
00115  * Revision 1.13  2002/01/08 18:38:01  scowan
00116  * Attempted to move nested classes outside for docs, could not do it.
00117  *
00118  * Revision 1.12  2001/11/02 17:15:07  mju
00119  * Use CELLTYPE instead of DATATYPE/numbits.
00120  * Add HasNullValue() methods.
00121  *
00122  * Revision 1.11  2001/10/25 21:29:44  scowan
00123  * Nothing.
00124  *
00125  * Revision 1.10  2001/10/16 21:34:46  vdronov
00126  * added PYRAMID_UseColorMap
00127  *
00128  * Revision 1.9  2001/09/06 19:42:27  scowan
00129  * Bitwise use of pyramid flags.
00130  *
00131  * Revision 1.8  2001/09/06 19:31:51  scowan
00132  * Added pyramid wrapper methods.
00133  *
00134  * Revision 1.7  2001/06/14 16:09:41  scowan
00135  * Changed source type.
00136  *
00137  * Revision 1.6  2001/06/14 14:59:24  scowan
00138  * Added to RVC namespace.
00139  *
00140  * Revision 1.5  2001/06/13 15:46:19  scowan
00141  * Changed objtypoe enum.
00142  *
00143  * Revision 1.4  2001/05/25 21:42:49  scowan
00144  * Create only one make method.
00145  * Make link parms for link method.
00146  *
00147  * Revision 1.3  2000/12/01 14:54:05  scowan
00148  * Fixed MAC errors.
00149  *
00150  * Revision 1.2  2000/10/19 21:18:11  scowan
00151  * Checked in for vacation.
00152  *
00153  * Revision 1.1  2000/10/02 17:23:21  scowan
00154  * Initial revision
00155  *
00156  * \endif
00157 ***/
00158 
00159 //!   \class RVC::RASTER rvc/raster.h
00160 //!   \brief Manages RVC::OBJTYPE_Raster RVC objects.  
00161 //!   
00162 //!   The interface currently wraps the MfRaster functions.
00163 //!   
00164 //!   RVC Object Types that this class supports: RVC::OBJTYPE_Raster.
00165 //!
00166 //!   Default RVC Object Type for this class: RVC::OBJTYPE_Raster.
00167 //!
00168 //!   Valid parents for this class:
00169 //!      - RVC::OBJTYPE_File
00170 //!      - RVC::OBJTYPE_Folder
00171 //!      - RVC::OBJTYPE_Raster
00172 //!      - RVC::OBJTYPE_Hyperspectral
00173 //!      - RVC::OBJTYPE_RasterSet
00174 //!      - RVC::OBJTYPE_Thumbnail
00175 
00176 #ifndef INC_RVC_RASTER_H
00177 #define INC_RVC_RASTER_H
00178 
00179 #ifndef INC_RVC_IMAGE_H
00180    #include <rvc/image.h>
00181 #endif
00182 
00183 #ifndef INC_MI32_ANYRASTV_H
00184    #include <mi32/anyrastv.h>
00185 #endif
00186 
00187 #ifndef INC_MI32_SIMPLEAR_H
00188    #include <mi32/simplear.h>
00189 #endif
00190 
00191 #ifndef GENERATING_DOXYGEN_OUTPUT
00192 struct RVCRASTINFO;        // Forward declarations
00193 struct SMLCONTEXT;
00194 #endif // GENERATING_DOXYGEN_OUTPUT
00195 
00196 namespace RVC {
00197 
00198 #ifndef GENERATING_DOXYGEN_OUTPUT
00199 class RASTERHANDLE;
00200 struct RASTERLINKPARMS;
00201 struct RASTERLINKDATAGEN;
00202 #endif // GENERATING_DOXYGEN_OUTPUT
00203 
00204 class RASTER : public RVC::IMAGE {
00205    public:
00206 
00207       enum LINKTYPE {               //! Type of external objects that can be linked to
00208          LINKTYPE_NoLink = 0,       //!< Raster is internal
00209          LINKTYPE_TIFF = 2,         //!< Raster is a link to TIFF image
00210          LINKTYPE_Generic = 3,      //!< Raster is a link to a generic raster image
00211          LINKTYPE_MrSID = 4,
00212          LINKTYPE_ECW = 5,
00213          LINKTYPE_JP2 = 6,
00214          LINKTYPE_SocetSetDT = 7,
00215          LINKTYPE_PNG = 8,
00216          LINKTYPE_JPEG = 9
00217          };
00218 
00219       enum COMPONENT {           //! Possible data conversion modes for Read(), ReadColumn() and Write()
00220          COMPONENT_Default = 0,     //!< Select default component
00221          COMPONENT_Red,             //!< Convert RGB to Red
00222          COMPONENT_Green,           //!< Convert RGB to Green
00223          COMPONENT_Blue,            //!< Convert RGB to Blue
00224          COMPONENT_Real,            //!< Convert to Real complex component
00225          COMPONENT_Imaginary,       //!< Convert to Imaginary complex component
00226          COMPONENT_Magnitude,       //!< Convert to Magnitude complex component
00227          COMPONENT_Phase,           //!< Convert to Phase complex component
00228          COMPONENT_Alpha,           //!< Convert to Alpha channel component from RGBA or ARGB
00229          COMPONENT_Cyan,            //!< Convert to Cyan from CMYK or KCMY
00230          COMPONENT_Magenta,         //!< Convert to Magenta from CMYK or KCMY
00231          COMPONENT_Yellow,          //!< Convert to Yellow from CMYK or KCMY
00232          COMPONENT_Black            //!< Convert to Black from CMYK or KCMY
00233          };
00234 
00235       enum USAGE {               //! Raster usage values, used in Make()
00236          USAGE_Default = 0,         //!< Ordinary raster
00237          USAGE_HyspcBand,           //!< HyperSpectral Band raster
00238          USAGE_HyspcClass,          //!< HyperSpectral Class raster
00239          USAGE_HyspcAverage,        //!< HyperSpectral Average raster
00240          USAGE_Pyramid,             //!< Pyramid raster
00241          USAGE_PrinComp,            //!< Principle Components raster
00242          USAGE_NullBand,            //!< Null band raster
00243          USAGE_Opacity              //!< Opacity mask raster
00244          };
00245 
00246       enum COMPTYPE {            //! Raster compression types
00247          COMPTYPE_None = 0,         //!< Set no compression
00248          COMPTYPE_RLE,              //!< Uses RLE compression, valid for 1-bit rasters
00249          COMPTYPE_JPEG,             //!< Uses JPEG compression, valid for 8-bit and 24-bit rasters
00250          COMPTYPE_Huffman,          //!< Uses Huffman compression, used in Hyperspectral images
00251          COMPTYPE_DPCM,             //!< Uses DPCM compression
00252          COMPTYPE_JP2               //!< Uses JP2 compression
00253          };
00254 
00255       #ifndef GENERATING_DOXYGEN_OUTPUT
00256       //! Forward declarations
00257       class GETOBJFILTER_ISSELECTABLE;
00258       class GETOBJFILTER_ISOVERLAPPING;
00259       #endif // GENERATING_DOXYGEN_OUTPUT
00260       
00261       //! Class to implement raster scale values
00262       class IMAGESCALE {
00263          public:
00264 
00265             //! Default constructor
00266             IMAGESCALE (
00267                ) :
00268                m_LineScale(1.0),
00269                m_ColumnScale(1.0),
00270                m_DataScale(1.0),
00271                m_DataOffset(0.0)
00272                {}
00273 
00274             //! Obtain raster column scale
00275             //! @return raster column scale
00276             double GetColumnScale (
00277                ) const {return (m_ColumnScale); }
00278 
00279             //! Obtain raster data offset
00280             //! @return raster data offset
00281             double GetDataOffset (
00282                ) const {return (m_DataOffset);}
00283 
00284             //! Obtain raster data scale
00285             //! @return raster data scale
00286             double GetDataScale (
00287                ) const {return (m_DataScale);}
00288 
00289             //! Obtain raster line scale
00290             //! @return raster line scale
00291             double GetLineScale (
00292                ) const {return (m_LineScale);}
00293 
00294             //! Set raster column scale
00295             void SetColumnScale (
00296                double ColumnScale
00297                ) {
00298                m_ColumnScale = ColumnScale;
00299                if (m_ColumnScale == 0.0) m_ColumnScale = 1.0;
00300                return;
00301                }
00302 
00303             //! Set raster data offset
00304             void SetDataOffset (
00305                double DataOffset
00306                ) {m_DataOffset = DataOffset; }
00307 
00308             //! Set raster data scale
00309             void SetDataScale (
00310                double DataScale
00311                ) {
00312                m_DataScale = DataScale;
00313                if (m_DataScale == 0.0) m_DataScale = 1.0;
00314                return;
00315                }
00316 
00317             //! Set raster line scale
00318             void SetLineScale (
00319                double LineScale
00320                ) {
00321                m_LineScale = LineScale;
00322                if (m_LineScale == 0.0) m_LineScale = 1.0;
00323                return;
00324                }
00325 
00326          private:
00327             #ifndef GENERATING_DOXYGEN_OUTPUT
00328 
00329             double m_LineScale;           //!< Line scale
00330             double m_ColumnScale;         //!< Column scale
00331             double m_DataScale;           //!< Scale factor for cell value
00332             double m_DataOffset;       //!< Offset for cell value
00333             #endif // GENERATING_DOXYGEN_OUTPUT
00334          }; // End of IMAGESCALE nested class.
00335 
00336       #ifndef GENERATING_DOXYGEN_OUTPUT
00337       //! Forward declarations
00338       class LINKPARMS;     
00339       class LINKPARMS_ECW;
00340       class LINKPARMS_GENERIC;
00341       class LINKPARMS_JP2;
00342       class LINKPARMS_JPEG;
00343       class LINKPARMS_MRSID;
00344       class LINKPARMS_PNG;
00345       class LINKPARMS_SOCETSETDT;
00346       class LINKPARMS_TIFF;
00347       #endif // GENERATING_DOXYGEN_OUTPUT
00348       
00349       //! Class to handle values needed to define the characteristics of a raster
00350       class MAKEPARMS {
00351          public:
00352 
00353             //! Constructor, initialize with critical raster creation parameters
00354             MAKEPARMS (
00355                INT32 NumLines,
00356                INT32 NumColumns,
00357                IMAGE::CELLTYPE CellType
00358                ) :
00359                m_NumLines(NumLines),
00360                m_NumColumns(NumColumns),
00361                m_CellType(CellType),
00362                m_TileLines(0), 
00363                m_TileColumns(0), 
00364                m_Usage(USAGE_Default),
00365                m_Inverted(false),
00366                m_PackOrder(PACKORDER_MostSigBit),
00367                m_CompType(COMPTYPE_None),
00368                m_CompQuality(75),
00369                m_UsedBits(0),
00370                m_IsCompressed(false),
00371                m_IsLossyCompressed(false),
00372                m_Fill(false),
00373                m_NoEmbeddedPyramidTiers(false)
00374                { }
00375 
00376             //! Template constructor
00377             MAKEPARMS (
00378                const RASTER& Template,          //!< Raster template to determine NumLines, NumColumns, Usage, and scaling
00379                IMAGE::CELLTYPE CellType = CELLTYPE_Invalid  //!< Optional cell type, default uses type from template
00380                ) :
00381                m_NumLines(Template.GetNumLines()),
00382                m_NumColumns(Template.GetNumColumns()),
00383                m_CellType((CellType!=CELLTYPE_Invalid)?CellType:Template.GetCellType()),
00384                m_TileLines(Template.GetNumTileLines()),
00385                m_TileColumns(Template.GetNumTileColumns()),
00386                m_Usage(Template.GetUsage()),
00387                m_Inverted(false),
00388                m_PackOrder(PACKORDER_MostSigBit),
00389                m_CompType(COMPTYPE_None),
00390                m_CompQuality(75),
00391                m_UsedBits(Template.GetNumUsedBits()),
00392                m_IsCompressed(false),
00393                m_IsLossyCompressed(false),
00394                m_Fill(false),
00395                m_NoEmbeddedPyramidTiers(false)
00396                {
00397                Template.GetImageScale(m_ImageScale);
00398                }
00399 
00400             //! Obtain image cell type.
00401             //! @return RVC::IMAGE::CELLTYPE for the raster.
00402             IMAGE::CELLTYPE GetCellType (
00403                ) const {return (m_CellType);}
00404                
00405             //! Obtain raster compression quality
00406             //! @return Compression quality for the raster.
00407             UINT16 GetCompressionQuality (
00408                ) const {return (m_CompQuality);}
00409 
00410             //! Obtain raster compression type
00411             //! @return RVC::RASTER::COMPTYPE for the raster.
00412             COMPTYPE GetCompressionType (
00413                ) const {return (m_CompType);}
00414 
00415             //! Obtain datatype based on raster creation parameters
00416             //! @return RVC::IMAGE::DATATYPE of the raster
00417             IMAGE::DATATYPE GetDataType (
00418                ) const {return (IMAGE::GetDataTypeFromCellType(m_CellType));}
00419          
00420             //! Obtain default raster tile size based on creation parameters
00421             //! @return default tile size
00422             INT32 GetDftTileSize (
00423                ) const;
00424                
00425             //! Get image scale information (RVC::RASTER::IMAGESCALE)
00426             //! @return IMAGESCALE reference
00427             const IMAGESCALE& GetImageScale (
00428                ) const {return (m_ImageScale);} 
00429 
00430             //! Get initial raster value
00431             bool GetInitialValue (
00432                ANYRASTVALUE& value
00433                ) const {
00434                value = m_InitValue;
00435                return (m_Fill);
00436                }
00437                
00438             //! Obtain number of bits in a raster cell
00439             //! @return number of raster bits
00440             UINT16 GetNumBits (
00441                ) const {return (IMAGE::GetNumBitsFromCellType(m_CellType));}
00442          
00443             //! Obtain number of columns in a raster
00444             //! @return number of raster columns
00445             INT32 GetNumColumns (
00446                ) const {return (m_NumColumns);}
00447          
00448             //! Obtain number of lines in a raster
00449             //! @return number of raster lines
00450             INT32 GetNumLines (
00451                ) const {return (m_NumLines);}
00452 
00453             //! Get the number of used bits.
00454             //! This related to JP2 compression and is dependent on the source raster value range.
00455             //! The number of used bits will be less than or equal to the number of bits in the created raster object.
00456             UINT16 GetNumUsedBits (
00457                ) const { return (m_UsedBits); }
00458                
00459             //! Obtain raster tile size based on creation parameters
00460             void GetTileSize (
00461                INT32& TileLines,       //!< Number of lines in a tile RETURNED
00462                INT32& TileColumns         //!< Number of columns in a tile RETURNED
00463                ) const;
00464 
00465             //! Obtain raster value range 
00466             void GetValueMinMax (
00467                ANYRASTVALUE& min,         //!< Minimum possible raster value
00468                ANYRASTVALUE& max       //!< Maximum possible raster value
00469                ) const;
00470 
00471             //! Is the raster compressed with a lossy compression algorithm?
00472             //! @return true if the raster is compressed with a lossy compression algorithm
00473             bool IsLossyCompressed (
00474                ) const {return (m_IsLossyCompressed);}
00475 
00476             //! Is the compression type valid for the raster cell type
00477             //! @return True if it is, false if not
00478             bool IsValidCompression (
00479                COMPTYPE CompType
00480                ) const;
00481                
00482             //! Set image cell type.
00483             void SetCellType (
00484                CELLTYPE CellType
00485                ) {m_CellType = CellType;}
00486 
00487             //! Set raster compression values
00488             void SetCompression (
00489                COMPTYPE CompType,         //!< Raster compression type
00490                UINT16 CompQuality         //!< Compression quality for lossy compression
00491                );
00492                
00493             //! Set whether to include embedded pyramid tiers if supported.
00494             //! Used in JPEG2000 compressed rasters produce only single resolution level.
00495             //! Default is to include embedded pyramid tiers.
00496             void SetIncludeEmbeddedPyramidTiers (
00497                bool IncludeTiers
00498                ) { m_NoEmbeddedPyramidTiers = !IncludeTiers; }
00499                
00500             //! Set image scale information (RVC::RASTER::IMAGESCALE)
00501             void SetImageScale (
00502                const IMAGESCALE& ImageScale
00503                ) {m_ImageScale = ImageScale; }  
00504 
00505             //! Set initial raster value
00506             void SetInitialValue (
00507                const ANYRASTVALUE& value
00508                ) {
00509                m_InitValue = value;
00510                m_Fill = true;
00511                return;
00512                }
00513 
00514             //! Set raster inversion flag
00515             void SetInverted (
00516                ) {m_Inverted = true;}
00517 
00518             //! Set number of columns in a raster
00519             void SetNumColumns (
00520                INT32 NumColumns
00521                ) {m_NumColumns = NumColumns;}
00522 
00523             //! Set number of lines in a raster
00524             void SetNumLines (
00525                INT32 NumLines
00526                ) {m_NumLines = NumLines;}
00527                
00528             //! Set the number of used bits.
00529             //! This related to JP2 compression and is dependent on the source raster value range.
00530             //! The number of used bits will be less than or equal to the number of bits in the created raster object.
00531             void SetNumUsedBits (
00532                const RASTER& SrcRastObj
00533                );
00534 
00535             //! Set the number of used bits.
00536             //! This related to JP2 compression and is dependent on the source raster value range.
00537             //! The number of used bits will be less than or equal to the number of bits in the created raster object.
00538             void SetNumUsedBits (
00539                UINT16 UsedBits
00540                ) { m_UsedBits = UsedBits; }
00541 
00542             //! Set raster pack order
00543             void SetPackOrder (
00544                PACKORDER PackOrder        //!< New raster pack order
00545                ) {m_PackOrder = PackOrder;}
00546 
00547             //! Set raster tile size, only if you know what you are doing!
00548             void SetTileSize (
00549                INT32 TileLines,
00550                INT32 TileColumns
00551                ) {
00552                m_TileLines = TileLines;
00553                m_TileColumns = TileColumns;
00554                return;
00555                }
00556 
00557             //! Set raster usage parameter, only if you know what you are doing
00558             void SetUsage (
00559                USAGE usage
00560                ) {m_Usage = usage;}
00561 
00562          private:
00563             #ifndef GENERATING_DOXYGEN_OUTPUT
00564 
00565             INT32 m_NumLines;             //!< Number of lines in raster
00566             INT32 m_NumColumns;           //!< Number of columns in raster
00567             CELLTYPE m_CellType;          //!< Image cell type
00568             PACKORDER m_PackOrder;        //!< Raster pack order
00569             USAGE m_Usage;                //!< Raster usage, see enum
00570             INT32 m_TileLines;            //!< Number of lines per tile
00571             INT32 m_TileColumns;          //!< Number of columns per tile
00572             COMPTYPE m_CompType;          //!< Compression type
00573             UINT16 m_CompQuality;         //!< Compression quality, 1-100, 0 == default
00574             UINT16 m_UsedBits;            //!< The number of used bits will be less than or equal to the number of bits in the created raster object.
00575             bool m_Inverted;              //!< Is raster inverted?
00576             bool m_IsCompressed;          //!< Is raster compressed
00577             bool m_IsLossyCompressed;     //!< Is raster lossy compressed
00578             bool m_Fill;
00579             bool m_NoEmbeddedPyramidTiers;
00580             ANYRASTVALUE m_InitValue;     //!< Value to initialize raster with
00581             IMAGESCALE m_ImageScale;
00582 
00583             friend class RASTER;
00584             #endif // GENERATING_DOXYGEN_OUTPUT
00585          }; // End of MAKEPARMS nested class.
00586 
00587       
00588       //! Default constructor.
00589       RASTER (
00590          );
00591 
00592       //! Copy constructor.
00593       RASTER (
00594          const RVC::RASTER& rhs
00595          );
00596 
00597       //! Destructor
00598       virtual ~RASTER (
00599          );
00600 
00601       //! Assignment.
00602       RVC::RASTER& operator= (
00603          const RVC::RASTER& rhs
00604          );
00605 
00606       static ERRVALUE AutoLinkTIFF (
00607          RVC::OBJECT& ParentObj,
00608          const FILEPATH& LinkFile,
00609          RVC::GEOSPATIAL::MAKELINKFLAGS LinkFlags
00610          );
00611          
00612       //! Compute the next pyramid size based on the sizes passed in
00613       //! @return 'True' if the next size is valid, 'false' if not
00614       static bool ComputeNextPyramidSize (
00615          INT32& NumColumns,
00616          INT32& NumLines
00617          );
00618 
00619       //! Copy the raster into the 'DestRaster' object using the sampling rates 'ColumnSample' and 'LineSample'
00620       //! This algorithm averages the cell cluster based on the sample rate for the destination
00621       ERRVALUE CopyAverageTo (
00622          RASTER& DestRaster,
00623          INT32 ColumnSample,
00624          INT32 LineSample,
00625          SIMPLE_ARRAY<COLOR>* ColorMap = 0
00626          );
00627 
00628       //! Copy the raster into the 'DestRaster' object using the sampling rates 'ColumnSample' and 'LineSample'
00629       //! This algorithm selects a cell to copy to the destination raster based on the sample rate
00630       ERRVALUE CopySampledTo (
00631          RASTER& DestRaster,
00632          INT32 ColumnSample,
00633          INT32 LineSample
00634          );
00635 
00636       //! Create an SML context for the given raster class instance
00637       ERRVALUE CreateSMLContext (
00638          SMLCONTEXT **pcontext               //!< SML context allocated and RETURNED
00639          );
00640 
00641       //! Obtain raster cell type.
00642       //! @return RVC::IMAGE::CELLTYPE of the raster
00643       IMAGE::CELLTYPE GetCellType (
00644          ) const {return (m_MakeParms.GetCellType());}
00645 
00646       //! Obtain array of components present for this raster.
00647       ERRVALUE GetComponents (
00648          SIMPLE_ARRAY<COMPONENT>& Components
00649          ) const;
00650 
00651       //! Obtain raster compression type
00652       //! @return RVC::RASTER::COMPTYPE for the raster.
00653       COMPTYPE GetCompressionType (
00654          ) const {return (m_MakeParms.m_CompType);}
00655 
00656       //! Obtain raster datatype based on RVC::IMAGE::DATATYPE enumeration
00657       //! @return RVC::IMAGE::DATATYPE of the raster
00658       IMAGE::DATATYPE GetDataType (
00659          ) const {return (m_MakeParms.GetDataType());}
00660       
00661       //! Obtain raster creation parameters
00662       //! @return const RVC::RASTER::MAKEPARMS
00663       const MAKEPARMS& GetMakeParms (
00664          ) const {return (m_MakeParms);}
00665 
00666       //! Obtain raster scale values (line, column, data scale and data offset)
00667       ERRVALUE GetImageScale (
00668          IMAGESCALE& scale                //!< Class to hold image scale values RETURNED
00669          ) const;
00670 
00671       //! Obtain type of external image the raster object is linked to
00672       //! @return RVC::RASTER::LINKTYPE enumeration value
00673       LINKTYPE GetLinkType (
00674          ) const {return (m_LinkType);}
00675          
00676       //! Obtain raster null value information
00677       ERRVALUE GetNullValue (
00678          NULLVALUE& NullValue             //!< Current NULLVALUE to get from raster
00679          ) const;
00680 
00681       //! Obtain number of bits in a raster cell
00682       //! @return number of bits in a raster cell
00683       UINT16 GetNumBits (
00684          ) const {return (m_MakeParms.GetNumBits());}
00685 
00686       //! Obtain number of columns in a raster tile
00687       //! @return number of columns in the raster tile
00688       INT32 GetNumTileColumns (
00689          ) const {return (m_MakeParms.m_TileColumns);}
00690 
00691       //! Obtain number of lines in a raster tile
00692       //! @return number of lines in the raster tile
00693       INT32 GetNumTileLines (
00694          ) const {return (m_MakeParms.m_TileLines);}
00695 
00696       //! Get the number of used bits.
00697       //! This related to JP2 compression and is dependent on the source raster value range.
00698       //! The number of used bits will be less than or equal to the number of bits in the created raster object.
00699       UINT16 GetNumUsedBits (
00700          ) const { return (m_MakeParms.m_UsedBits); }
00701             
00702       //! Obtain number of tiles in a raster row
00703       //! @return number of row tiles
00704       INT32 GetNumXTiles (
00705          ) const {return (m_XTiles);}
00706 
00707       //! Obtain number of tiles in a raster column
00708       //! @return number of column tiles
00709       INT32 GetNumYTiles (
00710          ) const {return (m_YTiles);}
00711 
00712       //! Obtain raster pack order
00713       //! @return Raster pack order
00714       PACKORDER GetPackOrder (
00715          ) const {return (m_MakeParms.m_PackOrder);}
00716 
00717       //! Return list of available raster pyramid sub-rasters.
00718       //!   The sample rate list will be sorted in ascending order and the array and list are aligned.
00719       ERRVALUE GetPyramidList (
00720          SIMPLE_ARRAY<INT32>& SampleList,    //!< Simple array of available sample rates RETURNED
00721          RVC::OBJITEMLIST& PyramidList       //!< List of pyramid raster ObjItem's RETURNED
00722          );
00723          
00724       //! Obtain number of bytes in a raster tile
00725       //! @return size of raster tile in bytes
00726       INT32 GetTileSizeBytes (
00727          ) const {return (m_TileSize);}
00728 
00729       //! Obtain purpose of raster image
00730       //! @return RVC::RASTER::USAGE enumeration value
00731       USAGE GetUsage (
00732          ) const {return (m_MakeParms.m_Usage);}
00733 
00734       //! Determine if null value exists for raster.
00735       bool HasNullValue (
00736          ) const;
00737          
00738       //! Is the raster compressed?
00739       //! @return true if the raster is compressed
00740       bool IsCompressed (
00741          ) const {return (m_MakeParms.m_IsCompressed);}
00742 
00743       //! Is the raster compressed with a lossy compression algorithm?
00744       //! @return true if the raster is compressed with a lossy compression algorithm
00745       bool IsLossyCompressed (
00746          ) const {return (m_MakeParms.m_IsLossyCompressed);}
00747 
00748       //! Is the raster flipped around such that the first raster line is at the bottom of the image
00749       //! @return true if the raster is inverted
00750       bool IsInverted (
00751          ) const {return (m_MakeParms.m_Inverted);}
00752 
00753       //! Create a raster object and establish a link to an external image
00754       ERRVALUE Link (
00755          const RVC::OBJECT& parent,             //!< Parent object to create raster under
00756          const RVC::OBJECTNAME& name,           //!< Name of raster object
00757          const RVC::OBJECTDESC& desc,           //!< Raster object description
00758          const LINKPARMS& LinkParms,
00759          const char* Source = 0                 //!< Source of raster creation, default is GetAppName()
00760          );
00761 
00762       //! Create a raster object
00763       ERRVALUE Make (
00764          const RVC::OBJECT& parent,             //!< Parent object to create raster under
00765          const RVC::OBJECTNAME& name,           //!< Name of raster object
00766          const RVC::OBJECTDESC& desc,           //!< Raster object description
00767          MAKEPARMS& MakeParms,                  //!< Parameters needed to create raster, cannot be changed after creation
00768          const char* Source = 0                 //!< Source of raster creation, default is GetAppName()
00769          );
00770 
00771       //! Create a raster object
00772       ERRVALUE Make (
00773          const RVC::OBJITEM& ObjItem,
00774          MAKEPARMS& MakeParms,                  //!< Parameters needed to create raster, cannot be changed after creation
00775          const char* Source = 0                 //!< Source of raster creation, default is GetAppName()
00776          );
00777 
00778       //! Create pyramid set under this raster object
00779       //! It will not write over valid pyramids unless PYRAMID_Rebuild is specified
00780       ERRVALUE MakePyramidSet (
00781          IMAGE::PYRAMID flags = IMAGE::PYRAMID_None
00782          );
00783 
00784       //! Read a line of raster cells up to a certain length
00785       ERRVALUE Read (
00786          INT32 Line,                               //!< Raster line to read
00787          INT32 StartColumn,                        //!< Raster column to start reading on
00788          void *data,                               //!< Buffer to read into
00789          INT32 Length = 1,                         //!< Number of columns to read
00790          CONVMODE Convert = CONVMODE_None,         //!< Data conversion mode
00791          COMPONENT Component = COMPONENT_Default   //!< Component extraction value
00792          ) const;
00793 
00794       //! Read a line of raster cells up to a certain length, converting to signed 8 bit
00795       ERRVALUE Read (
00796          INT32 Line,                               //!< Raster line to read
00797          INT32 StartColumn,                        //!< Raster column to start reading on
00798          INT8 *data,                               //!< Buffer to read into
00799          INT32 Length = 1,                         //!< Number of columns to read
00800          COMPONENT Component = COMPONENT_Default   //!< Component extraction value
00801          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_INT8, Component)); }
00802 
00803       //! Read a line of raster cells up to a certain length, converting to unsigned 8 bit
00804       ERRVALUE Read (
00805          INT32 Line,                         //!< Raster line to read
00806          INT32 StartColumn,                     //!< Raster column to start reading on
00807          UINT8 *data,                        //!< Buffer to read into
00808          INT32 Length = 1,                   //!< Number of columns to read
00809          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00810          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_INT8, Component)); }
00811 
00812       //! Read a line of raster cells up to a certain length, converting to signed 16 bit
00813       ERRVALUE Read (
00814          INT32 Line,                         //!< Raster line to read
00815          INT32 StartColumn,                     //!< Raster column to start reading on
00816          INT16 *data,                        //!< Buffer to read into
00817          INT32 Length = 1,                   //!< Number of columns to read
00818          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00819          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_INT16, Component)); }
00820 
00821       //! Read a line of raster cells up to a certain length, converting to unsigned 16 bit
00822       ERRVALUE Read (
00823          INT32 Line,                         //!< Raster line to read
00824          INT32 StartColumn,                     //!< Raster column to start reading on
00825          UINT16 *data,                       //!< Buffer to read into
00826          INT32 Length = 1,                   //!< Number of columns to read
00827          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00828          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_INT16, Component)); }
00829 
00830       //! Read a line of raster cells up to a certain length, converting to signed 32 bit
00831       ERRVALUE Read (
00832          INT32 Line,                         //!< Raster line to read
00833          INT32 StartColumn,                     //!< Raster column to start reading on
00834          INT32 *data,                        //!< Buffer to read into
00835          INT32 Length = 1,                   //!< Number of columns to read
00836          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00837          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_INT32, Component)); }
00838 
00839       //! Read a line of raster cells up to a certain length, converting to unsigned 32 bit
00840       ERRVALUE Read (
00841          INT32 Line,                         //!< Raster line to read
00842          INT32 StartColumn,                     //!< Raster column to start reading on
00843          UINT32 *data,                       //!< Buffer to read into
00844          INT32 Length = 1,                   //!< Number of columns to read
00845          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00846          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_INT32, Component)); }
00847 
00848       //! Read a line of raster cells up to a certain length, converting to 32 bit float
00849       ERRVALUE Read (
00850          INT32 Line,                         //!< Raster line to read
00851          INT32 StartColumn,                     //!< Raster column to start reading on
00852          float *data,                        //!< Buffer to read into
00853          INT32 Length = 1,                   //!< Number of columns to read
00854          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00855          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_Float, Component)); }
00856 
00857       //! Read a line of raster cells up to a certain length, converting to 64 bit double
00858       ERRVALUE Read (
00859          INT32 Line,                         //!< Raster line to read
00860          INT32 StartColumn,                     //!< Raster column to start reading on
00861          double *data,                       //!< Buffer to read into
00862          INT32 Length = 1,                   //!< Number of columns to read
00863          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00864          ) const { return (Read(Line, StartColumn, data, Length, CONVMODE_Double, Component)); }
00865 
00866       //! Read a column of raster cells up to a certain length
00867       ERRVALUE ReadColumn (
00868          INT32 Line,                         //!< Raster line to start reading on
00869          INT32 StartColumn,                     //!< Raster column to read
00870          void *data,                         //!< Buffer to read into
00871          INT32 Length = 1,                   //!< Number of lines to read
00872          CONVMODE Convert = CONVMODE_None,         //!< Data conversion mode
00873          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00874          ) const;
00875 
00876       //! Read a column of raster cells up to a certain length, converting to signed 8 bit
00877       ERRVALUE ReadColumn (
00878          INT32 Line,                         //!< Raster line to start reading on
00879          INT32 StartColumn,                     //!< Raster column to read
00880          INT8 *data,                         //!< Buffer to read into
00881          INT32 Length = 1,                   //!< Number of lines to read
00882          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00883          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_INT8, Component)); }
00884 
00885       //! Read a column of raster cells up to a certain length, converting to unsigned 8 bit
00886       ERRVALUE ReadColumn (
00887          INT32 Line,                         //!< Raster line to start reading on
00888          INT32 StartColumn,                     //!< Raster column to read
00889          UINT8 *data,                        //!< Buffer to read into
00890          INT32 Length = 1,                   //!< Number of lines to read
00891          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00892          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_INT8, Component)); }
00893 
00894       //! Read a column of raster cells up to a certain length, converting to signed 16 bit
00895       ERRVALUE ReadColumn (
00896          INT32 Line,                         //!< Raster line to start reading on
00897          INT32 StartColumn,                     //!< Raster column to read
00898          INT16 *data,                        //!< Buffer to read into
00899          INT32 Length = 1,                   //!< Number of lines to read
00900          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00901          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_INT16, Component)); }
00902 
00903       //! Read a column of raster cells up to a certain length, converting to unsigned 16 bit
00904       ERRVALUE ReadColumn (
00905          INT32 Line,                         //!< Raster line to start reading on
00906          INT32 StartColumn,                     //!< Raster column to read
00907          UINT16 *data,                       //!< Buffer to read into
00908          INT32 Length = 1,                   //!< Number of lines to read
00909          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00910          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_INT16, Component)); }
00911 
00912       //! Read a column of raster cells up to a certain length, converting to signed 32 bit
00913       ERRVALUE ReadColumn (
00914          INT32 Line,                         //!< Raster line to start reading on
00915          INT32 StartColumn,                     //!< Raster column to read
00916          INT32 *data,                        //!< Buffer to read into
00917          INT32 Length = 1,                   //!< Number of lines to read
00918          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00919          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_INT32, Component)); }
00920 
00921       //! Read a column of raster cells up to a certain length, converting to unsigned 32 bit
00922       ERRVALUE ReadColumn (
00923          INT32 Line,                         //!< Raster line to start reading on
00924          INT32 StartColumn,                     //!< Raster column to read
00925          UINT32 *data,                       //!< Buffer to read into
00926          INT32 Length = 1,                   //!< Number of lines to read
00927          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00928          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_INT32, Component)); }
00929 
00930       //! Read a column of raster cells up to a certain length, converting to 32 bit float
00931       ERRVALUE ReadColumn (
00932          INT32 Line,                         //!< Raster line to start reading on
00933          INT32 StartColumn,                     //!< Raster column to read
00934          float *data,                        //!< Buffer to read into
00935          INT32 Length = 1,                   //!< Number of lines to read
00936          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00937          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_Float, Component)); }
00938 
00939       //! Read a column of raster cells up to a certain length, converting to 64 bit double
00940       ERRVALUE ReadColumn (
00941          INT32 Line,                         //!< Raster line to start reading on
00942          INT32 StartColumn,                     //!< Raster column to read
00943          double *data,                       //!< Buffer to read into
00944          INT32 Length = 1,                   //!< Number of lines to read
00945          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00946          ) const { return (ReadColumn(Line, StartColumn, data, Length, CONVMODE_Double, Component)); }
00947 
00948       //! Set the raster scale value parameters
00949       ERRVALUE SetImageScale (
00950          const IMAGESCALE& scale                //!< Scale values to set in raster
00951          );
00952 
00953       //! Set the raster null value parameters
00954       ERRVALUE SetNullValue (
00955          const NULLVALUE& NullValue,               //!< Null value to set in raster
00956          bool NullUsed = true                      //!< Whether null value is used or not
00957          );
00958 
00959       //! Write a line of raster cells up to a certain length
00960       ERRVALUE Write (
00961          INT32 Line,                               //!< Raster line to write
00962          INT32 StartColumn,                        //!< Raster column to start writing on
00963          void *data,                               //!< Buffer to write from
00964          INT32 Length = 1,                         //!< Number of columns to write
00965          CONVMODE Convert = CONVMODE_None,         //!< Data conversion mode
00966          COMPONENT Component = COMPONENT_Default   //!< Component extraction value
00967          );
00968 
00969       //! Write a line of raster cells up to a certain length, converting from signed 8 bit
00970       ERRVALUE Write (
00971          INT32 Line,                         //!< Raster line to write
00972          INT32 StartColumn,                     //!< Raster column to start writing on
00973          INT8 *data,                         //!< Buffer to write from
00974          INT32 Length = 1,                   //!< Number of columns to write
00975          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00976          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_INT8, Component)); }
00977 
00978       //! Write a line of raster cells up to a certain length, converting from unsigned 8 bit
00979       ERRVALUE Write (
00980          INT32 Line,                         //!< Raster line to write
00981          INT32 StartColumn,                     //!< Raster column to start writing on
00982          UINT8 *data,                        //!< Buffer to write from
00983          INT32 Length = 1,                   //!< Number of columns to write
00984          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00985          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_INT8, Component)); }
00986 
00987       //! Write a line of raster cells up to a certain length, converting from signed 16 bit
00988       ERRVALUE Write (
00989          INT32 Line,                         //!< Raster line to write
00990          INT32 StartColumn,                     //!< Raster column to start writing on
00991          INT16 *data,                        //!< Buffer to write from
00992          INT32 Length = 1,                   //!< Number of columns to write
00993          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
00994          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_INT16, Component)); }
00995 
00996       //! Write a line of raster cells up to a certain length, converting from unsigned 16 bit
00997       ERRVALUE Write (
00998          INT32 Line,                         //!< Raster line to write
00999          INT32 StartColumn,                     //!< Raster column to start writing on
01000          UINT16 *data,                       //!< Buffer to write from
01001          INT32 Length = 1,                   //!< Number of columns to write
01002          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
01003          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_INT16, Component)); }
01004 
01005       //! Write a line of raster cells up to a certain length, converting from signed 32 bit
01006       ERRVALUE Write (
01007          INT32 Line,                         //!< Raster line to write
01008          INT32 StartColumn,                     //!< Raster column to start writing on
01009          INT32 *data,                        //!< Buffer to write from
01010          INT32 Length = 1,                   //!< Number of columns to write
01011          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
01012          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_INT32, Component)); }
01013 
01014       //! Write a line of raster cells up to a certain length, converting from unsigned 32 bit
01015       ERRVALUE Write (
01016          INT32 Line,                         //!< Raster line to write
01017          INT32 StartColumn,                     //!< Raster column to start writing on
01018          UINT32 *data,                       //!< Buffer to write from
01019          INT32 Length = 1,                   //!< Number of columns to write
01020          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
01021          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_INT32, Component)); }
01022 
01023       //! Write a line of raster cells up to a certain length, converting from 32 bit float
01024       ERRVALUE Write (
01025          INT32 Line,                         //!< Raster line to write
01026          INT32 StartColumn,                     //!< Raster column to start writing on
01027          float *data,                        //!< Buffer to write from
01028          INT32 Length = 1,                   //!< Number of columns to write
01029          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
01030          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_Float, Component)); }
01031 
01032       //! Write a line of raster cells up to a certain length, converting from 64 bit double
01033       ERRVALUE Write (
01034          INT32 Line,                         //!< Raster line to write
01035          INT32 StartColumn,                     //!< Raster column to start writing on
01036          double *data,                       //!< Buffer to write from
01037          INT32 Length = 1,                   //!< Number of columns to write
01038          COMPONENT Component = COMPONENT_Default      //!< Component extraction value
01039          ) { return (Write(Line, StartColumn, data, Length, CONVMODE_Double, Component)); }
01040 
01041    private:
01042       #ifndef GENERATING_DOXYGEN_OUTPUT
01043 
01044       //! Implementation of RVC::OBJECT virtual methods
01045       virtual ERRVALUE v_CloseObject ();
01046       virtual RVC::OBJTYPE v_GetDftObjectType () const;
01047       virtual bool v_IsObjectOpen () const;
01048       virtual ERRVALUE v_OpenObject (OPENMODE OpenFlags, MDLGPARENT parent = 0);
01049 
01050       //! Implementation of RVC::GEOSPATIAL virtual methods
01051       virtual void v_GetExtents (DRECT3D &extents) const;
01052       virtual void v_GetScale (double& xscale, double& yscale) const;
01053       virtual double v_GetZScale () const;
01054       virtual double v_GetZOffset () const;
01055       virtual bool v_HasCapability (int Capability) const;
01056       virtual void v_SetScale (double xscale, double yscale);
01057       virtual void v_SetZOffset (double zoffset);
01058       virtual void v_SetZScale (double zscale);
01059 
01060       //! Implementation of RVC::IMAGE virtual methods
01061       virtual ERRVALUE v_GetBandParms (INT32 BandNum, BANDPARMS& BandParms) const;
01062       virtual double v_GetColumnScale () const;
01063       virtual double v_GetLineScale () const;
01064       virtual ERRVALUE v_GetNullValue (INT32 BandNum, NULLVALUE& NullValue) const;
01065       virtual INT32 v_GetNumBands () const;
01066       virtual INT32 v_GetNumColumns () const { return (m_MakeParms.GetNumColumns()); }
01067       virtual INT32 v_GetNumLines () const { return (m_MakeParms.GetNumLines()); }
01068       virtual bool v_HasNullValue (INT32 BandNum) const;
01069       virtual ERRVALUE v_ReadBand (INT32 Band, INT32 Line, INT32 StartColumn, void *data, INT32 Length, CONVMODE Convert) const;
01070       virtual ERRVALUE v_ReadColumnBand (INT32 Band, INT32 Line, INT32 StartColumn, void *data, INT32 Length, CONVMODE Convert) const;
01071       virtual ERRVALUE v_SetCacheSize (INT32 NumTiles);
01072       virtual ERRVALUE v_SetCacheSize (CACHEMODE CacheFlags);
01073       virtual ERRVALUE v_SetNullValue (INT32 BandNum, const NULLVALUE* NullValue);
01074       virtual ERRVALUE v_WriteBand (INT32 Band, INT32 Line, INT32 StartColumn, void *data, INT32 Length, CONVMODE Convert);
01075 
01076       void AssignValues (const RVCRASTINFO& rinfo);
01077       int ComputeNumPyramidLevels (PYRAMID flags);
01078       PYRAMID ValidatePyramidFlags (PYRAMID flags) const;
01079 
01080       //! Open raster handle, might change later
01081       RASTERHANDLE* m_RasterHandle;
01082 
01083       //! Unchangeable values, safe from multi-threading
01084       MAKEPARMS m_MakeParms;        //!< Raster creation parameters
01085       LINKTYPE m_LinkType;       //!< Raster Link Type, see enum
01086       INT32 m_XTiles;               //!< Number of XTiles in a raster
01087       INT32 m_YTiles;               //!< Number of YTiles in a raster
01088       INT32 m_TileSize;          //!< Size of raster tile in bytes
01089 
01090       friend class MAKEPARMS;
01091       #endif // GENERATING_DOXYGEN_OUTPUT
01092    };
01093 
01094 //! Convenience filter for raster selection.
01095 //! This class provides for allowed and/or denied cell types to be specified during
01096 //! construction, as well as whether all rasters in a multiple selection are
01097 //! required to have the same dimensions.  Appropriate message IDs are set
01098 //! based on the specified cell types.
01099 class RASTER::GETOBJFILTER_ISSELECTABLE : public GETOBJFILTER {
01100    public:
01101    
01102       //! Constructor specifying allowed or denied cell types.
01103       GETOBJFILTER_ISSELECTABLE (
01104          RVC::IMAGE::CELLTYPE CellTypes,
01105          bool DenyTypes = false,
01106          bool NeedSameSize = false
01107          );
01108 
01109       virtual ~GETOBJFILTER_ISSELECTABLE () {}
01110    private:
01111       #ifndef GENERATING_DOXYGEN_OUTPUT
01112       IMAGE::CELLTYPE m_CellTypes;
01113       bool m_NeedSameSize;
01114    
01115       virtual bool v_IsSelectable (const RVC::OBJITEM& objitem, int position = -1);
01116       virtual bool v_IsValidList (const RVC::OBJITEMLIST& objlist);
01117       #endif // GENERATING_DOXYGEN_OUTPUT
01118    };
01119 
01120 
01121 //! Convenience filter for raster selection.
01122 //! This class combines the RVC::RASTER::GETOBJFILTER_ISSELECTABLE and
01123 //! RVC::GEOSPATIAL::GETOBJFILTER_ISOVERLAPPING filters
01124 class RASTER::GETOBJFILTER_ISOVERLAPPING : public GETOBJFILTER {
01125    public:
01126    
01127       //! Constructor specifying allowed or denied cell types.
01128       GETOBJFILTER_ISOVERLAPPING (
01129          const RVC::OBJITEM& SrcObjItem,
01130          RVC::IMAGE::CELLTYPE CellTypes,
01131          bool DenyTypes = false,
01132          bool NeedSameSize = false
01133          );
01134 
01135       virtual ~GETOBJFILTER_ISOVERLAPPING () {}
01136    private:
01137       #ifndef GENERATING_DOXYGEN_OUTPUT
01138       RASTER::GETOBJFILTER_ISSELECTABLE m_IsSelectable;
01139       GEOSPATIAL::GETOBJFILTER_ISOVERLAPPING m_IsOverlapping;
01140    
01141       virtual bool v_IsSelectable (const RVC::OBJITEM& objitem, int position = -1);
01142       virtual bool v_IsValidList (const RVC::OBJITEMLIST& objlist);
01143       #endif // GENERATING_DOXYGEN_OUTPUT
01144    };
01145 
01146 
01147 //! Parmeters needed to link to external rasters      
01148 class RASTER::LINKPARMS {
01149    protected:
01150    
01151       //! Constructor
01152       LINKPARMS (
01153          const FILEPATH& filename,           //!< File to link to
01154          RASTER::LINKTYPE LinkType,