OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MEMTiledDataset Class Reference

#include <ossimGdalTiledDataset.h>

Inheritance diagram for MEMTiledDataset:
ossimListenerManager

Public Member Functions

 MEMTiledDataset ()
 
 MEMTiledDataset (ossimImageSourceSequencer *iface)
 
 ~MEMTiledDataset ()
 
void setNoDataValueFlag (bool flag)
 DRB - 20081020 If true (default) the no data value will be set to null pixel value. More...
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 

Static Public Member Functions

static GDALDataset * Create (const char *pszFilename, int nXSize, int nYSize, int nBands, GDALDataType eType, char **papszParmList)
 

Private Member Functions

void create (ossimImageSourceSequencer *iface)
 

Private Attributes

ossimRefPtr< ossimImageDatatheData
 
ossimImageSourceSequencertheInterface
 
ossimIpt theTileSize
 
ossimIrect theAreaOfInterest
 
bool theJustCreatedFlag
 
bool theSetNoDataValueFlag
 DRB - 20081020 If true (default) the no data value will be set to null pixel value. More...
 

Friends

class MEMTiledRasterBand
 

Additional Inherited Members

- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 

Detailed Description

Definition at line 26 of file ossimGdalTiledDataset.h.

Constructor & Destructor Documentation

◆ MEMTiledDataset() [1/2]

MEMTiledDataset::MEMTiledDataset ( )

Definition at line 304 of file ossimGdalTiledDataset.cpp.

305  :
306  MEMDataset(),
307  theData(),
308  theInterface(NULL),
309  theTileSize(),
311  theJustCreatedFlag(false),
313 {
314 }
bool theSetNoDataValueFlag
DRB - 20081020 If true (default) the no data value will be set to null pixel value.
ossimIrect theAreaOfInterest
ossimImageSourceSequencer * theInterface
ossimRefPtr< ossimImageData > theData

◆ MEMTiledDataset() [2/2]

MEMTiledDataset::MEMTiledDataset ( ossimImageSourceSequencer iface)

Definition at line 316 of file ossimGdalTiledDataset.cpp.

References create(), and theInterface.

317  :
318  MEMDataset(),
319  theData(),
320  theInterface(iface),
321  theTileSize(),
323  theJustCreatedFlag(false),
325 {
327 }
bool theSetNoDataValueFlag
DRB - 20081020 If true (default) the no data value will be set to null pixel value.
ossimIrect theAreaOfInterest
void create(ossimImageSourceSequencer *iface)
ossimImageSourceSequencer * theInterface
ossimRefPtr< ossimImageData > theData

◆ ~MEMTiledDataset()

MEMTiledDataset::~MEMTiledDataset ( )

Definition at line 333 of file ossimGdalTiledDataset.cpp.

335 {
336  FlushCache();
337 }

Member Function Documentation

◆ create()

void MEMTiledDataset::create ( ossimImageSourceSequencer iface)
private

Definition at line 342 of file ossimGdalTiledDataset.cpp.

Referenced by MEMTiledDataset().

