OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimCibCadrgTileSource.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 an
9 // CADRG file.
10 //
11 //-----------------------------------------------------------------------
12 //$Id: ossimCibCadrgTileSource.h 17954 2010-08-21 20:39:47Z dburken $
13 #ifndef ossimCibCadrgTileSource_HEADER
14 #define ossimCibCadrgTileSource_HEADER 1
17 
18 class ossimRpfToc;
19 class ossimRpfTocEntry;
20 class ossimRpfFrame;
21 
36 {
37 public:
38  friend class ossimMultiEntryCibCadrg;
39 
46  {
47  OSSIM_PRODUCT_TYPE_UNKNOWN = 0,
48  OSSIM_PRODUCT_TYPE_CIB = 1,
49  OSSIM_PRODUCT_TYPE_CADRG = 2
50  };
51 
58 
66  virtual ossimString getShortName()const;
67 
75  virtual ossimString getLongName()const;
76 
80  virtual void close();
81 
84  virtual bool open();
85 
93  void setSkipEmptyCheck( bool bSkipEmptyCheck = false );
94 
105  virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
106  ossim_uint32 resLevel = 0);
107 
120  virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
121 
128  virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
129 
136  virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
137 
144  virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
145 
146 
188  virtual bool saveState(ossimKeywordlist& kwl,
189  const char* prefix=0)const;
190 
217  virtual bool loadState(const ossimKeywordlist& kwl,
218  const char* prefix=0);
219 
252 
263  virtual ossimScalarType getOutputScalarType() const;
264 
272  virtual ossim_uint32 getNumberOfInputBands()const;
273 
281  virtual ossim_uint32 getNumberOfOutputBands()const;
282 
286  virtual ossim_uint32 getTileWidth() const;
287 
291  virtual ossim_uint32 getTileHeight() const;
292 
299  virtual ossim_uint32 getImageTileWidth() const;
300 
307  virtual ossim_uint32 getImageTileHeight() const;
308 
309  virtual ossim_uint32 getCurrentEntry()const;
310  virtual bool setCurrentEntry(ossim_uint32 entryIdx);
311  virtual void getEntryList(std::vector<ossim_uint32>& entryList)const;
312 
313 
317  virtual ossim_int32 getCurrentEntryIndex()const;
318 
322  virtual const ossimRpfTocEntry* getCurrentTocEntry()const;
323 
327  virtual const ossimRpfToc* getToc()const;
328 
334  bool isValidRLevel(ossim_uint32 reduced_res_level) const;
335 
341  bool isOpen()const;
342 
344  bool isCib() const;
345 
347  bool isCadrg() const;
348 
350  ossimString getProductScale() const;
351 
360  vector<ossimString> getProductScaleList()const;
361 
368  vector<ossim_int32> getProductEntryList(const ossimString& productScale)const;
369 
370  ossimString getSecurityClassification()const;
371 
377  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
378 
383  virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
384 
389 
394 
395 
396 protected:
402  virtual ~ossimCibCadrgTileSource();
403 
404  void updatePropertiesToFirstValidFrame();
405 
412  virtual void setTocEntryToRender(const ossimRpfTocEntry* entry);
413 
423  {
425  :theRow(-1),
426  theCol(-1),
427  thePixelRow(-1),
428  thePixelCol(-1)
429  {}
431  ossim_int32 col,
432  ossim_int32 pixelRow,
433  ossim_int32 pixelCol,
434  const ossimRpfFrameEntry& entry)
435  :theRow(row),
436  theCol(col),
437  thePixelRow(pixelRow),
438  thePixelCol(pixelCol),
439  theFrameEntry(entry)
440  {}
442  :theRow(rhs.theRow),
443  theCol(rhs.theCol),
444  thePixelRow(rhs.thePixelRow),
445  thePixelCol(rhs.thePixelCol),
446  theFrameEntry(rhs.theFrameEntry)
447  {}
453  };
454 
459  virtual bool setEntryToRender(ossim_uint32 index);
460 
472  vector<ossimFrameEntryData> getIntersectingEntries(const ossimIrect& rect);
473 
484  void fillTile(const ossimIrect& tileRect,
485  const vector<ossimFrameEntryData>& framesInvolved,
486  ossimImageData* tile);
487 
495  void fillSubTileCib(const ossimRpfFrame& aFrame,
496  const ossimIrect& tileRect,
497  const ossimFrameEntryData& frameEntryData,
498  ossimImageData* tile);
499 
507  void fillSubTileCadrg(const ossimRpfFrame& aFrame,
508  const ossimIrect& tileRect,
509  const ossimFrameEntryData& frameEntryData,
510  ossimImageData* tile);
511 
517  void allocateForProduct();
518 
527  const ossimRpfTocEntry* findFirstFrame();
528 
529  void deleteAll();
530 
531  void populateLut();
532 
536  unsigned char* theCompressedBuffer;
537 
541  unsigned char* theUncompressedBuffer;
542 
549 
556 
561 
567 
574 
581 
587 
589 
595 
596  // data to use in property retrieval
597 
598 TYPE_DATA
599 };
600 
601 #endif /* #ifndef ossimCibCadrgTileSource_HEADER */
virtual bool open()=0
Pure virtual open.
ossim_uint32 theNumberOfLines
This will be computed based on the frames organized within the directory.
#define OSSIMDLLEXPORT
ossimCibCadrgProductType
Basic enumeration.
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.
ossimRpfToc * theTableOfContents
Will own a table of contents.
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.
unsigned char * theCompressedBuffer
This is for storage of a single compressed buffer.
bool theSkipEmptyCheck
If true during the call to open(), the RPF file is opened even if all the frame files are missing...
Protected structure that is only used internally by this class.
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.
ossimFrameEntryData(ossim_int32 row, ossim_int32 col, ossim_int32 pixelRow, ossim_int32 pixelCol, const ossimRpfFrameEntry &entry)
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
unsigned char * theUncompressedBuffer
This is used as a buffer to uncompress the data to.
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
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.
unsigned int ossim_uint32
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
virtual ossimString getLongName() const
Definition: ossimObject.cpp:53
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual ossim_uint32 getCurrentEntry() const
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
ossimRefPtr< ossimImageData > theTile
This is the actual data returned from a getTile request.
ossimScalarType
CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a c...
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.
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossim_uint32 theNumberOfSamples
This will be computed based on the frames organized within the directory.
ossimFrameEntryData(const ossimFrameEntryData &rhs)
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.
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)