OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimKakaduJ2kReader.cpp
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 // Author: David Burken
8 //
9 // Description:
10 //
11 // Class definition for JPEG2000 (J2K) reader.
12 //
13 //----------------------------------------------------------------------------
14 // $Id: ossimKakaduJ2kReader.cpp 23209 2015-03-30 01:01:36Z dburken $
15 
16 #include "ossimKakaduJ2kReader.h"
17 #include "ossimKakaduCommon.h"
18 #include "ossimKakaduMessaging.h"
19 
20 #include <ossim/base/ossimCommon.h>
21 #include <ossim/base/ossimEndian.h>
23 #include <ossim/base/ossimNotify.h>
26 #include <ossim/base/ossimTrace.h>
27 
30 
33 
34 #include <kdu_sample_processing.h>
35 #include <kdu_region_decompressor.h>
36 #include <kdu_threads.h>
37 
38 #include <fstream>
39 #include <iostream>
40 
41 
42 #ifdef OSSIM_ID_ENABLED
43 static const char OSSIM_ID[] = "$Id";
44 #endif
45 
46 static const ossimTrace traceDebug( ossimString("ossimKakaduJ2kReader:debug") );
47 static const ossimTrace traceDump( ossimString("ossimKakaduJ2kReader:dump" ) );
48 
50  "ossimKakaduJ2kReader",
52 
55  theCodestream(),
56  theThreadEnv(0),
57  theOpenTileThreadQueue(0),
58  theMinDwtLevels(0),
59  theFileStr(),
60  theSizRecord(),
61  theScalarType(OSSIM_SCALAR_UNKNOWN),
62  theImageRect(),
63  theTile(),
64  theCacheTile(),
65  theTileSizeX(0),
66  theTileSizeY(0),
67  theCacheId(-1)
68 {
69  kdu_customize_warnings(&pretty_cout); // Deliver warnings to stdout.
70  kdu_customize_errors(&pretty_cerr); // Deliver errors to stderr + throw exc
71 }
72 
74 {
75  closeEntry();
76 }
77 
79 {
80  return ossimString("ossim_kakadu_j2k_reader");
81 }
82 
84 {
85  return ossimString("ossim kakadu j2k reader");
86 }
87 
89 {
90  return ossimString("ossimKakaduJ2kReader");
91 }
92 
94  ossimDpt& result) const
95 {
96  if (resLevel == 0)
97  {
98  //---
99  // Assumption r0 or first layer is full res. Might need to change to
100  // use nitf IMAG field.
101  //---
102  result.x = 1.0;
103  result.y = 1.0;
104  }
105  else if ( theOverview.valid() && (resLevel > theMinDwtLevels) &&
106  (resLevel < getNumberOfDecimationLevels()) )
107  {
108  //---
109  // External overview file.
110  //
111  // Use the real lines and samples in case an resLevel is skipped.
112  //
113  // Note we must subtract the internal overviews as the external
114  // overview reader does not know about them.
115  //---
117  ossim_float64 rL =
119 
120  if (r0) // Divide by zero check
121  {
122  result.x = rL/r0;
123  }
124  else
125  {
126  result.x = ossim::nan();
127  }
128  r0 = getNumberOfLines(0);
130 
131  if (r0) // Divide by zero check.
132  {
133  result.y = rL/r0;
134  }
135  else
136  {
137  result.y = ossim::nan();
138  }
139  }
140  else
141  {
142  // Internal overviews are on power of two decimation.
143  result.x = 1.0 / pow((double)2, (double)resLevel);
144  result.y = result.x;
145  }
146 }
147 
149  vector<ossimDpt>& decimations) const
150 {
151  const ossim_uint32 LEVELS = getNumberOfDecimationLevels();
152  decimations.resize(LEVELS);
153  for (ossim_uint32 level = 0; level < LEVELS; ++level)
154  {
155  getDecimationFactor(level, decimations[level]);
156  }
157 }
158 
160 {
161  ossim_uint32 result = 1; // Add r0
162 
163  if (theMinDwtLevels)
164  {
165  //---
166  // Add internal overviews.
167  //---
168  result += theMinDwtLevels;
169  }
170 
171  if (theOverview.valid())
172  {
173  //---
174  // Add external overviews.
175  //
176  // NOTE: The ossimTiffTileSource will count r0 if present or it will
177  // add 1 to the decimation count if r0 is NOT present. Since
178  // since r0 has already be added subtract one.
179  //---
181  }
182 
183  return result;
184 }
185 
187  ossim_uint32 resLevel) const
188 {
189  ossim_uint32 result = 0;
190  if (resLevel < getNumberOfDecimationLevels())
191  {
192  result = theSizRecord.m_Ysiz;
193  if ( resLevel > 0 )
194  {
195  ossimDpt dpt;
196  getDecimationFactor(resLevel, dpt);
197  if ( !dpt.hasNans() )
198  {
199  result = static_cast<ossim_uint32>(result * dpt.y);
200  }
201  }
202  }
203  return result;
204 }
205 
207  ossim_uint32 resLevel) const
208 {
209  ossim_uint32 result = 0;
210  if (resLevel < getNumberOfDecimationLevels())
211  {
212  result = theSizRecord.m_Xsiz;
213  if ( resLevel > 0 )
214  {
215  ossimDpt dpt;
216  getDecimationFactor(resLevel, dpt);
217  result = static_cast<ossim_uint32>(result * dpt.x);
218  }
219  }
220  return result;
221 }
222 
224 {
225  static const char MODULE[] = "ossimKakaduJ2kReader::open";
226 
227  if (traceDebug())
228  {
230  << MODULE << " entered...\n";
231  }
232 
233  bool result = false;
234 
235  if(isOpen())
236  {
237  closeEntry();
238  }
239 
240  // Open up a stream to the file.
241  theFileStr.open(theImageFile.c_str(), ios::in | ios::binary);
242  if ( theFileStr.good() )
243  {
244  //---
245  // Check for the Start Of Codestream (SOC) and Size (SIZ) markers which
246  // are required as first and second fields in the main header.
247  //---
248  ossim_uint16 soc;
249  ossim_uint16 siz;
250  theFileStr.read((char*)&soc, 2);
251  theFileStr.read((char*)&siz, 2);
252 
253  if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN) // Alway big endian.
254  {
255  ossimEndian().swap(soc);
256  ossimEndian().swap(siz);
257  }
258 
259  const ossim_uint16 SOC_MARKER = 0xff4f; // start of codestream marker
260  const ossim_uint16 SIZ_MARKER = 0xff51; // size maker
261 
262  if ( (soc == SOC_MARKER) && (siz == SIZ_MARKER) )
263  {
264  // Read in and store the size record.
266 
267  // Position to start of code stream prior to create call.
268  theFileStr.seekg(0);
269 
270  //---
271  // Initialize the codestream. The class ossimKakaduNitfReader is a
272  // kdu_compressed source so we feed ourself to the codestream.
273  //
274  // TODO: Currently no kdu_thread_env. This should be implemented for
275  // speed...
276  //---
277 
278  //---
279  // Construct multi-threaded processing environment if required.
280  // Temp hard coded to a single thread.
281  //---
282 
283  if (theThreadEnv)
284  {
285  theThreadEnv->terminate(NULL, true);
286  theThreadEnv->destroy();
287  }
288  else
289  {
290  theThreadEnv = new kdu_core::kdu_thread_env();
291  }
292 
293  theThreadEnv->create(); // Creates the single "owner" thread
294 
295  // Check for threads in prefs file.
296  ossim_uint32 threads = 1;
297  const char* lookup = ossimPreferences::instance()->findPreference("kakadu_threads");
298  if ( lookup )
299  {
300  threads = ossimString::toUInt32(lookup);
301  if ( threads > 1 )
302  {
303  for (ossim_uint32 nt=1; nt < threads; ++nt)
304  {
305  if ( !theThreadEnv->add_thread() )
306  {
307  if (traceDebug())
308  {
310  << "Unable to create thread!\n";
311  }
312  }
313  }
314  }
315  }
316 
317  theOpenTileThreadQueue = theThreadEnv->add_queue(NULL,NULL,"open_tile_q");
318 
319  theCodestream.create(this, theThreadEnv);
320 
321  if ( theCodestream.exists() )
322  {
323  //---
324  // We have to store things here in this non-const method because
325  // NONE of the kakadu methods are const.
326  //---
327  theMinDwtLevels = theCodestream.get_min_dwt_levels();
328 
329  theCodestream.set_persistent(); // ????
330  theCodestream.enable_restart(); // ????
331 
332  kdu_core::kdu_dims region_of_interest;
333  region_of_interest.pos.x = 0;
334  region_of_interest.pos.y = 0;
335  region_of_interest.size.x = getNumberOfSamples(0);
336  region_of_interest.size.y = getNumberOfLines(0);
337 
338  theCodestream.apply_input_restrictions(
339  0, // first_component
340  0, // max_components (0 = all remaining will appear)
341  0, // highest resolution level
342  0, // max_layers (0 = all layers retained)
343  &region_of_interest, // expanded out to block boundary.
344  //KDU_WANT_CODESTREAM_COMPONENTS);
345  kdu_core::KDU_WANT_OUTPUT_COMPONENTS);
346 
347  // Set the scalar:
350  {
351  //---
352  // NOTE: Please leave commented out code for now.
353  //---
354  // Capture the sub image offset.
355  // theSubImageOffset.x = theSizRecord.theXOsiz;
356  // theSubImageOffset.y = theSizRecord.theYOsiz;
357 
358  // Initialize the image rect.
360  0,
362  theSizRecord.m_Ysiz-1);
363 
364  // Initialize the cache.
365  if (theCacheId != -1)
366  {
368  theCacheId = -1;
369  }
371 
372  // Stretch to tile boundary for the cache.
373  ossimIrect fullImgRect = theImageRect;
374  fullImgRect.stretchToTileBoundary(tileSize);
375 
376  // Set up the tile cache.
378  newTileCache(fullImgRect, tileSize);
379 
380  // Add the sub image rect after the
381 
382  // Initialize the tile we will return.
383  initializeTile();
384 
385  // Call the base complete open to pick up overviews.
386  completeOpen();
387 
388  // We should be good now so set the return result to true.
389  result = true;
390 
391  if (traceDebug())
392  {
394  << "\nSIZ marker segment"
395  << theSizRecord
396  << "theCodestream.get_num_components(false): "
397  << theCodestream.get_num_components(false)
398  << "\ntheCodestream.get_num_components(true): "
399  << theCodestream.get_num_components(true)
400  << "\ntheCodestream.get_bit_depth(0, true): "
401  << theCodestream.get_bit_depth(0, true)
402  << "\ntheCodestream.get_signed(0, true): "
403  << theCodestream.get_signed(0, true)
404  << "\ntheCodestream.get_min_dwt_levels(): "
405  << theCodestream.get_min_dwt_levels()
406  << "\ntheImageRect: " << theImageRect
407  << "\nFull image rect: " << fullImgRect
408  << "\nthreads: " << threads
409  << "\n";
410 
411  vector<ossimDpt> decimations;
412  getDecimationFactors(decimations);
413  for (ossim_uint32 i = 0; i < decimations.size(); ++i)
414  {
416  << theCodestream.get_min_dwt_levels()
417  << "Decimation factor[" << i << "]: "
418  << decimations[i]
419  << "\nsamples[" << i << "]: "
420  << getNumberOfSamples(i)
421  << "\nlines[" << i << "]: "
422  << getNumberOfLines(i)
423  << std::endl;
424 
425  }
426  }
427  }
428 
429  } // matches: if ( theCodestream.exists() )
430 
431  } // matches: if ( (soc == SOC_MARKER) && (siz == SIZ_MARKER) )
432 
433  } // matches: if ( theFileStr.good() )
434  else
435  {
436  if(traceDebug())
437  {
439  << MODULE << " ERROR:"
440  << "\nCannot open: " << theImageFile.c_str() << endl;
441  }
442  }
443 
444  if (traceDebug())
445  {
447  << MODULE << " exit status = " << (result?"true":"false\n")
448  << std::endl;
449  }
450 
451  return result;
452 }
453 
455 {
456  // return theFileStr.is_open();
457 
458  // Temp fix for gcc's that don't have a const "ifstream::is_open() const"
459  return theTile.valid();
460 }
461 
463 {
464  theFileStr.close();
465 
466  // Cleanup processing environment
467  if ( theThreadEnv )
468  {
469  theThreadEnv->join(NULL,true); // Wait until all internal processing is complete.
470  theThreadEnv->terminate(theOpenTileThreadQueue, true);
471  theThreadEnv->cs_terminate(theCodestream); // Terminates background codestream processing.
472  theThreadEnv->destroy();
473  delete theThreadEnv;
474  theThreadEnv = 0;
475  }
476 
477  if(theCodestream.exists())
478  {
479  theCodestream.destroy();
480  }
481 
483  {
485  }
486 
487  if (theCacheId != -1)
488  {
490  theCacheId = -1;
491  }
492 
493  theTile = 0;
494  theCacheTile = 0;
495  theTileSizeX = 0;
496  theTileSizeY = 0;
497 
499 }
500 
502  const char* prefix)
503 {
504  bool result = false;
505 
506  if ( ossimImageHandler::loadState(kwl, prefix) )
507  {
508  result = open();
509  }
510 
511  return result;
512 }
513 
514 
516  const ossimIrect& rect, ossim_uint32 resLevel)
517 {
518  // This tile source bypassed, or invalid res level, return a blank tile.
519  if(!isSourceEnabled() || !isOpen() || !isValidRLevel(resLevel))
520  {
522  }
523 
524  if (theTile.valid())
525  {
526  // Rectangle must be set prior to getOverviewTile call.
527  theTile->setImageRectangle(rect);
528 
529  if (resLevel)
530  {
531  if ( getOverviewTile(resLevel, theTile.get() ) == false )
532  {
533  theTile->makeBlank();
534  }
535  }
536  else
537  {
538  //---
539  // See if the whole tile is going to be filled, if not, start out with
540  // a blank tile so data from a previous load gets wiped out.
541  //---
542  if ( !rect.completely_within(theImageRect) )
543  {
544  // Start with a blank tile.
545  theTile->makeBlank();
546  }
547 
548  //---
549  // See if any point of the requested tile is in the image.
550  //---
551  if ( rect.intersects(theImageRect) )
552  {
553  ossimIrect clipRect = rect.clipToRect(theImageRect);
554 
555  ossimIrect exandedRect = clipRect;
556 
557  //---
558  // Shift the upper left corner of the "clip_rect" to the an even
559  // j2k tile boundry.
560  //---
562  theTileSizeY));
563 
564  // Vertical tile loop.
565  ossim_int32 y = exandedRect.ul().y;
566  while (y < exandedRect.lr().y)
567  {
568  // Horizontal tile loop.
569  ossim_int32 x = exandedRect.ul().x;
570  while (x < exandedRect.lr().x)
571  {
572  if ( loadTileFromCache(x, y, clipRect) == false )
573  {
574  if ( loadTile(x, y) )
575  {
576  //---
577  // Note: Clip the cache tile to the image clipRect
578  // since there are j2k tiles that go beyond the image
579  // dimensions, i.e., edge tiles.
580  //---
581  ossimIrect cr =
583  clipToRect(clipRect);
584 
587  cr,
588  OSSIM_BSQ);
589  }
590 
591  }
592 
593  x += theTileSizeX; // Go to next tile.
594  }
595 
596  y += theTileSizeY; // Go to next row of tiles.
597  }
598 
599  // Set the tile status.
600  theTile->validate();
601 
602  } // matches: if ( rect.intersects(theImageRect) )
603 
604  } // r0 block
605 
606  } // matches: if (theTile.valid())
607 
608  return theTile;
609 }
610 
612  ossimImageData* result)
613 {
614  bool status = false;
615 
616  if ( (resLevel < getNumberOfDecimationLevels()) && result &&
617  (result->getNumberOfBands() == getNumberOfOutputBands()) )
618  {
619  if (resLevel <= theMinDwtLevels)
620  {
621  // Internal overviews...
622  try
623  {
625  static_cast<int>(resLevel),
626  theThreadEnv,
628  result);
629  }
630  catch(const ossimException& e)
631  {
633  << __FILE__ << " " << __LINE__ << " caught exception\n"
634  << e.what();
635  status = false;
636  }
637 
638  } // matches: if (resLevel <= theMinDwtLevels)
639  else
640  {
641  // External overviews...
642  status = theOverview->getTile(result, resLevel - theMinDwtLevels);
643  }
644  }
645 
646  return status;
647 }
648 
650 {
651  return theSizRecord.m_Csiz;
652 }
653 
655 {
656  return theSizRecord.m_Csiz;
657 }
658 
660 {
661  ossim_uint32 result = 0;
662  if ( (theSizRecord.m_XTsiz <= 1024) && (theSizRecord.m_YTsiz <= 1024) )
663  {
664  result = theSizRecord.m_XTsiz;
665  }
666  return result;
667 }
668 
670 {
671  ossim_uint32 result = 0;
672  if ( (theSizRecord.m_XTsiz <= 1024) && (theSizRecord.m_YTsiz <= 1024) )
673  {
674  result = theSizRecord.m_YTsiz;
675  }
676  return result;
677 }
678 
680 {
681  return theSizRecord.getScalarType();
682 }
683 
685 {
688 
689  // Check for zero width, height and limit output tile sizes to 1024.
690  if ( !theTileSizeX || !theTileSizeY ||
691  ( theTileSizeX > 1024) || (theTileSizeY > 1024) )
692  {
693  ossimIpt tileSize;
694  ossim::defaultTileSize(tileSize);
695 
696  theTileSizeX = tileSize.x;
697  theTileSizeY = tileSize.y;
698  }
699 
701  create( this,
702  this->getOutputScalarType(),
703  this->getNumberOfOutputBands(),
704  theTileSizeX,
705  theTileSizeY);
706 
707  theTile->initialize();
708 
710  create( this,
711  this->getOutputScalarType(),
712  this->getNumberOfOutputBands(),
713  theTileSizeX,
714  theTileSizeY);
715 
717 }
718 
720  const ossimIrect& clipRect)
721 {
722  bool result = false;
723 
724  ossimIpt origin(x, y);
725 
726  ossimRefPtr<ossimImageData> tempTile =
728 
729  if (tempTile.valid())
730  {
731  //---
732  // Note: Clip the cache j2k tile to the image clipRect since
733  // there are j2k tiles that go beyond the image dimensions, i.e.,
734  // edge tiles.
735  //---
736  ossimIrect cr =
737  tempTile->getImageRectangle().clipToRect(clipRect);
738 
739  theTile->loadTile(tempTile.get()->getBuf(),
740  tempTile->getImageRectangle(),
741  cr,
742  OSSIM_BSQ);
743  result = true;
744  }
745  return result;
746 }
747 
749 {
750  bool result = true;
751 
752  ossimIpt ul(x, y);
753  ossimIpt lr(ul.x + theTileSizeX - 1,
754  ul.y + theTileSizeY - 1);
755 
756  // Set the cache rectangle to be an even j2k tile.
758 
759  //---
760  // Let the getOverviewTile do the rest of the work.
761  if ( getOverviewTile(0, theCacheTile.get()) )
762  {
763  // Add it to the cache for the next time.
765  }
766  else
767  {
769  << __FILE__ << __LINE__
770  << " ossimKakaduJ2kReader::loadBlock failed!"
771  << std::endl;
772  result = false;
773  }
774 
775  return result;
776 }
virtual void deleteCache(ossimAppFixedCacheId cacheId)
ossim_uint32 x
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossimString getLongName() const
Returns long name.
virtual bool open()
Open method.
virtual ossim_uint32 getNumberOfBands() const
ossimFilename theImageFile
virtual void setImageRectangle(const ossimIrect &rect)
ossim_uint32 m_Xsiz
width of reference grid
Represents serializable keyword/value map.
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const
Gets number of lines for res level.
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.
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
double y
Definition: ossimDpt.h:165
ossimRefPtr< ossimImageData > theCacheTile
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
const ossimIpt & ul() const
Definition: ossimIrect.h:274
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossim_uint32 toUInt32() const
ossimKakaduJ2kReader class for reading images with JPEG2000 (J2K) compressed blocks using kakadu libr...
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
ossimKakaduJ2kReader()
default construtor
unsigned short ossim_uint16
bool loadTile(ossim_uint32 x, ossim_uint32 y)
Loads a block of data to theCacheTile.
virtual void initialize()
Initialize the data buffer.
void initializeTile()
Initializes data member "theTile".
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Method to grab a tile(rectangle) from image.
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
ossim_uint32 m_YTsiz
height of one reference tile
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.
double ossim_float64
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual ossimString getClassName() const
Returns short name.
ossim_uint16 m_Csiz
number of component in the image
virtual bool isOpen() const
Method to test for open file stream.
kdu_core::kdu_codestream theCodestream
virtual ossimString getShortName() const
Returns short name.
kdu_core::kdu_thread_queue * theOpenTileThreadQueue
static ossimImageDataFactory * instance()
ossimRefPtr< ossimImageData > getTile(ossimAppFixedCacheId cacheId, const ossimIpt &origin)
const char * findPreference(const char *key) const
virtual ossimDataObjectStatus validate() const
virtual const char * what() const
Returns the error message.
virtual ~ossimKakaduJ2kReader()
virtural destructor
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Gets an overview tile.
ossim_uint32 m_XTsiz
width of one reference tile
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
virtual void close()
Deletes the overview and clears the valid image vertices.
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
bool hasNans() const
Definition: ossimDpt.h:67
static ossimPreferences * instance()
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const
Gets the number of samples for res level.
ossimScalarType
ossimScalarType theScalarType
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
Gets the decimation factor for a resLevel.
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 getNumberOfDecimationLevels() const
Returns the number of decimation levels.
return status
virtual void makeBlank()
Initializes data to null pixel values.
virtual void completeOpen()
Will complete the opening process.
ossimRefPtr< ossimImageHandler > theOverview
bool copyRegionToTile(kdu_supp::kdu_channel_mapping *channelMapping, kdu_core::kdu_codestream &codestream, int discard_levels, kdu_core::kdu_thread_env *threadEnv, kdu_core::kdu_thread_queue *threadQueue, ossimImageData *destTile)
Copies region from codestream to tile at a given rlevel.
ossimRefPtr< ossimImageData > theTile
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual void getDecimationFactors(vector< ossimDpt > &decimations) const
Get array of decimations for all levels.
kdu_core::kdu_thread_env * theThreadEnv
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.
ossimAppFixedTileCache::ossimAppFixedCacheId theCacheId
bool loadTileFromCache(ossim_uint32 x, ossim_uint32 y, const ossimIrect &clipRect)
Loads a block of data to theCacheTile from the cache.
double x
Definition: ossimDpt.h:164
ossimJ2kSizRecord theSizRecord
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
void stretchToTileBoundary(const ossimIpt &tileWidthHeight)
Definition: ossimIrect.cpp:212
virtual ossim_uint32 getImageTileHeight() const
Returns the tile width of the image or 0 if the image is not tiled.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossim_int32 x
Definition: ossimIpt.h:141
virtual void closeEntry()
Method to close current entry.
RTTI_DEF1_INST(ossimKakaduJ2kReader, "ossimKakaduJ2kReader", ossimImageHandler) ossimKakaduJ2kReader
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
ossimScalarType getScalarType() const
Gets the scalar type.
ossimRefPtr< ossimImageData > addTile(ossimAppFixedCacheId cacheId, ossimRefPtr< ossimImageData > data, bool duplicateData=true)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_uint32 m_Ysiz
height of reference grid
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
void parseStream(ossim::istream &in)
Parse method.