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

#include <ossimImageDataFactory.h>

Public Member Functions

virtual ~ossimImageDataFactory ()
 
virtual ossimRefPtr< ossimImageDatacreate (ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
 
virtual ossimRefPtr< ossimImageDatacreate (ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands, ossim_uint32 width, ossim_uint32 height) const
 
virtual ossimRefPtr< ossimImageDatacreate (ossimSource *owner, ossim_uint32 bands, ossimImageSource *inputSource) const
 
virtual ossimRefPtr< ossimImageDatacreate (ossimSource *owner, ossimImageSource *inputSource) const
 

Static Public Member Functions

static ossimImageDataFactoryinstance ()
 

Protected Member Functions

 ossimImageDataFactory ()
 
 ossimImageDataFactory (const ossimImageDataFactory &)
 
void operator= (ossimImageDataFactory &)
 

Static Protected Attributes

static ossimImageDataFactorytheInstance = 0
 
static std::mutex theInstanceMutex
 

Detailed Description

This factory should be called by all image source producers to allocate an image tile.

Definition at line 28 of file ossimImageDataFactory.h.

Constructor & Destructor Documentation

◆ ~ossimImageDataFactory()

ossimImageDataFactory::~ossimImageDataFactory ( )
virtual

Definition at line 39 of file ossimImageDataFactory.cpp.

References theInstance.

40 {
41  if(theInstance)
42  {
43  //delete theInstance;
44  theInstance = 0;
45  }
46 }
static ossimImageDataFactory * theInstance

◆ ossimImageDataFactory() [1/2]

ossimImageDataFactory::ossimImageDataFactory ( )
protected

Definition at line 34 of file ossimImageDataFactory.cpp.

References theInstance.

Referenced by instance().

35 {
36  theInstance = 0;
37 }
static ossimImageDataFactory * theInstance

◆ ossimImageDataFactory() [2/2]

ossimImageDataFactory::ossimImageDataFactory ( const ossimImageDataFactory )
inlineprotected

Definition at line 56 of file ossimImageDataFactory.h.

56 {}//hide

Member Function Documentation

◆ create() [1/4]

ossimRefPtr< ossimImageData > ossimImageDataFactory::create ( ossimSource owner,
ossimScalarType  scalar,
ossim_uint32  bands = 1 
) const
virtual

Definition at line 59 of file ossimImageDataFactory.cpp.

References ossim::defaultTileSize(), OSSIM_SCALAR_UNKNOWN, OSSIM_UINT8, ossimIpt::x, and ossimIpt::y.

Referenced by ossimHsvToRgbSource::allocate(), ossimHsiToRgbSource::allocate(), ossimRgbToHsiSource::allocate(), ossimRgbToHsvSource::allocate(), ossimDespeckleFilter::allocate(), ossimHistogramEqualization::allocate(), ossimAOD::allocate(), ossimBandMergeSource::allocate(), ossimConvolutionSource::allocate(), ossimIntensityAdjustmentFilter::allocate(), ossim3x3ConvolutionFilter::allocate(), ossimSICDToDetectedImage::allocate(), ossimImageMosaic::allocate(), ossimElevationMosaic::allocate(), ossimMaxMosaic::allocate(), ossimLinearStretchRemapper::allocate(), ossimCacheTileSource::allocate(), ATP::AtpTileSource::allocate(), ossimCastTileSourceFilter::allocate(), ossimTableRemapper::allocate(), ossimConvolutionFilter1D::allocate(), ossimValueAssignImageSourceFilter::allocate(), ossimShiftFilter::allocate(), ossimPolyCutter::allocate(), ossimRgbToIndexFilter::allocate(), ossimTwoColorView::allocate(), ossimMultiBandHistogramTileSource::allocate(), ossimBrightnessContrastSource::allocate(), ossimNBandToIndexFilter::allocate(), ossimKMeansFilter::allocate(), ossimScaleFilter::allocate(), ossimBandLutFilter::allocate(), ossimBandSelector::allocate(), ossimTopographicCorrectionFilter::allocate(), ossimIndexToRgbLutFilter::allocate(), ossimMaskFilter::allocate(), ossimJpegTileSource::allocate(), ossimHsiRemapper::allocate(), ossimDtedTileSource::allocate(), ossimWatermarkFilter::allocate(), ossimHdf5ImageHandler::allocate(), ossimOpjJp2Reader::allocate(), ossimGpkgReader::allocate(), ossimBumpShadeTileSource::allocate(), ossimPngReader::allocate(), ossimH5ImageHandler::allocate(), ossimImageRenderer::allocate(), ossimRpfCacheTileSource::allocateForProduct(), ossimCibCadrgTileSource::allocateForProduct(), ossimKakaduJpipHandler::allocateTile(), ossimTiledImagePatch::allocateTile(), ossimGeneralRasterTileSource::allocateTile(), ossimTiffTileSource::allocateTile(), ossimHlzTool::computeHLZ(), ossimViewshedTool::computeViewshed(), create(), demo2(), demo3(), ossimFusionCombiner::getNormTile(), ossimClosestToCenterCombiner::getTile(), ossimBitMaskTileSource::getTile(), ossimImageSourceSequencer::getTile(), ossimRangeDomeTileSource::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimGdalTileSource::getTileBlockRead(), ossimFftFilter::initialize(), ossimFusionCombiner::initialize(), ossimImageMpiSWriterSequenceConnection::initialize(), ossimGammaRemapper::initialize(), ossimEdgeFilter::initialize(), ossimAtCorrRemapper::initialize(), ossimImageMpiMWriterSequenceConnection::initialize(), ossimImageToPlaneNormalFilter::initialize(), ossimImageSourceSequencer::initialize(), ossimVideoImageSource::initialize(), ossimBandAverageFilter::initialize(), ossimEquationCombiner::initialize(), ossimNitfTileSource::initializeCacheTile(), ossimNitfTileSource::initializeOutputTile(), ossimHlzTool::initProcessingChain(), ossimIntensityAdjustmentFilter::loadNormTile(), ossimBitMaskTileSource::open(), ATP::ossimCorrelationSource::OpenCVCorrelation(), ossimTilePatch::ossimTilePatch(), ossimScaleFilter::runFilterTemplate(), and ossimGdalTileSource::setPreservePaletteIndexesFlag().

63 {
64  ossimIpt tileSize;
65  ossim::defaultTileSize(tileSize);
66  ossim_uint32 width = tileSize.x;
67  ossim_uint32 height = tileSize.y;
68 
69  // do some bounds checking and initialize to a default
70  bands = (bands>0)?bands:1;
71  scalar = scalar != OSSIM_SCALAR_UNKNOWN?scalar:OSSIM_UINT8;
72 
73  if (traceDebug())
74  {
76  << "ossimImageDataFactory::create DEBUG:"
77  << "\nCaller: "
78  << (owner ? owner->getClassName().c_str() : "unknown")
79  << "\nbands: " << bands
80  << "\nwidth: " << width
81  << "\nheight: " << height
82  << "\nScalar type: "
84  << std::endl;
85  }
86 
87  ossimRefPtr<ossimImageData> result = 0;
88  switch(scalar)
89  {
90  case OSSIM_UINT8:
91  {
92  result = new ossimU8ImageData(owner, bands, width, height);
93  break;
94  }
95  case OSSIM_USHORT11:
96  {
97  result = new ossimU11ImageData(owner, bands, width, height);
98  break;
99  }
100  case OSSIM_USHORT12:
101  {
102  result = new ossimU12ImageData(owner, bands, width, height);
103  break;
104  }
105  case OSSIM_USHORT13:
106  {
107  result = new ossimU13ImageData(owner, bands, width, height);
108  break;
109  }
110  case OSSIM_USHORT14:
111  {
112  result = new ossimU14ImageData(owner, bands, width, height);
113  break;
114  }
115  case OSSIM_USHORT15:
116  {
117  result = new ossimU15ImageData(owner, bands, width, height);
118  break;
119  }
120  case OSSIM_UINT16:
121  {
122  result = new ossimU16ImageData(owner, bands, width, height);
123  break;
124  }
125  case OSSIM_SINT16:
126  {
127  result = new ossimS16ImageData(owner, bands, width, height);
128  break;
129  }
130  default:
131  {
132  // create a generic image data implementation.
133  result = new ossimImageData(owner, scalar, bands, width, height);
134 
135  // Set the scalar type for stretching.
136  ossimImageSource* inputSource = dynamic_cast<ossimImageSource*>(owner);
137  if( inputSource )
138  {
139  for(ossim_uint32 band = 0; band < bands; ++band)
140  {
141  result->setMinPix(inputSource->getMinPixelValue(band), band);
142  result->setMaxPix(inputSource->getMaxPixelValue(band), band);
143  result->setNullPix(inputSource->getNullPixelValue(band), band);
144  }
145  }
146  break;
147  }
148  }
149 
150  return result;
151 }
16 bit unsigned integer (15 bits used)
16 bit unsigned integer
virtual ossimString getEntryString(ossim_int32 entry_number) const
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
16 bit signed integer
16 bit unsigned integer (14 bits used)
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
16 bit unsigned integer (13 bits used)
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
virtual void setNullPix(ossim_float64 null_pix)
unsigned int ossim_uint32
16 bit unsigned integer (11 bits used)
virtual void setMaxPix(ossim_float64 max_pix)
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
ossim_int32 y
Definition: ossimIpt.h:142
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
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
virtual void setMinPix(ossim_float64 min_pix)
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ create() [2/4]

ossimRefPtr< ossimImageData > ossimImageDataFactory::create ( ossimSource owner,
ossimScalarType  scalar,
ossim_uint32  bands,
ossim_uint32  width,
ossim_uint32  height 
) const
virtual

Definition at line 153 of file ossimImageDataFactory.cpp.

References ossim::defaultTileSize(), OSSIM_SCALAR_UNKNOWN, OSSIM_UINT8, ossimIpt::x, and ossimIpt::y.

159 {
160  ossimIpt tileSize;
161  ossim::defaultTileSize(tileSize);
162  // do some bounds checking and initialize to a default
163  bands = bands > 0?bands:1;
164  width = width > 0?width:tileSize.x;
165  height = height > 0?height:tileSize.y;
166  scalar = scalar != OSSIM_SCALAR_UNKNOWN?scalar:OSSIM_UINT8;
167 
168  if (traceDebug())
169  {
171  << "ossimImageDataFactory::create DEBUG:"
172  << "\nCaller: "
173  << (owner ? owner->getClassName().c_str() : "unknown")
174  << "\nbands: " << bands
175  << "\nwidth: " << width
176  << "\nheight: " << height
177  << "\nScalar type: "
179  << std::endl;
180  }
181 
182  ossimRefPtr<ossimImageData> result = 0;
183  switch(scalar)
184  {
185  case OSSIM_UINT8:
186  {
187  result = new ossimU8ImageData(owner, bands, width, height);
188  break;
189  }
190  case OSSIM_USHORT11:
191  {
192  result = new ossimU11ImageData(owner, bands, width, height);
193  break;
194  }
195  case OSSIM_USHORT12:
196  {
197  result = new ossimU12ImageData(owner, bands, width, height);
198  break;
199  }
200  case OSSIM_USHORT13:
201  {
202  result = new ossimU13ImageData(owner, bands, width, height);
203  break;
204  }
205  case OSSIM_USHORT14:
206  {
207  result = new ossimU14ImageData(owner, bands, width, height);
208  break;
209  }
210  case OSSIM_USHORT15:
211  {
212  result = new ossimU15ImageData(owner, bands, width, height);
213  break;
214  }
215  case OSSIM_UINT16:
216  {
217  result = new ossimU16ImageData(owner, bands, width, height);
218  break;
219  }
220  case OSSIM_SINT16:
221  {
222  result = new ossimS16ImageData(owner, bands, width, height);
223  break;
224  }
225  default:
226  {
227  // create a generic image data implementation.
228  result = new ossimImageData(owner, scalar, bands, width, height);
229  break;
230  }
231  }
232 
233  return result;
234 }
16 bit unsigned integer (15 bits used)
16 bit unsigned integer
virtual ossimString getEntryString(ossim_int32 entry_number) const
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
16 bit signed integer
16 bit unsigned integer (14 bits used)
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
16 bit unsigned integer (13 bits used)
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
16 bit unsigned integer (11 bits used)
ossim_int32 y
Definition: ossimIpt.h:142
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
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ create() [3/4]

ossimRefPtr< ossimImageData > ossimImageDataFactory::create ( ossimSource owner,
ossim_uint32  bands,
ossimImageSource inputSource 
) const
virtual

Definition at line 236 of file ossimImageDataFactory.cpp.

References create(), ossimImageSource::getMaxPixelValue(), ossimImageSource::getMinPixelValue(), ossimImageSource::getNullPixelValue(), ossimImageSource::getOutputScalarType(), ossimImageSource::getTileHeight(), ossimImageSource::getTileWidth(), ossimNotify(), ossimNotifyLevel_WARN, ossimImageData::setMaxPix(), ossimImageData::setMinPix(), ossimImageData::setNullPix(), and ossimRefPtr< T >::valid().

240 {
241  ossimRefPtr<ossimImageData> result = 0;
242 
243  if(inputSource)
244  {
245  ossimScalarType scalar = inputSource->getOutputScalarType();
246  ossim_uint32 width = inputSource->getTileWidth();
247  ossim_uint32 height = inputSource->getTileHeight();
248 
249  result = create(owner, scalar, bands, width, height);
250  if ( result.valid() )
251  {
252  for(ossim_uint32 band = 0; band < bands; ++band)
253  {
254  result->setMinPix(inputSource->getMinPixelValue(band), band);
255  result->setMaxPix(inputSource->getMaxPixelValue(band), band);
256  result->setNullPix(inputSource->getNullPixelValue(band), band);
257  }
258  }
259  }
260  else
261  {
263  << "ossimImageDataFactory::create ERROR:"
264  << "\nNULL input source!" << std::endl;
265  }
266 
267  return result;
268 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual void setNullPix(ossim_float64 null_pix)
unsigned int ossim_uint32
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimScalarType
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual void setMaxPix(ossim_float64 max_pix)
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual void setMinPix(ossim_float64 min_pix)
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ create() [4/4]

ossimRefPtr< ossimImageData > ossimImageDataFactory::create ( ossimSource owner,
ossimImageSource inputSource 
) const
virtual

Definition at line 271 of file ossimImageDataFactory.cpp.

References create(), ossimImageSource::getMaxPixelValue(), ossimImageSource::getMinPixelValue(), ossimImageSource::getNullPixelValue(), ossimImageSource::getNumberOfOutputBands(), ossimImageSource::getOutputScalarType(), ossimImageSource::getTileHeight(), ossimImageSource::getTileWidth(), ossimNotify(), ossimNotifyLevel_WARN, ossimImageData::setMaxPix(), ossimImageData::setMinPix(), ossimImageData::setNullPix(), and ossimRefPtr< T >::valid().

274 {
275  ossimRefPtr<ossimImageData> result = 0;
276 
277  if(inputSource)
278  {
279  ossimScalarType scalar = inputSource->getOutputScalarType();
280  ossim_uint32 bands = inputSource->getNumberOfOutputBands();
281  ossim_uint32 width = inputSource->getTileWidth();
282  ossim_uint32 height = inputSource->getTileHeight();
283 
284  result = create(owner, scalar, bands, width, height);
285  if ( result.valid() )
286  {
287  for(ossim_uint32 band = 0; band < bands; ++band)
288  {
289  result->setMinPix(inputSource->getMinPixelValue(band), band);
290  result->setMaxPix(inputSource->getMaxPixelValue(band), band);
291  result->setNullPix(inputSource->getNullPixelValue(band), band);
292  }
293  }
294  }
295  else
296  {
298  << "ossimImageDataFactory::create ERROR:"
299  << "\nNULL input source!" << std::endl;
300  }
301 
302  return result;
303 }
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual void setNullPix(ossim_float64 null_pix)
unsigned int ossim_uint32
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimScalarType
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual void setMaxPix(ossim_float64 max_pix)
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual void setMinPix(ossim_float64 min_pix)
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ instance()

ossimImageDataFactory * ossimImageDataFactory::instance ( )
static

Definition at line 48 of file ossimImageDataFactory.cpp.

References ossimImageDataFactory(), theInstance, and theInstanceMutex.

Referenced by ossimHsvToRgbSource::allocate(), ossimHsiToRgbSource::allocate(), ossimRgbToHsiSource::allocate(), ossimRgbToHsvSource::allocate(), ossimDespeckleFilter::allocate(), ossimHistogramEqualization::allocate(), ossimAOD::allocate(), ossimBandMergeSource::allocate(), ossimConvolutionSource::allocate(), ossimIntensityAdjustmentFilter::allocate(), ossim3x3ConvolutionFilter::allocate(), ossimSICDToDetectedImage::allocate(), ossimImageMosaic::allocate(), ossimElevationMosaic::allocate(), ossimMaxMosaic::allocate(), ossimLinearStretchRemapper::allocate(), ossimCacheTileSource::allocate(), ATP::AtpTileSource::allocate(), ossimCastTileSourceFilter::allocate(), ossimTableRemapper::allocate(), ossimConvolutionFilter1D::allocate(), ossimValueAssignImageSourceFilter::allocate(), ossimShiftFilter::allocate(), ossimPolyCutter::allocate(), ossimRgbToIndexFilter::allocate(), ossimTwoColorView::allocate(), ossimMultiBandHistogramTileSource::allocate(), ossimBrightnessContrastSource::allocate(), ossimNBandToIndexFilter::allocate(), ossimKMeansFilter::allocate(), ossimScaleFilter::allocate(), ossimBandLutFilter::allocate(), ossimBandSelector::allocate(), ossimTopographicCorrectionFilter::allocate(), ossimIndexToRgbLutFilter::allocate(), ossimMaskFilter::allocate(), ossimJpegTileSource::allocate(), ossimHsiRemapper::allocate(), ossimDtedTileSource::allocate(), ossimWatermarkFilter::allocate(), ossimHdf5ImageHandler::allocate(), ossimOpjJp2Reader::allocate(), ossimGpkgReader::allocate(), ossimBumpShadeTileSource::allocate(), ossimPngReader::allocate(), ossimH5ImageHandler::allocate(), ossimImageRenderer::allocate(), ossimRpfCacheTileSource::allocateForProduct(), ossimCibCadrgTileSource::allocateForProduct(), ossimKakaduJpipHandler::allocateTile(), ossimTiledImagePatch::allocateTile(), ossimGeneralRasterTileSource::allocateTile(), ossimTiffTileSource::allocateTile(), ossimHlzTool::computeHLZ(), ossimViewshedTool::computeViewshed(), demo2(), demo3(), ossimFusionCombiner::getNormTile(), ossimClosestToCenterCombiner::getTile(), ossimBitMaskTileSource::getTile(), ossimImageSourceSequencer::getTile(), ossimRangeDomeTileSource::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimGdalTileSource::getTileBlockRead(), ossimFftFilter::initialize(), ossimFusionCombiner::initialize(), ossimImageMpiSWriterSequenceConnection::initialize(), ossimGammaRemapper::initialize(), ossimEdgeFilter::initialize(), ossimAtCorrRemapper::initialize(), ossimImageMpiMWriterSequenceConnection::initialize(), ossimImageToPlaneNormalFilter::initialize(), ossimImageSourceSequencer::initialize(), ossimVideoImageSource::initialize(), ossimBandAverageFilter::initialize(), ossimOverviewSequencer::initialize(), ossimEquationCombiner::initialize(), ossimNitfTileSource::initializeCacheTile(), ossimNitfTileSource::initializeOutputTile(), ossimKakaduJ2kReader::initializeTile(), ossimKakaduJp2Reader::initializeTile(), ossimHlzTool::initProcessingChain(), ossimViewshedTool::initProcessingChain(), ossimIntensityAdjustmentFilter::loadNormTile(), ossimBitMaskTileSource::open(), ATP::ossimCorrelationSource::OpenCVCorrelation(), ossimTilePatch::ossimTilePatch(), ossimScaleFilter::runFilterTemplate(), and ossimGdalTileSource::setPreservePaletteIndexesFlag().

49 {
50  theInstanceMutex.lock();
51  if(!theInstance)
52  {
54  }
55  theInstanceMutex.unlock();
56  return theInstance;
57 }
static std::mutex theInstanceMutex
static ossimImageDataFactory * theInstance

◆ operator=()

void ossimImageDataFactory::operator= ( ossimImageDataFactory )
inlineprotected

Definition at line 57 of file ossimImageDataFactory.h.

57 {}// hide

Member Data Documentation

◆ theInstance

ossimImageDataFactory * ossimImageDataFactory::theInstance = 0
staticprotected

Definition at line 59 of file ossimImageDataFactory.h.

Referenced by instance(), ossimImageDataFactory(), and ~ossimImageDataFactory().

◆ theInstanceMutex

std::mutex ossimImageDataFactory::theInstanceMutex
staticprotected

Definition at line 60 of file ossimImageDataFactory.h.

Referenced by instance().


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