00001
00072 #ifndef INC_SPATMOD_IMAGEBASE_H
00073 #define INC_SPATMOD_IMAGEBASE_H
00074
00075 #ifndef INC_SPATMOD_IMAGEDIMENSIONS_H
00076 #include <spatmod/imagedimensions.h>
00077 #endif
00078
00079 #ifndef INC_SPATMOD_IMAGEPIXEL_H
00080 #include <spatmod/imagepixel.h>
00081 #endif
00082
00083 #ifndef INC_MI32_SIMPLEAR_H
00084 #include <mi32/simplear.h>
00085 #endif
00086
00087 #ifndef INC_MI32_MILOG_H
00088 #include <mi32/milog.h>
00089 #endif
00090
00091 class REGION2D;
00092
00093 namespace SPATMOD {
00094 namespace IMAGE {
00095
00096 class PIXELTABLE;
00097 class SECTION_ITERATOR;
00098
00099
00100
00103 class BASE {
00104 public:
00105
00107 enum CAPABILITY {
00108 CAPABILITY_Pull,
00109 CAPABILITY_Push
00110 };
00111
00113 enum ZOOMABILITY {
00114 ZOOMABILITY_Only1X,
00115 ZOOMABILITY_List,
00116 ZOOMABILITY_Range
00117 };
00118
00120 BASE ();
00121
00123 virtual ~BASE ();
00124
00127 ERRVALUE ComputeGeoreferenceRegion (
00128 REGION2D& region
00129 ) const;
00130
00132 INT32 ComputeTileColumn (
00133 double x,
00134 double zoom = 1
00135 ) const;
00136
00138 INT32 ComputeTileRow (
00139 double y,
00140 double zoom = 1
00141 ) const;
00142
00145 const DIMENSIONS& GetDimensions (
00146 ) const { return (m_Dimensions); }
00147
00150 ERRVALUE GetDimensions (
00151 DIMENSIONS& dimensions,
00152 double zoom
00153 ) const;
00154
00157 const GEOREFERENCE* GetGeoreference (
00158 ) const { return (m_pGeoreference); }
00159
00163 ERRVALUE GetGeoreference (
00164 GEOREFERENCE& georeference,
00165 double zoom
00166 ) const;
00167
00169 const MILOG& GetLog () const
00170 { return (m_Log); }
00171
00173 MILOG& GetLog ()
00174 { return (m_Log); }
00175
00178 INT32 GetNumColumnsOfTiles (
00179 ) const { return (m_Dimensions.GetNumColumnsOfTiles()); }
00180
00186 double GetNumColumnsPerTile (
00187 TILEPOSITION tileposition
00188 ) const { return (m_Dimensions.GetNumColumnsPerTile(tileposition)); }
00189
00192 INT32 GetNumRowsOfTiles (
00193 ) const { return (m_Dimensions.GetNumRowsOfTiles()); }
00194
00200 double GetNumRowsPerTile (
00201 TILEPOSITION tileposition
00202 ) const { return (m_Dimensions.GetNumRowsPerTile(tileposition)); }
00203
00206 UINT16 GetNumSamples (
00207 ) const { return (GetPixelProperties().GetNumSamples()); }
00208
00211 const PIXELTABLE* GetPixelLookupTable (
00212 ) const { return (v_GetPixelLookupTable()); }
00213
00215 const PIXEL& GetPixelProperties (
00216 ) const { return (m_PixelProperties); }
00217
00219 RANGETYPE GetPixelRangeType (
00220 ) const { return (m_PixelRangeType); }
00221
00224 PIXEL::TYPE GetPixelType (
00225 ) const { return (GetPixelProperties().GetPixelType()); }
00226
00229 const PIXEL& GetPixelValueMax (
00230 ) const { return (m_PixelValueMax); }
00231
00234 const PIXEL& GetPixelValueMin (
00235 ) const { return (m_PixelValueMin); }
00236
00239 UINT32 GetTotalColumns (
00240 ) const { return (m_Dimensions.GetTotalColumns()); }
00241
00244 UINT32 GetTotalRows (
00245 ) const { return (m_Dimensions.GetTotalRows()); }
00246
00248 const char* GetTypeName () const
00249 { return (v_GetTypeName()); }
00250
00258 ZOOMABILITY GetZoomAbility (
00259 SIMPLE_ARRAY<double>& ZoomsAllowed
00260 ) const { return (v_GetZoomAbility(ZoomsAllowed)); }
00261
00263 ERRVALUE LogCreate (
00264 const char *label = 0,
00265 bool OnlyEnds = false,
00266 MILOG::MODE mode = MILOG::MODE_OwnFile
00267 );
00268
00270 bool QueryCapability (
00271 CAPABILITY capability
00272 ) const { return (v_QueryCapability(capability)); }
00273
00276 float QueryIterator (
00277 const SECTION_ITERATOR& iterator
00278 ) const;
00279
00281 bool QueryZoom (
00282 double zoom
00283 ) const;
00284
00288 void SetGeoreference (
00289 const GEOREFERENCE *pGeoreference
00290 );
00291
00292 protected:
00293
00294 PIXELTABLE *m_pPixelLookupTable;
00295
00298 void AttachPixelLookupTable (
00299 PIXELTABLE& PixelTable
00300 );
00301
00304 void SetAllDimensions (
00305 const BASE& image
00306 );
00307
00311 void SetAllProperties (
00312 const BASE& image
00313 );
00314
00316 void SetDimensions (
00317 const DIMENSIONS& Dimensions
00318 );
00319
00323 void SetPixelLookupTable (
00324 const PIXELTABLE *pPixelTable
00325 );
00326
00329 void SetPixelProperties (
00330 const PIXEL& PixelProperties
00331 );
00332
00334 void SetPixelProperties (
00335 const BASE& image
00336 );
00337
00339 ERRVALUE SetPixelRange (
00340 const PIXEL& PixelValueMin,
00341 const PIXEL& PixelValueMax,
00342 RANGETYPE RangeType
00343 );
00344
00347 void SetPixelRangeDefault (
00348 );
00349
00351 ERRVALUE SetTileDimensions (
00352 double ColumnsPerTile,
00353 double RowsPerTile,
00354 double ColumnsPerTileFirst = 0,
00355 double RowsPerTileFirst = 0,
00356 double ColumnsPerTileLast = 0,
00357 double RowsPerTileLast = 0
00358 );
00359
00362 ERRVALUE SetTotalDimensions (
00363 UINT32 TotalColumns,
00364 UINT32 TotalRows
00365 );
00366
00367
00368
00371 virtual ERRVALUE v_GetGeoreference (
00372 GEOREFERENCE& georeference,
00373 double zoom
00374 ) const;
00375
00378 virtual const PIXELTABLE* v_GetPixelLookupTable (
00379 ) const;
00380
00382 virtual bool v_QueryCapability (
00383 CAPABILITY capability
00384 ) const;
00385
00390 virtual float v_QueryIterator (
00391 const SECTION_ITERATOR& iterator
00392 ) const;
00393
00394 private:
00395 #ifndef GENERATING_DOXYGEN_OUTPUT
00396
00397 DIMENSIONS m_Dimensions;
00398 PIXEL m_PixelProperties;
00399 PIXEL m_PixelValueMin;
00400 PIXEL m_PixelValueMax;
00401 RANGETYPE m_PixelRangeType;
00402 GEOREFERENCE *m_pGeoreference;
00403 MILOG m_Log;
00404
00405 #endif // GENERATING_DOXYGEN_OUTPUT
00406
00407
00408
00411 virtual ERRVALUE v_GetDimensions (
00412 DIMENSIONS& dimensions,
00413 double zoom
00414 ) const;
00415
00418 virtual const char* v_GetTypeName () const;
00419
00422 virtual ZOOMABILITY v_GetZoomAbility (
00423 SIMPLE_ARRAY<double>& ZoomsAllowed
00424 ) const;
00425
00427 virtual ERRVALUE v_LogCreate (
00428 const char *label,
00429 bool OnlyEnds,
00430 MILOG::MODE mode
00431 ) = 0;
00432
00433
00434 };
00435
00436
00437
00438 }
00439 }
00440
00441 #endif // INC_SPATMOD_IMAGEBASE_H