OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpfCacheTileSource.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: See top level LICENSE.txt file.
5 //
6 // Author: Garrett Potts
7 //
8 // Description: This class give the capability to access tiles from the
9 // input frames.
10 //
11 //-----------------------------------------------------------------------
12 //$Id: ossimRpfCacheTileSource.h 1361 2010-08-26 00:24:22Z david.burken $
13 #ifndef ossimRpfCacheTileSource_HEADER
14 #define ossimRpfCacheTileSource_HEADER 1
17 
18 class ossimRpfToc;
19 class ossimRpfTocEntry;
20 class ossimRpfFrame;
21 
23 {
24 public:
25 
32  {
33  OSSIM_PRODUCT_TYPE_UNKNOWN = 0,
34  OSSIM_PRODUCT_TYPE_CIB = 1,
35  OSSIM_PRODUCT_TYPE_CADRG = 2
36  };
37 
44 
52  virtual ossimString getShortName()const;
53 
61  virtual ossimString getLongName()const;
62 
66  virtual void close();
67 
70  virtual bool open();
71 
83  ossim_uint32 resLevel = 0);
84 
97  virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
98 
105  virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
106 
113  virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
114 
121  virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
122 
123 
132  virtual bool saveState(ossimKeywordlist& kwl,
133  const char* prefix=0)const;
134 
161  virtual bool loadState(const ossimKeywordlist& kwl,
162  const char* prefix=0);
163 
196 
207  virtual ossimScalarType getOutputScalarType() const;
208 
216  virtual ossim_uint32 getNumberOfInputBands()const;
217 
225  virtual ossim_uint32 getNumberOfOutputBands()const;
226 
230  virtual ossim_uint32 getTileWidth() const;
231 
235  virtual ossim_uint32 getTileHeight() const;
236 
243  virtual ossim_uint32 getImageTileWidth() const;
244 
251  virtual ossim_uint32 getImageTileHeight() const;
252 
253  virtual bool setCurrentEntry(ossim_uint32 entryIdx);
254 
255  virtual void getEntryList(std::vector<ossim_uint32>& entryList)const;
256 
262  bool isValidRLevel(ossim_uint32 reduced_res_level) const;
263 
269  bool isOpen()const;
270 
272  bool isCib() const;
273 
275  bool isCadrg() const;
276 
282  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
283 
288 
293 
294 
295 protected:
301  virtual ~ossimRpfCacheTileSource();
302 
307  void setActualImageRect();
308 
318  void checkLongitude(ossim_float64& leftLon, const ossim_float64& rightLon) const;
319 
329  {
331  :theRow(-1),
332  theCol(-1),
333  thePixelRow(-1),
334  thePixelCol(-1)
335  {}
337  ossim_int32 col,
338  ossim_int32 pixelRow,
339  ossim_int32 pixelCol,
340  const ossimRpfFrameEntry& entry)
341  :theRow(row),
342  theCol(col),
343  thePixelRow(pixelRow),
344  thePixelCol(pixelCol),
345  theFrameEntry(entry)
346  {}
348  :theRow(rhs.theRow),
349  theCol(rhs.theCol),
350  thePixelRow(rhs.thePixelRow),
351  thePixelCol(rhs.thePixelCol),
352  theFrameEntry(rhs.theFrameEntry)
353  {}
359  };
360 
365  virtual bool setEntryToRender(ossim_uint32 index);
366 
378  vector<ossimFrameEntryData> getIntersectingEntries(const ossimIrect& rect);
379 
390  void fillTile(const ossimIrect& tileRect,
391  const vector<ossimFrameEntryData>& framesInvolved,
392  ossimImageData* tile);
393 
401  void fillSubTileCib(const ossimRpfFrame& aFrame,
402  const ossimIrect& tileRect,
403  const ossimFrameEntryData& frameEntryData,
404  ossimImageData* tile);
405 
413  void fillSubTileCadrg(const ossimRpfFrame& aFrame,
414  const ossimIrect& tileRect,
415  const ossimFrameEntryData& frameEntryData,
416  ossimImageData* tile);
417 
423  void allocateForProduct();
424 
425  void deleteAll();
426 
427  void populateLut();
428 
429  bool buildFrameEntryArray(ossimFilename imageFile);
430  virtual void establishDecimationFactors();
431 
432 
437 
441  unsigned char* m_compressedBuffer;
442 
446  unsigned char* m_uncompressedBuffer;
447 
454 
461 
466 
470  std::vector<ossimString> m_fileNames;
471 
476 
482 
484 
485  // data to use in property retrieval
486 
493 
494  std::vector< std::vector<ossimRpfFrameEntry> > m_frameEntryArray;
495 
496 TYPE_DATA
497 };
498 
499 #endif /* #ifndef ossimRpfCacheTileSource_HEADER */
virtual bool open()=0
Pure virtual open.
std::vector< ossimString > m_fileNames
The size of the input frames.
Protected structure that is only used internally by this class.
ossimIrect m_actualImageRect
This holds the image bounds for the current entry.
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
ossimFrameEntryData(const ossimFrameEntryData &rhs)
virtual ossimString getShortName() const
Definition: ossimObject.cpp:48
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
double ossim_float64
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.
ossimFrameEntryData(ossim_int32 row, ossim_int32 col, ossim_int32 pixelRow, ossim_int32 pixelCol, const ossimRpfFrameEntry &entry)
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
ossimRpfCacheProductType
Basic enumeration.
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
#define TYPE_DATA
Definition: ossimRtti.h:339
virtual ossim_uint32 getImageTileHeight() const =0
Returns the tile width of the image or 0 if the image is not tiled.
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
unsigned int ossim_uint32
unsigned char * m_compressedBuffer
This is for storage of a single compressed buffer.
virtual ossimString getLongName() const
Definition: ossimObject.cpp:53
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
virtual void establishDecimationFactors()
Virtual method determines the decimation factors at each resolution level.
ossimScalarType
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossim_uint32 getImageTileWidth() const =0
Returns the tile width of the image or 0 if the image is not tiled.
ossimIpt m_tileSize
The size of the output tile.
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
unsigned char * m_uncompressedBuffer
This is used as a buffer to uncompress the data to.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual ossim_uint32 getNumberOfInputBands() const =0
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)