OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimKakaduJp2Reader.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Description: Class declaration for JPEG2000 JP2 reader.
8 //
9 // Specification: ISO/IEC 15444
10 //
11 //----------------------------------------------------------------------------
12 // $Id: ossimKakaduJp2Reader.h 22884 2014-09-12 13:14:35Z dburken $
13 
14 #ifndef ossimKakaduJp2Reader_HEADER
15 #define ossimKakaduJp2Reader_HEADER 1
16 
17 
19 #include <ossim/base/ossimIpt.h>
20 #include <ossim/base/ossimIrect.h>
21 #include <ossim/base/ossimRefPtr.h>
26 
27 #include <kdu_compressed.h>
28 
29 #include <vector>
30 
31 // Forward declarations:
32 
33 class ossimKeywordlist;
34 
35 class kdu_tile;
36 
37 namespace kdu_core
38 {
39  class kdu_compressed_source;
40  class kdu_line_buf;
41  class kdu_thread_queue;
42 }
43 
44 namespace kdu_supp
45 {
46  struct kdu_channel_mapping;
47  class jp2_family_src;
48 }
49 
55 {
56 public:
57 
60 
62  virtual ~ossimKakaduJp2Reader();
63 
68  virtual ossimString getShortName() const;
69 
74  virtual ossimString getLongName() const;
75 
80  virtual ossimString getClassName() const;
81 
92  ossim_uint32 resLevel=0);
93 
98  virtual ossim_uint32 getNumberOfInputBands() const;
99 
105  virtual ossim_uint32 getNumberOfOutputBands()const;
106 
113  virtual ossim_uint32 getImageTileWidth() const;
114 
121  virtual ossim_uint32 getImageTileHeight() const;
122 
126  virtual ossimScalarType getOutputScalarType() const;
127 
138 
149  virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
150 
161  virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
162 
167  virtual bool open();
168 
174  virtual bool isOpen()const;
175 
183  virtual void closeEntry();
184 
186  enum
187  {
188  SIGNATURE_BOX_SIZE = 12,
189  GEOTIFF_UUID_SIZE = 16
190  };
191 
198 
203  virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
204 
205 protected:
206 
225  virtual bool getOverviewTile(ossim_uint32 resLevel,
226  ossimImageData* result);
227 
228 private:
229 
234 
238  virtual ossimRefPtr<ossimImageGeometry> getImageGeometryFromGeotiffBox();
239 
243  virtual ossimRefPtr<ossimImageGeometry> getImageGeometryFromGmlBox();
244 
249  ossimRefPtr<ossimImageGeometry> getMetadataImageGeometry() const;
250 
255  bool isJp2();
256 
261  bool openJp2File();
262 
264  void initializeTile();
265 
275  bool loadTileFromCache(const ossimIpt& origin,
276  const ossimIrect& clipRect);
277 
285  bool loadTile(const ossimIpt& origin);
286 
292  bool configureChannelMapping();
293 
294  kdu_supp::jp2_family_src* theJp2FamilySrc;
295  kdu_core::kdu_compressed_source* theJp2Source;
296  kdu_supp::kdu_channel_mapping* theChannels;
297  kdu_core::kdu_codestream theCodestream;
298  kdu_core::kdu_thread_env* theThreadEnv;
299  kdu_core::kdu_thread_queue* theOpenTileThreadQueue;
300 
308  std::vector<ossimIrect> theJp2Dims;
309 
311  std::vector<ossimIrect> theJp2TileDims;
312 
315 
318 
319 TYPE_DATA
320 };
321 
322 #endif /* #ifndef ossimKakaduJp2Reader_HEADER */
virtual bool open()=0
Pure virtual open.
kdu_core::kdu_compressed_source * theJp2Source
ossimRefPtr< ossimImageData > theTile
ossimKakaduJp2Reader class for reading images with JPEG2000 (J2K) compressed blocks using kakadu libr...
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
kdu_core::kdu_thread_queue * theOpenTileThreadQueue
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.
kdu_core::kdu_codestream theCodestream
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
std::vector< ossimIrect > theJp2TileDims
Tile dimensions for each level.
virtual ossimString getShortName() const
Definition: ossimObject.cpp:48
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
kdu_core::kdu_thread_env * theThreadEnv
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
ossimRefPtr< ossimImageData > theCacheTile
kdu_supp::jp2_family_src * theJp2FamilySrc
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
ossimScalarType theScalarType
virtual ossimString getLongName() const
Definition: ossimObject.cpp:53
#define OSSIM_PLUGINS_DLL
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
ossimScalarType
virtual ossim_uint32 getImageTileWidth() const =0
Returns the tile width of the image or 0 if the image is not tiled.
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...
std::vector< ossimIrect > theJp2Dims
Has sub image offset.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual ossim_uint32 getNumberOfInputBands() const =0
ossimAppFixedTileCache::ossimAppFixedCacheId theCacheId
Cache initialized to image rect with sub image offset.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
kdu_supp::kdu_channel_mapping * theChannels