OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimGpkgReader.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // File: ossimGpkgReader.h
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 // Description: OSSIM GeoPackage reader (tile source).
10 //
11 //----------------------------------------------------------------------------
12 // $Id$
13 #ifndef ossimGpkgReader_HEADER
14 #define ossimGpkgReader_HEADER 1
15 
17 #include <ossim/base/ossimRefPtr.h>
18 #include "ossimGpkgTileEntry.h"
20 
21 #include <vector>
22 
24 class ossimImageData;
25 struct sqlite3;
26 
28 {
29 public:
30 
33 
35  virtual ~ossimGpkgReader();
36 
38  virtual ossimString getShortName() const;
39 
41  virtual ossimString getLongName() const;
42 
44  virtual ossimString getClassName() const;
45 
52  ossim_uint32 resLevel=0);
65  virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
66 
71  virtual ossim_uint32 getNumberOfInputBands() const;
72 
78  virtual ossim_uint32 getNumberOfOutputBands()const;
79 
84  virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
85 
90  virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
91 
96  virtual ossimIrect getImageRectangle(ossim_uint32 resLevel = 0) const;
97 
102  virtual bool saveState(ossimKeywordlist& kwl,
103  const char* prefix=0)const;
104 
109  virtual bool loadState(const ossimKeywordlist& kwl,
110  const char* prefix=0);
111 
121  virtual void setProperty(ossimRefPtr<ossimProperty> property);
122 
127  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
128 
133  virtual void getPropertyNames(std::vector<ossimString>& propertyNames) const;
134 
138  virtual ossimScalarType getOutputScalarType() const;
139 
143  virtual ossim_uint32 getTileWidth() const;
144 
148  virtual ossim_uint32 getTileHeight() const;
149 
156  virtual ossim_uint32 getImageTileWidth() const;
157 
164  virtual ossim_uint32 getImageTileHeight() const;
165 
166  bool isOpen()const;
167 
169  virtual void close();
170 
172  virtual ossim_uint32 getNumberOfEntries() const;
173 
175  virtual ossim_uint32 getCurrentEntry()const;
176 
181  virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
182 
191  virtual void getEntryNames(std::vector<ossimString>& entryNames) const;
192 
201  virtual bool setCurrentEntry(ossim_uint32 entryIdx);
202 
213 
220 
225 
226 protected:
227 
232  virtual bool open();
233 
234 private:
235 
236  bool initImageParams();
237 
239  void allocate();
240 
245  void fillTile( ossim_uint32 resLevel,
246  const ossimIrect& tileRect,
247  const ossimIrect& clipRect,
248  ossimImageData* tile );
249 
251  ossimIpt index );
252 
259  const ossimIpt& tileSize );
260 
261  void getTileIndexes( ossim_uint32 resLevel,
262  const ossimIrect& clipRect,
263  std::vector<ossimIpt>& tileIndexes ) const;
264 
265  void getTileSize( ossim_uint32 resLevel, ossimIpt& tileSize ) const;
266 
269 
270  void computeGsd( ossimDpt& gsd) const;
271 
273 
276  // std::ifstream m_str;
277  sqlite3* m_db;
283 
284  std::vector<ossimGpkgTileEntry> m_entries;
285 
288 
289 TYPE_DATA
290 };
291 
292 #endif
void getTileIndexes(ossim_uint32 resLevel, const ossimIrect &clipRect, std::vector< ossimIpt > &tileIndexes) const
ossim_uint32 m_tileWidth
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.
ossim_uint32 m_tileHeight
ossimRefPtr< ossimImageHandler > m_ih
ossimRefPtr< ossimImageData > uncompressPngTile(const ossimGpkgTileRecord &tile, const ossimIpt &tileSize)
Uncompresses png tile to m_cacheTile.
virtual ossimString getClassName() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossim_uint32 m_currentEntry
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const
Returns the number of lines in the image.
virtual bool open()
open method.
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Get propterty method.
void allocate()
Allocates m_tile.
void computeGsd(ossimDpt &gsd) const
virtual ossim_uint32 getNumberOfDecimationLevels() const
Returns the number of decimation levels.
virtual ossimString getLongName() const
void fillTile(ossim_uint32 resLevel, const ossimIrect &tileRect, const ossimIrect &clipRect, ossimImageData *tile)
virtual void getEntryNames(std::vector< ossimString > &entryNames) const
Get the list of entry names.
virtual ossim_uint32 getImageTileHeight() const
Returns the tile width of the image or 0 if the image is not tiled.
virtual ossim_uint32 getTileWidth() const
Returns the width of the output tile.
virtual void close()
Close method.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
ossimRefPtr< ossimCodecBase > m_jpegCodec
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossim_uint32 getNumberOfZoomLevels() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab fr...
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
Gets the entry list.
std::vector< ossimGpkgTileEntry > m_entries
ossimRefPtr< ossimImageData > m_tile
virtual ossim_uint32 getCurrentEntry() const
virtual ~ossimGpkgReader()
virtual destructor
virtual ossim_uint32 getTileHeight() const
Returns the height of the output tile.
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in...
virtual ossim_uint32 getNumberOfEntries() const
ossimScalarType
virtual ossimString getShortName() const
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
Get propterty names.
bool isOpen() const
Derived classes must implement this method to be concrete.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry()
ossimRefPtr< ossimImageData > m_cacheTile
ossimRefPtr< ossimCodecBase > m_pngCodec
ossimGpkgReader()
default constructor
void getTileSize(ossim_uint32 resLevel, ossimIpt &tileSize) const
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const
Returns the number of samples in the image.
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.
ossimScalarType m_scalar
virtual void setProperty(ossimRefPtr< ossimProperty > property)
Set propterty method.
ossim_uint32 m_bands