343 {
344  if (traceDebug())
345  {
347  << "MEMTiledDataset::create DEBUG: entered..."
348  << endl;
349  }
350 
351  theInterface = iface;
352 
353  if(theInterface)
354  {
355 
356  ossimKeywordlist kwl;
357 
358  GByte **papBandData;
359  int nBands = theInterface->getNumberOfOutputBands();
360  theData = ossimImageDataFactory::instance()->create(NULL, // no owner specified
361  theInterface);
362 
363  GDALDataType gdalType = ossimGdalType().toGdal(theInterface->getOutputScalarType());
364  int nWordSize = GDALGetDataTypeSize(gdalType) / 8;
365  int tw = theInterface->getTileWidth();
366  int th = theInterface->getTileHeight();
367  int band = 0;
368 
369  papBandData = (GByte **) CPLCalloc(sizeof(void *),nBands);
370 
371  for( band = 0; band < nBands; band++ )
372  {
373  papBandData[band] = (GByte *) VSICalloc( nWordSize, tw * th );
374  }
375 
376  poDriver = poMEMTiledDriver;
378 
381 
382  nRasterXSize = bounds.width();
383  nRasterYSize = bounds.height();
384 
385  if (traceDebug())
386  {
388  << "DEBUG:"
389  << "\nnRasterXSize" << nRasterXSize
390  << "\nnRasterYSize" << nRasterYSize
391  << endl;
392  }
393 
394  eAccess = GA_Update;
395  if(theData.valid())
396  {
397  theData->setWidth(nRasterXSize);
399  theData->initialize();
400  }
401 
402  if (traceDebug())
403  {
405  << "DEBUG:"
406  << "\ntheData: " << *theData.get()
407  << endl;
408  }
409 
410 
411 /* -------------------------------------------------------------------- */
412 /* Create band information objects. */
413 /* -------------------------------------------------------------------- */
414 
415  for( band = 0; band < nBands; band++ )
416  {
417 
418  MEMTiledRasterBand* rasterBand =
419  new MEMTiledRasterBand( this,
420  band+1,
421  papBandData[band],
422  gdalType,
423  0,
424  0,
425  TRUE );
426  rasterBand->theDataset = this;
428  {
429  rasterBand->SetNoDataValue(theInterface->getNullPixelValue(band));
430  }
431  SetBand( band+1,
432  rasterBand);
433  }
434 
435  theJustCreatedFlag = true;
436  CPLFree( papBandData );
437 
439 /* -------------------------------------------------------------------- */
440 /* Try to return a regular handle on the file. */
441 /* -------------------------------------------------------------------- */
442  }
443 
444  if (traceDebug())
445  {
447  << "MEMTiledDataset::create DEBUG: exited..."
448  << endl;
449  }
450 
451 }
bool theSetNoDataValueFlag
DRB - 20081020 If true (default) the no data value will be set to null pixel value.
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossimIrect theAreaOfInterest
virtual void initialize()
Initialize the data buffer.
MEMTiledDataset * theDataset
virtual void setHeight(ossim_uint32 height)
static ossimImageDataFactory * instance()
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual void setWidth(ossim_uint32 width)
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
ossimImageSourceSequencer * theInterface
ossim_int32 y
Definition: ossimIpt.h:142
friend class MEMTiledRasterBand
GDALDataType toGdal(ossimScalarType) const
ossimRefPtr< ossimImageData > theData
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ Create()

static GDALDataset* MEMTiledDataset::Create ( const char *  pszFilename,
int  nXSize,
int  nYSize,
int  nBands,
GDALDataType  eType,
char **  papszParmList 
)
static

◆ setNoDataValueFlag()

void MEMTiledDataset::setNoDataValueFlag ( bool  flag)

DRB - 20081020 If true (default) the no data value will be set to null pixel value.

The call to rasterBand->SetNoDataValue causes snow with some viewer with some data types. Like J2K. This can disable it.

Parameters
flagIf true the call to rasterBand->SetNoDataValue will be performed. If false it will be bypassed.

Definition at line 453 of file ossimGdalTiledDataset.cpp.

References theSetNoDataValueFlag.

Referenced by ossimGdalWriter::writeBlockFile().

454 {
455  theSetNoDataValueFlag = flag;
456 }
bool theSetNoDataValueFlag
DRB - 20081020 If true (default) the no data value will be set to null pixel value.

Friends And Related Function Documentation

◆ MEMTiledRasterBand

friend class MEMTiledRasterBand
friend

Definition at line 30 of file ossimGdalTiledDataset.h.

Member Data Documentation

◆ theAreaOfInterest

ossimIrect MEMTiledDataset::theAreaOfInterest
private

Definition at line 35 of file ossimGdalTiledDataset.h.

◆ theData

ossimRefPtr<ossimImageData> MEMTiledDataset::theData
private

Definition at line 32 of file ossimGdalTiledDataset.h.

Referenced by MEMTiledRasterBand::copyNulls().

◆ theInterface

ossimImageSourceSequencer* MEMTiledDataset::theInterface
private

Definition at line 33 of file ossimGdalTiledDataset.h.

Referenced by MEMTiledDataset().

◆ theJustCreatedFlag

bool MEMTiledDataset::theJustCreatedFlag
private

Definition at line 36 of file ossimGdalTiledDataset.h.

◆ theSetNoDataValueFlag

bool MEMTiledDataset::theSetNoDataValueFlag
private

DRB - 20081020 If true (default) the no data value will be set to null pixel value.

Definition at line 43 of file ossimGdalTiledDataset.h.

Referenced by setNoDataValueFlag().

◆ theTileSize

ossimIpt MEMTiledDataset::theTileSize
private

Definition at line 34 of file ossimGdalTiledDataset.h.


The documentation for this class was generated from the following files: