OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimImageCacheBase.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Mingjie Su
6 //
7 // Description: This class give the capability to access tiles from the
8 // input frames.
9 //
10 //-----------------------------------------------------------------------
11 //$Id: ossimImageCacheBase.h 2685 2011-06-07 16:24:41Z david.burken $
12 #ifndef ossimImageCacheBase_HEADER
13 #define ossimImageCacheBase_HEADER 1
16 
17 class ossimRpfToc;
18 class ossimRpfTocEntry;
19 class ossimRpfFrame;
20 
22 {
23 public:
24 
31 
35  virtual void close();
36 
39  virtual bool open() = 0;
40 
47  virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
48 
55  virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
56 
63  virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const ;
64 
65 
74  virtual bool saveState(ossimKeywordlist& kwl,
75  const char* prefix=0)const;
76 
103  virtual bool loadState(const ossimKeywordlist& kwl,
104  const char* prefix=0);
105 
106 
114  virtual ossim_uint32 getNumberOfInputBands()const;
115 
123  virtual ossim_uint32 getNumberOfOutputBands()const;
124 
128  virtual ossim_uint32 getTileWidth() const;
129 
133  virtual ossim_uint32 getTileHeight() const;
134 
141  virtual ossim_uint32 getImageTileWidth() const;
142 
149  virtual ossim_uint32 getImageTileHeight() const;
150 
151  virtual void getEntryList(std::vector<ossim_uint32>& entryList)const;
152 
158  bool isValidRLevel(ossim_uint32 reduced_res_level) const;
159 
165  bool isOpen()const;
166 
199 
200 protected:
206  virtual ~ossimImageCacheBase();
207 
212  void setActualImageRect();
213 
223  void checkLongitude(ossim_float64& leftLon, const ossim_float64& rightLon) const;
224 
234  {
236  :theRow(-1),
237  theCol(-1),
238  thePixelRow(-1),
239  thePixelCol(-1)
240  {}
242  ossim_int32 col,
243  ossim_int32 pixelRow,
244  ossim_int32 pixelCol,
245  const ossimRpfFrameEntry& entry)
246  :theRow(row),
247  theCol(col),
248  thePixelRow(pixelRow),
249  thePixelCol(pixelCol),
250  theFrameEntry(entry)
251  {}
253  :theRow(rhs.theRow),
254  theCol(rhs.theCol),
255  thePixelRow(rhs.thePixelRow),
256  thePixelCol(rhs.thePixelCol),
257  theFrameEntry(rhs.theFrameEntry)
258  {}
264  };
265 
266 
278  vector<ossimFrameEntryData> getIntersectingEntries(const ossimIrect& rect);
279 
280  void deleteAll();
281 
282  bool buildFrameEntryArray(ossimFilename imageFile, ossim_uint32 frameWidth, ossim_uint32 frameHeight);
283  virtual void establishDecimationFactors();
284 
289 
296 
303 
308 
312  std::vector<ossimString> m_fileNames;
313 
318 
320 
321  // data to use in property retrieval
322 
331 
332  std::vector< std::vector<ossimRpfFrameEntry> > m_frameEntryArray;
333 
334 TYPE_DATA
335 };
336 
337 #endif /* #ifndef ossimImageCacheBase_HEADER */
virtual bool open()=0
Pure virtual open.
ossimFrameEntryData(const ossimFrameEntryData &rhs)
ossim_uint32 m_numberOfBands
This is the actual data returned from a getTile request.
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
ossimFrameEntryData(ossim_int32 row, ossim_int32 col, ossim_int32 pixelRow, ossim_int32 pixelCol, const ossimRpfFrameEntry &entry)
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
ossimIrect m_actualImageRect
This holds the image bounds for the current entry.
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.
Protected structure that is only used internally by this class.
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
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
ossimRpfFrame * m_workFrame
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
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.
ossim_uint32 m_numOfFramesHorizontal
unsigned int ossim_uint32
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.
ossimIpt m_tileSize
The size of the output tile.
virtual ossim_uint32 getImageTileWidth() const =0
Returns the tile width of the image or 0 if the image is not tiled.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
std::vector< ossimString > m_fileNames
The size of the input frames.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossim_uint32 m_numOfFramesVertical
virtual ossim_uint32 getNumberOfInputBands() const =0
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
int ossim_int32