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

#include <ossimImageData.h>

Inheritance diagram for ossimImageData:
ossimRectilinearDataObject ossimDataObject ossimObject ossimReferenced ossimS16ImageData ossimU11ImageData ossimU12ImageData ossimU13ImageData ossimU14ImageData ossimU15ImageData ossimU16ImageData ossimU8ImageData

Public Types

enum  OverwriteBandRule {
  COLOR_DISCREPANCY = 0, COLOR_DISCREPANCY_OF_ANY_FROM_DEST = 1, COLOR_DISCREPANCY_OF_ALL_FROM_DEST = 2, COLOR_EQUALITY_OF_ANY_TO_SRC = 3,
  COLOR_EQUALITY_OF_ALL_TO_SRC = 4, NULL_RULE = 5
}
 Definitions for the unloadBand routines. More...
 

Public Member Functions

 ossimImageData (const ossimImageData &rhs)
 copy constructor More...
 
 ossimImageData ()
 
 ossimImageData (ossimSource *source, ossimScalarType scalar, ossim_uint32 bands=1)
 Constructor. More...
 
 ossimImageData (ossimSource *source, ossimScalarType scalar, ossim_uint32 bands, ossim_uint32 width, ossim_uint32 height)
 Constructor. More...
 
virtual ~ossimImageData ()
 virtual destructor More...
 
virtual const ossimImageDataoperator= (const ossimImageData &rhs)
 assignment operator= More...
 
virtual ossim_uint32 getWidth () const
 
virtual ossim_uint32 getHeight () const
 
virtual ossimIrect getImageRectangle () const
 
virtual void getWidthHeight (ossim_uint32 &w, ossim_uint32 &h)
 
virtual void setWidth (ossim_uint32 width)
 
virtual void setHeight (ossim_uint32 height)
 
virtual void setWidthHeight (ossim_uint32 w, ossim_uint32 h)
 
virtual void setImageRectangleAndBands (const ossimIrect &rect, ossim_uint32 numberOfBands)
 
virtual void setImageRectangle (const ossimIrect &rect)
 
virtual void setOrigin (const ossimIpt &origin)
 
virtual void assign (const ossimDataObject *data)
 
virtual void assign (const ossimImageData *data)
 
virtual void assignBand (const ossimImageData *data, ossim_uint32 source_band, ossim_uint32 output_band)
 
virtual ossimObjectdup () const
 
virtual ossim_uint32 getHashId () const
 Uses prime numbers as coefficients for this summation. More...
 
virtual void setNullPix (ossim_float64 null_pix)
 
virtual void setNullPix (ossim_float64 null_pix, ossim_uint32 band)
 
virtual void setNullPix (const ossim_float64 *nullPixArray, ossim_uint32 numberOfValues)
 
virtual void setMinPix (ossim_float64 min_pix)
 
virtual void setMinPix (ossim_float64 min_pix, ossim_uint32 band)
 
virtual void setMinPix (const ossim_float64 *minPixArray, ossim_uint32 numberOfValues)
 
virtual void setMaxPix (ossim_float64 max_pix)
 
virtual void setMaxPix (ossim_float64 max_pix, ossim_uint32 band)
 
virtual void setMaxPix (const ossim_float64 *maxPixArray, ossim_uint32 numberOfValues)
 
virtual const ossimIptgetOrigin () const
 
virtual void computeMinMaxPix (std::vector< ossim_float64 > &minBands, std::vector< ossim_float64 > &maxBands) const
 If the minBands and maxBands are empty or not equal to the imageData's current number of bands it will erase the contents, resize, and then replace the values in the passed in array with this objects min max values. More...
 
virtual void computeMinMaxNulPix (std::vector< ossim_float64 > &minBands, std::vector< ossim_float64 > &maxBands, std::vector< ossim_float64 > &nulBands) const
 Scans tile for min, max, nulls. More...
 
virtual const ossim_float64getNullPix () const
 
virtual const ossim_float64getMinPix () const
 
virtual const ossim_float64getMaxPix () const
 
virtual ossim_float64 getNullPix (ossim_uint32 band) const
 
virtual ossim_float64 getMinPix (ossim_uint32 band) const
 
virtual ossim_float64 getMaxPix (ossim_uint32 band) const
 
virtual ossim_float64 getMinNormalizedPix () const
 returns normalized minimum pixel value of band zero. More...
 
virtual ossimString getScalarTypeAsString () const
 
virtual ossim_uint32 getNumberOfBands () const
 
virtual void setNumberOfBands (ossim_uint32 bands, bool reallocate=false)
 
virtual ossim_float64 getPix (const ossimIpt &position, ossim_uint32 band=0) const
 Will return the pixel at location position. More...
 
virtual ossim_float64 getPix (ossim_uint32 offset, ossim_uint32 band=0) const
 Will return the pixel at offset and band number. More...
 
void fill (ossim_uint32 band, ossim_float64 value)
 will fill the entire band with the value. More...
 
void fill (ossim_float64 value)
 will fill all bands with the passed in value. More...
 
void createTestTile ()
 Creates a step wedge for testing only. More...
 
bool isNull (ossim_uint32 offset) const
 
bool isNull (ossim_uint32 offset, ossim_uint32 band) const
 
void setNull (ossim_uint32 offset)
 
void setNull (ossim_uint32 offset, ossim_uint32 band)
 
bool isNull (const ossimIpt &pt) const
 
void setNull (const ossimIpt &pt)
 
bool isNull (const ossimIpt &pt, ossim_uint32 band) const
 
void setNull (const ossimIpt &pt, ossim_uint32 band)
 
virtual bool isValidBand (ossim_uint32 band) const
 
virtual ossimDataObjectStatus validate () const
 
virtual ossimRefPtr< ossimImageDatanewNormalizedFloat () const
 Will take this tile and normalize it to a newly allocated floating point tile. More...
 
virtual void getNormalizedFloat (ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 &result) const
 will go to the band and offset and compute the normalized float and return it back to the caller through the result argument. More...
 
virtual void setNormalizedFloat (ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 input)
 This will assign to this object a normalized value by unnormalizing to its native type. More...
 
virtual void convertToNormalizedFloat (ossimImageData *result) const
 Will use the memory that you pass in to normalize this data object. More...
 
virtual ossimImageDatanewNormalizedDouble () const
 Will take this tile and normalize it to a newly allocated double point tile. More...
 
virtual void convertToNormalizedDouble (ossimImageData *result) const
 Will use the memory that you pass in to normalize this data object. More...
 
template<class T >
void copyTileToFloatBuffer (T, ossim_float32 *buf) const
 
virtual void unnormalizeInput (ossimImageData *normalizedInput)
 Will take the normalized input and convert it to this tile's data type. More...
 
virtual ossim_float64 computeAverageBandValue (ossim_uint32 bandNumber=0) const
 This will compute the average value for the band. More...
 
virtual ossim_float64 computeMeanSquaredError (ossim_float64 meanValue, ossim_uint32 bandNumber=0) const
 This will call the compute average band value and then use that in the calculation of: More...
 
virtual void populateHistogram (ossimRefPtr< ossimMultiBandHistogram > histo)
 
virtual void setHistogram (ossimRefPtr< ossimMultiResLevelHistogram > histo)
 
ossimRefPtr< ossimMultiResLevelHistogramgetHistogram ()
 
virtual bool hasAlpha () const
 
virtual const ossim_uint8getAlphaBuf () const
 
virtual ossim_uint8getAlphaBuf ()
 
virtual const void * getBuf () const
 
virtual const ossim_uint8getUcharBuf () const
 
virtual const ossim_uint16getUshortBuf () const
 
virtual const ossim_sint16getSshortBuf () const
 
virtual const ossim_float32getFloatBuf () const
 
virtual const ossim_float64getDoubleBuf () const
 
virtual void * getBuf ()
 
virtual ossim_uint8getUcharBuf ()
 
virtual ossim_uint16getUshortBuf ()
 
virtual ossim_sint16getSshortBuf ()
 
virtual ossim_float32getFloatBuf ()
 
virtual ossim_float64getDoubleBuf ()
 
virtual const void * getBuf (ossim_uint32 band) const
 
virtual const ossim_uint8getUcharBuf (ossim_uint32 band) const
 
virtual const ossim_uint16getUshortBuf (ossim_uint32 band) const
 
virtual const ossim_sint16getSshortBuf (ossim_uint32 band) const
 
virtual const ossim_float32getFloatBuf (ossim_uint32 band) const
 
virtual const ossim_float64getDoubleBuf (ossim_uint32 band) const
 
virtual void * getBuf (ossim_uint32 band)
 
virtual ossim_uint8getUcharBuf (ossim_uint32 band)
 
virtual ossim_uint16getUshortBuf (ossim_uint32 band)
 
virtual ossim_sint16getSshortBuf (ossim_uint32 band)
 
virtual ossim_float32getFloatBuf (ossim_uint32 band)
 
virtual ossim_float64getDoubleBuf (ossim_uint32 band)
 
virtual ossim_uint32 getSize () const
 Returns the total number of pixels in a tile for all bands. More...
 
virtual ossim_uint32 getSizePerBand () const
 Returns the number of pixels in a single band in a tile. More...
 
virtual ossim_uint32 getSizePerBandInBytes () const
 Returns the number of bytes in single band of the tile. More...
 
virtual ossim_uint32 getDataSizeInBytes () const
 
virtual ossim_uint32 getSizeInBytes () const
 Returns the total number of bytes for all bands. More...
 
virtual void makeBlank ()
 Initializes data to null pixel values. More...
 
virtual void initialize ()
 Initialize the data buffer. More...
 
virtual bool write (const ossimFilename &f) const
 Writes tile to stream. More...
 
virtual void copyTileToNormalizedBuffer (ossim_float64 *buf) const
 Copies entire tile to buf passed in. More...
 
virtual void copyTileToNormalizedBuffer (ossim_float32 *buf) const
 
virtual void copyTileBandToNormalizedBuffer (ossim_uint32 band, ossim_float64 *buf) const
 Will copy this tiles specified band number to the normalized buffer. More...
 
virtual void copyTileBandToNormalizedBuffer (ossim_uint32 band, ossim_float32 *buf) const
 Will copy this tiles specified band number to the normalized buffer. More...
 
virtual void copyNormalizedBufferToTile (ossim_float64 *buf)
 Copies buf passed in to tile. More...
 
virtual void copyNormalizedBufferToTile (ossim_float32 *buf)
 
virtual void copyNormalizedBufferToTile (ossim_uint32 band, ossim_float64 *buf)
 Will copy the normalized buffer to this tiles specified band. More...
 
virtual void copyNormalizedBufferToTile (ossim_uint32 band, ossim_float32 *buf)
 
virtual bool isWithin (ossim_int32 x, ossim_int32 y)
 
virtual void setValue (ossim_int32 x, ossim_int32 y, ossim_float64 color)
 
virtual void loadBand (const void *src, const ossimIrect &src_rect, ossim_uint32 band)
 
virtual void loadBand (const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect, ossim_uint32 band)
 
virtual void loadTile (const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
 
virtual void loadTileWithAlpha (const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
 
virtual void loadTile (const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect, ossimInterleaveType il_type)
 
virtual void nullTileAlpha (const ossim_uint8 *src, const ossimIrect &src_rect, bool mutliplyAlphaFlag=false)
 
virtual void nullTileAlpha (const ossim_uint8 *src, const ossimIrect &src_rect, const ossimIrect &clip_rect, bool multiplyAlphaFlag=false)
 
virtual void loadTile (const ossimImageData *src)
 Will load a tile of different types. More...
 
virtual void loadTileFrom1Band (const ossimImageData *data)
 
virtual void loadTileFrom1Band (const void *src, const ossimIrect &src_rect)
 
virtual void loadShortBand (const void *src, const ossimIrect &src_rect, ossim_uint32 band, bool swap_bytes=false)
 Specialized to load a tile from a short (16 bit scalar type) buffer. More...
 
virtual void unloadBand (void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, ossimInterleaveType il_type=OSSIM_BSQ, OverwriteBandRule ow_type=NULL_RULE) const
 This routine is designed for overwriting a selected band of the destination buffer 'dest' by an independent selected band of the source buffer according to a user-selected rule, defined by OverwriteBandRule. More...
 
virtual void unloadBand (void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, const ossimIrect &clip_rect, ossimInterleaveType il_type=OSSIM_BSQ, OverwriteBandRule ow_type=NULL_RULE) const
 This routine is designed for overwriting a selected band of the destination buffer 'dest' by an independent selected band of the source buffer according to a user-selected rule, defined by OverwriteBandRule. More...
 
virtual void unloadBand (void *dest, const ossimIrect &dest_rect, ossim_uint32 src_band) const
 
virtual void unloadBand (void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect, ossim_uint32 src_band) const
 
virtual void unloadTile (void *dest, const ossimIrect &dest_rect, ossimInterleaveType il_type) const
 
virtual void unloadTile (void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect, ossimInterleaveType il_type) const
 
virtual void unloadTileToBipAlpha (void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
virtual bool isPointWithin (const ossimIpt &point) const
 
virtual bool isPointWithin (ossim_int32 x, ossim_int32 y) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual void stretchMinMax ()
 Performs linear stretch on tile data from min/max to limits of scalar type. More...
 
virtual void computeAlphaChannel ()
 Computes the alpha channel. More...
 
virtual void copyLine (const void *src, ossim_int32 lineNumber, ossim_int32 lineStartSample, ossim_int32 lineStopSample, ossimInterleaveType lineInterleave)
 Method to copy a single line to the tile. More...
 
void setIndexedFlag (bool flag)
 Sets the indexed flag. More...
 
bool getIndexedFlag () const
 
ossim_float64 percentFull () const
 Returns the percentage (0-100) of data buffer containing non-null (valid) entries. More...
 
virtual bool isEqualTo (const ossimDataObject &rhs, bool deepTest=false) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
template<class T >
void computeMinMaxPix (T, vector< ossim_float64 > &minBands, vector< ossim_float64 > &maxBands) const
 
template<class T >
void computeMinMaxNulPix (T, vector< ossim_float64 > &minBands, vector< ossim_float64 > &maxBands, vector< ossim_float64 > &nulBands) const
 
- Public Member Functions inherited from ossimRectilinearDataObject
 ossimRectilinearDataObject ()
 default constructor More...
 
 ossimRectilinearDataObject (const ossimRectilinearDataObject &rhs)
 
 ossimRectilinearDataObject (ossim_uint32 numberOfSpatialComponents, ossimSource *owner, ossim_uint32 numberOfDataComponents, ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN, ossimDataObjectStatus status=OSSIM_NULL)
 
 ossimRectilinearDataObject (ossimSource *owner, ossim_uint32 numberOfDataComponents, ossim_uint32 length, ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN, ossimDataObjectStatus status=OSSIM_NULL)
 This is a helper constructor that allows one to instantiate a one dimensional Spatial component with N number of data components. More...
 
 ossimRectilinearDataObject (ossimSource *owner, ossim_uint32 numberOfDataComponents, ossim_uint32 width, ossim_uint32 height, ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN, ossimDataObjectStatus status=OSSIM_NULL)
 This is a helper constructor that allows one to instantiate a two dimensional Spatial component (WidthxHeight) with N number of data components. More...
 
 ossimRectilinearDataObject (ossimSource *owner, ossim_uint32 numberOfDataComponents, ossim_uint32 width, ossim_uint32 height, ossim_uint32 depth, ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN, ossimDataObjectStatus status=OSSIM_NULL)
 This is a helper constructor that allows one to instantiate a two dimensional Spatial component (WidthxHeightxDepth) with N number of data components. More...
 
virtual ~ossimRectilinearDataObject ()
 
virtual void setNumberOfDataComponents (ossim_uint32 n)
 How many components make up this data object. More...
 
virtual void setSpatialExtents (ossim_uint32 *extents, ossim_uint32 size)
 
virtual void setScalarType (ossimScalarType type)
 See ossimScalarType in ossimConstants for a full list. More...
 
virtual ossim_uint32 getNumberOfDataComponents () const
 
virtual ossim_uint32 getNumberOfSpatialComponents () const
 
virtual const ossim_uint32getSpatialExtents () const
 
virtual ossimScalarType getScalarType () const
 
virtual ossim_uint32 getScalarSizeInBytes () const
 
virtual void assign (const ossimRectilinearDataObject *data)
 
virtual ossim_uint32 computeSpatialProduct () const
 
virtual const ossimRectilinearDataObjectoperator= (const ossimRectilinearDataObject &rhs)
 assignment operator= More...
 
- Public Member Functions inherited from ossimDataObject
 ossimDataObject (ossimSource *source=0, ossimDataObjectStatus status=OSSIM_STATUS_UNKNOWN)
 
 ossimDataObject (const ossimDataObject &rhs)
 
virtual ~ossimDataObject ()
 
virtual void setOwner (ossimSource *aSource)
 Sets the owner of this Data object. More...
 
virtual ossimSourcegetOwner ()
 
virtual const ossimSourcegetOwner () const
 
virtual void setDataObjectStatus (ossimDataObjectStatus status) const
 Full list found in ossimConstants.h. More...
 
virtual ossimDataObjectStatus getDataObjectStatus () const
 
virtual ossimString getDataObjectStatusString () const
 
virtual ossim_uint32 getObjectSizeInBytes () const
 
virtual bool isInitialize () const
 This is to be overriden in the derived classes so they can check If their data is null. More...
 
virtual const ossimDataObjectoperator= (const ossimDataObject *rhs)
 
virtual const ossimDataObjectoperator= (const ossimDataObject &rhs)
 
virtual bool operator== (const ossimDataObject &rhs) const
 
virtual bool operator!= (const ossimDataObject &rhs) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Member Functions

template<class T >
void copyLineTemplate (T dummyTemplate, const void *src, ossim_int32 lineNumber, ossim_int32 lineStartSample, ossim_int32 lineStopSample, ossimInterleaveType lineInterleave)
 Templated copy line method. More...
 
template<class T >
void stretchMinMax (T dummyTemplate)
 Templated stretch method. More...
 
template<class T >
void computeAlphaChannel (T dummyTemplate)
 Templated compute alpha channel. More...
 
template<class T >
ossimDataObjectStatus validate (T dummyTemplate) const
 Templated validate method. More...
 
template<class T >
void makeBlank (T dummyTemplate)
 Templated makeBlank method. More...
 
template<class T >
ossim_float64 computeMeanSquaredError (T dummyTemplate, ossim_float64 meanValue, ossim_uint32 bandNumber) const
 Templated computeMeanSquaredError method. More...
 
template<class T >
ossim_float64 computeAverageBandValue (T dummyTemplate, ossim_uint32 bandNumber) const
 Templated computeAverageBandValue method. More...
 
void loadTileFromBip (const void *src, const ossimIrect &src_rect)
 
void loadTileFromBipAlpha (const void *src, const ossimIrect &src_rect)
 
void loadTileFromBil (const void *src, const ossimIrect &src_rect)
 
void loadTileFromBsq (const void *src, const ossimIrect &src_rect)
 
void loadTileFromBip (const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect)
 
void loadTileFromBil (const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect)
 
void loadTileFromBsq (const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect)
 
void unloadTileToBip (void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
void unloadTileToBil (void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
void unloadTileToBsq (void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
virtual void unloadBandToBsq (void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, const ossimIrect &clip_rect, OverwriteBandRule ow_type=NULL_RULE) const
 Called from public unloadBand() routines that have an OverwriteBandRule interface. More...
 
template<class T >
void copyTileToNormalizedBuffer (T dummyTemplate, ossim_float64 *buf) const
 Copies entire tile to buf passed in. More...
 
template<class T >
void copyTileToNormalizedBuffer (T dummyTemplate, ossim_float32 *buf) const
 
template<class T >
void copyTileToNormalizedBuffer (T dummyTemplate, ossim_uint32 band, ossim_float64 *buf) const
 Will copy this tiles specified band number to the normalized buffer. More...
 
template<class T >
void copyTileToNormalizedBuffer (T dummyTemplate, ossim_uint32 band, ossim_float32 *buf) const
 
template<class T >
void copyNormalizedBufferToTile (T dummyTemplate, ossim_float64 *buf)
 Copies buf passed in to tile. More...
 
template<class T >
void copyNormalizedBufferToTile (T dummyTemplate, ossim_float32 *buf)
 
template<class T >
void copyNormalizedBufferToTile (T dummyTemplate, ossim_uint32 band, ossim_float64 *buf)
 
template<class T >
void copyNormalizedBufferToTile (T dummyTemplate, ossim_uint32 band, ossim_float32 *buf)
 
template<class T >
void computeMinMaxPix (T dummyValue, std::vector< ossim_float64 > &minBands, std::vector< ossim_float64 > &maxBands) const
 
template<class T >
void computeMinMaxNulPix (T dummyValue, std::vector< ossim_float64 > &minBands, std::vector< ossim_float64 > &maxBands, std::vector< ossim_float64 > &nulBands) const
 
template<class T >
void loadBandTemplate (T, const void *src, const ossimIrect &src_rect, ossim_uint32 band)
 
template<class T >
void loadBandTemplate (T, const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect, ossim_uint32 band)
 
template<class T >
void nullTileAlphaTemplate (T, const ossim_uint8 *src, const ossimIrect &src_rect, const ossimIrect &clip_rect, bool multiplyAlphaFlag=false)
 
template<class T >
void loadTileFromBipTemplate (T, const void *src, const ossimIrect &src_rect)
 
template<class T >
void loadTileFromBipAlphaTemplate (T, const void *src, const ossimIrect &src_rect)
 
template<class T >
void loadTileFromBipTemplate (T, const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect)
 
template<class T >
void loadTileFromBipAlphaTemplate (T, const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect)
 
template<class T >
void loadTileFromBilTemplate (T, const void *src, const ossimIrect &src_rect)
 
template<class T >
void loadTileFromBilTemplate (T, const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect)
 
template<class T >
void loadTileFromBsqTemplate (T, const void *src, const ossimIrect &src_rect)
 
template<class T >
void loadTileFromBsqTemplate (T, const void *src, const ossimIrect &src_rect, const ossimIrect &clip_rect)
 
template<class T >
void unloadTileToBipTemplate (T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
template<class T >
void unloadTileToBipAlphaTemplate (T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
template<class T >
void unloadTileToBilTemplate (T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
template<class T >
void unloadTileToBsqTemplate (T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
 
template<class T >
void unloadBandTemplate (T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect, ossim_uint32 band) const
 
template<class T >
void unloadBandToBsqTemplate (T, void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, const ossimIrect &clip_rect, OverwriteBandRule ow_type=NULL_RULE) const
 
template<class T >
void createTestTile (T)
 Creates a test tile for scalar type for testing only. More...
 
virtual void initializeDefaults ()
 initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value for scalar type. More...
 
virtual void initializeMinDefault ()
 initializeMinDefault() Resizes theMinPixelValue array to number of bands and initializes to the default min for scalar type. More...
 
virtual void initializeMaxDefault ()
 initializeMaxDefault() Resizes theMaxPixelValue array to number of bands and initializes to the default max for scalar type. More...
 
virtual void initializeNullDefault ()
 initializeNullDefault() Resizes theNullPixelValue array to number of bands and initializes to the default null for scalar type. More...
 
bool hasSameDimensionsAs (ossimImageData *data) const
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

std::vector< ossim_float64m_nullPixelValue
 Null pixel value for each band. More...
 
std::vector< ossim_float64m_minPixelValue
 Min pixel value for each band. More...
 
std::vector< ossim_float64m_maxPixelValue
 Max pixel value for each band. More...
 
std::vector< ossim_uint8m_alpha
 Alpha channel. More...
 
ossimIpt m_origin
 
bool m_indexedFlag
 Indicates data contains palette indexes. More...
 
ossimRefPtr< ossimMultiResLevelHistogramm_histogram
 
ossim_float64 m_percentFull
 percentage (0-100) of image tile that has valid (non-null) pixel values. More...
 
- Protected Attributes inherited from ossimRectilinearDataObject
ossim_uint32 m_numberOfDataComponents
 
ossimScalarType m_scalarType
 
std::vector< ossim_uint8m_dataBuffer
 
std::vector< ossim_uint32m_spatialExtents
 
- Protected Attributes inherited from ossimDataObject
ossimSourcetheOwner
 
ossimDataObjectStatus theDataObjectStatus
 

Detailed Description

Definition at line 28 of file ossimImageData.h.

Member Enumeration Documentation

◆ OverwriteBandRule

Definitions for the unloadBand routines.

Enumerator
COLOR_DISCREPANCY 
COLOR_DISCREPANCY_OF_ANY_FROM_DEST 
COLOR_DISCREPANCY_OF_ALL_FROM_DEST 
COLOR_EQUALITY_OF_ANY_TO_SRC 
COLOR_EQUALITY_OF_ALL_TO_SRC 
NULL_RULE 

Definition at line 33 of file ossimImageData.h.

34  {
35  /*
36  * The COLOR_DISCREPANCY rule directs that the selected band of a pixel
37  * of the destination buffer is to be overwritten if *any* one of the
38  * other bands of the same destination pixel have color values that
39  * deviate from its color.
40  * Deprecated in favor of COLOR_DISCREPANCY_OF_ANY_FROM_DEST.
41  */
43 
44  /*
45  * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected
46  * band of a pixel of the destination buffer is to be overwritten if
47  * *any* one of the other bands of the same destination pixel have color
48  * values that deviate from its color.
49  * Same as the deprecated COLOR_DISCREPANCY.
50  */
52 
53  /*
54  * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected
55  * band of a pixel of the destination buffer is to be overwritten only if
56  * *all* of the other bands of the same destination pixel have color
57  * values that deviate from its color.
58  */
60 
61  /*
62  * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected
63  * band of a pixel of the destination buffer is to be overwritten if
64  * *any* one of the other bands of the same destination pixel have color
65  * values that are equal to the color of the selected band of the source
66  * pixel.
67  */
69 
70  /*
71  * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected
72  * band of a pixel of the destination buffer is to be overwritten only if
73  * *all* of the other bands of the same destination pixel have color
74  * values that are equal to the color of the selected band of the source
75  * pixel.
76  */
78 
79  /*
80  * The selected band of the destination buffer is to be overwritten
81  * by the selected band of the source image data (no questions asked).
82  */
83  NULL_RULE = 5
84  };

Constructor & Destructor Documentation

◆ ossimImageData() [1/4]

ossimImageData::ossimImageData ( const ossimImageData rhs)

copy constructor

Definition at line 102 of file ossimImageData.cpp.

107  m_alpha(rhs.m_alpha),
108  m_origin(rhs.m_origin),
110  m_percentFull(0)
111 {
112 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
ossim_float64 m_percentFull
percentage (0-100) of image tile that has valid (non-null) pixel values.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossimRectilinearDataObject()
default constructor
bool m_indexedFlag
Indicates data contains palette indexes.

◆ ossimImageData() [2/4]

ossimImageData::ossimImageData ( )

Definition at line 36 of file ossimImageData.cpp.

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

Referenced by dup(), newNormalizedDouble(), and newNormalizedFloat().

38  0, // owner
39  1, // bands
40  OSSIM_UINT8), // scalar
42  m_minPixelValue(0),
43  m_maxPixelValue(0),
44  m_alpha(0),
45  m_origin(0, 0),
46  m_indexedFlag(false),
47  m_histogram(NULL)
48 {
49  ossimIpt tileSize;
50  ossim::defaultTileSize(tileSize);
51  m_spatialExtents[0] = tileSize.x;
52  m_spatialExtents[1] = tileSize.y;
54 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
ossimRefPtr< ossimMultiResLevelHistogram > m_histogram
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
std::vector< ossim_uint32 > m_spatialExtents
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossimRectilinearDataObject()
default constructor
ossim_int32 y
Definition: ossimIpt.h:142
bool m_indexedFlag
Indicates data contains palette indexes.
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
virtual void initializeDefaults()
initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value f...

◆ ossimImageData() [3/4]

ossimImageData::ossimImageData ( ossimSource source,
ossimScalarType  scalar,
ossim_uint32  bands = 1 
)

Constructor.

Parameters
sourceThe owner. This can be null.
scalarThe Scalar type like OSSIM_UINT8, OSSIM_UINT16...
bandsThe number of bands.
Note
This does not initialize the undelying data buffer. Call the initialize method to allocate storage.

Definition at line 56 of file ossimImageData.cpp.

References ossim::defaultTileSize(), initializeDefaults(), ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, and ossimIpt::y.

60  owner,
61  bands,
62  scalar),
64  m_minPixelValue(0),
65  m_maxPixelValue(0),
66  m_alpha(0),
67  m_origin(0, 0),
68  m_indexedFlag(false),
69  m_histogram(NULL)
70 {
71  ossimIpt tileSize;
72  ossim::defaultTileSize(tileSize);
73  m_spatialExtents[0] = tileSize.x;
74  m_spatialExtents[1] = tileSize.y;
76 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
ossimRefPtr< ossimMultiResLevelHistogram > m_histogram
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
std::vector< ossim_uint32 > m_spatialExtents
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossimRectilinearDataObject()
default constructor
ossim_int32 y
Definition: ossimIpt.h:142
bool m_indexedFlag
Indicates data contains palette indexes.
ossim_int32 x
Definition: ossimIpt.h:141
virtual void initializeDefaults()
initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value f...

◆ ossimImageData() [4/4]

ossimImageData::ossimImageData ( ossimSource source,
ossimScalarType  scalar,
ossim_uint32  bands,
ossim_uint32  width,
ossim_uint32  height 
)

Constructor.

Parameters
sourceThe owner. This can be null.
scalarThe Scalar type like OSSIM_UINT8, OSSIM_UINT16...
bandsThe number of bands.
widthThe width or number of samples in the buffer.
heightThe height or numer of lines in the buffer.
Note
This does not initialize the undelying data buffer. Call the initialize method to allocate storage.

Definition at line 78 of file ossimImageData.cpp.

References initializeDefaults(), and ossimRectilinearDataObject::m_spatialExtents.

84  bands,
85  width, // 2-D array
86  height,
87  scalar),
89  m_minPixelValue(0),
90  m_maxPixelValue(0),
91  m_alpha(0),
92  m_origin(0, 0),
93  m_indexedFlag(false),
94  m_histogram(NULL),
95  m_percentFull(0)
96 {
97  m_spatialExtents[0] = width;
98  m_spatialExtents[1] = height;
100 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.
ossimRefPtr< ossimMultiResLevelHistogram > m_histogram
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
std::vector< ossim_uint32 > m_spatialExtents
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
ossim_float64 m_percentFull
percentage (0-100) of image tile that has valid (non-null) pixel values.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossimRectilinearDataObject()
default constructor
bool m_indexedFlag
Indicates data contains palette indexes.
virtual void initializeDefaults()
initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value f...

◆ ~ossimImageData()

ossimImageData::~ossimImageData ( )
virtual

virtual destructor

Definition at line 132 of file ossimImageData.cpp.

133 {
134 }

Member Function Documentation

◆ assign() [1/2]

void ossimImageData::assign ( const ossimDataObject data)
virtual

Reimplemented from ossimDataObject.

Definition at line 2723 of file ossimImageData.cpp.

Referenced by ossimImageElevationHandler::getTile().

2724 {
2725  if(data)
2726  {
2727  const ossimImageData* d = dynamic_cast<const ossimImageData*>(data);
2728  if(d)
2729  {
2730  assign(d);
2731  }
2732  }
2733 }
virtual void assign(const ossimDataObject *data)

◆ assign() [2/2]

void ossimImageData::assign ( const ossimImageData data)
virtual

Definition at line 2735 of file ossimImageData.cpp.

References ossimRectilinearDataObject::assign(), getBuf(), getNumberOfBands(), ossimDataObject::getOwner(), getSizeInBytes(), initializeDefaults(), m_maxPixelValue, m_minPixelValue, m_nullPixelValue, m_origin, ossimNotify(), ossimNotifyLevel_WARN, and ossimDataObject::setOwner().

2736 {
2737  ossimSource* tmp_owner = getOwner();
2738 
2740 
2741  //***
2742  // The data member "theSource" will be overwritten so capture it and then
2743  // set it back.
2744  //***
2745  setOwner(tmp_owner);
2746 
2747  if(this != data)
2748  {
2749  ossim_uint32 numberOfBands = getNumberOfBands();
2750  if(!numberOfBands)
2751  {
2753  << "ossimImageData::assign\n"
2754  << "Number of components is 0, can't assign" << std::endl;
2755  return;
2756  }
2757  m_origin = data->m_origin;
2758 
2762 
2763  if (m_minPixelValue.size() == 0 ||
2764  m_maxPixelValue.size() == 0 ||
2765  m_nullPixelValue.size() == 0)
2766  {
2768  }
2769 
2770  ossim_uint32 source_size = data->getSizeInBytes();
2771  const void* s = data->getBuf();
2772  void* d = getBuf();
2773  if (s && d)
2774  memcpy(d, s, source_size);
2775 
2776  }
2777 }
virtual void setOwner(ossimSource *aSource)
Sets the owner of this Data object.
virtual ossim_uint32 getNumberOfBands() const
virtual void assign(const ossimRectilinearDataObject *data)
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const
virtual ossimSource * getOwner()
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual void initializeDefaults()
initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value f...

◆ assignBand()

void ossimImageData::assignBand ( const ossimImageData data,
ossim_uint32  source_band,
ossim_uint32  output_band 
)
virtual

Definition at line 2779 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getSizePerBandInBytes(), isValidBand(), OSSIM_NULL, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by ossimBandSelector::getTile(), ossimEquationCombiner::parseAssignBand(), and ossimEquationCombiner::parseStdFuncs().

2782 {
2783  //***
2784  // This method requires this image data to be initialized to the same
2785  // size as the source data being copied.
2786  //***
2787 
2788  // Some basic error checking...
2789  if ( !data->isValidBand(source_band) )
2790  {
2792  << "ossimImageData::assignBand ERROR:"
2793  << "\nInvalid source band!" << std::endl;
2794  return;
2795  }
2796  if ( !isValidBand(output_band) )
2797  {
2799  << "ossimImageData::assignBand ERROR:"
2800  << "\nInvalid output band!" << std::endl;
2801  return;
2802  }
2803  if (data->getDataObjectStatus() == OSSIM_NULL)
2804  {
2806  << "ossimImageData::assignBand ERROR:"
2807  << "\nSource data status is null!" << std::endl;
2808  return;
2809  }
2811  {
2813  << "ossimImageData::assignBand ERROR:"
2814  << "\nThis status is null!" << std::endl;
2815  return;
2816  }
2817 
2818  //***
2819  // Make sure this buffer is the same size; if not, return.
2820  //***
2821  ossim_uint32 source_size = data->getSizePerBandInBytes();
2822 
2823  if ( source_size != getSizePerBandInBytes() )
2824  {
2825  return;
2826  }
2827 
2828  // Get the pointers to the bands.
2829  const void* s = data->getBuf(source_band);
2830  void* d = getBuf(output_band);
2831 
2832  // One last check.
2833  if (s == 0 || d == 0)
2834  {
2835  return;
2836  }
2837 
2838  // Ok copy the image data...
2839  memcpy(d, s, source_size);
2840 }
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
unsigned int ossim_uint32
virtual bool isValidBand(ossim_uint32 band) const
virtual const void * getBuf() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ computeAlphaChannel() [1/2]

void ossimImageData::computeAlphaChannel ( )
virtual

Computes the alpha channel.

For each pixel if any band value is not null then alpha will be 255; else, 0.

Definition at line 7107 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_STATUS_UNKNOWN, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and ossimDataObject::setDataObjectStatus().

Referenced by ossimGpkgWriter::writeTile().

7108 {
7109  if ( getDataObjectStatus() != OSSIM_NULL )
7110  {
7111  switch (getScalarType())
7112  {
7113  case OSSIM_UINT8:
7114  {
7116  return;
7117  }
7118  case OSSIM_SINT8:
7119  {
7121  return;
7122  }
7123  case OSSIM_UINT16:
7124  case OSSIM_USHORT11:
7125  case OSSIM_USHORT12:
7126  case OSSIM_USHORT13:
7127  case OSSIM_USHORT14:
7128  case OSSIM_USHORT15:
7129  {
7131  return;
7132  }
7133  case OSSIM_SINT16:
7134  {
7136  return;
7137  }
7138  case OSSIM_UINT32:
7139  {
7141  return;
7142  }
7143  case OSSIM_SINT32:
7144  {
7146  return;
7147  }
7148  case OSSIM_FLOAT32:
7150  {
7152  return;
7153  }
7155  case OSSIM_FLOAT64:
7156  {
7158  return;
7159  }
7160  case OSSIM_SCALAR_UNKNOWN:
7161  default:
7162  {
7166  "ossimImageData::computeAlphaChannel File %s line %d\n\
7167 Invalid scalar type: %d",
7168 __FILE__,
7169 __LINE__,
7170 getScalarType());
7171  break;
7172  }
7173  }
7174  }
7175 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
virtual void computeAlphaChannel()
Computes the alpha channel.
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ computeAlphaChannel() [2/2]

template<class T >
void ossimImageData::computeAlphaChannel ( dummyTemplate)
protected

Templated compute alpha channel.

For each pixel if any band value is not null then alpha will be 255; else, 0.

Definition at line 7177 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getNumberOfBands(), getSizePerBand(), m_alpha, m_nullPixelValue, OSSIM_EMPTY, and OSSIM_FULL.

7178 {
7179  const ossim_uint32 SPB = getSizePerBand();
7180  const ossim_uint8 ANP = 0; // Alpha Null Pixel
7181  const ossim_uint8 AVP = 255; // Alpha Valid Pixel
7182 
7183  // Allocate the alpha channel if not already.
7184  if (m_alpha.size() != SPB)
7185  {
7186  m_alpha.resize(SPB);
7187  }
7188 
7190  {
7191  memset( static_cast<void*>(&m_alpha.front()),
7192  static_cast<int>(AVP),
7193  static_cast<int>(SPB) );
7194  }
7195  else if (getDataObjectStatus() == OSSIM_EMPTY)
7196  {
7197  // Start with alpha being set to 0.
7198  memset( static_cast<void*>(&m_alpha.front()),
7199  static_cast<int>(ANP),
7200  static_cast<int>(SPB) );
7201  }
7202  else // Partial must check each pixel.
7203  {
7204  const ossim_uint32 BANDS = getNumberOfBands();
7205 
7206  std::vector<T> null_pix(BANDS);
7207  std::vector<const T*> buf(BANDS); // Pointer to pixel data.
7208  ossim_uint32 band;
7209  for(band = 0; band < BANDS; ++band)
7210  {
7211  buf[band] = static_cast<const T*>(getBuf(band));
7212  null_pix[band] = static_cast<T>(m_nullPixelValue[band]);
7213  }
7214 
7215  for(ossim_uint32 i = 0; i < SPB; ++i)
7216  {
7217  //---
7218  // Start with alpha being set to 0. If any band has a valid pixel set
7219  // to 255 and break from band loop.
7220  //---
7221  m_alpha[i] = ANP;
7222  for(band = 0; band < BANDS; ++band)
7223  {
7224  if (buf[band][i] != null_pix[band])
7225  {
7226  m_alpha[i] = AVP;
7227  break;
7228  }
7229  }
7230  }
7231  }
7232 
7233 } // End: template <class T> void ossimImageData::computeAlphaChannel
virtual ossim_uint32 getNumberOfBands() const
std::vector< ossim_uint8 > m_alpha
Alpha channel.
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ computeAverageBandValue() [1/2]

ossim_float64 ossimImageData::computeAverageBandValue ( ossim_uint32  bandNumber = 0) const
virtual

This will compute the average value for the band.

Definition at line 1034 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_STATUS_UNKNOWN, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and ossimDataObject::setDataObjectStatus().

1035 {
1036  ossim_float64 result = 0.0;
1037 
1038  switch (getScalarType())
1039  {
1040  case OSSIM_UINT8:
1041  {
1043  bandNumber);
1044  break;
1045  }
1046  case OSSIM_SINT8:
1047  {
1049  bandNumber);
1050  break;
1051  }
1052  case OSSIM_UINT16:
1053  case OSSIM_USHORT11:
1054  case OSSIM_USHORT12:
1055  case OSSIM_USHORT13:
1056  case OSSIM_USHORT14:
1057  case OSSIM_USHORT15:
1058  {
1060  bandNumber);
1061  break;
1062  }
1063  case OSSIM_SINT16:
1064  {
1066  bandNumber);
1067  break;
1068  }
1069  case OSSIM_UINT32:
1070  {
1072  bandNumber);
1073  break;
1074  }
1075  case OSSIM_SINT32:
1076  {
1078  bandNumber);
1079  break;
1080  }
1081  case OSSIM_FLOAT32:
1083  {
1084  result = computeAverageBandValue(ossim_float32(0.0),
1085  bandNumber);
1086  break;
1087  }
1089  case OSSIM_FLOAT64:
1090  {
1091  result = computeAverageBandValue(ossim_float64(0.0),
1092  bandNumber);
1093  break;
1094  }
1095  case OSSIM_SCALAR_UNKNOWN:
1096  default:
1097  {
1101  "ossimImageData::computeAverageBandValue File %s line %d\n\
1102 Invalid scalar type: %d",
1103 __FILE__,
1104 __LINE__,
1105 getScalarType());
1106  break;
1107  }
1108  }
1109 
1110  return result;
1111 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossim_float64 computeAverageBandValue(ossim_uint32 bandNumber=0) const
This will compute the average value for the band.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ computeAverageBandValue() [2/2]

template<class T >
ossim_float64 ossimImageData::computeAverageBandValue ( dummyTemplate,
ossim_uint32  bandNumber 
) const
protected

Templated computeAverageBandValue method.

Definition at line 1113 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getSizePerBand(), isNull(), OSSIM_EMPTY, and OSSIM_NULL.

1116 {
1117  ossim_float64 result = 0.0;
1118 
1119  if ( (getDataObjectStatus() == OSSIM_NULL) ||
1121  {
1122  return result;
1123  }
1124 
1125  ossim_uint32 index = 0;
1126  ossim_uint32 validPixelCount = 0;
1127 
1128  const T* BUFFER = static_cast<const T*>(getBuf(bandNumber));
1129  if(BUFFER)
1130  {
1131  const ossim_uint32 BOUNDS = getSizePerBand();
1132  for(index = 0; index < BOUNDS; ++index)
1133  {
1134  if(!isNull(index))
1135  {
1136  result += BUFFER[index];
1137  ++validPixelCount;
1138  }
1139  }
1140  if(validPixelCount > 0)
1141  {
1142  result /= validPixelCount;
1143  }
1144  }
1145 
1146  return result;
1147 }
virtual ossimDataObjectStatus getDataObjectStatus() const
bool isNull(ossim_uint32 offset) const
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const void * getBuf() const

◆ computeMeanSquaredError() [1/2]

ossim_float64 ossimImageData::computeMeanSquaredError ( ossim_float64  meanValue,
ossim_uint32  bandNumber = 0 
) const
virtual

This will call the compute average band value and then use that in the calculation of:

It will then do a SUM[(Mean - Actual)^2]/width*height.

This is the average variance from the passed in mean.

Definition at line 713 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_STATUS_UNKNOWN, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and ossimDataObject::setDataObjectStatus().

716 {
717  ossim_float64 result = -1; // invalid MSE
718 
719  switch (getScalarType())
720  {
721  case OSSIM_UINT8:
722  {
724  meanValue,
725  bandNumber);
726  break;
727  }
728  case OSSIM_SINT8:
729  {
731  meanValue,
732  bandNumber);
733  break;
734  }
735  case OSSIM_UINT16:
736  case OSSIM_USHORT11:
737  case OSSIM_USHORT12:
738  case OSSIM_USHORT13:
739  case OSSIM_USHORT14:
740  case OSSIM_USHORT15:
741  {
743  meanValue,
744  bandNumber);
745  break;
746  }
747  case OSSIM_SINT16:
748  {
750  meanValue,
751  bandNumber);
752  break;
753  }
754  case OSSIM_UINT32:
755  {
757  meanValue,
758  bandNumber);
759  break;
760  }
761  case OSSIM_SINT32:
762  {
764  meanValue,
765  bandNumber);
766  break;
767  }
768  case OSSIM_FLOAT32:
770  {
772  meanValue,
773  bandNumber);
774  break;
775  }
777  case OSSIM_FLOAT64:
778  {
780  meanValue,
781  bandNumber);
782  break;
783  }
785  default:
786  {
790  "ossimImageData::computeMeanSquaredError File %s line %d\n\
791 Invalid scalar type: %d",
792 __FILE__,
793 __LINE__,
794 getScalarType());
795  break;
796  }
797  }
798 
799  return result;
800 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossim_float64 computeMeanSquaredError(ossim_float64 meanValue, ossim_uint32 bandNumber=0) const
This will call the compute average band value and then use that in the calculation of: ...
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ computeMeanSquaredError() [2/2]

template<class T >
ossim_float64 ossimImageData::computeMeanSquaredError ( dummyTemplate,
ossim_float64  meanValue,
ossim_uint32  bandNumber 
) const
protected

Templated computeMeanSquaredError method.

Definition at line 802 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getSizePerBand(), isNull(), OSSIM_EMPTY, and OSSIM_NULL.

806 {
807  ossim_float64 result = -1.0; // invalid MSE
808 
809  if ( (getDataObjectStatus() == OSSIM_NULL) ||
811  {
812  return result;
813  }
814 
815  ossim_uint32 index = 0;
816  ossim_float64 delta = 0.0;
817  ossim_uint32 validPixelCount = 0;
818 
819  const T* BUFFER = static_cast<const T*>(getBuf(bandNumber));
820  if(BUFFER)
821  {
822  const ossim_uint32 BOUNDS = getSizePerBand();
823  for(index = 0; index < BOUNDS; ++index)
824  {
825  if(!isNull(index))
826  {
827  delta = BUFFER[index] - meanValue;
828  result += (delta*delta);
829  ++validPixelCount;
830  }
831  }
832  if(validPixelCount > 0)
833  {
834  result /= validPixelCount;
835  }
836  }
837 
838  return result;
839 }
virtual ossimDataObjectStatus getDataObjectStatus() const
bool isNull(ossim_uint32 offset) const
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const void * getBuf() const

◆ computeMinMaxNulPix() [1/3]

virtual void ossimImageData::computeMinMaxNulPix ( std::vector< ossim_float64 > &  minBands,
std::vector< ossim_float64 > &  maxBands,
std::vector< ossim_float64 > &  nulBands 
) const
virtual

Scans tile for min, max, nulls.

If the nullBands, minBands and maxBands are empty or not equal to the imageData's current number of bands it will erase the contents, resize, and then replace the values in the passed in array with this objects min max values. If the arrays are the same size as this objects number of bands it will just update the values and use the current values in the arrays as initial min max values.

If the status of this object(getDataObjectStatus()) is OSSIM_NULL no action is performed.

Referenced by ossimOverviewSequencer::getNextTile().

◆ computeMinMaxNulPix() [2/3]

template<class T >
void ossimImageData::computeMinMaxNulPix ( dummyValue,
std::vector< ossim_float64 > &  minBands,
std::vector< ossim_float64 > &  maxBands,
std::vector< ossim_float64 > &  nulBands 
) const
protected

◆ computeMinMaxNulPix() [3/3]

template<class T >
void ossimImageData::computeMinMaxNulPix ( ,
vector< ossim_float64 > &  minBands,
vector< ossim_float64 > &  maxBands,
vector< ossim_float64 > &  nulBands 
) const

Definition at line 3950 of file ossimImageData.cpp.

References ossim::defaultNull(), getBuf(), getMaxPix(), getMinPix(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), and getSizePerBand().

3954 {
3955  const ossim_uint32 BANDS = getNumberOfBands();
3956  const ossim_uint32 SPB = getSizePerBand();
3957  T DEFAULT_NULL = static_cast<T>(ossim::defaultNull(getScalarType()));
3958 
3959  if( minBands.size() != BANDS ||
3960  maxBands.size() != BANDS ||
3961  nulBands.size() != BANDS )
3962  {
3963  // First time through.
3964  minBands.resize(BANDS);
3965  maxBands.resize(BANDS);
3966  nulBands.resize(BANDS);
3967  for (ossim_uint32 band = 0; band < BANDS; ++band)
3968  {
3969  // Set min to max and max to min for starters.
3970  minBands[band] = getMaxPix(band);
3971  maxBands[band] = getMinPix(band);
3972  nulBands[band] = getMaxPix(band);
3973  }
3974  }
3975 
3976  for(ossim_uint32 band = 0; band < BANDS; ++band)
3977  {
3978  const T* bandBuffer = (const T*)getBuf(band);
3979  if(bandBuffer)
3980  {
3981  ossim_float64 currentMin = minBands[band];
3982  ossim_float64 currentMax = maxBands[band];
3983  ossim_float64 currentNul = nulBands[band];
3984  for(ossim_uint32 offset = 0; offset < SPB; ++offset)
3985  {
3986  T p = bandBuffer[offset];
3987 
3988  // Since we are scanning for nulls this is making an assumption that the default
3989  // null is incorrect and should be ignored in this scan as it could have been
3990  // introduced by a make blank on a partial tile so ignore it.
3991  // NOTE (OLK 03/2015): It is a bad idea to ignore pixels with default nulls, as it may
3992  // be the actual null value being used. By ignoring it, a new null will be latched
3993  // corresponding to actual, non-null, minimum value. Unfortunately, when tiles are
3994  // initialized, they are filled with default nulls since (with float-data), the
3995  // null (if any exists) is not yet known -- effectively creating two null pixel values.
3996  // The recommendation (if you're looking at this code, then you're probably having the
3997  // problem that your nulls aren't being recognized), is to turn off the flag in your
3998  // ossim prefs file with: overview_builder.scan_for_min_max_null_if_float: false
3999  // (or just delete that line)
4000  if ( p != DEFAULT_NULL )
4001  {
4002  // Must do null first as min depends on null.
4003  if ( p < currentNul )
4004  {
4005  currentNul = p;
4006  }
4007  if( ( p < currentMin ) && ( p > currentNul ) )
4008  {
4009  currentMin = p;
4010  }
4011  else if( p > currentMax )
4012  {
4013  currentMax = p;
4014  }
4015  }
4016  }
4017  minBands[band] = currentMin;
4018  maxBands[band] = currentMax;
4019  nulBands[band] = currentNul;
4020  }
4021  }
4022 }
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
double ossim_float64
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getMinPix() const
virtual ossimScalarType getScalarType() const
virtual const void * getBuf() const

◆ computeMinMaxPix() [1/3]

virtual void ossimImageData::computeMinMaxPix ( std::vector< ossim_float64 > &  minBands,
std::vector< ossim_float64 > &  maxBands 
) const
virtual

If the minBands and maxBands are empty or not equal to the imageData's current number of bands it will erase the contents, resize, and then replace the values in the passed in array with this objects min max values.

If the arrays are the same size as this objects number of bands it will just update the values and use the current values in the arrays as initial min max values.

If the status of this object(getDataObjectStatus()) is OSSIM_NULL or OSSIM_EMPTY no action is performed.

Referenced by ossimOverviewSequencer::getNextTile().

◆ computeMinMaxPix() [2/3]

template<class T >
void ossimImageData::computeMinMaxPix ( dummyValue,
std::vector< ossim_float64 > &  minBands,
std::vector< ossim_float64 > &  maxBands 
) const
protected

◆ computeMinMaxPix() [3/3]

template<class T >
void ossimImageData::computeMinMaxPix ( ,
vector< ossim_float64 > &  minBands,
vector< ossim_float64 > &  maxBands 
) const

Definition at line 3806 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), getNumberOfBands(), and getSizePerBand().

3809 {
3810  const ossim_uint32 BANDS = getNumberOfBands();
3811  const ossim_uint32 SPB = getSizePerBand();
3812 
3813  if( minBands.size() != BANDS ||
3814  maxBands.size() != BANDS )
3815  {
3816  minBands.resize(BANDS);
3817  maxBands.resize(BANDS);
3818  for (ossim_uint32 band = 0; band < BANDS; ++band)
3819  {
3820  // Set min to max and max to min for starters.
3821  minBands[band] = getMaxPix(band);
3822  maxBands[band] = getMinPix(band);
3823  }
3824  }
3825 
3826  for(ossim_uint32 band = 0; band < BANDS; ++band)
3827  {
3828  const T* bandBuffer = (const T*)getBuf(band);
3829  if(bandBuffer)
3830  {
3831  const T NP = static_cast<T>(getNullPix(band));
3832  ossim_float64 currentMin = minBands[band];
3833  ossim_float64 currentMax = maxBands[band];
3834  for(ossim_uint32 offset = 0; offset < SPB; ++offset)
3835  {
3836  T p = bandBuffer[offset];
3837  if(p != NP)
3838  {
3839  if(p < currentMin)
3840  {
3841  currentMin = p;
3842  }
3843  else if(p > currentMax)
3844  {
3845  currentMax = p;
3846  }
3847  }
3848  }
3849  minBands[band] = currentMin;
3850  maxBands[band] = currentMax;
3851  }
3852  }
3853 }
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const

◆ convertToNormalizedDouble()

void ossimImageData::convertToNormalizedDouble ( ossimImageData result) const
virtual

Will use the memory that you pass in to normalize this data object.

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 657 of file ossimImageData.cpp.

References copyTileToNormalizedBuffer(), getBuf(), ossimDataObject::getDataObjectStatus(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_NORMALIZED_DOUBLE, OSSIM_NULL, and ossimDataObject::setDataObjectStatus().

Referenced by newNormalizedDouble().

658 {
659  if(!result)
660  {
661  return;
662  }
663  // make sure that the types and width and height are
664  // good.
665  if( (result->getScalarType() != OSSIM_NORMALIZED_DOUBLE) ||
666  (result->getNumberOfBands() != this->getNumberOfBands())||
667  (result->getWidth() != this->getWidth()) ||
668  (result->getHeight() != this->getHeight())||
669  (result->getDataObjectStatus() == OSSIM_NULL) ||
671  {
672  return;
673  }
674 
677 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
double ossim_float64
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.

◆ convertToNormalizedFloat()

void ossimImageData::convertToNormalizedFloat ( ossimImageData result) const
virtual

Will use the memory that you pass in to normalize this data object.

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 619 of file ossimImageData.cpp.

References copyTileToNormalizedBuffer(), getBuf(), ossimDataObject::getDataObjectStatus(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, and ossimDataObject::setDataObjectStatus().

Referenced by newNormalizedFloat().

620 {
621  if(!result)
622  {
623  return;
624  }
625  // make sure that the types and width and height are
626  // good.
627  if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
628  (result->getNumberOfBands() != this->getNumberOfBands())||
629  (result->getWidth() != this->getWidth()) ||
630  (result->getHeight() != this->getHeight())||
631  (result->getDataObjectStatus() == OSSIM_NULL) ||
633  {
634  return;
635  }
636 
639 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
float ossim_float32
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
32 bit normalized floating point
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual ossimScalarType getScalarType() const
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.

◆ copyLine()

void ossimImageData::copyLine ( const void *  src,
ossim_int32  lineNumber,
ossim_int32  lineStartSample,
ossim_int32  lineStopSample,
ossimInterleaveType  lineInterleave 
)
virtual

Method to copy a single line to the tile.

This will copy a line to the tile. It is assumed that all bands are in the buffer "src". Only pixels within the tile rect will be copied. Note that all coordinates are relative to the tile coordinates. Clipping will be performed on pixels outside of the tile rectangle. No fill is added if a partial tile line is copied so callers should do a ossimImageData::makeBlank if the whole tile is not to be stuffed. ossimImageData::validate should be called after all lines are copied if in doubt of a full tile.

Parameters
srcThe source buffer or line to copy containing all bands.
lineNumberLine number to copy.
lineStartSampleThe start sample of the source buffer relative to tile coordinates.
lineStopSampleThe stop sample of the source buffer relative to tile coordinates.
lineInterleaveInterleave of src buffer. If OSSIM_BIP assumed rgbrgbrgb; else, red row, green row, blue row.

Usage example in method: ossimTiffTileSource::loadFromScanLine

Definition at line 7277 of file ossimImageData.cpp.

References copyLineTemplate(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by ossimTiffTileSource::loadFromScanLine().

7282 {
7283  switch(m_scalarType)
7284  {
7285  case OSSIM_UINT8:
7286  {
7287  copyLineTemplate((ossim_uint8)0, src, lineNumber, lineStartSample,
7288  lineStopSample, lineInterleave);
7289  break;
7290  }
7291  case OSSIM_SINT8:
7292  {
7293  copyLineTemplate((ossim_sint8)0, src, lineNumber, lineStartSample,
7294  lineStopSample, lineInterleave);
7295  break;
7296 
7297  }
7298  case OSSIM_USHORT11:
7299  case OSSIM_USHORT12:
7300  case OSSIM_USHORT13:
7301  case OSSIM_USHORT14:
7302  case OSSIM_USHORT15:
7303  case OSSIM_UINT16:
7304  {
7305  copyLineTemplate((ossim_uint16)0, src, lineNumber, lineStartSample,
7306  lineStopSample, lineInterleave);
7307  break;
7308  }
7309  case OSSIM_SINT16:
7310  {
7311  copyLineTemplate((ossim_sint16)0, src, lineNumber, lineStartSample,
7312  lineStopSample, lineInterleave);
7313  break;
7314  }
7315  case OSSIM_UINT32:
7316  {
7317  copyLineTemplate((ossim_uint32)0, src, lineNumber, lineStartSample,
7318  lineStopSample, lineInterleave);
7319  break;
7320  }
7321  case OSSIM_SINT32:
7322  {
7323  copyLineTemplate((ossim_sint32)0, src, lineNumber, lineStartSample,
7324  lineStopSample, lineInterleave);
7325  break;
7326  }
7328  case OSSIM_FLOAT32:
7329  {
7330  copyLineTemplate((ossim_float32)0.0, src, lineNumber, lineStartSample,
7331  lineStopSample, lineInterleave);
7332  break;
7333  }
7335  case OSSIM_FLOAT64:
7336  {
7337  copyLineTemplate((ossim_float64)0.0, src, lineNumber, lineStartSample,
7338  lineStopSample, lineInterleave);
7339  break;
7340  }
7341  case OSSIM_SCALAR_UNKNOWN:
7342  default:
7343  {
7344  // Shouldn't hit this.
7346  << "ossimImageData::copyLine Unsupported scalar type!"
7347  << std::endl;
7348  break;
7349  }
7350  }
7351 
7352 } // End: void ossimImageData::copyLine
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
void copyLineTemplate(T dummyTemplate, const void *src, ossim_int32 lineNumber, ossim_int32 lineStartSample, ossim_int32 lineStopSample, ossimInterleaveType lineInterleave)
Templated copy line method.
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyLineTemplate()

template<class T >
void ossimImageData::copyLineTemplate ( dummyTemplate,
const void *  src,
ossim_int32  lineNumber,
ossim_int32  lineStartSample,
ossim_int32  lineStopSample,
ossimInterleaveType  lineInterleave 
)
protected

Templated copy line method.

Definition at line 7355 of file ossimImageData.cpp.

References getBuf(), getImageRectangle(), ossimIrect::lr(), ossimRectilinearDataObject::m_numberOfDataComponents, OSSIM_BIP, ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by copyLine().

7361 {
7362  if (src)
7363  {
7364  const ossimIrect RECT = getImageRectangle();
7365 
7366  // Check for intersect:
7367  if ( ( lineNumber >= RECT.ul().y) &&
7368  ( lineNumber <= RECT.lr().y) &&
7369  ( lineStartSample < lineStopSample) &&
7370  ( lineStartSample <= RECT.lr().x) &&
7371  ( lineStopSample >= RECT.ul().x) )
7372  {
7373  const ossim_int32 BANDS = static_cast<ossim_int32>(m_numberOfDataComponents);
7374  const ossim_int32 START_SAMP =
7375  (lineStartSample > RECT.ul().x)?lineStartSample:RECT.ul().x;
7376  const ossim_int32 STOP_SAMP =
7377  (lineStopSample < RECT.lr().x)?lineStopSample:RECT.lr().x;
7378  const ossim_int32 SAMPS = STOP_SAMP - START_SAMP + 1;
7379 
7380  std::vector<T*> d(BANDS);
7381 
7382  ossim_int32 band;
7383  for (band = 0; band < BANDS; ++band)
7384  {
7385  d[band] = static_cast<T*>(getBuf(band));
7386 
7387  // Position at start sample.
7388  d[band] += (lineNumber - RECT.ul().y) * RECT.width() + (START_SAMP - RECT.ul().x);
7389  }
7390 
7391  if (lineInterleave == OSSIM_BIP)
7392  {
7393  const T* S = static_cast<const T*>(src); // Source buffer:
7394 
7395  // Position at start sample.
7396  S += (START_SAMP - lineStartSample) * BANDS;
7397 
7398  ossim_int32 srcOffset = 0;
7399  for (ossim_int32 samp = 0; samp < SAMPS; ++samp)
7400  {
7401  for (band = 0; band < BANDS; ++band)
7402  {
7403  d[band][samp] = S[srcOffset++];
7404  }
7405  }
7406  }
7407  else
7408  {
7409  const ossim_int32 W = lineStopSample - lineStartSample + 1;
7410  std::vector<const T*> S(BANDS);
7411  for (band = 0; band < BANDS; ++band)
7412  {
7413  S[band] = static_cast<const T*>(src) + (START_SAMP - lineStartSample);
7414  if (band)
7415  {
7416  S[band] += band * W; // Move to line.
7417  }
7418  }
7419 
7420  for (band = 0; band < BANDS; ++band)
7421  {
7422  for (ossim_int32 samp = 0; samp < SAMPS; ++samp)
7423  {
7424  d[band][samp] = S[band][samp];
7425  }
7426  }
7427  }
7428 
7429  } // intersect check
7430 
7431  } // if (src)
7432 
7433 } // End: template <class T> void ossimImageData::copyLineTemplate
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ copyNormalizedBufferToTile() [1/8]

void ossimImageData::copyNormalizedBufferToTile ( ossim_float64 buf)
virtual

Copies buf passed in to tile.

Data is unnormalized to the tile's scalar type. The "buf" passed to method is assumed to be at least as big as the tiles: "getSize() * sizeof(double)"

Reimplemented in ossimU8ImageData, ossimU16ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 6547 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getDataSizeInBytes(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by ossimMaxMosaic::combineNorm(), ossimBlendMosaic::combineNorm(), copyNormalizedBufferToTile(), ossimIntensityAdjustmentFilter::getTile(), ossimColorNormalizedFusion::getTile(), ossimBrightnessContrastSource::getTile(), ossimGammaRemapper::getTile(), ossimSFIMFusion::getTile(), ossimClosestToCenterCombiner::getTile(), ossimHsiRemapper::getTile(), ossimBandClipFilter::getTile(), ossimTableRemapper::remapFromNativeTable(), ossimTableRemapper::remapFromNormalizedTable(), and unnormalizeInput().

6548 {
6549  if (!buf)
6550  {
6552  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6553  << "\nNull buffer passed to method! Returning..." << std::endl;
6554  return;
6555  }
6556 
6558  {
6560  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6561  << "\nThis object is null! Returning..." << std::endl;
6562  return;
6563  }
6564 
6565  switch(getScalarType())
6566  {
6568  {
6569  memmove(getBuf(), buf, getDataSizeInBytes());
6570  break;
6571  }
6573  {
6574  ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
6575  ossim_float32* inputBuf = static_cast<ossim_float32*>(getBuf());
6576  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
6577  {
6578  inputBuf[offset] = static_cast<ossim_float32>(buf[offset]);
6579  }
6580  break;
6581  }
6582  case OSSIM_FLOAT32:
6583  {
6585  break;
6586  }
6587  case OSSIM_FLOAT64:
6588  {
6590  break;
6591  }
6592  case OSSIM_UINT8:
6593  {
6595  break;
6596 
6597  }
6598  case OSSIM_SINT8:
6599  {
6601  break;
6602 
6603  }
6604  case OSSIM_USHORT11:
6605  case OSSIM_USHORT12:
6606  case OSSIM_USHORT13:
6607  case OSSIM_USHORT14:
6608  case OSSIM_USHORT15:
6609  case OSSIM_UINT16:
6610  {
6612  break;
6613  }
6614  case OSSIM_SINT16:
6615  {
6617  break;
6618  }
6619  case OSSIM_UINT32:
6620  {
6622  break;
6623  }
6624  case OSSIM_SINT32:
6625  {
6627  break;
6628  }
6629  case OSSIM_SCALAR_UNKNOWN:
6630  default:
6631  {
6633  << "ossimImageData::copyNormalizedBufferToTile\n"
6634  << "Unknown scalar type!" << std::endl;
6635  }
6636 
6637  } // End of "switch(getScalarType())".
6638 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
virtual ossim_uint32 getDataSizeInBytes() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyNormalizedBufferToTile() [2/8]

void ossimImageData::copyNormalizedBufferToTile ( ossim_float32 buf)
virtual

Reimplemented in ossimU16ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, ossimS16ImageData, and ossimU8ImageData.

Definition at line 6737 of file ossimImageData.cpp.

References copyNormalizedBufferToTile(), getBuf(), ossimDataObject::getDataObjectStatus(), getDataSizeInBytes(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

6738 {
6739  if (!buf)
6740  {
6742  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6743  << "\nNull buffer passed to method! Returning..." << std::endl;
6744  return;
6745  }
6746 
6748  {
6750  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6751  << "\nThis object is null! Returning..." << std::endl;
6752  return;
6753  }
6754 
6755  switch(getScalarType())
6756  {
6758  {
6759  ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
6760  ossim_float64* inputBuf = static_cast<ossim_float64*>(getBuf());
6761  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
6762  {
6763  inputBuf[offset] = buf[offset];
6764  }
6765  break;
6766  }
6768  {
6769  memmove(getBuf(), buf, getDataSizeInBytes());
6770  break;
6771  }
6772  case OSSIM_FLOAT32:
6773  {
6775  break;
6776  }
6777  case OSSIM_FLOAT64:
6778  {
6780  break;
6781  }
6782  case OSSIM_UINT8:
6783  {
6785  break;
6786 
6787  }
6788  case OSSIM_SINT8:
6789  {
6791  break;
6792 
6793  }
6794  case OSSIM_USHORT11:
6795  case OSSIM_USHORT12:
6796  case OSSIM_USHORT13:
6797  case OSSIM_USHORT14:
6798  case OSSIM_USHORT15:
6799  case OSSIM_UINT16:
6800  {
6802  break;
6803  }
6804  case OSSIM_SINT16:
6805  {
6807  break;
6808  }
6809  case OSSIM_UINT32:
6810  {
6812  break;
6813  }
6814  case OSSIM_SINT32:
6815  {
6817  break;
6818  }
6819  case OSSIM_SCALAR_UNKNOWN:
6820  default:
6821  {
6823  << "ossimImageDatacopyNormalizedBufferToTile\n"
6824  << "Unknown scalar type!" << std::endl;
6825  }
6826 
6827  } // End of "switch(getScalarType())".
6828 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
virtual ossim_uint32 getDataSizeInBytes() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyNormalizedBufferToTile() [3/8]

void ossimImageData::copyNormalizedBufferToTile ( ossim_uint32  band,
ossim_float64 buf 
)
virtual

Will copy the normalized buffer to this tiles specified band.

If band is out of range then nothing

is done and returns.

Reimplemented in ossimU16ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, ossimS16ImageData, and ossimU8ImageData.

Definition at line 6640 of file ossimImageData.cpp.

References copyNormalizedBufferToTile(), getBuf(), ossimDataObject::getDataObjectStatus(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getSizePerBandInBytes(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

6642 {
6643  if (!buf)
6644  {
6646  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6647  << "\nNull buffer passed to method! Returning..." << std::endl;
6648  return;
6649  }
6650 
6652  {
6654  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6655  << "\nThis object is null! Returning..." << std::endl;
6656  return;
6657  }
6658 
6659  if(band < getNumberOfBands())
6660  {
6661  switch(getScalarType())
6662  {
6664  {
6665  memmove(getBuf(band), buf, getSizePerBandInBytes());
6666  break;
6667  }
6669  {
6670  ossim_uint32 upperBound = getWidth()*getHeight();
6671  ossim_float32* inputBuf = static_cast<ossim_float32*>(getBuf(band));
6672  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
6673  {
6674  inputBuf[offset] = static_cast<ossim_float32>(buf[offset]);
6675  }
6676  break;
6677  }
6678  case OSSIM_FLOAT32:
6679  {
6681  break;
6682  }
6683  case OSSIM_FLOAT64:
6684  {
6686  break;
6687  }
6688  case OSSIM_UINT8:
6689  {
6690  copyNormalizedBufferToTile((ossim_uint8)0, band, buf);
6691  break;
6692 
6693  }
6694  case OSSIM_SINT8:
6695  {
6696  copyNormalizedBufferToTile((ossim_sint8)0, band, buf);
6697  break;
6698 
6699  }
6700  case OSSIM_USHORT11:
6701  case OSSIM_USHORT12:
6702  case OSSIM_USHORT13:
6703  case OSSIM_USHORT14:
6704  case OSSIM_USHORT15:
6705  case OSSIM_UINT16:
6706  {
6708  break;
6709  }
6710  case OSSIM_SINT16:
6711  {
6713  break;
6714  }
6715  case OSSIM_UINT32:
6716  {
6718  break;
6719  }
6720  case OSSIM_SINT32:
6721  {
6723  break;
6724  }
6725  case OSSIM_SCALAR_UNKNOWN:
6726  default:
6727  {
6729  << "ossimImageData::copyNormalizedBufferToTile\n"
6730  << "Unknown scalar type." << std::endl;
6731  }
6732 
6733  } // End of "switch(getScalarType())".
6734  }
6735 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyNormalizedBufferToTile() [4/8]

void ossimImageData::copyNormalizedBufferToTile ( ossim_uint32  band,
ossim_float32 buf 
)
virtual

Reimplemented in ossimU16ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, ossimS16ImageData, and ossimU8ImageData.

Definition at line 6830 of file ossimImageData.cpp.

References copyNormalizedBufferToTile(), getBuf(), ossimDataObject::getDataObjectStatus(), getHeight(), ossimRectilinearDataObject::getScalarType(), getSizePerBandInBytes(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

6832 {
6833  if (!buf)
6834  {
6836  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6837  << "\nNull buffer passed to method! Returning..." << std::endl;
6838  return;
6839  }
6840 
6842  {
6844  << "ossimImageData::copyNormalizedBufferToTile ERROR:"
6845  << "\nThis object is null! Returning..." << std::endl;
6846  return;
6847  }
6848 
6849  switch(getScalarType())
6850  {
6852  {
6853  ossim_uint32 upperBound = getWidth()*getHeight();
6854  ossim_float64* inputBuf = static_cast<ossim_float64*>(getBuf(band));
6855  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
6856  {
6857  inputBuf[offset] = buf[offset];
6858  }
6859  break;
6860  }
6862  {
6863  memmove(getBuf(band), buf, getSizePerBandInBytes());
6864  break;
6865  }
6866  case OSSIM_FLOAT32:
6867  {
6869  break;
6870  }
6871  case OSSIM_FLOAT64:
6872  {
6874  break;
6875  }
6876  case OSSIM_UINT8:
6877  {
6878  copyNormalizedBufferToTile((ossim_uint8)0, band, buf);
6879  break;
6880 
6881  }
6882  case OSSIM_SINT8:
6883  {
6884  copyNormalizedBufferToTile((ossim_sint8)0, band, buf);
6885  break;
6886 
6887  }
6888  case OSSIM_USHORT11:
6889  case OSSIM_USHORT12:
6890  case OSSIM_USHORT13:
6891  case OSSIM_USHORT14:
6892  case OSSIM_USHORT15:
6893  case OSSIM_UINT16:
6894  {
6896  break;
6897  }
6898  case OSSIM_SINT16:
6899  {
6901  break;
6902  }
6903  case OSSIM_UINT32:
6904  {
6906  break;
6907  }
6908  case OSSIM_SINT32:
6909  {
6911  break;
6912  }
6913  case OSSIM_SCALAR_UNKNOWN:
6914  default:
6915  {
6917  << "ossimImageData::copyNormalizedBufferToTile\n"
6918  << "Unknown scalar type!" << std::endl;
6919  }
6920 
6921  } // End of "switch(getScalarType())".
6922 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyNormalizedBufferToTile() [5/8]

template<class T >
void ossimImageData::copyNormalizedBufferToTile ( dummyTemplate,
ossim_float64 buf 
)
protected

Copies buf passed in to tile.

Data is unnormalized to the tile's scalar type. The "buf" passed to method is assumed to be at least as big as the tiles: "getSize() * sizeof(double)"

Definition at line 6134 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), getNumberOfBands(), and getSizePerBand().

6136 {
6137  const ossim_uint32 SIZE = getSizePerBand();
6138  const ossim_uint32 BANDS = getNumberOfBands();
6139 
6140  for(ossim_uint32 band = 0; band < BANDS; ++band)
6141  {
6142  const ossim_float64 MIN_PIX = getMinPix(band);
6143  const ossim_float64 MAX_PIX = getMaxPix(band);
6144  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
6145  const T NP = (T)getNullPix(band);
6146 
6147  ossim_float64* s = buf + (band*SIZE); // source
6148  T* d = (T*)getBuf(band); // destination
6149 
6150  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6151  {
6152  const ossim_float64 P = s[offset];
6153  if(P != 0.0)
6154  {
6155  d[offset] = (T)(MIN_PIX + RANGE*P);
6156  }
6157  else
6158  {
6159  d[offset] = NP;
6160  }
6161  }
6162  }
6163 }
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const

◆ copyNormalizedBufferToTile() [6/8]

template<class T >
void ossimImageData::copyNormalizedBufferToTile ( dummyTemplate,
ossim_float32 buf 
)
protected

Definition at line 6166 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), getNumberOfBands(), and getSizePerBand().

6168 {
6169  const ossim_uint32 SIZE = getSizePerBand();
6170  const ossim_uint32 BANDS = getNumberOfBands();
6171 
6172  for(ossim_uint32 band = 0; band < BANDS; ++band)
6173  {
6174  const ossim_float64 MIN_PIX = getMinPix(band);
6175  const ossim_float64 MAX_PIX = getMaxPix(band);
6176  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
6177  const T NP = (T)getNullPix(band);
6178 
6179  ossim_float32* s = buf + (band*SIZE); // source
6180  T* d = (T*)getBuf(band); // destination
6181 
6182  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6183  {
6184  const ossim_float64 P = s[offset];
6185  if(P != 0.0)
6186  {
6187  ossim_float64 test = MIN_PIX + RANGE*P;
6188  if(test > MAX_PIX) test = MAX_PIX;
6189  d[offset] = (T)test;
6190  }
6191  else
6192  {
6193  d[offset] = NP;
6194  }
6195  }
6196  }
6197 }
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
float ossim_float32
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const

◆ copyNormalizedBufferToTile() [7/8]

template<class T >
void ossimImageData::copyNormalizedBufferToTile ( dummyTemplate,
ossim_uint32  band,
ossim_float64 buf 
)
protected

Definition at line 6200 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), and getSizePerBand().

6203 {
6204  const ossim_uint32 SIZE = getSizePerBand();
6205  const ossim_float64 MIN_PIX = getMinPix(band);
6206  const ossim_float64 MAX_PIX = getMaxPix(band);
6207  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
6208  const T NP = (T)getNullPix(band);
6209 
6210  ossim_float64* s = buf; // source
6211  T* d = (T*)getBuf(band); // destination
6212 
6213  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6214  {
6215  const ossim_float64 P = s[offset];
6216  if(P != 0.0)
6217  {
6218  ossim_float64 test = MIN_PIX + RANGE*P;
6219  if(test > MAX_PIX) test = MAX_PIX;
6220  d[offset] = (T)test;
6221  }
6222  else
6223  {
6224  d[offset] = NP;
6225  }
6226  }
6227 }
virtual const ossim_float64 * getMaxPix() const
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const

◆ copyNormalizedBufferToTile() [8/8]

template<class T >
void ossimImageData::copyNormalizedBufferToTile ( dummyTemplate,
ossim_uint32  band,
ossim_float32 buf 
)
protected

Definition at line 6230 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), and getSizePerBand().

6233 {
6234  const ossim_uint32 SIZE = getSizePerBand();
6235  const ossim_float64 MIN_PIX = getMinPix(band);
6236  const ossim_float64 MAX_PIX = getMaxPix(band);
6237  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
6238  const T NP = (T)getNullPix(band);
6239 
6240  ossim_float32* s = buf; // source
6241  T* d = (T*)getBuf(band); // destination
6242 
6243  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6244  {
6245  const ossim_float64 P = s[offset];
6246  if(P != 0.0)
6247  {
6248  ossim_float64 test = MIN_PIX + RANGE*P;
6249  if(test > MAX_PIX) test = MAX_PIX;
6250  d[offset] = (T)test;
6251  }
6252  else
6253  {
6254  d[offset] = NP;
6255  }
6256  }
6257 }
virtual const ossim_float64 * getMaxPix() const
float ossim_float32
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const

◆ copyTileBandToNormalizedBuffer() [1/2]

void ossimImageData::copyTileBandToNormalizedBuffer ( ossim_uint32  band,
ossim_float64 buf 
) const
virtual

Will copy this tiles specified band number to the normalized buffer.

if the band is out of range then nothing is done and returns.

Parameters
bandZero based band to copy.
bufBuffer to copy to.

Definition at line 6259 of file ossimImageData.cpp.

References copyTileToNormalizedBuffer(), getBuf(), ossimDataObject::getDataObjectStatus(), getDataSizeInBytes(), getHeight(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by ossimSFIMFusion::getTile(), ossimHsiRemapper::getTile(), and ossimTwoColorView::runNorm().

6261 {
6262  if (!buf)
6263  {
6265  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
6266  << "\nNull buffer passed to method! Returning..." << std::endl;
6267  return;
6268  }
6269 
6271  {
6273  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
6274  << "\nThis object is null! Returning..." << std::endl;
6275  return;
6276  }
6277 
6278  if(!getBuf(band)) return;
6279 
6280  switch(getScalarType())
6281  {
6283  {
6284  memmove(buf, getBuf(band), getDataSizeInBytes());
6285  break;
6286  }
6288  {
6289  ossim_uint32 upperBound = getWidth()*getHeight();
6290  const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf(band));
6291  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
6292  {
6293  buf[offset] = inputBuf[offset];
6294  }
6295  break;
6296  }
6297  case OSSIM_FLOAT32:
6298  {
6300  break;
6301  }
6302  case OSSIM_FLOAT64:
6303  {
6305  break;
6306  }
6307  case OSSIM_UINT8:
6308  {
6309  copyTileToNormalizedBuffer((ossim_uint8)0, band, buf);
6310  break;
6311 
6312  }
6313  case OSSIM_SINT8:
6314  {
6315  copyTileToNormalizedBuffer((ossim_sint8)0, band, buf);
6316  break;
6317 
6318  }
6319  case OSSIM_USHORT11:
6320  case OSSIM_USHORT12:
6321  case OSSIM_USHORT13:
6322  case OSSIM_USHORT14:
6323  case OSSIM_USHORT15:
6324  case OSSIM_UINT16:
6325  {
6327  break;
6328  }
6329  case OSSIM_SINT16:
6330  {
6332  break;
6333  }
6334  case OSSIM_UINT32:
6335  {
6337  break;
6338  }
6339  case OSSIM_SINT32:
6340  {
6342  break;
6343  }
6344  case OSSIM_SCALAR_UNKNOWN:
6345  default:
6346  {
6348  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
6349  << " Unknown scalar type!"
6350  << std::endl;
6351  }
6352 
6353  } // End of "switch(getScalarType())"
6354 
6355 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
virtual ossim_uint32 getDataSizeInBytes() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyTileBandToNormalizedBuffer() [2/2]

void ossimImageData::copyTileBandToNormalizedBuffer ( ossim_uint32  band,
ossim_float32 buf 
) const
virtual

Will copy this tiles specified band number to the normalized buffer.

if the band is out of range then nothing is done and returns.

Parameters
bandZero based band to copy.
bufBuffer to copy to.

Definition at line 6451 of file ossimImageData.cpp.

References copyTileToNormalizedBuffer(), getBuf(), ossimDataObject::getDataObjectStatus(), getHeight(), ossimRectilinearDataObject::getScalarType(), getSizePerBandInBytes(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

6453 {
6454  if (!buf)
6455  {
6457  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
6458  << "\nNull buffer passed to method! Returning..." << std::endl;
6459  return;
6460  }
6461 
6463  {
6465  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
6466  << "\nThis object is null! Returning..." << std::endl;
6467  return;
6468  }
6469 
6470  switch(getScalarType())
6471  {
6473  {
6474  ossim_uint32 upperBound = getWidth()*getHeight();
6475  const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf(band));
6476  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
6477  {
6478  buf[offset] = inputBuf[offset];
6479  }
6480  break;
6481  }
6483  {
6484  memmove(buf, getBuf(band), getSizePerBandInBytes());
6485  break;
6486  }
6487  case OSSIM_FLOAT32:
6488  {
6490  break;
6491  }
6492  case OSSIM_FLOAT64:
6493  {
6495  break;
6496  }
6497  case OSSIM_UINT8:
6498  {
6499  copyTileToNormalizedBuffer((ossim_uint8)0, band, buf);
6500  break;
6501 
6502  }
6503  case OSSIM_SINT8:
6504  {
6505  copyTileToNormalizedBuffer((ossim_sint8)0, band, buf);
6506  break;
6507 
6508  }
6509  case OSSIM_USHORT11:
6510  case OSSIM_USHORT12:
6511  case OSSIM_USHORT13:
6512  case OSSIM_USHORT14:
6513  case OSSIM_USHORT15:
6514  case OSSIM_UINT16:
6515  {
6517  break;
6518  }
6519  case OSSIM_SINT16:
6520  {
6522  break;
6523  }
6524  case OSSIM_UINT32:
6525  {
6527  break;
6528  }
6529  case OSSIM_SINT32:
6530  {
6532  break;
6533  }
6534  case OSSIM_SCALAR_UNKNOWN:
6535  default:
6536  {
6538  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
6539  << " Unknown scalar type"
6540  << std::endl;
6541  }
6542 
6543  } // End of "switch(getScalarType())"
6544 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyTileToFloatBuffer()

template<class T >
void ossimImageData::copyTileToFloatBuffer ( ,
ossim_float32 buf 
) const
inline

Definition at line 323 of file ossimImageData.h.

References ossimRectilinearDataObject::getBuf().

325  {
326  const ossim_uint32 SIZE = getSizePerBand();
327  const ossim_uint32 BANDS = getNumberOfBands();
328 
329  for(ossim_uint32 band = 0; band < BANDS; ++band)
330  {
331  const T* s = (T*)getBuf(band); // source
332  ossim_float32* d = (ossim_float32*)(buf + (band*SIZE)); // destination
333 
334  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
335  {
336  ossim_float32 p = s[offset];
337  d[offset] = p;
338  }
339  }
340  }
virtual ossim_uint32 getNumberOfBands() const
float ossim_float32
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const void * getBuf() const

◆ copyTileToNormalizedBuffer() [1/6]

void ossimImageData::copyTileToNormalizedBuffer ( ossim_float64 buf) const
virtual

Copies entire tile to buf passed in.

Data put in buf is normalized. The "buf" passed to method is assumed to be at least as big as: "getSize() * sizeof(double)"

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 5892 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getDataSizeInBytes(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by ossimBrightnessMatch::computeInputBrightness(), convertToNormalizedDouble(), convertToNormalizedFloat(), copyTileBandToNormalizedBuffer(), copyTileToNormalizedBuffer(), ossimImageCombiner::getNextNormTile(), ossimFusionCombiner::getNormIntensity(), ossimFusionCombiner::getNormTile(), ossimBrightnessContrastSource::getTile(), ossimGammaRemapper::getTile(), ossimLocalCorrelationFusion::getTile(), ossimHsiRemapper::getTile(), ossimBandClipFilter::getTile(), ossimIntensityAdjustmentFilter::loadNormTile(), ossimTableRemapper::remapFromNativeTable(), and ossimTableRemapper::remapFromNormalizedTable().

5893 {
5894  if (!buf)
5895  {
5897  << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
5898  << "\nNull buffer passed to method! Returning..." << std::endl;
5899  return;
5900  }
5901 
5903  {
5905  << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
5906  << "\nThis object is null! Returning..." << std::endl;
5907  return;
5908  }
5909 
5910  switch(getScalarType())
5911  {
5913  {
5914  memmove(buf, getBuf(), getDataSizeInBytes());
5915  break;
5916  }
5918  {
5919  ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
5920  const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf());
5921  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
5922  {
5923  buf[offset] = inputBuf[offset];
5924  }
5925  break;
5926  }
5927  case OSSIM_FLOAT32:
5928  {
5930  break;
5931  }
5932  case OSSIM_FLOAT64:
5933  {
5935  break;
5936  }
5937  case OSSIM_UINT8:
5938  {
5940  break;
5941 
5942  }
5943  case OSSIM_SINT8:
5944  {
5946  break;
5947 
5948  }
5949  case OSSIM_USHORT11:
5950  case OSSIM_USHORT12:
5951  case OSSIM_USHORT13:
5952  case OSSIM_USHORT14:
5953  case OSSIM_USHORT15:
5954  case OSSIM_UINT16:
5955  {
5957  break;
5958  }
5959  case OSSIM_SINT16:
5960  {
5962  break;
5963  }
5964  case OSSIM_UINT32:
5965  {
5967  break;
5968  }
5969  case OSSIM_SINT32:
5970  {
5972  break;
5973  }
5974  case OSSIM_SCALAR_UNKNOWN:
5975  default:
5976  {
5978  << "NOTICE: copyTileToNormalizedBuffer not implemented yet"
5979  << std::endl;
5980  }
5981 
5982  } // End of "switch(getScalarType())"
5983 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
virtual ossim_uint32 getDataSizeInBytes() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyTileToNormalizedBuffer() [2/6]

void ossimImageData::copyTileToNormalizedBuffer ( ossim_float32 buf) const
virtual

Reimplemented in ossimU16ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, ossimS16ImageData, and ossimU8ImageData.

Definition at line 6357 of file ossimImageData.cpp.

References copyTileToNormalizedBuffer(), getBuf(), ossimDataObject::getDataObjectStatus(), getDataSizeInBytes(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

6358 {
6359 
6360  if (!buf)
6361  {
6363  << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
6364  << "\nNull buffer passed to method! Returning..." << std::endl;
6365  return;
6366  }
6367 
6369  {
6371  << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
6372  << "\nThis object is null! Returning..." << std::endl;
6373  return;
6374  }
6375 
6376  switch(getScalarType())
6377  {
6379  {
6380  ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
6381  const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf());
6382  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
6383  {
6384  buf[offset] = inputBuf[offset];
6385  }
6386  break;
6387  }
6389  {
6390  memmove(buf, getBuf(), getDataSizeInBytes());
6391  break;
6392  }
6393  case OSSIM_FLOAT32:
6394  {
6396  break;
6397  }
6398  case OSSIM_FLOAT64:
6399  {
6401  break;
6402  }
6403  case OSSIM_UINT8:
6404  {
6406  break;
6407 
6408  }
6409  case OSSIM_SINT8:
6410  {
6412  break;
6413 
6414  }
6415  case OSSIM_USHORT11:
6416  case OSSIM_USHORT12:
6417  case OSSIM_USHORT13:
6418  case OSSIM_USHORT14:
6419  case OSSIM_USHORT15:
6420  case OSSIM_UINT16:
6421  {
6423  break;
6424  }
6425  case OSSIM_SINT16:
6426  {
6428  break;
6429  }
6430  case OSSIM_UINT32:
6431  {
6433  break;
6434  }
6435  case OSSIM_SINT32:
6436  {
6438  break;
6439  }
6440  case OSSIM_SCALAR_UNKNOWN:
6441  default:
6442  {
6444  << "NOTICE: copyTileToNormalizedBuffer not implemented yet"
6445  << std::endl;
6446  }
6447 
6448  } // End of "switch(getScalarType())"
6449 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
virtual ossim_uint32 getDataSizeInBytes() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ copyTileToNormalizedBuffer() [3/6]

template<class T >
void ossimImageData::copyTileToNormalizedBuffer ( dummyTemplate,
ossim_float64 buf 
) const
protected

Copies entire tile to buf passed in.

Data put in buf is normalized. The "buf" passed to method is assumed to be at least as big as: "getSize() * sizeof(double)"

Definition at line 5986 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), getNumberOfBands(), getSizePerBand(), and OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE.

5988 {
5989  const ossim_uint32 SIZE = getSizePerBand();
5990  const ossim_uint32 BANDS = getNumberOfBands();
5991 
5992  for(ossim_uint32 band = 0; band < BANDS; ++band)
5993  {
5994  const ossim_float64 MIN_PIX = getMinPix(band);
5995  const ossim_float64 MAX_PIX = getMaxPix(band);
5996  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
5997  const ossim_float64 NP = getNullPix(band);
5998 
5999  const T* s = (T*)getBuf(band); // source
6000  ossim_float64* d = (ossim_float64*)(buf + (band*SIZE)); // destination
6001 
6002  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6003  {
6004  ossim_float64 p = s[offset];
6005  if(p != NP)
6006  {
6007  if( p == MIN_PIX)
6008  {
6010  }
6011  else
6012  {
6013  d[offset] = (p-MIN_PIX)/RANGE;
6014  }
6015  }
6016  else
6017  {
6018  d[offset] = 0.0;
6019  }
6020  }
6021  }
6022 }
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
#define OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE
virtual const void * getBuf() const

◆ copyTileToNormalizedBuffer() [4/6]

template<class T >
void ossimImageData::copyTileToNormalizedBuffer ( dummyTemplate,
ossim_float32 buf 
) const
protected

Definition at line 6025 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), getNumberOfBands(), getSizePerBand(), and OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT.

6027 {
6028  const ossim_uint32 SIZE = getSizePerBand();
6029  const ossim_uint32 BANDS = getNumberOfBands();
6030 
6031  for(ossim_uint32 band = 0; band < BANDS; ++band)
6032  {
6033  const ossim_float64 MIN_PIX = getMinPix(band);
6034  const ossim_float64 MAX_PIX = getMaxPix(band);
6035  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
6036  const ossim_float64 NP = getNullPix(band);
6037 
6038  const T* s = (T*)getBuf(band); // source
6039  ossim_float32* d = (ossim_float32*)(buf + (band*SIZE)); // destination
6040 
6041  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6042  {
6043  ossim_float64 p = s[offset];
6044  if(p != NP)
6045  {
6046  if( p == MIN_PIX)
6047  {
6049  }
6050  else
6051  {
6052  d[offset] = (p-MIN_PIX)/RANGE;
6053  }
6054  }
6055  else
6056  {
6057  d[offset] = 0.0;
6058  }
6059  }
6060  }
6061 }
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
float ossim_float32
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const
#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT

◆ copyTileToNormalizedBuffer() [5/6]

template<class T >
void ossimImageData::copyTileToNormalizedBuffer ( dummyTemplate,
ossim_uint32  band,
ossim_float64 buf 
) const
protected

Will copy this tiles specified band number to the normalized buffer.

if the band is out of range then nothing is done and returns.

Definition at line 6064 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), getSizePerBand(), and OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE.

6067 {
6068  const ossim_uint32 SIZE = getSizePerBand();
6069  const ossim_float64 MIN_PIX = getMinPix(band);
6070  const ossim_float64 MAX_PIX = getMaxPix(band);
6071  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
6072  const ossim_float64 NP = getNullPix(band);
6073 
6074  const T* s = (T*)getBuf(band); // source
6075  ossim_float64* d = (ossim_float64*)(buf); // destination
6076 
6077  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6078  {
6079  ossim_float64 p = s[offset];
6080  if(p != NP)
6081  {
6082  if( p == MIN_PIX)
6083  {
6085  }
6086  else
6087  {
6088  d[offset] = (p-MIN_PIX)/RANGE;
6089  }
6090  }
6091  else
6092  {
6093  d[offset] = 0.0;
6094  }
6095  }
6096 }
virtual const ossim_float64 * getMaxPix() const
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
#define OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE
virtual const void * getBuf() const

◆ copyTileToNormalizedBuffer() [6/6]

template<class T >
void ossimImageData::copyTileToNormalizedBuffer ( dummyTemplate,
ossim_uint32  band,
ossim_float32 buf 
) const
protected

Definition at line 6099 of file ossimImageData.cpp.

References getBuf(), getMaxPix(), getMinPix(), getNullPix(), getSizePerBand(), and OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT.

6102 {
6103  const ossim_uint32 SIZE = getSizePerBand();
6104  const ossim_float64 MIN_PIX = getMinPix(band);
6105  const ossim_float64 MAX_PIX = getMaxPix(band);
6106  const ossim_float64 RANGE = (MAX_PIX-MIN_PIX);
6107  const ossim_float64 NP = getNullPix(band);
6108 
6109  const T* s = (T*)getBuf(band); // source
6110  ossim_float32* d = (ossim_float32*)(buf); // destination
6111 
6112  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
6113  {
6114  ossim_float64 p = s[offset];
6115  if(p != NP)
6116  {
6117  if( p == MIN_PIX)
6118  {
6120  }
6121  else
6122  {
6123  d[offset] = (p-MIN_PIX)/RANGE;
6124  }
6125  }
6126  else
6127  {
6128  d[offset] = 0.0;
6129  }
6130  }
6131 }
virtual const ossim_float64 * getMaxPix() const
float ossim_float32
double ossim_float64
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const ossim_float64 * getMinPix() const
virtual const void * getBuf() const
#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT

◆ createTestTile() [1/2]

void ossimImageData::createTestTile ( )

Creates a step wedge for testing only.

Writes line at a time of a single value, starting at scalar null, and going to scalar max in increments of scalar range/tile_lines.

Definition at line 1893 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), ossimRectilinearDataObject::getScalarType(), initialize(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

1894 {
1895  // Check the status and allocate memory if needed.
1897  {
1898  initialize();
1899  }
1900 
1901  if ( getDataObjectStatus() != OSSIM_NULL )
1902  {
1903  switch (getScalarType())
1904  {
1905  case OSSIM_UINT8:
1906  {
1908  break;
1909  }
1910  case OSSIM_SINT8:
1911  {
1913  break;
1914  }
1915  case OSSIM_UINT16:
1916  case OSSIM_USHORT11:
1917  case OSSIM_USHORT12:
1918  case OSSIM_USHORT13:
1919  case OSSIM_USHORT14:
1920  case OSSIM_USHORT15:
1921  {
1923  break;
1924  }
1925  case OSSIM_SINT16:
1926  {
1928  break;
1929  }
1930  case OSSIM_UINT32:
1931  {
1933  break;
1934  }
1935  case OSSIM_SINT32:
1936  {
1938  break;
1939  }
1940  case OSSIM_FLOAT32:
1942  {
1944  break;
1945  }
1947  case OSSIM_FLOAT64:
1948  {
1950  break;
1951  }
1952  case OSSIM_SCALAR_UNKNOWN:
1953  default:
1956  "ossimImageData::createTestTile File %s line %d\nInvalid or unhandled scalar type: %d",
1957  __FILE__,
1958  __LINE__,
1959  getScalarType());
1960  }
1961  }
1962  else
1963  {
1966  "ossimImageData::createTestTile File %s line %d\nTile must be initialed!",
1967  __FILE__,
1968  __LINE__,
1969  getScalarType());
1970  }
1971 
1972 } // End: ossimImageData::createTestTile()
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
virtual void initialize()
Initialize the data buffer.
double ossim_float64
signed short ossim_sint16
void createTestTile()
Creates a step wedge for testing only.
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ createTestTile() [2/2]

template<class T >
void ossimImageData::createTestTile ( )
protected

Creates a test tile for scalar type for testing only.

Protected template implementation of matching public createTestTile.

Definition at line 1975 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getHeight(), getMaxPix(), getNullPix(), getNumberOfBands(), getWidth(), OSSIM_NULL, STEP, and validate().

1976 {
1978  {
1979  const ossim_uint32 BANDS = getNumberOfBands();
1980  const ossim_uint32 LINES = getHeight();
1981  const ossim_uint32 SAMPS = getWidth();
1982  const ossim_float64 NP = getNullPix(0);
1983  const ossim_float64 MAX_PIX = getMaxPix(0);
1984 
1985  const T STEP = static_cast<T>( (MAX_PIX-NP) / (LINES-1) );
1986 
1987  for(ossim_uint32 band = 0; band < BANDS; ++band)
1988  {
1989  T* s = (T*)getBuf(band);
1990  T p = (T)NP;
1991 
1992  for ( ossim_uint32 line = 0; line < LINES; ++line )
1993  {
1994  for ( ossim_uint32 samp = 0; samp < SAMPS; ++samp )
1995  {
1996  s[samp] = p;
1997  }
1998  p += STEP;
1999  s += SAMPS;
2000 
2001  }
2002  }
2003 
2004  validate();
2005  }
2006 
2007 } // End: ossimImageData::createTestTile() template implementation.
virtual ossim_uint32 getWidth() const
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
#define STEP(bseg)
Definition: polygrf.h:238
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
double ossim_float64
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual const void * getBuf() const

◆ dup()

ossimObject * ossimImageData::dup ( ) const
virtual

Reimplemented from ossimObject.

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 5887 of file ossimImageData.cpp.

References ossimImageData().

Referenced by ossimFixedTileCache::addTile(), ossimHsvToRgbSource::allocate(), ossimHsiToRgbSource::allocate(), ossimRgbToHsiSource::allocate(), ossimRgbToHsvSource::allocate(), ossimIntensityAdjustmentFilter::allocate(), ossimRgbToGreyFilter::allocate(), ossimTiledImageHandler::allocate(), ossimJpegTileSource::allocate(), ossimPngReader::allocate(), ossimPixelFlipper::allocateClipTileBuffer(), ossimEquationCombiner::applyBlurr(), ossimEquationCombiner::applyConvolution(), ossimEquationCombiner::applyShift(), ossimTilePatch::convolve(), demo2(), ossimMaskFilter::executeMaskFilter(), ossimImageCacheTileSource::fillTile(), ossimEquationCombiner::getNewImageData(), ossimErosionFilter::getTile(), ossimFftFilter::getTile(), ossimDilationFilter::getTile(), ossimSFIMFusion::getTile(), ossimClosestToCenterCombiner::getTile(), ossimLocalCorrelationFusion::getTile(), ossimMeanMedianFilter::getTile(), ossimSubImageTileSource::getTile(), ossimImageElevationHandler::getTile(), ossimImageRenderer::getTileAtResLevel(), ossimImageToPlaneNormalFilter::initialize(), ossimEquationCombiner::parseAssignBand(), ossimMultiThreadSequencer::ossimGetTileJob::run(), and ossimImageHandlerMtAdaptor::setAdaptee().

5888 {
5889  return new ossimImageData(*this);
5890 }

◆ fill() [1/2]

void ossimImageData::fill ( ossim_uint32  band,
ossim_float64  value 
)

will fill the entire band with the value.

Definition at line 1768 of file ossimImageData.cpp.

References getBuf(), ossimObject::getClassName(), getDoubleBuf(), getFloatBuf(), getHeight(), ossimRectilinearDataObject::getScalarType(), getSshortBuf(), getUcharBuf(), getUshortBuf(), getWidth(), OSSIM_EMPTY, ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and ossimDataObject::setDataObjectStatus().

Referenced by ossimFeatherMosaic::combine(), ossimHlzTool::computeHLZ(), ossimViewshedTool::computeViewshed(), ossimU8ImageData::fill(), fill(), ossimBandMergeSource::getTile(), and ossimRangeDomeTileSource::getTile().

1769 {
1770  void* s = getBuf(band);
1771 
1772  if (s == 0) return; // nothing to do...
1773 
1774  ossim_uint32 size_in_pixels = getWidth()*getHeight();
1775 
1776  switch (getScalarType())
1777  {
1778  case OSSIM_UINT8:
1779  {
1780  ossim_uint8* p = getUcharBuf(band);
1781  ossim_uint8 np = static_cast<ossim_uint8>(value);
1782  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1783 
1784  break;
1785  }
1786  case OSSIM_SINT8:
1787  {
1788  ossim_sint8* p = static_cast<ossim_sint8*>(getBuf(band));
1789  ossim_sint8 np = static_cast<ossim_sint8>(value);
1790  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1791 
1792  break;
1793  }
1794  case OSSIM_UINT16:
1795  case OSSIM_USHORT11:
1796  case OSSIM_USHORT12:
1797  case OSSIM_USHORT13:
1798  case OSSIM_USHORT14:
1799  case OSSIM_USHORT15:
1800  {
1801  ossim_uint16* p = getUshortBuf(band);
1802  ossim_uint16 np = static_cast<ossim_uint16>(value);
1803  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1804 
1805  break;
1806  }
1807  case OSSIM_SINT16:
1808  {
1809  ossim_sint16* p = getSshortBuf(band);
1810  ossim_sint16 np = static_cast<ossim_sint16>(value);
1811  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1812 
1813  break;
1814  }
1815  case OSSIM_UINT32:
1816  {
1817  ossim_uint32* p = static_cast<ossim_uint32*>(getBuf(band));
1818  ossim_uint32 np = static_cast<ossim_uint32>(value);
1819  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1820 
1821  break;
1822  }
1823  case OSSIM_SINT32:
1824  {
1825  ossim_sint32* p = static_cast<ossim_sint32*>(getBuf(band));
1826  ossim_sint32 np = static_cast<ossim_sint32>(value);
1827  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1828 
1829  break;
1830  }
1832  case OSSIM_FLOAT32:
1833  {
1834  ossim_float32* p = getFloatBuf(band);
1835  ossim_float32 np = static_cast<ossim_float32>(value);
1836  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1837 
1838  break;
1839  }
1841  case OSSIM_FLOAT64:
1842  {
1843  ossim_float64* p = getDoubleBuf(band);
1844  ossim_float64 np = static_cast<ossim_float64>(value);
1845  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1846 
1847  break;
1848  }
1849  case OSSIM_SCALAR_UNKNOWN:
1850  default:
1853  "ossimImageData::makeBlank File %s line %d\n\
1854 Invalid scalar type: %d",
1855 __FILE__,
1856 __LINE__,
1857 getScalarType());
1858  return;
1859  }
1860 
1862 
1863 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getWidth() const
64 bit floating point
virtual const ossim_uint16 * getUshortBuf() const
16 bit unsigned integer
virtual const ossim_uint8 * getUcharBuf() const
float ossim_float32
16 bit signed integer
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
virtual const ossim_sint16 * getSshortBuf() const
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual const ossim_float32 * getFloatBuf() const
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)
virtual const ossim_float64 * getDoubleBuf() const

◆ fill() [2/2]

void ossimImageData::fill ( ossim_float64  value)

will fill all bands with the passed in value.

Definition at line 1865 of file ossimImageData.cpp.

References fill(), getNumberOfBands(), m_nullPixelValue, OSSIM_EMPTY, OSSIM_FULL, OSSIM_PARTIAL, and ossimDataObject::setDataObjectStatus().

1866 {
1867  ossim_uint32 valueNullCount= 0;
1868  for(ossim_uint32 band=0; band < getNumberOfBands(); ++band)
1869  {
1870  if (value == m_nullPixelValue[band])
1871  {
1872  ++valueNullCount;
1873  }
1874 
1875  fill(band, value);
1876  }
1877 
1878  if (valueNullCount==0)
1879  {
1881  }
1882  else if(valueNullCount==getNumberOfBands())
1883  {
1885  }
1886  else
1887  {
1889  }
1890 }
void fill(ossim_uint32 band, ossim_float64 value)
will fill the entire band with the value.
virtual ossim_uint32 getNumberOfBands() const
unsigned int ossim_uint32
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.

◆ getAlphaBuf() [1/2]

const ossim_uint8 * ossimImageData::getAlphaBuf ( ) const
virtual
Returns
const ossim_uint8* to the alpha channel or null if the alpha channel was not computed.

Definition at line 161 of file ossimImageData.cpp.

References m_alpha.

Referenced by unloadTileToBipAlphaTemplate(), and ossimKakaduCompressor::writeTile().

162 {
163  if (m_alpha.size() > 0)
164  {
165  return &m_alpha.front();
166  }
167  return 0;
168 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.

◆ getAlphaBuf() [2/2]

ossim_uint8 * ossimImageData::getAlphaBuf ( )
virtual
Returns
ossim_uint8* to the alpha channel or null if the alpha channel was not computed.

Definition at line 170 of file ossimImageData.cpp.

References m_alpha.

171 {
172  if (m_alpha.size() > 0)
173  {
174  return &m_alpha.front();
175  }
176  return 0;
177 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.

◆ getBuf() [1/4]

const void * ossimImageData::getBuf ( ) const
virtual
Returns
const void* to theDataBuffer

Reimplemented from ossimRectilinearDataObject.

Definition at line 179 of file ossimImageData.cpp.

References ossimRectilinearDataObject::m_dataBuffer.

Referenced by ossimFixedTileCache::addTile(), ossimCastTileSourceFilter::applyCast(), ossimEquationCombiner::applyClamp(), ossimMeanMedianFilter::applyMean(), ossimMeanMedianFilter::applyMeanNullCenterOnly(), ossimMeanMedianFilter::applyMedian(), ossimMeanMedianFilter::applyMedianNullCenterOnly(), ossimEquationCombiner::applyOp(), assign(), assignBand(), ossimEquationCombiner::assignValue(), ossimBandAverageFilter::averageInput(), ossimCastTileSourceFilter::castInputToOutput(), ossimPixelFlipper::clipTile(), ossimImageMosaic::combine(), ossimElevationMosaic::combine(), ossimMaxMosaic::combine(), ossimBlendMosaic::combine(), ossimFeatherMosaic::combine(), ossimImageMosaic::combineNorm(), ossimElevationMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), ossimBlendMosaic::combineNorm(), computeAlphaChannel(), computeAverageBandValue(), ossimImageHistogramSource::computeFastModeHistogram(), ossimBrightnessMatch::computeInputBrightness(), ossimIntensityAdjustmentFilter::computeMeanIntensity(), computeMeanSquaredError(), computeMinMaxNulPix(), computeMinMaxPix(), ossimImageHistogramSource::computeNormalModeHistogram(), ossimImageToPlaneNormalFilter::computeNormalsTemplate(), ossimLocalCorrelationFusion::computeRegression(), ossimImageStatisticsSource::computeStatisticsTemplate(), ossimRgbToIndexFilter::convertInputTile(), ossimNBandToIndexFilter::convertInputTileToOutputTemplate(), ATP::convertToIpl(), ossimS16ImageData::convertToNormalizedDouble(), ossimU14ImageData::convertToNormalizedDouble(), ossimU15ImageData::convertToNormalizedDouble(), ossimU11ImageData::convertToNormalizedDouble(), ossimU12ImageData::convertToNormalizedDouble(), ossimU13ImageData::convertToNormalizedDouble(), ossimU8ImageData::convertToNormalizedDouble(), ossimU16ImageData::convertToNormalizedDouble(), convertToNormalizedDouble(), ossimS16ImageData::convertToNormalizedFloat(), ossimU14ImageData::convertToNormalizedFloat(), ossimU15ImageData::convertToNormalizedFloat(), ossimU11ImageData::convertToNormalizedFloat(), ossimU12ImageData::convertToNormalizedFloat(), ossimU13ImageData::convertToNormalizedFloat(), ossimU8ImageData::convertToNormalizedFloat(), ossimU16ImageData::convertToNormalizedFloat(), convertToNormalizedFloat(), ossimNitfTileSource::convertTransparentToNull(), ossimConvolutionSource::convolve(), ossim3x3ConvolutionFilter::convolveFull(), ossimConvolutionFilter1D::convolveFull(), ossim3x3ConvolutionFilter::convolvePartial(), ossimConvolutionFilter1D::convolvePartial(), ossimImageDataHelper::copyInputToThis(), ATP::copyIplToOid(), ossimPngReader::copyLines(), ossimPngReader::copyLinesWithAlpha(), copyLineTemplate(), ossimU8ImageData::copyNormalizedBufferToTile(), ossimS16ImageData::copyNormalizedBufferToTile(), ossimU13ImageData::copyNormalizedBufferToTile(), ossimU15ImageData::copyNormalizedBufferToTile(), ossimU14ImageData::copyNormalizedBufferToTile(), ossimU11ImageData::copyNormalizedBufferToTile(), ossimU12ImageData::copyNormalizedBufferToTile(), ossimU16ImageData::copyNormalizedBufferToTile(), copyNormalizedBufferToTile(), ossim::copyOpjSrgbImage(), ossim::copyRegionToTile(), copyTileBandToNormalizedBuffer(), ossimU8ImageData::copyTileToNormalizedBuffer(), ossimS16ImageData::copyTileToNormalizedBuffer(), ossimU13ImageData::copyTileToNormalizedBuffer(), ossimU14ImageData::copyTileToNormalizedBuffer(), ossimU15ImageData::copyTileToNormalizedBuffer(), ossimU11ImageData::copyTileToNormalizedBuffer(), ossimU12ImageData::copyTileToNormalizedBuffer(), ossimU16ImageData::copyTileToNormalizedBuffer(), copyTileToNormalizedBuffer(), createTestTile(), demo1(), demo3(), ossimDespeckleFilter::despeckle(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimGeoAnnotationBitmap::draw(), ossimAnnotationFontObject::draw(), ossimElevRemapper::elevRemap(), ossimPngCodec::encode(), ossimValueAssignImageSourceFilter::executeAssignGroup(), ossimValueAssignImageSourceFilter::executeAssignSeparate(), ossimMaskFilter::executeMaskFilter(), ossimMaskFilter::executeMaskFilterBinarySelection(), ossimMaskFilter::executeMaskFilterInvertSelection(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(), ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(), ossimNitfTileSource::explodePackedBits(), ossimS16ImageData::fill(), ossimU14ImageData::fill(), ossimU15ImageData::fill(), ossimU12ImageData::fill(), ossimU11ImageData::fill(), ossimU13ImageData::fill(), ossimU8ImageData::fill(), ossimU16ImageData::fill(), ossimImageDataHelper::fill(), ossimWatermarkFilter::fill(), fill(), ossimUsgsDemTileSource::fillBuffer(), ossimDtedTileSource::fillBuffer(), ossimTiledElevationDatabase::fillGrid(), ossimTilePatch::fillTile(), ossimCacheTileSource::fillTile(), ossimShiftFilter::fillTile(), ossimImageCacheTileSource::fillTile(), ossimGpkgReader::fillTile(), ossimImageRenderer::fillTile(), ossimGeoPdfReader::fillTile(), ossimTilePatch::fillTileTemplate(), ossimCcfTileSource::fillUcharBuffer(), ossimCcfTileSource::fillUshortBuffer(), ossimNullPixelFlip::flipPixels(), ossimPixelFlipper::flipPixels(), getBuf(), getDoubleBuf(), getFloatBuf(), ossimEquationCombiner::getNewImageData(), ossimImageCombiner::getNextNormTile(), ossimImageMpiMWriterSequenceConnection::getNextTile(), ossimMpiMasterOverviewSequencer::getNextTile(), ossimImageSourceSequencer::getNextTile(), getNormalizedFloat(), ossimFusionCombiner::getNormIntensity(), ossimFusionCombiner::getNormTile(), getPix(), getSshortBuf(), ossimIntensityAdjustmentFilter::getTile(), ossimHsvToRgbSource::getTile(), ossimJpegYCbCrToRgbSource::getTile(), ossimHsiToRgbSource::getTile(), ossimRgbToHsiSource::getTile(), ossimRgbToHsvSource::getTile(), ossimRgbToJpegYCbCrSource::getTile(), ossimHistogramThreshholdFilter::getTile(), ossimColorNormalizedFusion::getTile(), ossimMultiBandHistogramTileSource::getTile(), ossimFftFilter::getTile(), ossimDilationFilter::getTile(), ossim3x3ConvolutionFilter::getTile(), ossimHistoMatchRemapper::getTile(), ossimEdgeFilter::getTile(), ossimBrightnessContrastSource::getTile(), ossimBandMergeSource::getTile(), ossimPolyCutter::getTile(), ossimSFIMFusion::getTile(), ossimClosestToCenterCombiner::getTile(), ossimMapCompositionSource::getTile(), ossimLinearStretchRemapper::getTile(), ossimLocalCorrelationFusion::getTile(), ossimAnnotationSource::getTile(), ossimElevImageSource::getTile(), ossimMemoryImageSource::getTile(), ossimValueAssignImageSourceFilter::getTile(), ossimConvolutionFilter1D::getTile(), ossimGdalTileSource::getTile(), ossimKMeansFilter::getTile(), ossimBandClipFilter::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimHdfReader::getTile(), ossimBitMaskTileSource::getTile(), ossimMrSidReader::getTile(), ossimImageSourceSequencer::getTile(), ossimKakaduJ2kReader::getTile(), ossimKakaduJp2Reader::getTile(), ossimNitfTileSource::getTile(), ossimBandLutFilter::getTile(), ossimIndexToRgbLutFilter::getTile(), ossimBumpShadeTileSource::getTile(), ossimPixelFlipper::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimImageRenderer::getTileAtResLevel(), ossimGdalTileSource::getTileBlockRead(), getUcharBuf(), getUshortBuf(), ossimRgbImage::initialize(), ossimImageToPlaneNormalFilter::initializeTile(), isEqualTo(), isNull(), loadBandTemplate(), ossimNitfTileSource::loadBlockFromCache(), ossimTiffTileSource::loadFromRgbaU8Strip(), ossimGdalTileSource::loadIndexTo3BandTileTemplate(), ossimIntensityAdjustmentFilter::loadNormTile(), ossimNitfTileSource::loadTile(), loadTile(), loadTileFrom1Band(), loadTileFromBilTemplate(), loadTileFromBipAlphaTemplate(), loadTileFromBipTemplate(), loadTileFromBsqTemplate(), ossimKakaduJp2Reader::loadTileFromCache(), ossimKakaduJ2kReader::loadTileFromCache(), ossimNitfTileSource::lutUncompress(), makeBlank(), nullTileAlphaTemplate(), ossimGeoidImage::offsetFromEllipsoidTemplate(), ossimEquationCombiner::parseAssignBand(), ossimEquationCombiner::parseStdFuncs(), populateHistogram(), ossimSICDToDetectedImage::processAmplitudeAngleTile(), ossimSICDToDetectedImage::processComplexTile(), ossimBrightnessContrastSource::processRgbTile(), ossimTableRemapper::remapFromNativeTable(), ossimResampler::resample(), ossimFilterResampler::resample(), ossimFilterResampler::resampleBilinearTile(), ossimResampler::resampleFullTile(), ossimResampler::resampleNearestNeighbor(), ossimResampler::resamplePartialTile(), ossimResampler::resampleTile(), ossimResampler::resampleTileNearestNeighbor(), ossimImageRenderer::resampleTileToDecimation(), ossimBandClipFilter::runClamp(), ossimBandClipFilter::runClip(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimFftw3Filter::runFft(), ossimFftFilter::runFft(), ossimScaleFilter::runFilterTemplate(), ossimScaleFilter::runHorizontalFilterTemplate(), ossimEdgeFilter::runLaplacianFilter(), ossimBandClipFilter::runLinearStretch(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runLocalMax8Filter(), ossimBandClipFilter::runMedianStretch(), ossimTwoColorView::runNative8(), ossimTwoColorView::runNorm(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(), ossimRgbToGreyFilter::runUcharTransformation(), ossimScaleFilter::runVerticalFilterTemplate(), setNormalizedFloat(), setNull(), ossimS16ImageData::setValue(), ossimU8ImageData::setValue(), ossimU16ImageData::setValue(), setValue(), ossimMpiSlaveOverviewSequencer::slaveProcessTiles(), stretchMinMax(), unloadBandTemplate(), unloadBandToBsqTemplate(), unloadTileToBilTemplate(), unloadTileToBipAlphaTemplate(), unloadTileToBipTemplate(), unloadTileToBsqTemplate(), ossimS16ImageData::unnormalizeInput(), ossimU15ImageData::unnormalizeInput(), ossimU11ImageData::unnormalizeInput(), ossimU12ImageData::unnormalizeInput(), ossimU13ImageData::unnormalizeInput(), ossimU14ImageData::unnormalizeInput(), ossimU8ImageData::unnormalizeInput(), ossimU16ImageData::unnormalizeInput(), unnormalizeInput(), ossim::unNormalizeTile(), ossimS16ImageData::validate(), ossimU16ImageData::validate(), validate(), ossimNitfTileSource::vqUncompressC4(), ossimNitfTileSource::vqUncompressM4(), write(), ossimNitf20Writer::writeBlockBandSeparate(), ossimNitfWriter::writeBlockBandSeparate(), ossimNitf20Writer::writeBlockBandSequential(), ossimNitfWriter::writeBlockBandSequential(), and ossimKakaduCompressor::writeTile().

180 {
181  if (m_dataBuffer.size() > 0)
182  {
183  return static_cast<const void*>(&m_dataBuffer.front());
184  }
185  return 0;
186 }
std::vector< ossim_uint8 > m_dataBuffer

◆ getBuf() [2/4]

void * ossimImageData::getBuf ( )
virtual
Returns
void* to theDataBuffer

Reimplemented from ossimRectilinearDataObject.

Definition at line 188 of file ossimImageData.cpp.

References ossimRectilinearDataObject::m_dataBuffer.

189 {
190  if (m_dataBuffer.size() > 0)
191  {
192  return static_cast<void*>(&m_dataBuffer.front());
193  }
194  return 0;
195 }
std::vector< ossim_uint8 > m_dataBuffer

◆ getBuf() [3/4]

const void * ossimImageData::getBuf ( ossim_uint32  band) const
virtual
Parameters
band(zero based)
Returns
void* to theDataBuffer positioned at band.

Definition at line 197 of file ossimImageData.cpp.

References getBuf(), getSizePerBandInBytes(), and isValidBand().

198 {
199  const ossim_uint8* b = static_cast<const ossim_uint8*>(getBuf());
200 
201  if (isValidBand(band) && b != 0)
202  {
203  b += (band * getSizePerBandInBytes());
204  return static_cast<const void*>(b);
205  }
206  return 0;
207 }
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
virtual bool isValidBand(ossim_uint32 band) const
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ getBuf() [4/4]

void * ossimImageData::getBuf ( ossim_uint32  band)
virtual
Parameters
band(zero based)
Returns
void* to theDataBuffer positioned at band.

Definition at line 209 of file ossimImageData.cpp.

References getBuf(), getSizePerBandInBytes(), and isValidBand().

210 {
211  ossim_uint8* b = static_cast<ossim_uint8*>(getBuf());
212 
213  if (isValidBand(band) && b != 0)
214  {
215  b += (band * getSizePerBandInBytes());
216  return static_cast<void*>(b);
217  }
218  return 0;
219 }
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
virtual bool isValidBand(ossim_uint32 band) const
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ getDataSizeInBytes()

ossim_uint32 ossimImageData::getDataSizeInBytes ( ) const
virtual

Reimplemented from ossimRectilinearDataObject.

Definition at line 7272 of file ossimImageData.cpp.

References getSizeInBytes().

Referenced by ossimAppFixedTileCache::addTile(), ossimFixedTileCache::addTile(), copyNormalizedBufferToTile(), copyTileBandToNormalizedBuffer(), copyTileToNormalizedBuffer(), and ossimOpjCompressor::writeTile().

7273 {
7274  return getSizeInBytes();
7275 }
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.

◆ getDoubleBuf() [1/4]

const ossim_float64 * ossimImageData::getDoubleBuf ( ) const
virtual
Returns
const ossim_float64* to theDataBuffer if scalar is of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.

Definition at line 263 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT64, and OSSIM_NORMALIZED_DOUBLE.

Referenced by fill(), getNormalizedFloat(), getPix(), ossimLinearStretchRemapper::getTile(), ossimBandLutFilter::getTile(), and setNormalizedFloat().

264 {
265  if (m_scalarType == OSSIM_FLOAT64 ||
267  {
268  return static_cast<const ossim_float64*>(getBuf());
269  }
270  return 0;
271 }
64 bit floating point
double ossim_float64
64 bit normalized floating point
virtual const void * getBuf() const

◆ getDoubleBuf() [2/4]

ossim_float64 * ossimImageData::getDoubleBuf ( )
virtual
Returns
float64* to theDataBuffer if scalar is of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.

Definition at line 315 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT64, and OSSIM_NORMALIZED_DOUBLE.

316 {
317  if (m_scalarType == OSSIM_FLOAT64 ||
319  {
320  return static_cast<ossim_float64*>(getBuf());
321  }
322  return 0;
323 }
64 bit floating point
double ossim_float64
64 bit normalized floating point
virtual const void * getBuf() const

◆ getDoubleBuf() [3/4]

const ossim_float64 * ossimImageData::getDoubleBuf ( ossim_uint32  band) const
virtual
Parameters
band(zero based)
Returns
ossim_float64* to theDataBuffer positioned at band if scalar is of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.

Definition at line 367 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT64, and OSSIM_NORMALIZED_DOUBLE.

368 {
369  if (m_scalarType == OSSIM_FLOAT64 ||
371  {
372  return static_cast<const ossim_float64*>(getBuf(band));
373  }
374  return 0;
375 }
64 bit floating point
double ossim_float64
64 bit normalized floating point
virtual const void * getBuf() const

◆ getDoubleBuf() [4/4]

ossim_float64 * ossimImageData::getDoubleBuf ( ossim_uint32  band)
virtual
Parameters
band(zero based)
Returns
ossim_float64* to theDataBuffer positioned at band if scalar is of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.

Definition at line 419 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT64, and OSSIM_NORMALIZED_DOUBLE.

420 {
421  if (m_scalarType == OSSIM_FLOAT64 ||
423  {
424  return static_cast<ossim_float64*>(getBuf(band));
425  }
426  return 0;
427 }
64 bit floating point
double ossim_float64
64 bit normalized floating point
virtual const void * getBuf() const

◆ getFloatBuf() [1/4]

const ossim_float32 * ossimImageData::getFloatBuf ( ) const
virtual
Returns
const ossim_float32* to theDataBuffer if scalar is of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.

Definition at line 253 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT32, and OSSIM_NORMALIZED_FLOAT.

Referenced by fill(), getNormalizedFloat(), getPix(), ossimLinearStretchRemapper::getTile(), ossimSlopeFilter::getTile(), ossimPointCloudImageHandler::getTile(), ossimLasReader::getTile(), ossimBandLutFilter::getTile(), ossimBrightnessContrastSource::processNBandTile(), setNormalizedFloat(), and ossim::unNormalizeTile().

254 {
255  if (m_scalarType == OSSIM_FLOAT32 ||
257  {
258  return static_cast<const ossim_float32*>(getBuf());
259  }
260  return 0;
261 }
float ossim_float32
32 bit floating point
32 bit normalized floating point
virtual const void * getBuf() const

◆ getFloatBuf() [2/4]

ossim_float32 * ossimImageData::getFloatBuf ( )
virtual
Returns
ossim_float32* to theDataBuffer if scalar is of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.

Definition at line 305 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT32, and OSSIM_NORMALIZED_FLOAT.

306 {
307  if (m_scalarType == OSSIM_FLOAT32 ||
309  {
310  return static_cast<ossim_float32*>(getBuf());
311  }
312  return 0;
313 }
float ossim_float32
32 bit floating point
32 bit normalized floating point
virtual const void * getBuf() const

◆ getFloatBuf() [3/4]

const ossim_float32 * ossimImageData::getFloatBuf ( ossim_uint32  band) const
virtual
Parameters
band(zero based)
Returns
ossim_float32* to theDataBuffer positioned at band if scalar is of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.

Definition at line 357 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT32, and OSSIM_NORMALIZED_FLOAT.

358 {
359  if (m_scalarType == OSSIM_FLOAT32 ||
361  {
362  return static_cast<const ossim_float32*>(getBuf(band));
363  }
364  return 0;
365 }
float ossim_float32
32 bit floating point
32 bit normalized floating point
virtual const void * getBuf() const

◆ getFloatBuf() [4/4]

ossim_float32 * ossimImageData::getFloatBuf ( ossim_uint32  band)
virtual
Parameters
band(zero based)
Returns
ossim_float32* to theDataBuffer positioned at band if scalar is of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.

Definition at line 409 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT32, and OSSIM_NORMALIZED_FLOAT.

410 {
411  if (m_scalarType == OSSIM_FLOAT32 ||
413  {
414  return static_cast<ossim_float32*>(getBuf(band));
415  }
416  return 0;
417 }
float ossim_float32
32 bit floating point
32 bit normalized floating point
virtual const void * getBuf() const

◆ getHashId()

ossim_uint32 ossimImageData::getHashId ( ) const
inlinevirtual

Uses prime numbers as coefficients for this summation.

Take the the fours bytes of each origin and multiply by the prime numbers and sum together. This has been proven by others to give nicely distributed id number.

Implements ossimDataObject.

Definition at line 1291 of file ossimImageData.h.

References m_origin, ossimIpt::x, and ossimIpt::y.

1292 {
1293  const unsigned char *bufx = (unsigned char*)(&m_origin.x);
1294  const unsigned char *bufy = (unsigned char*)(&m_origin.y);
1295  return (ossim_uint32)(bufx[0]*101 + bufx[1]*103 +
1296  bufx[2]*107 + bufx[3]*109 +
1297  bufy[0]*139 + bufy[1]*149 +
1298  bufy[2]*151 + bufy[3]*157);
1299 }
unsigned int ossim_uint32
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ getHeight()

ossim_uint32 ossimImageData::getHeight ( ) const
virtual
Returns
The height of the data object.

Definition at line 7240 of file ossimImageData.cpp.

References ossimRectilinearDataObject::m_spatialExtents.

Referenced by ossimCastTileSourceFilter::allocate(), ossimTiffTileSource::allocateTile(), ossimCastTileSourceFilter::applyCast(), ossimEquationCombiner::applyClamp(), ossimMeanMedianFilter::applyMean(), ossimMeanMedianFilter::applyMeanNullCenterOnly(), ossimMeanMedianFilter::applyMedian(), ossimMeanMedianFilter::applyMedianNullCenterOnly(), ossimEquationCombiner::applyOp(), ossimEquationCombiner::assignValue(), ossimBandAverageFilter::averageInput(), ossimCastTileSourceFilter::castInputToOutput(), ossimPixelFlipper::clipTile(), ossimElevationMosaic::combine(), ossimImageMosaic::combine(), ossimMaxMosaic::combine(), ossimBlendMosaic::combine(), ossimFeatherMosaic::combine(), ossimElevationMosaic::combineNorm(), ossimImageMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), ossimBlendMosaic::combineNorm(), ossimU8ImageData::computeAverageBandValue(), ossimBitMaskWriter::computeImageSize(), ossimBrightnessMatch::computeInputBrightness(), ossimIntensityAdjustmentFilter::computeMeanIntensity(), ossimS16ImageData::computeMeanSquaredError(), ossimU11ImageData::computeMeanSquaredError(), ossimU12ImageData::computeMeanSquaredError(), ossimU13ImageData::computeMeanSquaredError(), ossimU14ImageData::computeMeanSquaredError(), ossimU15ImageData::computeMeanSquaredError(), ossimU8ImageData::computeMeanSquaredError(), ossimU16ImageData::computeMeanSquaredError(), ossimImageToPlaneNormalFilter::computeNormalsTemplate(), ossimImageStatisticsSource::computeStatisticsTemplate(), ossimRgbToIndexFilter::convertInputTile(), ossimNBandToIndexFilter::convertInputTileToOutputTemplate(), ossimPotraceTool::convertToBitmap(), ATP::convertToIpl(), ossimS16ImageData::convertToNormalizedDouble(), ossimU11ImageData::convertToNormalizedDouble(), ossimU12ImageData::convertToNormalizedDouble(), ossimU13ImageData::convertToNormalizedDouble(), ossimU14ImageData::convertToNormalizedDouble(), ossimU15ImageData::convertToNormalizedDouble(), ossimU8ImageData::convertToNormalizedDouble(), ossimU16ImageData::convertToNormalizedDouble(), convertToNormalizedDouble(), ossimS16ImageData::convertToNormalizedFloat(), ossimU11ImageData::convertToNormalizedFloat(), ossimU12ImageData::convertToNormalizedFloat(), ossimU13ImageData::convertToNormalizedFloat(), ossimU15ImageData::convertToNormalizedFloat(), ossimU14ImageData::convertToNormalizedFloat(), ossimU8ImageData::convertToNormalizedFloat(), ossimU16ImageData::convertToNormalizedFloat(), convertToNormalizedFloat(), ossimNitfTileSource::convertTransparentToNull(), ossimConvolutionSource::convolve(), ossimTilePatch::convolve(), ossim3x3ConvolutionFilter::convolveFull(), ossimConvolutionFilter1D::convolveFull(), ossim3x3ConvolutionFilter::convolvePartial(), ossimConvolutionFilter1D::convolvePartial(), ossimImageDataHelper::copyInputToThis(), ATP::copyIplToOid(), copyNormalizedBufferToTile(), ossim::copyOpjSrgbImage(), copyTileBandToNormalizedBuffer(), copyTileToNormalizedBuffer(), createTestTile(), demo1(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimElevRemapper::elevRemap(), ossimPngCodec::encode(), ossimJpegCodec::encode(), ossimValueAssignImageSourceFilter::executeAssignGroup(), ossimValueAssignImageSourceFilter::executeAssignSeparate(), ossimMaskFilter::executeMaskFilter(), ossimMaskFilter::executeMaskFilterBinarySelection(), ossimMaskFilter::executeMaskFilterInvertSelection(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(), ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(), ossimNitfTileSource::explodePackedBits(), ossimImageDataHelper::fill(), fill(), ossimTiledElevationDatabase::fillGrid(), ossimTilePatch::fillTileTemplate(), ossimNullPixelFlip::flipPixels(), getImageRectangle(), getSizePerBand(), getSizePerBandInBytes(), ossimHsvToRgbSource::getTile(), ossimIntensityAdjustmentFilter::getTile(), ossimHsiToRgbSource::getTile(), ossimRgbToJpegYCbCrSource::getTile(), ossimRgbToHsvSource::getTile(), ossimRgbToHsiSource::getTile(), ossimJpegYCbCrToRgbSource::getTile(), ossimColorNormalizedFusion::getTile(), ossimDespeckleFilter::getTile(), ossimFeatherMosaic::getTile(), ossimHistoMatchRemapper::getTile(), ossimElevationMosaic::getTile(), ossimImageMosaic::getTile(), ossimMaxMosaic::getTile(), ossimBandMergeSource::getTile(), ossimGammaRemapper::getTile(), ossimAOD::getTile(), ossimSFIMFusion::getTile(), ossimRectangleCutFilter::getTile(), ossimLinearStretchRemapper::getTile(), ossimLocalCorrelationFusion::getTile(), ossimConvolutionSource::getTile(), ossimElevImageSource::getTile(), ossimHsiRemapper::getTile(), ossimGdalTileSource::getTile(), ossimBandClipFilter::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimBitMaskTileSource::getTile(), ossimBandLutFilter::getTile(), ossimIndexToRgbLutFilter::getTile(), ossimBumpShadeTileSource::getTile(), ossimEquationCombiner::getTile(), ossimElevImageSource::getTileHeight(), ossimJpegTileSource::getTileHeight(), ossimUsgsDemTileSource::getTileHeight(), ossimCcfTileSource::getTileHeight(), ossimAdrgTileSource::getTileHeight(), ossimGdalTileSource::getTileHeight(), ossimPngReader::getTileHeight(), ossimFeatherMosaic::initialize(), ossimGammaRemapper::initialize(), ossimAtCorrRemapper::initialize(), ossimRgbImage::initialize(), isEqualTo(), ossimIntensityAdjustmentFilter::loadNormTile(), ossimNitfTileSource::lutUncompress(), ossimTiledElevationDatabase::mapRegion(), newNormalizedDouble(), newNormalizedFloat(), ossimEquationCombiner::parseAssignBand(), ossimEquationCombiner::parseStdFuncs(), populateHistogram(), print(), ossimSICDToDetectedImage::processAmplitudeAngleTile(), ossimSICDToDetectedImage::processComplexTile(), ossimBrightnessContrastSource::processRgbTile(), ossimResampler::resampleFullTile(), ossimResampler::resamplePartialTile(), ossimResampler::resampleTile(), ossimResampler::resampleTileNearestNeighbor(), ossimImageRenderer::resampleTileToDecimation(), ossimBandClipFilter::runClamp(), ossimBandClipFilter::runClip(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimFftw3Filter::runFft(), ossimFftFilter::runFft(), ossimEdgeFilter::runLaplacianFilter(), ossimBandClipFilter::runLinearStretch(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runLocalMax8Filter(), ossimBandClipFilter::runMedianStretch(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(), ossimRgbToGreyFilter::runUcharTransformation(), setImageRectangle(), setImageRectangleAndBands(), ossimTilePatch::setRect(), ossimGeoAnnotationBitmap::transform(), write(), ossimNitf20Writer::writeBlockBandSeparate(), ossimNitfWriter::writeBlockBandSeparate(), ossimNitf20Writer::writeBlockBandSequential(), ossimNitfWriter::writeBlockBandSequential(), ossimPdfWriter::writeJpegTile(), ossimPdfWriter::writeRawTile(), and ossimKakaduCompressor::writeTile().

7241 {
7242  return m_spatialExtents[1];
7243 }
std::vector< ossim_uint32 > m_spatialExtents

◆ getHistogram()

ossimRefPtr< ossimMultiResLevelHistogram > ossimImageData::getHistogram ( )

Definition at line 7553 of file ossimImageData.cpp.

References m_histogram.

7554 {
7555  return m_histogram;
7556 }
ossimRefPtr< ossimMultiResLevelHistogram > m_histogram

◆ getImageRectangle()

ossimIrect ossimImageData::getImageRectangle ( ) const
inlinevirtual
Returns
The image rectangle relative to origin, height and width.

Definition at line 1250 of file ossimImageData.h.

References getHeight(), getWidth(), m_origin, ossimIpt::x, and ossimIpt::y.

Referenced by ossimPixelFlipper::allocateClipTileBuffer(), ossimEquationCombiner::applyBlurr(), ossimEquationCombiner::applyConvolution(), ossimEquationCombiner::applyShift(), ossimPixelFlipper::clipTile(), ATP::AtpTileSource::computeParallax(), ossimLocalCorrelationFusion::computeRegression(), ossimConvolutionSource::convolve(), copyLineTemplate(), ossim::copyRegionToTile(), ossimJpegCodec::decodeJpegToRgb(), demo1(), demo3(), ossimDespeckleFilter::despeckle(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimAnnotationEllipseObject::draw(), ossimAnnotationMultiPolyLineObject::draw(), ossimGeoAnnotationBitmap::draw(), ossimAnnotationMultiEllipseObject::draw(), ossimAnnotationMultiPolyObject::draw(), ossimAnnotationPolyObject::draw(), ossimAnnotationGdBitmapFont::draw(), ossimAnnotationLineObject::draw(), ossimAnnotationFontObject::draw(), ossimAnnotationMultiLineObject::draw(), ossimGdalOgrVectorAnnotation::drawAnnotations(), ossimEsriShapeFileFilter::drawAnnotations(), ossimMapCompositionSource::drawBorders(), ossimElevRemapper::elevRemap(), ossimImageDataHelper::fill(), ossimWatermarkFilter::fill(), ossimTilePatch::fillPatch(), ossimJpegTileSource::fillTile(), ossimGpkgReader::fillTile(), ossimGeoPdfReader::fillTile(), ossimTilePatch::fillTileTemplate(), ATP::ossimCorrelationSource::findFeatures(), ossimNullPixelFlip::flipPixels(), ossimPixelFlipper::flipPixels(), ossimBitMaskWriter::generateMask(), ossimGeoAnnotationBitmap::getBoundingRect(), ossimWatermarkFilter::getCenterRect(), ossimImageElevationHandler::getHeightAboveMSL(), ossimEquationCombiner::getImageData(), ossimWatermarkFilter::getLowerCenterRect(), ossimWatermarkFilter::getLowerLeftRect(), ossimWatermarkFilter::getLowerRightRect(), ossimImageCombiner::getNextNormTile(), ossimImageCombiner::getNextTile(), ossimKakaduNitfReader::getOverviewTile(), ossimOpjJp2Reader::getOverviewTile(), ossimKakaduJp2Reader::getOverviewTile(), ossimNitfTileSource::getPartialReadSize(), ossimTilePatch::getRect(), ossimHistogramEqualization::getTile(), ossimPointCloudUtilityFilter::getTile(), ossimBandMergeSource::getTile(), ossimMapCompositionSource::getTile(), ossimRectangleCutFilter::getTile(), ossimImageHandlerMtAdaptor::getTile(), ossimMemoryImageSource::getTile(), ossimUsgsDemTileSource::getTile(), ossimImageSource::getTile(), ossimJpegTileSource::getTile(), ossimTiledImagePatch::getTile(), ossimGdalTileSource::getTile(), ossimGpkgReader::getTile(), ossimHdf5ImageHandler::getTile(), ossimCcfTileSource::getTile(), ossimHdfReader::getTile(), ossimDtedTileSource::getTile(), ossimH5ImageHandler::getTile(), ossimPngReader::getTile(), ossimAdrgTileSource::getTile(), ossimImageCacheTileSource::getTile(), ossimKakaduJ2kReader::getTile(), ossimPointCloudImageHandler::getTile(), ossimRangeDomeTileSource::getTile(), ossimKakaduJp2Reader::getTile(), ossimLasReader::getTile(), ossimTiffTileSource::getTile(), ossimGeoPdfReader::getTile(), ossimNitfTileSource::getTile(), ossimRpfCacheTileSource::getTile(), ossimBumpShadeTileSource::getTile(), ossimCibCadrgTileSource::getTile(), ossimMaskFilter::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimGdalTileSource::getTileBlockRead(), ossimWatermarkFilter::getUniformDenseRects(), ossimWatermarkFilter::getUniformSparceRects(), ossimWatermarkFilter::getUpperCenterRect(), ossimWatermarkFilter::getUpperLeftRect(), ossimWatermarkFilter::getUpperRightRect(), ossimGeoAnnotationBitmap::intersects(), loadBandTemplate(), ossimNitfTileSource::loadBlockFromCache(), ossimGdalTileSource::loadIndexTo3BandTileTemplate(), ossimIntensityAdjustmentFilter::loadNormTile(), loadShortBand(), ossimMemoryImageSource::loadState(), ossimNitfTileSource::loadTile(), loadTile(), loadTileFrom1Band(), loadTileFromBilTemplate(), loadTileFromBipAlphaTemplate(), loadTileFromBipTemplate(), loadTileFromBsqTemplate(), ossimKakaduJp2Reader::loadTileFromCache(), ossimKakaduJ2kReader::loadTileFromCache(), nullTileAlpha(), nullTileAlphaTemplate(), ATP::ossimCorrelationSource::OpenCVCorrelation(), print(), ossimFilterResampler::resample(), ossimResampler::resample(), ossimFilterResampler::resampleBilinearTile(), ossimResampler::resampleNearestNeighbor(), ossimResampler::resampleTile(), ossimResampler::resampleTileNearestNeighbor(), ossimScaleFilter::runHorizontalFilterTemplate(), ossimScaleFilter::runVerticalFilterTemplate(), ossimMemoryImageSource::setImage(), ossimImageDataHelper::setImageData(), ossimMemoryImageSource::setRect(), unloadBand(), unloadBandTemplate(), unloadBandToBsqTemplate(), unloadTile(), unloadTileToBilTemplate(), unloadTileToBipAlphaTemplate(), unloadTileToBipTemplate(), unloadTileToBsqTemplate(), ossimPdfWriter::writeJpegTile(), ossimPdfWriter::writeRawTile(), and ossimOpjCompressor::writeTile().

1251 {
1252  ossimIpt lr(m_origin.x + getWidth() - 1,
1253  m_origin.y + getHeight() - 1);
1254 
1255  return ossimIrect(m_origin, lr);
1256 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getHeight() const
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ getIndexedFlag()

bool ossimImageData::getIndexedFlag ( ) const
Returns
The indexed flag.

Definition at line 7440 of file ossimImageData.cpp.

References m_indexedFlag.

7441 {
7442  return m_indexedFlag;
7443 }
bool m_indexedFlag
Indicates data contains palette indexes.

◆ getMaxPix() [1/2]

const ossim_float64 * ossimImageData::getMaxPix ( ) const
inlinevirtual

Definition at line 1268 of file ossimImageData.h.

References m_maxPixelValue.

Referenced by ossimCastTileSourceFilter::castInputToOutput(), ossimFeatherMosaic::combine(), ossimElevationMosaic::combineNorm(), ossimImageMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), computeMinMaxNulPix(), computeMinMaxPix(), ossimPngReader::copyLinesWithAlpha(), copyNormalizedBufferToTile(), ossimS16ImageData::copyTileToNormalizedBuffer(), copyTileToNormalizedBuffer(), createTestTile(), demo1(), ossimMaskFilter::executeMaskFilterBinarySelection(), ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(), ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(), ossimWatermarkFilter::fill(), ossimTilePatch::fillTile(), ossimShiftFilter::fillTile(), ossimTilePatch::fillTileTemplate(), ossimNullPixelFlip::flipPixels(), ossimEquationCombiner::getImageData(), ossimMemoryImageSource::getMaxPixelValue(), ossimElevImageSource::getMaxPixelValue(), ossimOpjJp2Reader::getMaxPixelValue(), ossimIntensityAdjustmentFilter::getTile(), ossimColorNormalizedFusion::getTile(), ossimUsgsDemTileSource::getTile(), ossimEquationCombiner::parseStdFuncs(), ossimFilterResampler::resampleBilinearTile(), ossimResampler::resampleFullTile(), ossimResampler::resamplePartialTile(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimScaleFilter::runHorizontalFilterTemplate(), ossimEdgeFilter::runLaplacianFilter(), ossimBandClipFilter::runLinearStretch(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(), ossimScaleFilter::runVerticalFilterTemplate(), unloadTileToBipAlphaTemplate(), and ossim::unNormalizeTile().

1269 {
1270  return ( m_maxPixelValue.size() > 0 ? &m_maxPixelValue.front() : 0 );
1271 }
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.

◆ getMaxPix() [2/2]

ossim_float64 ossimImageData::getMaxPix ( ossim_uint32  band) const
inlinevirtual

Definition at line 1285 of file ossimImageData.h.

References ossim::defaultMax(), ossimRectilinearDataObject::getScalarType(), and m_maxPixelValue.

1286 {
1287  return ( band < m_maxPixelValue.size() ? m_maxPixelValue[band] :
1289 }
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
virtual ossimScalarType getScalarType() const
OSSIM_DLL double defaultMax(ossimScalarType scalarType)

◆ getMinNormalizedPix()

ossim_float64 ossimImageData::getMinNormalizedPix ( ) const
virtual

returns normalized minimum pixel value of band zero.

Reimplemented in ossimU16ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, ossimS16ImageData, and ossimU8ImageData.

Definition at line 6924 of file ossimImageData.cpp.

References m_maxPixelValue, m_minPixelValue, ossimRectilinearDataObject::m_scalarType, OSSIM_NORMALIZED_DOUBLE, and OSSIM_NORMALIZED_FLOAT.

Referenced by ossimGammaRemapper::getTile(), and ossimBrightnessContrastSource::processNBandTile().

6925 {
6928  {
6929  return m_minPixelValue[0]; // Already normalized.
6930  }
6931  return (1.0 / (m_maxPixelValue[0] - m_minPixelValue[0] + 1.0));
6932 }
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
32 bit normalized floating point
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
64 bit normalized floating point

◆ getMinPix() [1/2]

const ossim_float64 * ossimImageData::getMinPix ( ) const
inlinevirtual

Definition at line 1263 of file ossimImageData.h.

References m_minPixelValue.

Referenced by ossimTableRemapper::allocate(), ossimCastTileSourceFilter::castInputToOutput(), ossimFeatherMosaic::combine(), ossimElevationMosaic::combineNorm(), ossimImageMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), computeMinMaxNulPix(), computeMinMaxPix(), ossimPngReader::copyLinesWithAlpha(), copyNormalizedBufferToTile(), ossimS16ImageData::copyTileToNormalizedBuffer(), copyTileToNormalizedBuffer(), demo1(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(), ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(), ossimWatermarkFilter::fill(), ossimTilePatch::fillTile(), ossimShiftFilter::fillTile(), ossimTilePatch::fillTileTemplate(), ossimNullPixelFlip::flipPixels(), ossimEquationCombiner::getImageData(), ossimMemoryImageSource::getMinPixelValue(), ossimElevImageSource::getMinPixelValue(), ossimIntensityAdjustmentFilter::getTile(), ossimColorNormalizedFusion::getTile(), ossimSFIMFusion::getTile(), ossimUsgsDemTileSource::getTile(), ossimTiffTileSource::loadFromRgbaU8aStrip(), ossimGdalTileSource::loadIndexTo3BandTileTemplate(), nullTileAlphaTemplate(), ossimEquationCombiner::parseStdFuncs(), ossimFilterResampler::resampleBilinearTile(), ossimResampler::resampleFullTile(), ossimResampler::resamplePartialTile(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimScaleFilter::runHorizontalFilterTemplate(), ossimEdgeFilter::runLaplacianFilter(), ossimBandClipFilter::runLinearStretch(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(), ossimScaleFilter::runVerticalFilterTemplate(), and ossim::unNormalizeTile().

1264 {
1265  return ( m_minPixelValue.size() > 0 ? &m_minPixelValue.front() : 0 );
1266 }
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.

◆ getMinPix() [2/2]

ossim_float64 ossimImageData::getMinPix ( ossim_uint32  band) const
inlinevirtual

Definition at line 1279 of file ossimImageData.h.

References ossim::defaultMin(), ossimRectilinearDataObject::getScalarType(), and m_minPixelValue.

1280 {
1281  return ( band < m_minPixelValue.size() ? m_minPixelValue[band] :
1283 }
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual ossimScalarType getScalarType() const

◆ getNormalizedFloat()

void ossimImageData::getNormalizedFloat ( ossim_uint32  offset,
ossim_uint32  bandNumber,
ossim_float32 result 
) const
virtual

will go to the band and offset and compute the normalized float and return it back to the caller through the result argument.

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 429 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getDoubleBuf(), getFloatBuf(), ossimRectilinearDataObject::getNumberOfDataComponents(), ossimRectilinearDataObject::getScalarType(), getSshortBuf(), getUcharBuf(), getUshortBuf(), m_maxPixelValue, m_minPixelValue, m_nullPixelValue, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by loadTile().

432 {
433  // Make sure that the types and width and height are good.
434  if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
435  {
436  ossim_float32 p = 0.0;
437 
438  switch (getScalarType())
439  {
440  case OSSIM_UINT8:
441  {
442  const unsigned char* sourceBuf = getUcharBuf(bandNumber);
443  p = sourceBuf[offset];
444  break;
445  }
446  case OSSIM_SINT8:
447  {
448  const ossim_sint8* sourceBuf = static_cast<const ossim_sint8*>(getBuf(bandNumber));
449  p = sourceBuf[offset];
450  break;
451  }
452  case OSSIM_USHORT11:
453  case OSSIM_USHORT12:
454  case OSSIM_USHORT13:
455  case OSSIM_USHORT14:
456  case OSSIM_USHORT15:
457  case OSSIM_UINT16:
458  {
459  const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
460  p = sourceBuf[offset];
461  break;
462  }
463  case OSSIM_SINT16:
464  {
465  const ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
466  p = sourceBuf[offset];
467  break;
468  }
469  case OSSIM_UINT32:
470  {
471  const ossim_uint32* sourceBuf =
472  static_cast<const ossim_uint32*>(getBuf(bandNumber));
473  p = sourceBuf[offset];
474  break;
475  }
476  case OSSIM_SINT32:
477  {
478  const ossim_sint32* sourceBuf = static_cast<const ossim_sint32*>(getBuf(bandNumber));
479  p = sourceBuf[offset];
480  break;
481  }
483  case OSSIM_FLOAT32:
484  {
485  const ossim_float32* sourceBuf = getFloatBuf(bandNumber);
486  p = sourceBuf[offset];
487  break;
488  }
489  case OSSIM_FLOAT64:
491  {
492  const ossim_float64* sourceBuf = getDoubleBuf(bandNumber);
493  p = sourceBuf[offset];
494  break;
495  }
497  default:
498  {
499  // Shouldn't hit this.
501  << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
502  << std::endl;
503  }
504 
505  } // Matches: switch (getScalarType())
506 
507  if ( p != m_nullPixelValue[bandNumber] )
508  {
509  const ossim_float32 DELTA = m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber] - 1;
510  const ossim_float32 OFFSET_TO_ONE = 1 - m_minPixelValue[bandNumber];
511 
512  result = ( p <= m_maxPixelValue[bandNumber] ) ?
513  ( ( p >= m_minPixelValue[bandNumber] ) ? ( p + OFFSET_TO_ONE ) / DELTA : 0.0 ) : 1.0;
514  }
515  else
516  {
517  result = 0.0;
518  }
519 
520  } // Matches: if( (getDataObjectStatus() ...
521 
522 } // End: ossimImageData::getNormalizedFloat
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
virtual const ossim_uint16 * getUshortBuf() const
16 bit unsigned integer
virtual const ossim_uint8 * getUcharBuf() const
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
virtual const ossim_sint16 * getSshortBuf() const
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual const ossim_float32 * getFloatBuf() const
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const
virtual ossim_uint32 getNumberOfDataComponents() const
8 bit unsigned integer
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)
virtual const ossim_float64 * getDoubleBuf() const

◆ getNullPix() [1/2]

const ossim_float64 * ossimImageData::getNullPix ( ) const
inlinevirtual

Definition at line 1258 of file ossimImageData.h.

References m_nullPixelValue.

Referenced by ossimCastTileSourceFilter::applyCast(), ossimEquationCombiner::applyClamp(), ossimMeanMedianFilter::applyMean(), ossimMeanMedianFilter::applyMeanNullCenterOnly(), ossimMeanMedianFilter::applyMedian(), ossimMeanMedianFilter::applyMedianNullCenterOnly(), ossimEquationCombiner::applyOp(), ossimEquationCombiner::assignValue(), ossimBandAverageFilter::averageInput(), ossimCastTileSourceFilter::castInputToOutput(), ossimElevationMosaic::combine(), ossimImageMosaic::combine(), ossimMaxMosaic::combine(), ossimBlendMosaic::combine(), ossimFeatherMosaic::combine(), ossimImageMosaic::combineNorm(), ossimElevationMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), ossimBlendMosaic::combineNorm(), computeMinMaxPix(), ossimImageToPlaneNormalFilter::computeNormalsTemplate(), ossimLocalCorrelationFusion::computeRegression(), ossimImageStatisticsSource::computeStatisticsTemplate(), ossimPotraceTool::convertToBitmap(), ossimNitfTileSource::convertTransparentToNull(), ossimConvolutionSource::convolve(), ossim3x3ConvolutionFilter::convolvePartial(), ossimConvolutionFilter1D::convolvePartial(), ossimPngReader::copyLinesWithAlpha(), copyNormalizedBufferToTile(), MEMTiledRasterBand::copyNulls(), copyTileToNormalizedBuffer(), createTestTile(), demo1(), ossimDespeckleFilter::despeckle(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimMaskFilter::executeMaskFilterBinarySelection(), ossimMaskFilter::executeMaskFilterInvertSelection(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(), ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(), ossimWatermarkFilter::fill(), ossimTiledElevationDatabase::fillGrid(), ossimTilePatch::fillTile(), ossimShiftFilter::fillTile(), ossimTilePatch::fillTileTemplate(), ATP::ossimCorrelationSource::findFeatures(), ossimNullPixelFlip::flipPixels(), ossimImageElevationHandler::getHeightAboveMSL(), ossimMemoryImageSource::getNullPixelValue(), ossimImageElevationHandler::getPostValue(), ossimColorNormalizedFusion::getTile(), ossimBandMergeSource::getTile(), ossimPolyCutter::getTile(), ossimSlopeFilter::getTile(), ossimUsgsDemTileSource::getTile(), ossimBandLutFilter::getTile(), ossimBumpShadeTileSource::getTile(), ossimIndexToRgbLutFilter::getTile(), isNull(), ossimTiffTileSource::loadFromRgbaU8aStrip(), ossimGdalTileSource::loadIndexTo3BandTileTemplate(), loadTile(), nullTileAlphaTemplate(), ossimGeoidImage::offsetFromEllipsoidTemplate(), ossimEquationCombiner::parseStdFuncs(), populateHistogram(), ossimFilterResampler::resampleBilinearTile(), ossimResampler::resamplePartialTile(), ossimResampler::resampleTile(), ossimResampler::resampleTileNearestNeighbor(), ossimImageRenderer::resampleTileToDecimation(), ossimBandClipFilter::runClamp(), ossimBandClipFilter::runClip(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimFftFilter::runFft(), ossimScaleFilter::runHorizontalFilterTemplate(), ossimEdgeFilter::runLaplacianFilter(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runLocalMax8Filter(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(), ossimScaleFilter::runVerticalFilterTemplate(), setNull(), ossimKakaduNitfReader::setNullPixelValue(), ossim::unNormalizeTile(), and ossimU8ImageData::validate().

1259 {
1260  return ( m_nullPixelValue.size() > 0 ? &m_nullPixelValue.front() : 0 );
1261 }
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ getNullPix() [2/2]

ossim_float64 ossimImageData::getNullPix ( ossim_uint32  band) const
inlinevirtual

Definition at line 1273 of file ossimImageData.h.

References ossim::defaultNull(), ossimRectilinearDataObject::getScalarType(), and m_nullPixelValue.

1274 {
1275  return ( band < m_nullPixelValue.size() ? m_nullPixelValue[band] :
1277 }
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual ossimScalarType getScalarType() const
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ getNumberOfBands()

ossim_uint32 ossimImageData::getNumberOfBands ( ) const
virtual

Definition at line 1659 of file ossimImageData.cpp.

References ossimRectilinearDataObject::getNumberOfDataComponents().

Referenced by ossimCastTileSourceFilter::allocate(), ossimTableRemapper::allocate(), ossimMultiBandHistogramTileSource::allocate(), ossimBrightnessContrastSource::allocate(), ossimTopographicCorrectionFilter::allocate(), ossimWatermarkFilter::allocate(), ossimPixelFlipper::allocateClipTileBuffer(), ossimCastTileSourceFilter::applyCast(), ossimEquationCombiner::applyClamp(), ossimHistogramRemapper::applyLinearStretch(), ossimMeanMedianFilter::applyMean(), ossimMeanMedianFilter::applyMeanNullCenterOnly(), ossimMeanMedianFilter::applyMedian(), ossimMeanMedianFilter::applyMedianNullCenterOnly(), ossimEquationCombiner::applyOp(), assign(), ossimEquationCombiner::assignValue(), ossimBandAverageFilter::averageInput(), ossimCastTileSourceFilter::castInputToOutput(), ossimElevationMosaic::combine(), ossimImageMosaic::combine(), ossimMaxMosaic::combine(), ossimBlendMosaic::combine(), ossimFeatherMosaic::combine(), ossimElevationMosaic::combineNorm(), ossimImageMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), ossimBlendMosaic::combineNorm(), computeAlphaChannel(), ossimBrightnessMatch::computeInputBrightness(), ossimIntensityAdjustmentFilter::computeMeanIntensity(), computeMinMaxNulPix(), computeMinMaxPix(), ossimImageStatisticsSource::computeStatisticsTemplate(), ossimRgbToIndexFilter::convertInputTile(), ossimNBandToIndexFilter::convertInputTileToOutputTemplate(), ATP::convertToIpl(), ossimS16ImageData::convertToNormalizedDouble(), ossimU11ImageData::convertToNormalizedDouble(), ossimU12ImageData::convertToNormalizedDouble(), ossimU13ImageData::convertToNormalizedDouble(), ossimU14ImageData::convertToNormalizedDouble(), ossimU15ImageData::convertToNormalizedDouble(), ossimU8ImageData::convertToNormalizedDouble(), ossimU16ImageData::convertToNormalizedDouble(), convertToNormalizedDouble(), ossimS16ImageData::convertToNormalizedFloat(), ossimU11ImageData::convertToNormalizedFloat(), ossimU12ImageData::convertToNormalizedFloat(), ossimU13ImageData::convertToNormalizedFloat(), ossimU14ImageData::convertToNormalizedFloat(), ossimU15ImageData::convertToNormalizedFloat(), ossimU8ImageData::convertToNormalizedFloat(), ossimU16ImageData::convertToNormalizedFloat(), convertToNormalizedFloat(), ossimNitfTileSource::convertTransparentToNull(), ossimConvolutionSource::convolve(), ossim3x3ConvolutionFilter::convolveFull(), ossimConvolutionFilter1D::convolveFull(), ossim3x3ConvolutionFilter::convolvePartial(), ossimConvolutionFilter1D::convolvePartial(), ossimImageDataHelper::copyInputToThis(), ossimS16ImageData::copyNormalizedBufferToTile(), ossimU11ImageData::copyNormalizedBufferToTile(), ossimU12ImageData::copyNormalizedBufferToTile(), ossimU13ImageData::copyNormalizedBufferToTile(), ossimU14ImageData::copyNormalizedBufferToTile(), ossimU15ImageData::copyNormalizedBufferToTile(), ossimU16ImageData::copyNormalizedBufferToTile(), ossimU8ImageData::copyNormalizedBufferToTile(), copyNormalizedBufferToTile(), ossim::copyOpjSrgbImage(), ossim::copyRegionToTile(), ossimS16ImageData::copyTileToNormalizedBuffer(), ossimU11ImageData::copyTileToNormalizedBuffer(), ossimU12ImageData::copyTileToNormalizedBuffer(), ossimU13ImageData::copyTileToNormalizedBuffer(), ossimU14ImageData::copyTileToNormalizedBuffer(), ossimU15ImageData::copyTileToNormalizedBuffer(), ossimU8ImageData::copyTileToNormalizedBuffer(), ossimU16ImageData::copyTileToNormalizedBuffer(), copyTileToNormalizedBuffer(), createTestTile(), ossimJpegCodec::decodeJpegToRgb(), demo1(), demo3(), ossimDespeckleFilter::despeckle(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimGeoAnnotationBitmap::draw(), ossimAnnotationFontObject::draw(), ossimElevRemapper::elevRemap(), ossimPngCodec::encode(), ossimJpegCodec::encode(), ossimValueAssignImageSourceFilter::executeAssignGroup(), ossimValueAssignImageSourceFilter::executeAssignSeparate(), ossimMaskFilter::executeMaskFilterBinarySelection(), ossimMaskFilter::executeMaskFilterInvertSelection(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(), ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(), ossimNitfTileSource::explodePackedBits(), ossimImageDataHelper::fill(), fill(), ossimTilePatch::fillTile(), ossimShiftFilter::fillTile(), ossimGeoPdfReader::fillTile(), ossimTilePatch::fillTileTemplate(), ossimNullPixelFlip::flipPixels(), ossimPixelFlipper::flipPixels(), ossimEquationCombiner::getImageData(), ossimImageCombiner::getNextNormTile(), ossimFusionCombiner::getNormIntensity(), ossimFusionCombiner::getNormTile(), ossimMemoryImageSource::getNumberOfInputBands(), ossimKakaduNitfReader::getOverviewTile(), ossimKakaduJ2kReader::getOverviewTile(), ossimKakaduJp2Reader::getOverviewTile(), ossimImageHandler::getOverviewTile(), ossimIntensityAdjustmentFilter::getTile(), ossimHsvToRgbSource::getTile(), ossimJpegYCbCrToRgbSource::getTile(), ossimHsiToRgbSource::getTile(), ossimRgbToHsiSource::getTile(), ossimRgbToHsvSource::getTile(), ossimRgbToJpegYCbCrSource::getTile(), ossimColorNormalizedFusion::getTile(), ossimHistogramEqualization::getTile(), ossimDilationFilter::getTile(), ossimSICDToDetectedImage::getTile(), ossimHistoMatchRemapper::getTile(), ossimEdgeFilter::getTile(), ossimBrightnessContrastSource::getTile(), ossimGammaRemapper::getTile(), ossimBandMergeSource::getTile(), ossimSFIMFusion::getTile(), ossimClosestToCenterCombiner::getTile(), ossimMapCompositionSource::getTile(), ossimLocalCorrelationFusion::getTile(), ossimBandAverageFilter::getTile(), ossimHsiRemapper::getTile(), ossimUsgsDemTileSource::getTile(), ossimJpegTileSource::getTile(), ossimBandClipFilter::getTile(), ossimGpkgReader::getTile(), ossimHdf5ImageHandler::getTile(), ossimCcfTileSource::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimHdfReader::getTile(), ossimDtedTileSource::getTile(), ossimH5ImageHandler::getTile(), ossimPngReader::getTile(), ossimImageSourceSequencer::getTile(), ossimAdrgTileSource::getTile(), ossimImageCacheTileSource::getTile(), ossimPointCloudImageHandler::getTile(), ossimTiffTileSource::getTile(), ossimGeoPdfReader::getTile(), ossimRpfCacheTileSource::getTile(), ossimBumpShadeTileSource::getTile(), ossimCibCadrgTileSource::getTile(), ossimGammaRemapper::initialize(), ossimAtCorrRemapper::initialize(), ossimRgbImage::initialize(), ossimS16ImageData::isNull(), ossimU15ImageData::isNull(), ossimU11ImageData::isNull(), ossimU14ImageData::isNull(), ossimU12ImageData::isNull(), ossimU13ImageData::isNull(), ossimU8ImageData::isNull(), isNull(), ossimIntensityAdjustmentFilter::loadNormTile(), ossimGammaRemapper::loadState(), ossimAtCorrGridRemapper::loadState(), loadTile(), loadTileFrom1Band(), loadTileFromBilTemplate(), loadTileFromBipAlphaTemplate(), loadTileFromBipTemplate(), loadTileFromBsqTemplate(), ossimNitfTileSource::lutUncompress(), makeBlank(), newNormalizedDouble(), newNormalizedFloat(), nullTileAlphaTemplate(), ossimEquationCombiner::parseAssignBand(), ossimEquationCombiner::parseStdFuncs(), populateHistogram(), print(), ossimBrightnessContrastSource::processNBandTile(), ossimTableRemapper::remapFromNativeTable(), ossimTableRemapper::remapFromNormalizedTable(), ossimFilterResampler::resampleBilinearTile(), ossimResampler::resampleFullTile(), ossimResampler::resamplePartialTile(), ossimResampler::resampleTile(), ossimResampler::resampleTileNearestNeighbor(), ossimImageRenderer::resampleTileToDecimation(), ossimBandClipFilter::runClamp(), ossimBandClipFilter::runClip(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimFftw3Filter::runFft(), ossimFftFilter::runFft(), ossimScaleFilter::runFilterTemplate(), ossimScaleFilter::runHorizontalFilterTemplate(), ossimEdgeFilter::runLaplacianFilter(), ossimBandClipFilter::runLinearStretch(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runLocalMax8Filter(), ossimBandClipFilter::runMedianStretch(), ossimTwoColorView::runNative8(), ossimTwoColorView::runNorm(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(), ossimRgbToGreyFilter::runUcharTransformation(), ossimScaleFilter::runVerticalFilterTemplate(), setImageRectangleAndBands(), ossimU8ImageData::setNormalizedFloat(), ossimS16ImageData::setNull(), ossimU11ImageData::setNull(), ossimU14ImageData::setNull(), ossimU12ImageData::setNull(), ossimU13ImageData::setNull(), ossimU15ImageData::setNull(), ossimU8ImageData::setNull(), setNull(), ossimAnnotationSource::setNumberOfBands(), setNumberOfBands(), ossimBandSelector::setOutputBandList(), ossimTiffTileSource::setOutputBandList(), ossimGeneralRasterTileSource::setOutputBandList(), stretchMinMax(), unloadBandToBsqTemplate(), unloadTileToBilTemplate(), unloadTileToBipAlphaTemplate(), unloadTileToBipTemplate(), unloadTileToBsqTemplate(), ossimS16ImageData::validate(), ossimU15ImageData::validate(), ossimU11ImageData::validate(), ossimU12ImageData::validate(), ossimU13ImageData::validate(), ossimU14ImageData::validate(), ossimU8ImageData::validate(), ossimU16ImageData::validate(), validate(), ossimGammaRemapper::verifyEnabled(), ossimAtCorrRemapper::verifyEnabled(), ossimNitfTileSource::vqUncompressC4(), ossimNitfTileSource::vqUncompressM4(), write(), ossimNitf20Writer::writeBlockBandSeparate(), ossimNitfWriter::writeBlockBandSeparate(), ossimNitf20Writer::writeBlockBandSequential(), ossimNitfWriter::writeBlockBandSequential(), and ossimKakaduCompressor::writeTile().

1660 {
1661  return getNumberOfDataComponents();
1662 }
virtual ossim_uint32 getNumberOfDataComponents() const

◆ getOrigin()

virtual const ossimIpt& ossimImageData::getOrigin ( ) const
inlinevirtual

◆ getPix() [1/2]

ossim_float64 ossimImageData::getPix ( const ossimIpt position,
ossim_uint32  band = 0 
) const
virtual

Will return the pixel at location position.

Note it will first get the passed in position relative to the origin or upper left corner of this tile and then return the result.

Definition at line 1664 of file ossimImageData.cpp.

References m_origin, ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, and ossimIpt::y.

Referenced by ossimPotraceTool::convertToBitmap(), ATP::ossimCorrelationSource::findFeatures(), ossimImageElevationHandler::getHeightAboveMSL(), ossimImageElevationHandler::getPostValue(), ossimPointCloudUtilityFilter::getTile(), ossimSlopeFilter::getTile(), ossimKMeansFilter::getTile(), ossimBandLutFilter::getTile(), and ossimHlzTool::PatchProcessorJob::maskTest().

1666 {
1667  ossimIpt relative( position.x - m_origin.x,
1668  position.y - m_origin.y);
1669  if((relative.x < 0) || (relative.x >= (ossim_int32)m_spatialExtents[0])) return 0.0;
1670  if((relative.y < 0) || (relative.y >= (ossim_int32)m_spatialExtents[1])) return 0.0;
1671  return getPix((m_spatialExtents[0])*relative.y + relative.x, band);
1672 }
virtual ossim_float64 getPix(const ossimIpt &position, ossim_uint32 band=0) const
Will return the pixel at location position.
std::vector< ossim_uint32 > m_spatialExtents
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ getPix() [2/2]

ossim_float64 ossimImageData::getPix ( ossim_uint32  offset,
ossim_uint32  band = 0 
) const
virtual

Will return the pixel at offset and band number.

Definition at line 1674 of file ossimImageData.cpp.

References getBuf(), getDoubleBuf(), getFloatBuf(), getSshortBuf(), getUcharBuf(), getUshortBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

1675 {
1676  switch(m_scalarType)
1677  {
1678  case OSSIM_UINT8:
1679  {
1680  const ossim_uint8* buf = getUcharBuf(band);
1681  if(buf)
1682  {
1683  return (ossim_float64)buf[offset];
1684  }
1685  break;
1686  }
1687  case OSSIM_SINT8:
1688  {
1689  const ossim_sint8* buf = static_cast<const ossim_sint8*>(getBuf(band));
1690  if(buf)
1691  {
1692  return (ossim_float64)buf[offset];
1693  }
1694  break;
1695  }
1696  case OSSIM_USHORT11:
1697  case OSSIM_USHORT12:
1698  case OSSIM_USHORT13:
1699  case OSSIM_USHORT14:
1700  case OSSIM_USHORT15:
1701  case OSSIM_UINT16:
1702  {
1703  const ossim_uint16* buf = getUshortBuf(band);
1704  if(buf)
1705  {
1706  return (ossim_float64)buf[offset];
1707  }
1708  break;
1709  }
1710  case OSSIM_SINT16:
1711  {
1712  const ossim_sint16* buf = getSshortBuf(band);
1713  if(buf)
1714  {
1715  return (ossim_float64)buf[offset];
1716  }
1717  break;
1718  }
1719  case OSSIM_SINT32:
1720  {
1721  const ossim_sint32* buf = static_cast<const ossim_sint32*>(getBuf(band));
1722  if(buf)
1723  {
1724  return (ossim_float64)buf[offset];
1725  }
1726  break;
1727  }
1728  case OSSIM_UINT32:
1729  {
1730  const ossim_uint32* buf = static_cast<const ossim_uint32*>(getBuf(band));
1731  if(buf)
1732  {
1733  return (ossim_float64)buf[offset];
1734  }
1735  break;
1736  }
1738  case OSSIM_FLOAT64:
1739  {
1740  const ossim_float64* buf = getDoubleBuf(band);
1741  if(buf)
1742  {
1743  return (ossim_float64)buf[offset];
1744  }
1745  break;
1746  }
1748  case OSSIM_FLOAT32:
1749  {
1750  const ossim_float32* buf = getFloatBuf(band);
1751  if(buf)
1752  {
1753  return (ossim_float64)buf[offset];
1754  }
1755  break;
1756  }
1757  case OSSIM_SCALAR_UNKNOWN:
1758  default:
1759  // Shouldn't hit this.
1761  << "ossimImageData::fill Unsupported scalar type!"
1762  << std::endl;
1763  }
1764 
1765  return 0.0;
1766 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
virtual const ossim_uint16 * getUshortBuf() const
16 bit unsigned integer
virtual const ossim_uint8 * getUcharBuf() const
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
virtual const ossim_sint16 * getSshortBuf() const
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual const ossim_float32 * getFloatBuf() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)
virtual const ossim_float64 * getDoubleBuf() const

◆ getScalarTypeAsString()

ossimString ossimImageData::getScalarTypeAsString ( ) const
virtual

Definition at line 1654 of file ossimImageData.cpp.

References ossimLookUpTable::getEntryString(), ossimRectilinearDataObject::getScalarType(), and ossimScalarTypeLut::instance().

1655 {
1657 }
virtual ossimString getEntryString(ossim_int32 entry_number) const
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
virtual ossimScalarType getScalarType() const

◆ getSize()

ossim_uint32 ossimImageData::getSize ( ) const
virtual

◆ getSizeInBytes()

ossim_uint32 ossimImageData::getSizeInBytes ( ) const
virtual

◆ getSizePerBand()

ossim_uint32 ossimImageData::getSizePerBand ( ) const
virtual

Returns the number of pixels in a single band in a tile.

Note: This is not in bytes but in pixels.

Definition at line 146 of file ossimImageData.cpp.

References getHeight(), and getWidth().

Referenced by ossimEquationCombiner::applyOp(), computeAlphaChannel(), ossimS16ImageData::computeAverageBandValue(), ossimU11ImageData::computeAverageBandValue(), ossimU15ImageData::computeAverageBandValue(), ossimU12ImageData::computeAverageBandValue(), ossimU13ImageData::computeAverageBandValue(), ossimU14ImageData::computeAverageBandValue(), ossimU16ImageData::computeAverageBandValue(), computeAverageBandValue(), computeMeanSquaredError(), computeMinMaxNulPix(), computeMinMaxPix(), ossimS16ImageData::convertToNormalizedDouble(), ossimU15ImageData::convertToNormalizedDouble(), ossimU11ImageData::convertToNormalizedDouble(), ossimU12ImageData::convertToNormalizedDouble(), ossimU13ImageData::convertToNormalizedDouble(), ossimU14ImageData::convertToNormalizedDouble(), ossimU8ImageData::convertToNormalizedDouble(), ossimU16ImageData::convertToNormalizedDouble(), ossimS16ImageData::convertToNormalizedFloat(), ossimU15ImageData::convertToNormalizedFloat(), ossimU11ImageData::convertToNormalizedFloat(), ossimU12ImageData::convertToNormalizedFloat(), ossimU13ImageData::convertToNormalizedFloat(), ossimU14ImageData::convertToNormalizedFloat(), ossimU8ImageData::convertToNormalizedFloat(), ossimU16ImageData::convertToNormalizedFloat(), ossimS16ImageData::copyNormalizedBufferToTile(), ossimU14ImageData::copyNormalizedBufferToTile(), ossimU15ImageData::copyNormalizedBufferToTile(), ossimU11ImageData::copyNormalizedBufferToTile(), ossimU12ImageData::copyNormalizedBufferToTile(), ossimU13ImageData::copyNormalizedBufferToTile(), ossimU16ImageData::copyNormalizedBufferToTile(), ossimU8ImageData::copyNormalizedBufferToTile(), copyNormalizedBufferToTile(), ossimS16ImageData::copyTileToNormalizedBuffer(), ossimU14ImageData::copyTileToNormalizedBuffer(), ossimU15ImageData::copyTileToNormalizedBuffer(), ossimU12ImageData::copyTileToNormalizedBuffer(), ossimU13ImageData::copyTileToNormalizedBuffer(), ossimU11ImageData::copyTileToNormalizedBuffer(), ossimU8ImageData::copyTileToNormalizedBuffer(), ossimU16ImageData::copyTileToNormalizedBuffer(), copyTileToNormalizedBuffer(), ossimS16ImageData::fill(), ossimU15ImageData::fill(), ossimU11ImageData::fill(), ossimU12ImageData::fill(), ossimU13ImageData::fill(), ossimU14ImageData::fill(), ossimU8ImageData::fill(), ossimU16ImageData::fill(), ossimShiftFilter::fillTile(), ossimCcfTileSource::fillUcharBuffer(), ossimCcfTileSource::fillUshortBuffer(), getSize(), ossimGammaRemapper::getTile(), ossimSlopeFilter::getTile(), ossimHsiRemapper::getTile(), ossimImageToPlaneNormalFilter::initializeTile(), makeBlank(), ossimBrightnessContrastSource::processNBandTile(), ossimTableRemapper::remapFromNativeTable(), ossimTableRemapper::remapFromNormalizedTable(), ossimFilterResampler::resampleBilinearTile(), ossimTwoColorView::runNative8(), ossimTwoColorView::runNorm(), stretchMinMax(), ossimS16ImageData::unnormalizeInput(), ossimU12ImageData::unnormalizeInput(), ossimU15ImageData::unnormalizeInput(), ossimU14ImageData::unnormalizeInput(), ossimU11ImageData::unnormalizeInput(), ossimU13ImageData::unnormalizeInput(), ossimU8ImageData::unnormalizeInput(), ossimU16ImageData::unnormalizeInput(), ossimS16ImageData::validate(), ossimU13ImageData::validate(), ossimU12ImageData::validate(), ossimU15ImageData::validate(), ossimU11ImageData::validate(), ossimU14ImageData::validate(), ossimU8ImageData::validate(), ossimU16ImageData::validate(), and validate().

147 {
148  return (getHeight() * getWidth());
149 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getHeight() const

◆ getSizePerBandInBytes()

ossim_uint32 ossimImageData::getSizePerBandInBytes ( ) const
virtual

Returns the number of bytes in single band of the tile.

Definition at line 156 of file ossimImageData.cpp.

References getHeight(), ossimRectilinearDataObject::getScalarSizeInBytes(), and getWidth().

Referenced by assignBand(), copyNormalizedBufferToTile(), copyTileBandToNormalizedBuffer(), ossimNitfTileSource::explodePackedBits(), getBuf(), getSizeInBytes(), ossimBandMergeSource::getTile(), and makeBlank().

157 {
158  return (getHeight() * getWidth() * getScalarSizeInBytes());
159 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getHeight() const
virtual ossim_uint32 getScalarSizeInBytes() const

◆ getSshortBuf() [1/4]

const ossim_sint16 * ossimImageData::getSshortBuf ( ) const
virtual

◆ getSshortBuf() [2/4]

ossim_sint16 * ossimImageData::getSshortBuf ( )
virtual
Returns
ossim_sint16* to theDataBuffer if scalar is of type OSSIM_SSHORT16; else, NULL.

Definition at line 296 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, and OSSIM_SINT16.

297 {
298  if (m_scalarType == OSSIM_SINT16)
299  {
300  return static_cast<ossim_sint16*>(getBuf());
301  }
302  return 0;
303 }
16 bit signed integer
signed short ossim_sint16
virtual const void * getBuf() const

◆ getSshortBuf() [3/4]

const ossim_sint16 * ossimImageData::getSshortBuf ( ossim_uint32  band) const
virtual
Parameters
band(zero based)
Returns
ossim_sint16* to theDataBuffer positioned at band if scalar is of type OSSIM_SSHORT16; else, NULL.

Definition at line 348 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, and OSSIM_SINT16.

349 {
350  if (m_scalarType == OSSIM_SINT16)
351  {
352  return static_cast<const ossim_sint16*>(getBuf(band));
353  }
354  return 0;
355 }
16 bit signed integer
signed short ossim_sint16
virtual const void * getBuf() const

◆ getSshortBuf() [4/4]

ossim_sint16 * ossimImageData::getSshortBuf ( ossim_uint32  band)
virtual
Parameters
band(zero based)
Returns
ossim_sint16* to theDataBuffer positioned at band if scalar is of type OSSIM_SSHORT16; else, NULL.

Definition at line 400 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, and OSSIM_SINT16.

401 {
402  if (m_scalarType == OSSIM_SINT16)
403  {
404  return static_cast<ossim_sint16*>(getBuf(band));
405  }
406  return 0;
407 }
16 bit signed integer
signed short ossim_sint16
virtual const void * getBuf() const

◆ getUcharBuf() [1/4]

const ossim_uint8 * ossimImageData::getUcharBuf ( ) const
virtual
Returns
const ossim_uint8* to theDataBuffer if scalar is of type OSSIM_UCHAR; else, NULL.

Definition at line 221 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, and OSSIM_UINT8.

Referenced by ossimU8ImageData::computeAverageBandValue(), ossimU8ImageData::computeMeanSquaredError(), ossimU8ImageData::convertToNormalizedDouble(), ossimU8ImageData::convertToNormalizedFloat(), ossimU8ImageData::copyNormalizedBufferToTile(), ossim::copyRegionToTile(), ossimU8ImageData::copyTileToNormalizedBuffer(), ossimJpegCodec::decodeJpegToRgb(), ossimJpegCodec::encode(), ossimU8ImageData::fill(), fill(), ossimU8ImageData::getNormalizedFloat(), getNormalizedFloat(), getPix(), ossimLinearStretchRemapper::getTile(), ossimBandLutFilter::getTile(), ossimU8ImageData::isNull(), ossimU8ImageData::setNormalizedFloat(), setNormalizedFloat(), ossimU8ImageData::setNull(), ossimU8ImageData::setValue(), ossimU8ImageData::unnormalizeInput(), ossimU8ImageData::validate(), ossimPdfWriter::writeJpegTile(), ossimPdfWriter::writeRawTile(), and ossimOpjCompressor::writeTile().

222 {
223  if (m_scalarType == OSSIM_UINT8)
224  {
225  return static_cast<const ossim_uint8*>(getBuf());
226  }
227  return 0;
228 }
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8

◆ getUcharBuf() [2/4]

ossim_uint8 * ossimImageData::getUcharBuf ( )
virtual
Returns
ossim_uint8* to theDataBuffer if scalar is of type OSSIM_UCHAR; else, NULL.

Definition at line 273 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, and OSSIM_UINT8.

274 {
275  if (m_scalarType == OSSIM_UINT8)
276  {
277  return static_cast<ossim_uint8*>(getBuf());
278  }
279  return 0;
280 }
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8

◆ getUcharBuf() [3/4]

const ossim_uint8 * ossimImageData::getUcharBuf ( ossim_uint32  band) const
virtual
Parameters
band(zero based)
Returns
ossim_uint8* to theDataBuffer positioned at band if scalar is of type OSSIM_UCHAR; else, NULL.

Definition at line 325 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, and OSSIM_UINT8.

326 {
327  if (m_scalarType == OSSIM_UINT8)
328  {
329  return static_cast<const ossim_uint8*>(getBuf(band));
330  }
331  return 0;
332 }
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8

◆ getUcharBuf() [4/4]

ossim_uint8 * ossimImageData::getUcharBuf ( ossim_uint32  band)
virtual
Parameters
band(zero based)
Returns
ossim_uint8* to theDataBuffer positioned at band if scalar is of type OSSIM_UCHAR; else, NULL.

Definition at line 377 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, and OSSIM_UINT8.

378 {
379  if (m_scalarType == OSSIM_UINT8)
380  {
381  return static_cast<ossim_uint8*>(getBuf(band));
382  }
383  return 0;
384 }
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8

◆ getUshortBuf() [1/4]

const ossim_uint16 * ossimImageData::getUshortBuf ( ) const
virtual
Returns
const ossim_uint16* to theDataBuffer if scalar is of type OSSIM_USHORT16 or USHORT11; else, NULL.

Definition at line 230 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_UINT16, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, and OSSIM_USHORT15.

Referenced by ossimU11ImageData::computeAverageBandValue(), ossimU13ImageData::computeAverageBandValue(), ossimU15ImageData::computeAverageBandValue(), ossimU12ImageData::computeAverageBandValue(), ossimU14ImageData::computeAverageBandValue(), ossimU16ImageData::computeAverageBandValue(), ossimU15ImageData::computeMeanSquaredError(), ossimU11ImageData::computeMeanSquaredError(), ossimU13ImageData::computeMeanSquaredError(), ossimU12ImageData::computeMeanSquaredError(), ossimU14ImageData::computeMeanSquaredError(), ossimU16ImageData::computeMeanSquaredError(), ossimU15ImageData::convertToNormalizedDouble(), ossimU13ImageData::convertToNormalizedDouble(), ossimU12ImageData::convertToNormalizedDouble(), ossimU14ImageData::convertToNormalizedDouble(), ossimU11ImageData::convertToNormalizedDouble(), ossimU16ImageData::convertToNormalizedDouble(), ossimU15ImageData::convertToNormalizedFloat(), ossimU13ImageData::convertToNormalizedFloat(), ossimU12ImageData::convertToNormalizedFloat(), ossimU14ImageData::convertToNormalizedFloat(), ossimU11ImageData::convertToNormalizedFloat(), ossimU16ImageData::convertToNormalizedFloat(), ossimU14ImageData::copyNormalizedBufferToTile(), ossimU12ImageData::copyNormalizedBufferToTile(), ossimU15ImageData::copyNormalizedBufferToTile(), ossimU11ImageData::copyNormalizedBufferToTile(), ossimU13ImageData::copyNormalizedBufferToTile(), ossimU16ImageData::copyNormalizedBufferToTile(), ossimU12ImageData::copyTileToNormalizedBuffer(), ossimU15ImageData::copyTileToNormalizedBuffer(), ossimU11ImageData::copyTileToNormalizedBuffer(), ossimU13ImageData::copyTileToNormalizedBuffer(), ossimU14ImageData::copyTileToNormalizedBuffer(), ossimU16ImageData::copyTileToNormalizedBuffer(), ossimU11ImageData::fill(), ossimU12ImageData::fill(), ossimU15ImageData::fill(), ossimU13ImageData::fill(), ossimU14ImageData::fill(), ossimU16ImageData::fill(), fill(), ossimU15ImageData::getNormalizedFloat(), ossimU11ImageData::getNormalizedFloat(), ossimU13ImageData::getNormalizedFloat(), ossimU12ImageData::getNormalizedFloat(), ossimU14ImageData::getNormalizedFloat(), ossimU16ImageData::getNormalizedFloat(), getNormalizedFloat(), getPix(), ossimLinearStretchRemapper::getTile(), ossimLasReader::getTile(), ossimBandLutFilter::getTile(), ossimU12ImageData::isNull(), ossimU11ImageData::isNull(), ossimU13ImageData::isNull(), ossimU15ImageData::isNull(), ossimU14ImageData::isNull(), loadShortBand(), ossimU15ImageData::setNormalizedFloat(), ossimU13ImageData::setNormalizedFloat(), ossimU14ImageData::setNormalizedFloat(), ossimU12ImageData::setNormalizedFloat(), ossimU11ImageData::setNormalizedFloat(), ossimU16ImageData::setNormalizedFloat(), setNormalizedFloat(), ossimU13ImageData::setNull(), ossimU11ImageData::setNull(), ossimU14ImageData::setNull(), ossimU12ImageData::setNull(), ossimU15ImageData::setNull(), ossimU14ImageData::setValue(), ossimU11ImageData::setValue(), ossimU13ImageData::setValue(), ossimU12ImageData::setValue(), ossimU15ImageData::setValue(), ossimU16ImageData::setValue(), ossimU14ImageData::unnormalizeInput(), ossimU15ImageData::unnormalizeInput(), ossimU11ImageData::unnormalizeInput(), ossimU13ImageData::unnormalizeInput(), ossimU12ImageData::unnormalizeInput(), ossimU16ImageData::unnormalizeInput(), ossimU13ImageData::validate(), ossimU15ImageData::validate(), ossimU14ImageData::validate(), ossimU11ImageData::validate(), ossimU12ImageData::validate(), and ossimU16ImageData::validate().

231 {
232  if (m_scalarType == OSSIM_UINT16 ||
238  {
239  return static_cast<const ossim_uint16*>(getBuf());
240  }
241  return 0;
242 }
16 bit unsigned integer (15 bits used)
16 bit unsigned integer
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
16 bit unsigned integer (12 bits used)

◆ getUshortBuf() [2/4]

ossim_uint16 * ossimImageData::getUshortBuf ( )
virtual
Returns
ossim_uint16* to theDataBuffer if scalar is of type OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.

Definition at line 282 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_UINT16, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, and OSSIM_USHORT15.

283 {
284  if (m_scalarType == OSSIM_UINT16 ||
290  {
291  return static_cast<ossim_uint16*>(getBuf());
292  }
293  return 0;
294 }
16 bit unsigned integer (15 bits used)
16 bit unsigned integer
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
16 bit unsigned integer (12 bits used)

◆ getUshortBuf() [3/4]

const ossim_uint16 * ossimImageData::getUshortBuf ( ossim_uint32  band) const
virtual
Parameters
band(zero based)
Returns
ossim_uint16* to theDataBuffer positioned at band if scalar is of type OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.

Definition at line 334 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_UINT16, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, and OSSIM_USHORT15.

335 {
336  if (m_scalarType == OSSIM_UINT16 ||
342  {
343  return static_cast<const ossim_uint16*>(getBuf(band));
344  }
345  return 0;
346 }
16 bit unsigned integer (15 bits used)
16 bit unsigned integer
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
16 bit unsigned integer (12 bits used)

◆ getUshortBuf() [4/4]

ossim_uint16 * ossimImageData::getUshortBuf ( ossim_uint32  band)
virtual
Parameters
band(zero based)
Returns
ossim_uint16* to theDataBuffer positioned at band if scalar is of type OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.

Definition at line 386 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::m_scalarType, OSSIM_UINT16, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, and OSSIM_USHORT15.

387 {
388  if (m_scalarType == OSSIM_UINT16 ||
394  {
395  return static_cast<ossim_uint16*>(getBuf(band));
396  }
397  return 0;
398 }
16 bit unsigned integer (15 bits used)
16 bit unsigned integer
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
16 bit unsigned integer (12 bits used)

◆ getWidth()

ossim_uint32 ossimImageData::getWidth ( ) const
virtual
Returns
The width of the data object.

Definition at line 7235 of file ossimImageData.cpp.

References ossimRectilinearDataObject::m_spatialExtents.

Referenced by ossimCastTileSourceFilter::allocate(), ossimGeneralRasterTileSource::allocateBuffer(), ossimTiffTileSource::allocateTile(), ossimCastTileSourceFilter::applyCast(), ossimEquationCombiner::applyClamp(), ossimMeanMedianFilter::applyMean(), ossimMeanMedianFilter::applyMeanNullCenterOnly(), ossimMeanMedianFilter::applyMedian(), ossimMeanMedianFilter::applyMedianNullCenterOnly(), ossimEquationCombiner::applyOp(), ossimEquationCombiner::assignValue(), ossimBandAverageFilter::averageInput(), ossimCastTileSourceFilter::castInputToOutput(), ossimPixelFlipper::clipTile(), ossimElevationMosaic::combine(), ossimImageMosaic::combine(), ossimMaxMosaic::combine(), ossimBlendMosaic::combine(), ossimFeatherMosaic::combine(), ossimElevationMosaic::combineNorm(), ossimImageMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), ossimBlendMosaic::combineNorm(), ossimU8ImageData::computeAverageBandValue(), ossimBitMaskWriter::computeImageSize(), ossimBrightnessMatch::computeInputBrightness(), ossimIntensityAdjustmentFilter::computeMeanIntensity(), ossimS16ImageData::computeMeanSquaredError(), ossimU11ImageData::computeMeanSquaredError(), ossimU12ImageData::computeMeanSquaredError(), ossimU13ImageData::computeMeanSquaredError(), ossimU14ImageData::computeMeanSquaredError(), ossimU15ImageData::computeMeanSquaredError(), ossimU8ImageData::computeMeanSquaredError(), ossimU16ImageData::computeMeanSquaredError(), ossimImageToPlaneNormalFilter::computeNormalsTemplate(), ossimImageStatisticsSource::computeStatisticsTemplate(), ossimRgbToIndexFilter::convertInputTile(), ossimNBandToIndexFilter::convertInputTileToOutputTemplate(), ossimPotraceTool::convertToBitmap(), ATP::convertToIpl(), ossimS16ImageData::convertToNormalizedDouble(), ossimU11ImageData::convertToNormalizedDouble(), ossimU12ImageData::convertToNormalizedDouble(), ossimU13ImageData::convertToNormalizedDouble(), ossimU14ImageData::convertToNormalizedDouble(), ossimU15ImageData::convertToNormalizedDouble(), ossimU8ImageData::convertToNormalizedDouble(), ossimU16ImageData::convertToNormalizedDouble(), convertToNormalizedDouble(), ossimS16ImageData::convertToNormalizedFloat(), ossimU11ImageData::convertToNormalizedFloat(), ossimU13ImageData::convertToNormalizedFloat(), ossimU14ImageData::convertToNormalizedFloat(), ossimU15ImageData::convertToNormalizedFloat(), ossimU12ImageData::convertToNormalizedFloat(), ossimU8ImageData::convertToNormalizedFloat(), ossimU16ImageData::convertToNormalizedFloat(), convertToNormalizedFloat(), ossimNitfTileSource::convertTransparentToNull(), ossimConvolutionSource::convolve(), ossimTilePatch::convolve(), ossim3x3ConvolutionFilter::convolveFull(), ossimConvolutionFilter1D::convolveFull(), ossim3x3ConvolutionFilter::convolvePartial(), ossimConvolutionFilter1D::convolvePartial(), ossimImageDataHelper::copyInputToThis(), ATP::copyIplToOid(), copyNormalizedBufferToTile(), ossim::copyOpjSrgbImage(), copyTileBandToNormalizedBuffer(), copyTileToNormalizedBuffer(), createTestTile(), demo1(), ossimDespeckleFilter::despeckle(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimElevRemapper::elevRemap(), ossimPngCodec::encode(), ossimJpegCodec::encode(), ossimValueAssignImageSourceFilter::executeAssignGroup(), ossimValueAssignImageSourceFilter::executeAssignSeparate(), ossimMaskFilter::executeMaskFilter(), ossimMaskFilter::executeMaskFilterBinarySelection(), ossimMaskFilter::executeMaskFilterInvertSelection(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(), ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(), ossimNitfTileSource::explodePackedBits(), ossimImageDataHelper::fill(), ossimWatermarkFilter::fill(), fill(), ossimUsgsDemTileSource::fillBuffer(), ossimDtedTileSource::fillBuffer(), ossimTiledElevationDatabase::fillGrid(), ossimGeoPdfReader::fillTile(), ossimTilePatch::fillTileTemplate(), ossimCcfTileSource::fillUcharBuffer(), ossimCcfTileSource::fillUshortBuffer(), ossimNullPixelFlip::flipPixels(), getImageRectangle(), getSizePerBand(), getSizePerBandInBytes(), ossimHsvToRgbSource::getTile(), ossimIntensityAdjustmentFilter::getTile(), ossimJpegYCbCrToRgbSource::getTile(), ossimHsiToRgbSource::getTile(), ossimRgbToHsiSource::getTile(), ossimRgbToHsvSource::getTile(), ossimRgbToJpegYCbCrSource::getTile(), ossimColorNormalizedFusion::getTile(), ossimDespeckleFilter::getTile(), ossimFeatherMosaic::getTile(), ossimHistoMatchRemapper::getTile(), ossimElevationMosaic::getTile(), ossimImageMosaic::getTile(), ossimBandMergeSource::getTile(), ossimGammaRemapper::getTile(), ossimMaxMosaic::getTile(), ossimAOD::getTile(), ossimSFIMFusion::getTile(), ossimRectangleCutFilter::getTile(), ossimLinearStretchRemapper::getTile(), ossimLocalCorrelationFusion::getTile(), ossimConvolutionSource::getTile(), ossimElevImageSource::getTile(), ossimHsiRemapper::getTile(), ossimGdalTileSource::getTile(), ossimBandClipFilter::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimBitMaskTileSource::getTile(), ossimBandLutFilter::getTile(), ossimBumpShadeTileSource::getTile(), ossimIndexToRgbLutFilter::getTile(), ossimEquationCombiner::getTile(), ossimElevImageSource::getTileWidth(), ossimJpegTileSource::getTileWidth(), ossimUsgsDemTileSource::getTileWidth(), ossimCcfTileSource::getTileWidth(), ossimAdrgTileSource::getTileWidth(), ossimGdalTileSource::getTileWidth(), ossimPngReader::getTileWidth(), ossimFeatherMosaic::initialize(), ossimGammaRemapper::initialize(), ossimAtCorrRemapper::initialize(), ossimRgbImage::initialize(), isEqualTo(), isNull(), loadBandTemplate(), ossimTiffTileSource::loadFromRgbaU8aStrip(), ossimTiffTileSource::loadFromRgbaU8Strip(), ossimGdalTileSource::loadIndexTo3BandTileTemplate(), ossimIntensityAdjustmentFilter::loadNormTile(), loadShortBand(), loadTile(), loadTileFromBilTemplate(), loadTileFromBipAlphaTemplate(), loadTileFromBipTemplate(), loadTileFromBsqTemplate(), ossimNitfTileSource::lutUncompress(), ossimTiledElevationDatabase::mapRegion(), newNormalizedDouble(), newNormalizedFloat(), nullTileAlphaTemplate(), ossimGeoidImage::offsetFromEllipsoidTemplate(), ATP::ossimCorrelationSource::OpenCVCorrelation(), ossimEquationCombiner::parseAssignBand(), ossimEquationCombiner::parseStdFuncs(), populateHistogram(), print(), ossimSICDToDetectedImage::processAmplitudeAngleTile(), ossimSICDToDetectedImage::processComplexTile(), ossimBrightnessContrastSource::processRgbTile(), ossimFilterResampler::resampleBilinearTile(), ossimResampler::resampleFullTile(), ossimResampler::resamplePartialTile(), ossimResampler::resampleTile(), ossimResampler::resampleTileNearestNeighbor(), ossimImageRenderer::resampleTileToDecimation(), ossimBandClipFilter::runClamp(), ossimBandClipFilter::runClip(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimFftw3Filter::runFft(), ossimFftFilter::runFft(), ossimEdgeFilter::runLaplacianFilter(), ossimBandClipFilter::runLinearStretch(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runLocalMax8Filter(), ossimBandClipFilter::runMedianStretch(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(), ossimRgbToGreyFilter::runUcharTransformation(), setImageRectangle(), setImageRectangleAndBands(), setNull(), ossimTilePatch::setRect(), ossimGeoAnnotationBitmap::transform(), unloadBandTemplate(), unloadBandToBsqTemplate(), unloadTileToBilTemplate(), unloadTileToBipAlphaTemplate(), unloadTileToBipTemplate(), unloadTileToBsqTemplate(), ossimNitfTileSource::vqUncompressC4(), ossimNitfTileSource::vqUncompressM4(), write(), ossimNitf20Writer::writeBlockBandSeparate(), ossimNitfWriter::writeBlockBandSeparate(), ossimNitf20Writer::writeBlockBandSequential(), ossimNitfWriter::writeBlockBandSequential(), ossimPdfWriter::writeJpegTile(), ossimPdfWriter::writeRawTile(), and ossimKakaduCompressor::writeTile().

7236 {
7237  return m_spatialExtents[0];
7238 }
std::vector< ossim_uint32 > m_spatialExtents

◆ getWidthHeight()

void ossimImageData::getWidthHeight ( ossim_uint32 w,
ossim_uint32 h 
)
virtual

Definition at line 7245 of file ossimImageData.cpp.

References ossimRectilinearDataObject::m_spatialExtents.

7246 {
7247  w = m_spatialExtents[0];
7248  h = m_spatialExtents[1];
7249 }
std::vector< ossim_uint32 > m_spatialExtents

◆ hasAlpha()

bool ossimImageData::hasAlpha ( ) const
inlinevirtual
Returns
true if alpha channel is initialized, false if not.

Definition at line 1245 of file ossimImageData.h.

References m_alpha.

Referenced by unloadTileToBipAlphaTemplate().

1246 {
1247  return (m_alpha.size()?true:false);
1248 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.

◆ hasSameDimensionsAs()

bool ossimImageData::hasSameDimensionsAs ( ossimImageData data) const
inlineprotected

Definition at line 1201 of file ossimImageData.h.

References ossimRectilinearDataObject::m_scalarType, and ossimRectilinearDataObject::m_spatialExtents.

1202  {
1203  bool result = false;
1204  if(data)
1205  {
1206  result = ((m_spatialExtents.size() ==
1207  data->m_spatialExtents.size())&&
1208  (m_spatialExtents[0] == data->m_spatialExtents[0])&&
1209  (m_spatialExtents[1] == data->m_spatialExtents[1])&&
1210  (m_scalarType == data->m_scalarType));
1211  }
1212  return result;
1213  }
std::vector< ossim_uint32 > m_spatialExtents

◆ initialize()

void ossimImageData::initialize ( )
virtual

Initialize the data buffer.

Reimplemented from ossimRectilinearDataObject.

Definition at line 1352 of file ossimImageData.cpp.

References ossimRectilinearDataObject::initialize(), ossimRectilinearDataObject::m_dataBuffer, and makeBlank().

Referenced by ossimHsvToRgbSource::allocate(), ossimHsiToRgbSource::allocate(), ossimRgbToHsiSource::allocate(), ossimRgbToHsvSource::allocate(), ossimDespeckleFilter::allocate(), ossimHistogramEqualization::allocate(), ossimAOD::allocate(), ossimConvolutionSource::allocate(), ossimBandMergeSource::allocate(), ossimIntensityAdjustmentFilter::allocate(), ossim3x3ConvolutionFilter::allocate(), ossimElevationMosaic::allocate(), ossimSICDToDetectedImage::allocate(), ossimImageMosaic::allocate(), ossimRgbToGreyFilter::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(), ossimAnnotationSource::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(), ossimCastTileSourceFilter::applyCast(), ossimHlzTool::computeHLZ(), ossimBrightnessMatch::computeInputBrightness(), ossimViewshedTool::computeViewshed(), ossimTilePatch::convolve(), ossimRgbImage::createNewGrey(), ossimRgbImage::createNewTrueColor(), createTestTile(), ossimJpegCodec::decodeJpegToRgb(), demo2(), demo3(), ossimMaskFilter::executeMaskFilter(), ossimGeoPdfReader::fillTile(), ossimImageCombiner::getNextNormTile(), ossimFusionCombiner::getNormIntensity(), ossimFusionCombiner::getNormTile(), ossimHsvToRgbSource::getTile(), ossimDespeckleFilter::getTile(), ossimFeatherMosaic::getTile(), ossimElevationMosaic::getTile(), ossimImageMosaic::getTile(), ossimGammaRemapper::getTile(), ossimMaxMosaic::getTile(), ossimBandMergeSource::getTile(), ossimAOD::getTile(), ossimSFIMFusion::getTile(), ossimClosestToCenterCombiner::getTile(), ossimLocalCorrelationFusion::getTile(), ossimSlopeFilter::getTile(), ossimConvolutionSource::getTile(), ossimElevImageSource::getTile(), ossimMemoryImageSource::getTile(), ossimTiledImagePatch::getTile(), ossimBandClipFilter::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimBitMaskTileSource::getTile(), ossimImageSourceSequencer::getTile(), ossimRangeDomeTileSource::getTile(), ossimTiffTileSource::getTile(), ossimBumpShadeTileSource::getTile(), ossimMaskFilter::getTile(), ossimEquationCombiner::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimImageRenderer::getTileAtResLevel(), ossimGdalTileSource::getTileBlockRead(), ossimBlendMosaic::initialize(), ossimFftFilter::initialize(), ossimFeatherMosaic::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(), ossimPointCloudImageHandler::initTile(), ossimLasReader::initTile(), loadBandTemplate(), ossimIntensityAdjustmentFilter::loadNormTile(), loadShortBand(), ossimMemoryImageSource::loadState(), loadTile(), loadTileFromBilTemplate(), loadTileFromBipAlphaTemplate(), loadTileFromBipTemplate(), loadTileFromBsqTemplate(), newNormalizedDouble(), newNormalizedFloat(), nullTileAlphaTemplate(), ossimBitMaskTileSource::open(), ATP::ossimCorrelationSource::OpenCVCorrelation(), ossimBandClipFilter::ossimBandClipFilter(), ossimTilePatch::ossimTilePatch(), ossimEquationCombiner::parseStdFuncs(), ossimResampler::resampleTile(), ossimScaleFilter::runFilterTemplate(), ossimMemoryImageSource::setImage(), setImageRectangle(), setImageRectangleAndBands(), ossimGdalTileSource::setPreservePaletteIndexesFlag(), ossimTilePatch::setRect(), ossimPdfWriter::writeJpegTile(), and ossimPdfWriter::writeRawTile().

1353 {
1354  // let the base class allocate a buffer
1356 
1357  if (m_dataBuffer.size() > 0)
1358  {
1359  makeBlank(); // Make blank will set the status.
1360  }
1361 }
std::vector< ossim_uint8 > m_dataBuffer
virtual void initialize()
Initializes m_dataBuffer to current spatial extents.
virtual void makeBlank()
Initializes data to null pixel values.

◆ initializeDefaults()

void ossimImageData::initializeDefaults ( )
protectedvirtual

initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value for scalar type.

Definition at line 1540 of file ossimImageData.cpp.

References initializeMaxDefault(), initializeMinDefault(), and initializeNullDefault().

Referenced by assign(), loadState(), and ossimImageData().

1541 {
1545 }
virtual void initializeNullDefault()
initializeNullDefault() Resizes theNullPixelValue array to number of bands and initializes to the def...
virtual void initializeMaxDefault()
initializeMaxDefault() Resizes theMaxPixelValue array to number of bands and initializes to the defau...
virtual void initializeMinDefault()
initializeMinDefault() Resizes theMinPixelValue array to number of bands and initializes to the defau...

◆ initializeMaxDefault()

void ossimImageData::initializeMaxDefault ( )
protectedvirtual

initializeMaxDefault() Resizes theMaxPixelValue array to number of bands and initializes to the default max for scalar type.

Definition at line 1564 of file ossimImageData.cpp.

References ossim::defaultMax(), ossimRectilinearDataObject::getScalarType(), m_maxPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

Referenced by initializeDefaults(), and setMaxPix().

1565 {
1567  {
1568  return;
1569  }
1570 
1572 
1574 
1575  for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
1576  {
1577  m_maxPixelValue[band] = value;
1578  }
1579 }
double ossim_float64
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
virtual ossimScalarType getScalarType() const
OSSIM_DLL double defaultMax(ossimScalarType scalarType)

◆ initializeMinDefault()

void ossimImageData::initializeMinDefault ( )
protectedvirtual

initializeMinDefault() Resizes theMinPixelValue array to number of bands and initializes to the default min for scalar type.

Definition at line 1547 of file ossimImageData.cpp.

References ossim::defaultMin(), ossimRectilinearDataObject::getScalarType(), m_minPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

Referenced by initializeDefaults(), and setMinPix().

1548 {
1550  {
1551  return;
1552  }
1553 
1555 
1557 
1558  for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
1559  {
1560  m_minPixelValue[band] = value;
1561  }
1562 }
double ossim_float64
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
unsigned int ossim_uint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual ossimScalarType getScalarType() const

◆ initializeNullDefault()

void ossimImageData::initializeNullDefault ( )
protectedvirtual

initializeNullDefault() Resizes theNullPixelValue array to number of bands and initializes to the default null for scalar type.

Definition at line 1581 of file ossimImageData.cpp.

References ossim::defaultNull(), ossimRectilinearDataObject::getScalarType(), m_nullPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

Referenced by initializeDefaults(), and setNullPix().

1582 {
1584  {
1585  return;
1586  }
1587 
1589 
1591 
1592  for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
1593  {
1594  m_nullPixelValue[band] = value;
1595  }
1596 }
double ossim_float64
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
unsigned int ossim_uint32
virtual ossimScalarType getScalarType() const
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ isEqualTo()

bool ossimImageData::isEqualTo ( const ossimDataObject rhs,
bool  deepTest = false 
) const
virtual

Definition at line 1598 of file ossimImageData.cpp.

References getBuf(), getHeight(), getSizeInBytes(), getWidth(), m_maxPixelValue, m_minPixelValue, m_nullPixelValue, ossimRectilinearDataObject::m_numberOfDataComponents, m_origin, and ossimRectilinearDataObject::m_scalarType.

1600 {
1601  const ossimImageData* rhsPtr = dynamic_cast<const ossimImageData*>(&rhs);
1602  if(!rhsPtr) return false;
1603  bool result = ( (m_scalarType == rhsPtr->m_scalarType)&&
1605  (m_origin == rhsPtr->m_origin)&&
1606  (getWidth() == rhsPtr->getWidth())&&
1607  (getHeight() == rhsPtr->getHeight()));
1608 
1609  if(result)
1610  {
1611  bool test=true;
1612  for(ossim_uint32 index = 0; index < m_numberOfDataComponents; ++index)
1613  {
1614  if(m_minPixelValue[index] != rhsPtr->m_minPixelValue[index])
1615  {
1616  test = false;
1617  break;
1618  }
1619  if(m_maxPixelValue[index] != rhsPtr->m_maxPixelValue[index])
1620  {
1621  test = false;
1622  break;
1623  }
1624  if(m_nullPixelValue[index] != rhsPtr->m_nullPixelValue[index])
1625  {
1626  test = false;
1627  break;
1628  }
1629  }
1630  result = test;
1631  }
1632  if(deepTest&&result)
1633  {
1634  if(getBuf() != 0 && rhsPtr->getBuf() != 0)
1635  {
1636  if(memcmp(getBuf(), rhsPtr->getBuf(), getSizeInBytes()) != 0)
1637  {
1638  result = false;
1639  }
1640  }
1641  else if(getBuf() == 0 && rhsPtr->getBuf() == 0)
1642  {
1643  // nothing both are null so don't change the result.
1644  }
1645  else // one is null so not equal.
1646  {
1647  result = false;
1648  }
1649  }
1650 
1651  return result;
1652 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getHeight() const
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const

◆ isNull() [1/4]

bool ossimImageData::isNull ( ossim_uint32  offset) const

Definition at line 2009 of file ossimImageData.cpp.

References getBuf(), getNullPix(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by ossimBlendMosaic::combine(), ossimFeatherMosaic::combine(), ossimBlendMosaic::combineNorm(), ossimU16ImageData::computeAverageBandValue(), computeAverageBandValue(), ossimU16ImageData::computeMeanSquaredError(), computeMeanSquaredError(), ossimNBandToIndexFilter::convertInputTileToOutputTemplate(), ossimConvolutionSource::convolve(), ossimTilePatch::fillTileTemplate(), ossimClosestToCenterCombiner::findIdx(), ossimBitMaskWriter::generateMask(), isNull(), ossimResampler::resamplePartialTile(), ossimBandClipFilter::runLinearStretch(), and ossimBandClipFilter::runMedianStretch().

2010 {
2011  ossim_uint32 numberOfBands = getNumberOfBands();
2012  ossim_uint32 band=0;
2013  if(!getBuf())
2014  {
2015  return true;
2016  }
2017 
2018  switch(getScalarType())
2019  {
2020  case OSSIM_UINT8:
2021  {
2022  for(band = 0; band < numberOfBands; ++band)
2023  {
2024  const ossim_uint8* buf = static_cast<const ossim_uint8*>(getBuf(band))+offset;
2025  if((*buf) != (ossim_uint8)getNullPix(band))
2026  {
2027  return false;
2028  }
2029  }
2030  break;
2031  }
2032  case OSSIM_SINT8:
2033  {
2034  for(band = 0; band < numberOfBands; ++band)
2035  {
2036  const ossim_sint8* buf = static_cast<const ossim_sint8*>(getBuf(band))+offset;
2037  if((*buf) != (ossim_uint8)getNullPix(band))
2038  {
2039  return false;
2040  }
2041  }
2042  break;
2043  }
2044  case OSSIM_UINT16:
2045  case OSSIM_USHORT11:
2046  case OSSIM_USHORT12:
2047  case OSSIM_USHORT13:
2048  case OSSIM_USHORT14:
2049  case OSSIM_USHORT15:
2050  {
2051  for(band = 0; band < numberOfBands; band++)
2052  {
2053  const ossim_uint16* buf = static_cast<const ossim_uint16*>(getBuf(band))+offset;
2054  if((*buf) != (ossim_uint16)getNullPix(band))
2055  {
2056  return false;
2057  }
2058  }
2059  break;
2060  }
2061  case OSSIM_SINT16:
2062  {
2063  for(band = 0; band < numberOfBands; band++)
2064  {
2065  const ossim_sint16* buf = static_cast<const ossim_sint16*>(getBuf(band))+offset;
2066  if((*buf) != (ossim_sint16)getNullPix(band))
2067  {
2068  return false;
2069  }
2070  }
2071  break;
2072  }
2073  case OSSIM_UINT32:
2074  {
2075  for(band = 0; band < numberOfBands; band++)
2076  {
2077  const ossim_uint32* buf = static_cast<const ossim_uint32*>(getBuf(band))+offset;
2078  if((*buf) != (ossim_uint32)getNullPix(band))
2079  {
2080  return false;
2081  }
2082  }
2083  break;
2084  }
2085  case OSSIM_SINT32:
2086  {
2087  for(band = 0; band < numberOfBands; band++)
2088  {
2089  const ossim_sint32* buf = static_cast<const ossim_sint32*>(getBuf(band))+offset;
2090  if((*buf) != (ossim_sint32)getNullPix(band))
2091  {
2092  return false;
2093  }
2094  }
2095  break;
2096  }
2098  {
2099  for(band = 0; band < numberOfBands; band++)
2100  {
2101  const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
2102  if((*buf) != 0.0)
2103  {
2104  return false;
2105  }
2106  }
2107  break;
2108  }
2109  case OSSIM_FLOAT32:
2110  {
2111  for(band = 0; band < numberOfBands; band++)
2112  {
2113  const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
2114  if((*buf) != (ossim_float32)getNullPix(band))
2115  {
2116  return false;
2117  }
2118  }
2119  break;
2120  }
2122  {
2123  for(band = 0; band < numberOfBands; band++)
2124  {
2125  const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
2126  if((*buf) != 0.0)
2127  {
2128  return false;
2129  }
2130  }
2131  break;
2132  }
2133  case OSSIM_FLOAT64:
2134  {
2135  for(band = 0; band < numberOfBands; band++)
2136  {
2137  const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
2138  if((*buf) != getNullPix(band))
2139  {
2140  return false;
2141  }
2142  }
2143  break;
2144  }
2145  case OSSIM_SCALAR_UNKNOWN:
2146  default:
2147  {
2148  //ERROR
2150  << "ossimImageData::isNull Unsupported scalar type!"
2151  << std::endl;
2152  }
2153  }
2154  return true;
2155 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ isNull() [2/4]

bool ossimImageData::isNull ( ossim_uint32  offset,
ossim_uint32  band 
) const

Definition at line 2157 of file ossimImageData.cpp.

References getBuf(), getNullPix(), ossimRectilinearDataObject::getScalarType(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

2158 {
2159  switch(getScalarType())
2160  {
2161  case OSSIM_UINT8:
2162  {
2163  const ossim_uint8* buf =
2164  static_cast<const ossim_uint8*>(getBuf(band))+offset;
2165 
2166  if((*buf) != (ossim_uint8)getNullPix(band))
2167  {
2168  return false;
2169  }
2170  break;
2171  }
2172  case OSSIM_SINT8:
2173  {
2174  const ossim_sint8* buf =
2175  static_cast<const ossim_sint8*>(getBuf(band))+offset;
2176 
2177  if((*buf) != (ossim_sint8)getNullPix(band))
2178  {
2179  return false;
2180  }
2181  break;
2182  }
2183  case OSSIM_UINT16:
2184  case OSSIM_USHORT11:
2185  case OSSIM_USHORT12:
2186  case OSSIM_USHORT13:
2187  case OSSIM_USHORT14:
2188  case OSSIM_USHORT15:
2189  {
2190  const ossim_uint16* buf =
2191  static_cast<const ossim_uint16*>(getBuf(band))+offset;
2192  if((*buf) != (ossim_uint16)getNullPix(band))
2193  {
2194  return false;
2195  }
2196  break;
2197  }
2198  case OSSIM_SINT16:
2199  {
2200  const ossim_sint16* buf =
2201  static_cast<const ossim_sint16*>(getBuf(band))+offset;
2202  if((*buf) != (ossim_sint16)getNullPix(band))
2203  {
2204  return false;
2205  }
2206  break;
2207  }
2208  case OSSIM_UINT32:
2209  {
2210  const ossim_uint32* buf =
2211  static_cast<const ossim_uint32*>(getBuf(band))+offset;
2212  if((*buf) != (ossim_uint32)getNullPix(band))
2213  {
2214  return false;
2215  }
2216  break;
2217  }
2218  case OSSIM_SINT32:
2219  {
2220  const ossim_sint32* buf =
2221  static_cast<const ossim_sint32*>(getBuf(band))+offset;
2222  if((*buf) != (ossim_sint32)getNullPix(band))
2223  {
2224  return false;
2225  }
2226  break;
2227  }
2229  case OSSIM_FLOAT32:
2230  {
2231  const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
2232  if((*buf) != (ossim_float32)getNullPix(band))
2233  {
2234  return false;
2235  }
2236  break;
2237  }
2238  case OSSIM_FLOAT64:
2240  {
2241  const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
2242  if((*buf) != getNullPix(band))
2243  {
2244  return false;
2245  }
2246  break;
2247  }
2248  case OSSIM_SCALAR_UNKNOWN:
2249  default:
2250  {
2251  //ERROR
2253  << "ossimImageData::isNull Unsupported scalar type!"
2254  << std::endl;
2255  }
2256  }
2257  return true;
2258 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ isNull() [3/4]

bool ossimImageData::isNull ( const ossimIpt pt) const

Definition at line 2260 of file ossimImageData.cpp.

References getWidth(), isNull(), m_origin, ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, and ossimIpt::y.

2261 {
2262  ossim_int32 xNew = (pt.x - m_origin.x);
2263  ossim_int32 yNew = (pt.y - m_origin.y);
2264  if(xNew < 0 || xNew >= static_cast<ossim_int32>(m_spatialExtents[0]) ||
2265  yNew < 0 || yNew >= static_cast<ossim_int32>(m_spatialExtents[1]) )
2266  {
2267  return true;
2268  }
2269  ossim_uint32 offset = getWidth()*yNew + xNew;
2270 
2271  return isNull(offset);
2272 }
virtual ossim_uint32 getWidth() const
bool isNull(ossim_uint32 offset) const
unsigned int ossim_uint32
std::vector< ossim_uint32 > m_spatialExtents
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ isNull() [4/4]

bool ossimImageData::isNull ( const ossimIpt pt,
ossim_uint32  band 
) const

Definition at line 2274 of file ossimImageData.cpp.

References getWidth(), isNull(), m_origin, ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, and ossimIpt::y.

2275 {
2276  ossim_int32 xNew = (pt.x - m_origin.x);
2277  ossim_int32 yNew = (pt.y - m_origin.y);
2278  if(xNew < 0 || xNew >= static_cast<ossim_int32>(m_spatialExtents[0]) ||
2279  yNew < 0 || yNew >= static_cast<ossim_int32>(m_spatialExtents[1]) )
2280  {
2281  return true;
2282  }
2283  ossim_uint32 offset = getWidth()*yNew + xNew;
2284 
2285  return isNull(offset, band);
2286 }
virtual ossim_uint32 getWidth() const
bool isNull(ossim_uint32 offset) const
unsigned int ossim_uint32
std::vector< ossim_uint32 > m_spatialExtents
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ isPointWithin() [1/2]

bool ossimImageData::isPointWithin ( const ossimIpt point) const
virtual

Definition at line 4503 of file ossimImageData.cpp.

References m_origin, ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, and ossimIpt::y.

4504 {
4505  return ((point.x >= m_origin.x)&&
4506  (point.y >= m_origin.y)&&
4507  ((point.x - m_origin.x)<static_cast<ossim_int32>(m_spatialExtents[0]))&&
4508  ((point.y - m_origin.y)<static_cast<ossim_int32>(m_spatialExtents[1])));
4509 }
std::vector< ossim_uint32 > m_spatialExtents
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ isPointWithin() [2/2]

bool ossimImageData::isPointWithin ( ossim_int32  x,
ossim_int32  y 
) const
virtual

Definition at line 4511 of file ossimImageData.cpp.

References m_origin, ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, x, ossimIpt::y, and y.

4512 {
4513  return ((x >= m_origin.x)&&
4514  (y >= m_origin.y)&&
4515  ((x - m_origin.x) < static_cast<ossim_int32>(m_spatialExtents[0]))&&
4516  ((y - m_origin.y) < static_cast<ossim_int32>(m_spatialExtents[1])));
4517 }
ossim_uint32 x
ossim_uint32 y
std::vector< ossim_uint32 > m_spatialExtents
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ isValidBand()

bool ossimImageData::isValidBand ( ossim_uint32  band) const
virtual

◆ isWithin()

bool ossimImageData::isWithin ( ossim_int32  x,
ossim_int32  y 
)
virtual

Definition at line 1415 of file ossimImageData.cpp.

References m_origin, ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, x, ossimIpt::y, and y.

Referenced by ossimS16ImageData::setValue(), ossimU12ImageData::setValue(), ossimU13ImageData::setValue(), ossimU15ImageData::setValue(), ossimU14ImageData::setValue(), ossimU11ImageData::setValue(), ossimU8ImageData::setValue(), ossimU16ImageData::setValue(), and setValue().

1416 {
1417  return ((x >= m_origin.x) &&
1418  (x < m_origin.x + static_cast<ossim_int32>(m_spatialExtents[0])) &&
1419  (y >= m_origin.y) &&
1420  (y < m_origin.y + static_cast<ossim_int32>(m_spatialExtents[1])));
1421 
1422 }
ossim_uint32 x
ossim_uint32 y
std::vector< ossim_uint32 > m_spatialExtents
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ loadBand() [1/2]

void ossimImageData::loadBand ( const void *  src,
const ossimIrect src_rect,
ossim_uint32  band 
)
virtual

Definition at line 2842 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadBandTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

Referenced by demo3(), ossimAdrgTileSource::fillBuffer(), ossimMapCompositionSource::getTile(), ossimGdalTileSource::getTile(), ossimHdf5ImageHandler::getTile(), ossimH5ImageHandler::getTile(), ossimMrSidReader::getTile(), ossimMG4LidarReader::getTile(), ossimGdalTileSource::getTileBlockRead(), loadTileFrom1Band(), and ossimGeoPdfReader::resetCacheBuffer().

2845 {
2846  // Call the appropriate load method.
2847  switch (getScalarType())
2848  {
2849  case OSSIM_UINT8:
2850  loadBandTemplate(ossim_uint8(0), src, src_rect, band);
2851  return;
2852 
2853  case OSSIM_SINT8:
2854  loadBandTemplate(ossim_sint8(0), src, src_rect, band);
2855  return;
2856 
2857  case OSSIM_UINT16:
2858  case OSSIM_USHORT11:
2859  case OSSIM_USHORT12:
2860  case OSSIM_USHORT13:
2861  case OSSIM_USHORT14:
2862  case OSSIM_USHORT15:
2863  loadBandTemplate(ossim_uint16(0), src, src_rect, band);
2864  return;
2865 
2866  case OSSIM_SINT16:
2867  loadBandTemplate(ossim_sint16(0), src, src_rect, band);
2868  return;
2869 
2870  case OSSIM_UINT32:
2871  loadBandTemplate(ossim_uint32(0), src, src_rect, band);
2872  return;
2873 
2874  case OSSIM_SINT32:
2875  loadBandTemplate(ossim_sint32(0), src, src_rect, band);
2876  return;
2877 
2878  case OSSIM_FLOAT32:
2880  loadBandTemplate(ossim_float32(0), src, src_rect, band);
2881  return;
2882 
2884  case OSSIM_FLOAT64:
2885  loadBandTemplate(ossim_float64(0), src, src_rect, band);
2886  return;
2887 
2888  case OSSIM_SCALAR_UNKNOWN:
2889  default:
2892  "ossimImageData::loadBand\n\
2893 File %s line %d\nUnknown scalar type!",
2894 __FILE__,
2895 __LINE__);
2896  return;
2897  }
2898 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)
void loadBandTemplate(T, const void *src, const ossimIrect &src_rect, ossim_uint32 band)

◆ loadBand() [2/2]

void ossimImageData::loadBand ( const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect,
ossim_uint32  band 
)
virtual

Definition at line 2900 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadBandTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

2904 {
2905  // Call the appropriate load method.
2906  switch (getScalarType())
2907  {
2908  case OSSIM_UINT8:
2909  loadBandTemplate(ossim_uint8(0), src, src_rect, clip_rect, band);
2910  return;
2911 
2912  case OSSIM_SINT8:
2913  loadBandTemplate(ossim_sint8(0), src, src_rect, clip_rect, band);
2914  return;
2915 
2916  case OSSIM_UINT16:
2917  case OSSIM_USHORT11:
2918  case OSSIM_USHORT12:
2919  case OSSIM_USHORT13:
2920  case OSSIM_USHORT14:
2921  case OSSIM_USHORT15:
2922  loadBandTemplate(ossim_uint16(0), src, src_rect, clip_rect, band);
2923  return;
2924 
2925  case OSSIM_SINT16:
2926  loadBandTemplate(ossim_sint16(0), src, src_rect, clip_rect, band);
2927  return;
2928 
2929  case OSSIM_UINT32:
2930  loadBandTemplate(ossim_uint32(0), src, src_rect, clip_rect, band);
2931  return;
2932 
2933  case OSSIM_SINT32:
2934  loadBandTemplate(ossim_sint32(0), src, src_rect, clip_rect, band);
2935  return;
2936 
2937  case OSSIM_FLOAT32:
2939  loadBandTemplate(ossim_float32(0), src, src_rect, clip_rect, band);
2940  return;
2941 
2943  case OSSIM_FLOAT64:
2944  loadBandTemplate(ossim_float64(0), src, src_rect, clip_rect, band);
2945  return;
2946 
2947  case OSSIM_SCALAR_UNKNOWN:
2948  default:
2951  "ossimImageData::loadBand\n\
2952 File %s line %d\nUnknown scalar type!",
2953 __FILE__,
2954 __LINE__);
2955  return;
2956  }
2957 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)
void loadBandTemplate(T, const void *src, const ossimIrect &src_rect, ossim_uint32 band)

◆ loadBandTemplate() [1/2]

template<class T >
void ossimImageData::loadBandTemplate ( ,
const void *  src,
const ossimIrect src_rect,
ossim_uint32  band 
)
protected

Definition at line 2959 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), and getImageRectangle().

Referenced by loadBand().

2963 {
2964  const ossimIrect img_rect = getImageRectangle();
2965 
2966  // Get the clip rect.
2967  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
2968 
2969 
2970  loadBandTemplate(T(0), src, src_rect, clip_rect, band);
2971 }
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
void loadBandTemplate(T, const void *src, const ossimIrect &src_rect, ossim_uint32 band)

◆ loadBandTemplate() [2/2]

template<class T >
void ossimImageData::loadBandTemplate ( ,
const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect,
ossim_uint32  band 
)
protected

Definition at line 2973 of file ossimImageData.cpp.

References ossimIrect::completely_within(), getBuf(), ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getWidth(), ossimIrect::height(), initialize(), ossimIrect::intersects(), isValidBand(), ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

2978 {
2979  static const char MODULE[] = "ossimImageData::loadBand";
2980 
2981  // Check the pointer.
2982  if (!src)
2983  {
2984  // Set the error...
2987  "%s File %s line %d\nNULL pointer passed to method!",
2988  MODULE,
2989  __FILE__,
2990  __LINE__);
2991  return;
2992  }
2993 
2994  // Check the band.
2995  if (!isValidBand(band))
2996  {
2997  // Set the error...
3000  "%s File %s line %d\nInvalid band: %d",
3001  MODULE,
3002  __FILE__,
3003  __LINE__,
3004  band);
3005  return;
3006  }
3007 
3008  const ossimIrect img_rect = getImageRectangle();
3009 
3010  // Check for intersect.
3011  if ( ! img_rect.intersects(src_rect) )
3012  {
3013  return; // Nothing to do here.
3014  }
3015 
3016  // Check the clip rect.
3017  if (!clip_rect.completely_within(img_rect))
3018  {
3019  return;
3020  }
3021 
3022  // Check the status and allocate memory if needed.
3024 
3025  // Get the width of the buffers.
3026  ossim_uint32 s_width = src_rect.width();
3027  ossim_uint32 d_width = getWidth();
3028 
3029  const T* s = static_cast<const T*>(src);
3030  T* d = static_cast<T*>(getBuf(band));
3031 
3032  // Move the pointers to the first valid pixel.
3033  s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
3034  clip_rect.ul().x - src_rect.ul().x;
3035 
3036  d += (clip_rect.ul().y - img_rect.ul().y) * d_width +
3037  clip_rect.ul().x - img_rect.ul().x;
3038 
3039  // Copy the data.
3040  ossim_uint32 clipHeight = clip_rect.height();
3041  ossim_uint32 clipWidth = clip_rect.width();
3042 
3043  for (ossim_uint32 line = 0; line < clipHeight; ++line)
3044  {
3045  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
3046  {
3047  d[sample] = s[sample];
3048  }
3049 
3050  s += s_width;
3051  d += d_width;
3052  }
3053 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual bool isValidBand(ossim_uint32 band) const
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ loadShortBand()

void ossimImageData::loadShortBand ( const void *  src,
const ossimIrect src_rect,
ossim_uint32  band,
bool  swap_bytes = false 
)
virtual

Specialized to load a tile from a short (16 bit scalar type) buffer.

Performs byte swapping if swap_bytes is set to true.

Definition at line 4423 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getUshortBuf(), getWidth(), initialize(), ossimIrect::intersects(), isValidBand(), ossimIrect::lr(), ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), validate(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

4427 {
4428  static const char MODULE[] = "ossimImageData::loadShortBand";
4429 
4430  // Check the pointer.
4431  if (!src)
4432  {
4433  // Set the error...
4436  "%s File %s line %d\nNULL pointer passed to method!",
4437  MODULE,
4438  __FILE__,
4439  __LINE__);
4440  return;
4441  }
4442 
4443  // Check the band.
4444  if (!isValidBand(band))
4445  {
4446  // Set the error...
4449  "%s File %s line %d\nInvalid band: %d",
4450  MODULE,
4451  __FILE__,
4452  __LINE__,
4453  band);
4454  return;
4455  }
4456 
4457  const ossimIrect img_rect = getImageRectangle();
4458 
4459  // Check for intersect.
4460  if ( ! img_rect.intersects(src_rect) )
4461  {
4462  return; // Nothing to do here.
4463  }
4464 
4465  // Get the clip rect.
4466  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
4467 
4468  // Check the status and allocate memory if needed.
4470 
4471  // Get the width of the buffers.
4472  ossim_uint32 s_width = src_rect.width();
4473  ossim_uint32 d_width = getWidth();
4474 
4475  const ossim_uint16* s = static_cast<const ossim_uint16*>(src);
4476  ossim_uint16* d = getUshortBuf(band);
4477 
4478  // Move the pointers to the first valid pixel.
4479  s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
4480  clip_rect.ul().x - src_rect.ul().x;
4481 
4482  d += (clip_rect.ul().y - img_rect.ul().y) * d_width +
4483  clip_rect.ul().x - img_rect.ul().x;
4484 
4485  // Copy the data.
4486  for (ossim_int32 line=clip_rect.ul().y; line<=clip_rect.lr().y; line++)
4487  {
4488  ossim_uint32 i = 0;
4489  for (ossim_int32 sample=clip_rect.ul().x; sample<=clip_rect.lr().x; sample++)
4490  {
4491  d[i] = (swap_bytes ? ( (s[i] << 8) | (s[i] >> 8) ) :
4492  s[i]);
4493  ++i;
4494  }
4495 
4496  s += s_width;
4497  d += d_width;
4498  }
4499 
4500  validate();
4501 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
virtual const ossim_uint16 * getUshortBuf() const
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
unsigned short ossim_uint16
virtual void initialize()
Initialize the data buffer.
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual bool isValidBand(ossim_uint32 band) const
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ loadState()

bool ossimImageData::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimRectilinearDataObject.

Definition at line 7468 of file ossimImageData.cpp.

References ossimString::empty(), ossimKeywordlist::find(), initializeDefaults(), ossimRectilinearDataObject::loadState(), m_alpha, m_indexedFlag, m_maxPixelValue, m_minPixelValue, m_nullPixelValue, m_origin, ossimRectilinearDataObject::m_spatialExtents, setImageRectangle(), ossimRectilinearDataObject::setNumberOfDataComponents(), ossimString::toBool(), ossimIpt::toPoint(), ossimIrect::toRect(), ossim::toSimpleVector(), and ossimString::toUInt32().

Referenced by ossimMemoryImageSource::loadState().

7469 {
7470  bool result = ossimRectilinearDataObject::loadState(kwl, prefix);
7471  m_spatialExtents.resize(2);
7472  if(result)
7473  {
7474  const char* null_pixels = kwl.find(prefix, "null_pixels");
7475  const char* min_pixels = kwl.find(prefix, "min_pixels");
7476  const char* max_pixels = kwl.find(prefix, "max_pixels");
7477  const char* alpha = kwl.find(prefix, "alpha");
7478  const char* origin = kwl.find(prefix, "origin");
7479  const char* indexed = kwl.find(prefix, "indexed");
7480  ossimString rectString = kwl.find(prefix, "rect");
7481  const char* numberOfBands = kwl.find(prefix, "number_bands");
7482  m_nullPixelValue.clear();
7483  m_minPixelValue.clear();
7484  m_maxPixelValue.clear();
7485  m_alpha.clear();
7486  if(null_pixels)
7487  {
7489  {
7490  return false;
7491  }
7492  }
7493  if(min_pixels)
7494  {
7496  {
7497  return false;
7498  }
7499  }
7500  if(max_pixels)
7501  {
7503  {
7504  return false;
7505  }
7506  }
7507  if(alpha)
7508  {
7510  {
7511  return false;
7512  }
7513  }
7514  if(origin)
7515  {
7516  m_origin.toPoint(origin);
7517  }
7518  m_indexedFlag = false;
7519  if(indexed)
7520  {
7521  m_indexedFlag = ossimString(indexed).toBool();
7522  }
7523  if(!rectString.empty())
7524  {
7525  ossimIrect rect;
7526 
7527  if(rect.toRect(rectString))
7528  {
7529  setImageRectangle(rect);
7530  }
7531  }
7532  if(numberOfBands)
7533  {
7534  ossim_uint32 nBands = ossimString(numberOfBands).toUInt32();
7535  setNumberOfDataComponents(nBands);
7536  if(m_nullPixelValue.empty()||
7537  m_minPixelValue.empty()||
7538  m_maxPixelValue.empty())
7539  {
7541  }
7542  }
7543  }
7544 
7545  return result;
7546 }
virtual void setImageRectangle(const ossimIrect &rect)
std::vector< ossim_uint8 > m_alpha
Alpha channel.
const char * find(const char *key) const
ossim_uint32 toUInt32() const
bool toSimpleVector(std::vector< T > &result, const ossimString &stringOfPoints)
Definition: ossimCommon.h:537
virtual void setNumberOfDataComponents(ossim_uint32 n)
How many components make up this data object.
bool toBool() const
String to numeric methods.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
std::vector< ossim_uint32 > m_spatialExtents
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimIpt.cpp:170
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
bool m_indexedFlag
Indicates data contains palette indexes.
bool empty() const
Definition: ossimString.h:411
bool toRect(const ossimString &rectString)
expected Format: form 1: ( 30, -90, 512, 512, [LH|RH] ) -x- -y- -w- -h- -Right or left handed- ...
Definition: ossimIrect.cpp:359
virtual void initializeDefaults()
initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value f...

◆ loadTile() [1/3]

void ossimImageData::loadTile ( const void *  src,
const ossimIrect src_rect,
ossimInterleaveType  il_type 
)
virtual

Definition at line 3162 of file ossimImageData.cpp.

References ossimObject::getClassName(), loadTileFromBil(), loadTileFromBip(), loadTileFromBsq(), OSSIM_BIL, OSSIM_BIP, OSSIM_BSQ, ossimErrorCodes::OSSIM_ERROR, ossimNotify(), ossimNotifyLevel_WARN, and ossimSetError().

Referenced by ossimMeanMedianFilter::applyMeanNullCenterOnly(), ossimMeanMedianFilter::applyMedianNullCenterOnly(), ossimPixelFlipper::clipTile(), ossimTilePatch::convolve(), demo3(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimMaskFilter::executeMaskFilter(), ossimTilePatch::fillPatch(), ossimRpfCacheTileSource::fillSubTileCadrg(), ossimCibCadrgTileSource::fillSubTileCadrg(), ossimRpfCacheTileSource::fillSubTileCib(), ossimCibCadrgTileSource::fillSubTileCib(), ossimTilePatch::fillTile(), ossimCacheTileSource::fillTile(), ossimImageCacheTileSource::fillTile(), ossimGeoPdfReader::fillTile(), ossimDespeckleFilter::getTile(), ossimMultiBandHistogramTileSource::getTile(), ossimFftFilter::getTile(), ossimPolyCutter::getTile(), ossimSFIMFusion::getTile(), ossimLocalCorrelationFusion::getTile(), ossimAnnotationSource::getTile(), ossimConvolutionSource::getTile(), ossimMemoryImageSource::getTile(), ossimValueAssignImageSourceFilter::getTile(), ossimSubImageTileSource::getTile(), ossimImageSource::getTile(), ossimTiledImagePatch::getTile(), ossimHdfReader::getTile(), ossimWatermarkFilter::getTile(), ossimImageSourceSequencer::getTile(), ossimKakaduJ2kReader::getTile(), ossimKakaduJp2Reader::getTile(), ossimLasReader::getTile(), ossimTiledImageHandler::getTile(), ossimNitfTileSource::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimGdalTileSource::getTileBlockRead(), ossimNitfTileSource::loadBlockFromCache(), ossimTiffTileSource::loadFromScanLine(), ossimTiffTileSource::loadFromTile(), ossimNitfTileSource::loadTile(), loadTile(), ossimKakaduJp2Reader::loadTileFromCache(), ossimKakaduJ2kReader::loadTileFromCache(), ossimGeoPdfReader::resetCacheBuffer(), and ossimScaleFilter::runFilterTemplate().

3165 {
3166  switch (il_type)
3167  {
3168  case OSSIM_BIP:
3169  loadTileFromBip(src, src_rect);
3170  return;
3171  case OSSIM_BIL:
3172  loadTileFromBil(src, src_rect);
3173  return;
3174  case OSSIM_BSQ:
3175  loadTileFromBsq(src, src_rect);
3176  return;
3177  default:
3179  << "ossimImageData::loadTile ERROR: unsupported interleave type!"
3180  << std::endl;
3183  "ossimImageData::loadTile\n\
3184 File %s line %d\nUnknown interleave type!",
3185 __FILE__,
3186 __LINE__);
3187  return;
3188  } // End of "switch (type)"
3189 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
void loadTileFromBil(const void *src, const ossimIrect &src_rect)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
void loadTileFromBip(const void *src, const ossimIrect &src_rect)
void loadTileFromBsq(const void *src, const ossimIrect &src_rect)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadTile() [2/3]

void ossimImageData::loadTile ( const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect,
ossimInterleaveType  il_type 
)
virtual

Definition at line 3221 of file ossimImageData.cpp.

References ossimObject::getClassName(), loadTileFromBil(), loadTileFromBip(), loadTileFromBsq(), OSSIM_BIL, OSSIM_BIP, OSSIM_BSQ, ossimErrorCodes::OSSIM_ERROR, ossimNotify(), ossimNotifyLevel_WARN, and ossimSetError().

3225 {
3226  switch (il_type)
3227  {
3228  case OSSIM_BIP:
3229  loadTileFromBip(src, src_rect, clip_rect);
3230  return;
3231  case OSSIM_BIL:
3232  loadTileFromBil(src, src_rect, clip_rect);
3233  return;
3234  case OSSIM_BSQ:
3235  loadTileFromBsq(src, src_rect, clip_rect);
3236  return;
3237  default:
3239  << "ossimImageData::loadTile ERROR: unsupported interleave type!"
3240  << std::endl;
3243  "ossimImageData::loadTile\n\
3244 File %s line %d\nUnknown interleave type!",
3245 __FILE__,
3246 __LINE__);
3247  return;
3248  } // End of "switch (type)"
3249 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
void loadTileFromBil(const void *src, const ossimIrect &src_rect)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
void loadTileFromBip(const void *src, const ossimIrect &src_rect)
void loadTileFromBsq(const void *src, const ossimIrect &src_rect)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadTile() [3/3]

void ossimImageData::loadTile ( const ossimImageData src)
virtual

Will load a tile of different types.

If they are the same then it will call loadTile(void*...) method. Note if they are of different types we will have to go through a much slower assign process by normalizing the right side and then unnormalizing to the destination type. For this method to work they both must have the same number of bands.

Definition at line 3055 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), getBuf(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNormalizedFloat(), getNullPix(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), ossimIrect::height(), initialize(), ossimIrect::intersects(), loadTile(), OSSIM_BSQ, OSSIM_NULL, ossimNotify(), ossimNotifyLevel_WARN, ossimDataObject::setDataObjectStatus(), setNormalizedFloat(), setNullPix(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

3056 {
3057  if (!src)
3058  {
3060  << "ossimImageData::loadTile ERROR:"
3061  << "Null tile passed to method!" << std::endl;
3062  return;
3063  }
3064 
3065  if (!src->getBuf())
3066  {
3068  << "ossimImageData::loadTile ERROR:"
3069  << "Source tile buff is null!" << std::endl;
3070  return;
3071  }
3072 
3073  if (!this->getBuf())
3074  {
3076  << "ossimImageData::loadTile ERROR:"
3077  << "This tile not initialized!" << std::endl;
3078  return;
3079  }
3080 
3081  if (src->getNumberOfBands() != this->getNumberOfBands())
3082  {
3084  << "ossimImageData::loadTile ERROR:"
3085  << "Tiles do not have same number of bands!" << std::endl;
3086  return;
3087  }
3088 
3089  //***
3090  // Set the status of this tile to the status of the source tile.
3091  // Do this in place of validate.
3092  //***
3094 
3095  if(getScalarType() == src->getScalarType())
3096  {
3097  loadTile((void*)(src->getBuf()),
3098  src->getImageRectangle(),
3099  OSSIM_BSQ);
3100  setNullPix(src->getNullPix(), src->getNumberOfBands());
3101  }
3102  else // do a slow generic normalize to unnormalize copy
3103  {
3104  // Check the pointer.
3105  ossimIrect src_rect = src->getImageRectangle();
3106  const ossimIrect img_rect = getImageRectangle();
3107 
3108  // Check for intersect.
3109  if ( !img_rect.intersects(src_rect) )
3110  {
3111  return; // Nothing to do here.
3112  }
3113 
3114  // Get the clip rect.
3115  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
3116 
3117  // Check the status and allocate memory if needed.
3119 
3120  // Get the width of the buffers.
3121  ossim_uint32 num_bands = getNumberOfBands();
3122  ossim_uint32 s_width = src_rect.width();
3123  ossim_uint32 d_width = getWidth();
3124 
3125  ossim_uint32 band;
3126 
3127  ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) *
3128  s_width + (clip_rect.ul().x - src_rect.ul().x);
3129 
3130  ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) *
3131  d_width + (clip_rect.ul().x - img_rect.ul().x);
3132 
3133  ossim_uint32 clipHeight = clip_rect.height();
3134  ossim_uint32 clipWidth = clip_rect.width();
3135 
3136  // Copy the data.
3137  for (band=0; band<num_bands; ++band)
3138  {
3139  ossim_uint32 sourceIndex = sourceOffset;
3140  ossim_uint32 destinationIndex = destinationOffset;
3141  ossim_float32 tempResult = 0.0;
3142 
3143  for (ossim_uint32 line = 0; line < clipHeight; ++line)
3144  {
3145  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
3146  {
3147  src->getNormalizedFloat(sourceIndex + sample,
3148  band,
3149  tempResult);
3150 
3151  this->setNormalizedFloat(destinationIndex + sample,
3152  band,
3153  tempResult);
3154  }
3155  sourceIndex += s_width;
3156  destinationIndex += d_width;
3157  }
3158  }
3159  }
3160 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual void getNormalizedFloat(ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 &result) const
will go to the band and offset and compute the normalized float and return it back to the caller thro...
float ossim_float32
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual void setNullPix(ossim_float64 null_pix)
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual ossimScalarType getScalarType() const
virtual void setNormalizedFloat(ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 input)
This will assign to this object a normalized value by unnormalizing to its native type...
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
ossim_int32 x
Definition: ossimIpt.h:141
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadTileFrom1Band() [1/2]

void ossimImageData::loadTileFrom1Band ( const ossimImageData data)
virtual

Definition at line 4416 of file ossimImageData.cpp.

References getBuf(), and getImageRectangle().

4417 {
4418  if(!src) return;
4419  loadTileFrom1Band((const void*)src->getBuf(),
4420  src->getImageRectangle());
4421 }
virtual void loadTileFrom1Band(const ossimImageData *data)

◆ loadTileFrom1Band() [2/2]

void ossimImageData::loadTileFrom1Band ( const void *  src,
const ossimIrect src_rect 
)
virtual

Definition at line 4406 of file ossimImageData.cpp.

References getNumberOfBands(), and loadBand().

4408 {
4409  ossim_uint32 bands = getNumberOfBands();
4410  for(ossim_uint32 band = 0; band < bands; ++band)
4411  {
4412  loadBand(src, src_rect, band);
4413  }
4414 }
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
virtual ossim_uint32 getNumberOfBands() const
unsigned int ossim_uint32

◆ loadTileFromBil() [1/2]

void ossimImageData::loadTileFromBil ( const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 3492 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadTileFromBilTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

Referenced by loadTile().

3494 {
3495  switch (getScalarType())
3496  {
3497  case OSSIM_UINT8:
3498  loadTileFromBilTemplate(ossim_uint8(0), src, src_rect);
3499  return;
3500 
3501  case OSSIM_SINT8:
3502  loadTileFromBilTemplate(ossim_sint8(0), src, src_rect);
3503  return;
3504 
3505  case OSSIM_UINT16:
3506  case OSSIM_USHORT11:
3507  case OSSIM_USHORT12:
3508  case OSSIM_USHORT13:
3509  case OSSIM_USHORT14:
3510  case OSSIM_USHORT15:
3511  loadTileFromBilTemplate(ossim_uint16(0), src, src_rect);
3512  return;
3513 
3514  case OSSIM_SINT16:
3515  loadTileFromBilTemplate(ossim_sint16(0), src, src_rect);
3516  return;
3517 
3518  case OSSIM_UINT32:
3519  loadTileFromBilTemplate(ossim_uint32(0), src, src_rect);
3520  return;
3521 
3522  case OSSIM_SINT32:
3523  loadTileFromBilTemplate(ossim_sint32(0), src, src_rect);
3524  return;
3525 
3527  case OSSIM_FLOAT32:
3528  loadTileFromBilTemplate(ossim_float32(0), src, src_rect);
3529  return;
3530 
3532  case OSSIM_FLOAT64:
3533  loadTileFromBilTemplate(ossim_float64(0), src, src_rect);
3534  return;
3535 
3536  case OSSIM_SCALAR_UNKNOWN:
3537  default:
3540  "ossimImageData::loadTileFromBil\n\
3541 File %s line %d\nUnsupported scalar type for method!",
3542 __FILE__,
3543 __LINE__);
3544  return;
3545  }
3546 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
void loadTileFromBilTemplate(T, const void *src, const ossimIrect &src_rect)
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ loadTileFromBil() [2/2]

void ossimImageData::loadTileFromBil ( const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect 
)
protected

Definition at line 3548 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadTileFromBilTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

3551 {
3552  switch (getScalarType())
3553  {
3554  case OSSIM_UINT8:
3555  loadTileFromBilTemplate(ossim_uint8(0), src, src_rect, clip_rect);
3556  return;
3557 
3558  case OSSIM_SINT8:
3559  loadTileFromBilTemplate(ossim_sint8(0), src, src_rect, clip_rect);
3560  return;
3561 
3562  case OSSIM_UINT16:
3563  case OSSIM_USHORT11:
3564  case OSSIM_USHORT12:
3565  case OSSIM_USHORT13:
3566  case OSSIM_USHORT14:
3567  case OSSIM_USHORT15:
3568  loadTileFromBilTemplate(ossim_uint16(0), src, src_rect, clip_rect);
3569  return;
3570 
3571  case OSSIM_SINT16:
3572  loadTileFromBilTemplate(ossim_sint16(0), src, src_rect, clip_rect);
3573  return;
3574 
3575  case OSSIM_UINT32:
3576  loadTileFromBilTemplate(ossim_uint32(0), src, src_rect, clip_rect);
3577  return;
3578 
3579  case OSSIM_SINT32:
3580  loadTileFromBilTemplate(ossim_sint32(0), src, src_rect, clip_rect);
3581  return;
3582 
3584  case OSSIM_FLOAT32:
3585  loadTileFromBilTemplate(ossim_float32(0), src, src_rect, clip_rect);
3586  return;
3587 
3589  case OSSIM_FLOAT64:
3590  loadTileFromBilTemplate(ossim_float64(0), src, src_rect, clip_rect);
3591  return;
3592 
3593  case OSSIM_SCALAR_UNKNOWN:
3594  default:
3597  "ossimImageData::loadTileFromBil\n\
3598 File %s line %d\nUnsupported scalar type for method!",
3599 __FILE__,
3600 __LINE__);
3601  return;
3602  }
3603 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
void loadTileFromBilTemplate(T, const void *src, const ossimIrect &src_rect)
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ loadTileFromBilTemplate() [1/2]

template<class T >
void ossimImageData::loadTileFromBilTemplate ( ,
const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 4222 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), and getImageRectangle().

Referenced by loadTileFromBil().

4225 {
4226  const ossimIrect img_rect = getImageRectangle();
4227 
4228  // Get the clip rect.
4229  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
4230 
4231  loadTileFromBilTemplate(T(0), src, src_rect, clip_rect);
4232 }
void loadTileFromBilTemplate(T, const void *src, const ossimIrect &src_rect)
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501

◆ loadTileFromBilTemplate() [2/2]

template<class T >
void ossimImageData::loadTileFromBilTemplate ( ,
const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect 
)
protected

Definition at line 4235 of file ossimImageData.cpp.

References ossimIrect::completely_within(), getBuf(), ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::height(), initialize(), ossimIrect::intersects(), ossimIrect::lr(), ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

4239 {
4240  static const char MODULE[] = "ossimImageData::loadTileFromBil";
4241 
4242  // Check the pointer.
4243  if (!src)
4244  {
4245  // Set the error...
4248  "%s File %s line %d\nNULL pointer passed to method!",
4249  MODULE,
4250  __FILE__,
4251  __LINE__);
4252  return;
4253  }
4254 
4255  const ossimIrect img_rect = getImageRectangle();
4256 
4257  // Check for intersect.
4258  if ( ! img_rect.intersects(src_rect) )
4259  {
4260  return; // Nothing to do here.
4261  }
4262 
4263  // Check the clip rect.
4264  if (!clip_rect.completely_within(img_rect))
4265  {
4266  return;
4267  }
4268 
4269  // Check the status and allocate memory if needed.
4271 
4272  // Get the width of the buffers.
4273  ossim_uint32 num_bands = getNumberOfBands();
4274  ossim_uint32 s_width = (src_rect.lr().x - src_rect.ul().x + 1);
4275  ossim_uint32 d_width = getWidth();
4276  ossim_uint32 band = 0;
4277  ossim_uint32 d_offset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
4278  clip_rect.ul().x - img_rect.ul().x;
4279 
4280  const T* s = static_cast<const T*>(src);
4281 
4282  // Get the number of bands and make destination pointers to each one.
4283  T** d = new T*[num_bands];
4284 
4285  for (band=0; band<num_bands; band++)
4286  {
4287  d[band] = static_cast<T*>(getBuf(band));
4288 
4289  // Move the pointers to the first valid pixel.
4290  d[band] += d_offset;
4291  }
4292 
4293  // Move the source pointer to the first valid pixel.
4294  s += (clip_rect.ul().y - src_rect.ul().y) * s_width * num_bands +
4295  clip_rect.ul().x - src_rect.ul().x;
4296 
4297  // Copy the data.
4298  ossim_uint32 clipHeight = clip_rect.height();
4299  ossim_uint32 clipWidth = clip_rect.width();
4300 
4301  for (ossim_uint32 line = 0; line < clipHeight; ++line)
4302  {
4303  for (band = 0; band < num_bands; ++band)
4304  {
4305  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4306  {
4307  d[band][sample] = s[sample];
4308  }
4309  s += s_width;
4310  d[band] += d_width;
4311  }
4312  }
4313 
4314  delete [] d;
4315 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ loadTileFromBip() [1/2]

void ossimImageData::loadTileFromBip ( const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 3323 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadTileFromBipTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

Referenced by loadTile().

3325 {
3326  switch (getScalarType())
3327  {
3328  case OSSIM_UINT8:
3329  loadTileFromBipTemplate(ossim_uint8(0), src, src_rect);
3330  return;
3331 
3332  case OSSIM_SINT8:
3333  loadTileFromBipTemplate(ossim_sint8(0), src, src_rect);
3334  return;
3335 
3336  case OSSIM_UINT16:
3337  case OSSIM_USHORT11:
3338  case OSSIM_USHORT12:
3339  case OSSIM_USHORT13:
3340  case OSSIM_USHORT14:
3341  case OSSIM_USHORT15:
3342  loadTileFromBipTemplate(ossim_uint16(0), src, src_rect);
3343  return;
3344 
3345  case OSSIM_SINT16:
3346  loadTileFromBipTemplate(ossim_sint16(0), src, src_rect);
3347  return;
3348 
3349  case OSSIM_UINT32:
3350  loadTileFromBipTemplate(ossim_uint32(0), src, src_rect);
3351  return;
3352 
3353  case OSSIM_SINT32:
3354  loadTileFromBipTemplate(ossim_sint32(0), src, src_rect);
3355  return;
3356 
3358  case OSSIM_FLOAT32:
3359  loadTileFromBipTemplate(ossim_float32(0), src, src_rect);
3360  return;
3361 
3363  case OSSIM_FLOAT64:
3364  loadTileFromBipTemplate(ossim_float64(0), src, src_rect);
3365  return;
3366 
3367  case OSSIM_SCALAR_UNKNOWN:
3368  default:
3371  "ossimImageData::loadTileFromBip\n\
3372 File %s line %d\nUnsupported scalar type for method!",
3373 __FILE__,
3374 __LINE__);
3375  return;
3376  }
3377 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
void loadTileFromBipTemplate(T, const void *src, const ossimIrect &src_rect)
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ loadTileFromBip() [2/2]

void ossimImageData::loadTileFromBip ( const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect 
)
protected

Definition at line 3435 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadTileFromBipTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

3438 {
3439  switch (getScalarType())
3440  {
3441  case OSSIM_UINT8:
3442  loadTileFromBipTemplate(ossim_uint8(0), src, src_rect, clip_rect);
3443  return;
3444 
3445  case OSSIM_SINT8:
3446  loadTileFromBipTemplate(ossim_sint8(0), src, src_rect, clip_rect);
3447  return;
3448 
3449  case OSSIM_UINT16:
3450  case OSSIM_USHORT11:
3451  case OSSIM_USHORT12:
3452  case OSSIM_USHORT13:
3453  case OSSIM_USHORT14:
3454  case OSSIM_USHORT15:
3455  loadTileFromBipTemplate(ossim_uint16(0), src, src_rect, clip_rect);
3456  return;
3457 
3458  case OSSIM_SINT16:
3459  loadTileFromBipTemplate(ossim_sint16(0), src, src_rect, clip_rect);
3460  return;
3461 
3462  case OSSIM_UINT32:
3463  loadTileFromBipTemplate(ossim_uint32(0), src, src_rect, clip_rect);
3464  return;
3465 
3466  case OSSIM_SINT32:
3467  loadTileFromBipTemplate(ossim_sint32(0), src, src_rect, clip_rect);
3468  return;
3469 
3471  case OSSIM_FLOAT32:
3472  loadTileFromBipTemplate(ossim_float32(0), src, src_rect, clip_rect);
3473  return;
3474 
3476  case OSSIM_FLOAT64:
3477  loadTileFromBipTemplate(ossim_float64(0), src, src_rect, clip_rect);
3478  return;
3479 
3480  case OSSIM_SCALAR_UNKNOWN:
3481  default:
3484  "ossimImageData::loadTileFromBip\n\
3485 File %s line %d\nUnsupported scalar type for method!",
3486 __FILE__,
3487 __LINE__);
3488  return;
3489  }
3490 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
void loadTileFromBipTemplate(T, const void *src, const ossimIrect &src_rect)
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ loadTileFromBipAlpha()

void ossimImageData::loadTileFromBipAlpha ( const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 3379 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadTileFromBipAlphaTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

Referenced by loadTileWithAlpha().

3381 {
3382  switch (getScalarType())
3383  {
3384  case OSSIM_UINT8:
3385  loadTileFromBipAlphaTemplate(ossim_uint8(0), src, src_rect);
3386  return;
3387 
3388  case OSSIM_SINT8:
3389  loadTileFromBipAlphaTemplate(ossim_sint8(0), src, src_rect);
3390  return;
3391 
3392  case OSSIM_UINT16:
3393  case OSSIM_USHORT11:
3394  case OSSIM_USHORT12:
3395  case OSSIM_USHORT13:
3396  case OSSIM_USHORT14:
3397  case OSSIM_USHORT15:
3398  loadTileFromBipAlphaTemplate(ossim_uint16(0), src, src_rect);
3399  return;
3400 
3401  case OSSIM_SINT16:
3402  loadTileFromBipAlphaTemplate(ossim_sint16(0), src, src_rect);
3403  return;
3404 
3405  case OSSIM_UINT32:
3406  loadTileFromBipAlphaTemplate(ossim_uint32(0), src, src_rect);
3407  return;
3408 
3409  case OSSIM_SINT32:
3410  loadTileFromBipAlphaTemplate(ossim_sint32(0), src, src_rect);
3411  return;
3412 
3414  case OSSIM_FLOAT32:
3415  loadTileFromBipAlphaTemplate(ossim_float32(0), src, src_rect);
3416  return;
3417 
3419  case OSSIM_FLOAT64:
3420  loadTileFromBipAlphaTemplate(ossim_float64(0), src, src_rect);
3421  return;
3422 
3423  case OSSIM_SCALAR_UNKNOWN:
3424  default:
3427  "ossimImageData::loadTileFromBip\n\
3428 File %s line %d\nUnsupported scalar type for method!",
3429 __FILE__,
3430 __LINE__);
3431  return;
3432  }
3433 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
void loadTileFromBipAlphaTemplate(T, const void *src, const ossimIrect &src_rect)
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ loadTileFromBipAlphaTemplate() [1/2]

template<class T >
void ossimImageData::loadTileFromBipAlphaTemplate ( ,
const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 4037 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), and getImageRectangle().

Referenced by loadTileFromBipAlpha().

4040 {
4041  const ossimIrect img_rect = getImageRectangle();
4042 
4043  // Get the clip rect.
4044  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
4045 
4046  loadTileFromBipAlphaTemplate(T(0), src, src_rect, clip_rect);
4047 }
void loadTileFromBipAlphaTemplate(T, const void *src, const ossimIrect &src_rect)
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501

◆ loadTileFromBipAlphaTemplate() [2/2]

template<class T >
void ossimImageData::loadTileFromBipAlphaTemplate ( ,
const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect 
)
protected

Definition at line 4136 of file ossimImageData.cpp.

References ossimIrect::completely_within(), getBuf(), ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::height(), initialize(), ossimIrect::intersects(), ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

4140 {
4141  static const char MODULE[] = "ossimImageData::loadTileFromBip";
4142 
4143  // Check the pointer.
4144  if (!src)
4145  {
4146  // Set the error...
4149  "%s File %s line %d\nNULL pointer passed to method!",
4150  MODULE,
4151  __FILE__,
4152  __LINE__);
4153  return;
4154  }
4155 
4156  const ossimIrect img_rect = getImageRectangle();
4157 
4158  // Check for intersect.
4159  if ( ! img_rect.intersects(src_rect) )
4160  {
4161  return; // Nothing to do here.
4162  }
4163 
4164  // Check the clip rect.
4165  if (!clip_rect.completely_within(img_rect))
4166  {
4167  return;
4168  }
4169 
4170  // Check the status and allocate memory if needed.
4172 
4173  // Get the width of the buffers.
4174  ossim_uint32 num_bands = getNumberOfBands();
4175  ossim_uint32 s_width = (src_rect.width()) * (num_bands+1);
4176  ossim_uint32 d_width = getWidth();
4177  ossim_uint32 band = 0;
4178  const T* s = static_cast<const T*>(src);
4179  T** d = new T*[num_bands];
4180 
4181  // Make destination pointers to each one.
4182  for (band=0; band<num_bands; band++)
4183  {
4184  d[band] = static_cast<T*>(getBuf(band));
4185 
4186  // Move the pointers to the first valid pixel.
4187  d[band] += (clip_rect.ul().y - img_rect.ul().y) * d_width +
4188  clip_rect.ul().x - img_rect.ul().x;
4189  }
4190 
4191  // Move the source pointer to the first valid pixel.
4192  s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
4193  (clip_rect.ul().x - src_rect.ul().x) * (num_bands+1); // +1 for the alpha
4194 
4195  // Copy the data.
4196  ossim_uint32 clipHeight = clip_rect.height();
4197  ossim_uint32 clipWidth = clip_rect.width();
4198 
4199  for (ossim_uint32 line = 0; line < clipHeight; ++line)
4200  {
4201  ossim_uint32 j = 0;
4202  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4203  {
4204  for (band=0; band<num_bands; band++)
4205  {
4206  d[band][sample] = s[j+band];
4207  }
4208  j += (num_bands+1); // need to offset by the alpha channel
4209  }
4210 
4211  s += s_width;
4212  for (band=0; band<num_bands; band++)
4213  {
4214  d[band] += d_width;
4215  }
4216  }
4217 
4218  delete [] d;
4219 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ loadTileFromBipTemplate() [1/2]

template<class T >
void ossimImageData::loadTileFromBipTemplate ( ,
const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 4025 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), and getImageRectangle().

Referenced by loadTileFromBip().

4028 {
4029  const ossimIrect img_rect = getImageRectangle();
4030 
4031  // Get the clip rect.
4032  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
4033 
4034  loadTileFromBipTemplate(T(0), src, src_rect, clip_rect);
4035 }
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
void loadTileFromBipTemplate(T, const void *src, const ossimIrect &src_rect)

◆ loadTileFromBipTemplate() [2/2]

template<class T >
void ossimImageData::loadTileFromBipTemplate ( ,
const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect 
)
protected

Definition at line 4050 of file ossimImageData.cpp.

References ossimIrect::completely_within(), getBuf(), ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::height(), initialize(), ossimIrect::intersects(), ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

4054 {
4055  static const char MODULE[] = "ossimImageData::loadTileFromBip";
4056 
4057  // Check the pointer.
4058  if (!src)
4059  {
4060  // Set the error...
4063  "%s File %s line %d\nNULL pointer passed to method!",
4064  MODULE,
4065  __FILE__,
4066  __LINE__);
4067  return;
4068  }
4069 
4070  const ossimIrect img_rect = getImageRectangle();
4071 
4072  // Check for intersect.
4073  if ( ! img_rect.intersects(src_rect) )
4074  {
4075  return; // Nothing to do here.
4076  }
4077 
4078  // Check the clip rect.
4079  if (!clip_rect.completely_within(img_rect))
4080  {
4081  return;
4082  }
4083 
4084  // Check the status and allocate memory if needed.
4086 
4087  // Get the width of the buffers.
4088  ossim_uint32 num_bands = getNumberOfBands();
4089  ossim_uint32 s_width = (src_rect.width()) * num_bands;
4090  ossim_uint32 d_width = getWidth();
4091  ossim_uint32 band = 0;
4092  const T* s = static_cast<const T*>(src);
4093  T** d = new T*[num_bands];
4094 
4095  // Make destination pointers to each one.
4096  for (band=0; band<num_bands; band++)
4097  {
4098  d[band] = static_cast<T*>(getBuf(band));
4099 
4100  // Move the pointers to the first valid pixel.
4101  d[band] += (clip_rect.ul().y - img_rect.ul().y) * d_width +
4102  clip_rect.ul().x - img_rect.ul().x;
4103  }
4104 
4105  // Move the source pointer to the first valid pixel.
4106  s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
4107  (clip_rect.ul().x - src_rect.ul().x) * num_bands;
4108 
4109  // Copy the data.
4110  ossim_uint32 clipHeight = clip_rect.height();
4111  ossim_uint32 clipWidth = clip_rect.width();
4112 
4113  for (ossim_uint32 line = 0; line < clipHeight; ++line)
4114  {
4115  ossim_uint32 j = 0;
4116  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4117  {
4118  for (band=0; band<num_bands; band++)
4119  {
4120  d[band][sample] = s[j+band];
4121  }
4122  j += num_bands;
4123  }
4124 
4125  s += s_width;
4126  for (band=0; band<num_bands; band++)
4127  {
4128  d[band] += d_width;
4129  }
4130  }
4131 
4132  delete [] d;
4133 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ loadTileFromBsq() [1/2]

void ossimImageData::loadTileFromBsq ( const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 3605 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadTileFromBsqTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

Referenced by loadTile().

3607 {
3608  switch (getScalarType())
3609  {
3610  case OSSIM_UINT8:
3611  loadTileFromBsqTemplate(ossim_uint8(0), src, src_rect);
3612  return;
3613 
3614  case OSSIM_SINT8:
3615  loadTileFromBsqTemplate(ossim_sint8(0), src, src_rect);
3616  return;
3617 
3618  case OSSIM_UINT16:
3619  case OSSIM_USHORT11:
3620  case OSSIM_USHORT12:
3621  case OSSIM_USHORT13:
3622  case OSSIM_USHORT14:
3623  case OSSIM_USHORT15:
3624  loadTileFromBsqTemplate(ossim_uint16(0), src, src_rect);
3625  return;
3626 
3627  case OSSIM_SINT16:
3628  loadTileFromBsqTemplate(ossim_sint16(0), src, src_rect);
3629  return;
3630 
3631  case OSSIM_UINT32:
3632  loadTileFromBsqTemplate(ossim_uint32(0), src, src_rect);
3633  return;
3634 
3635  case OSSIM_SINT32:
3636  loadTileFromBsqTemplate(ossim_sint32(0), src, src_rect);
3637  return;
3638 
3640  case OSSIM_FLOAT32:
3641  loadTileFromBsqTemplate(ossim_float32(0), src, src_rect);
3642  return;
3643 
3645  case OSSIM_FLOAT64:
3646  loadTileFromBsqTemplate(ossim_float64(0), src, src_rect);
3647  return;
3648 
3649  case OSSIM_SCALAR_UNKNOWN:
3650  default:
3653  "ossimImageData::loadTileFromBsq\n\
3654 File %s line %d\nUnsupported scalar type for method!",
3655 __FILE__,
3656 __LINE__);
3657  return;
3658  }
3659 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
void loadTileFromBsqTemplate(T, const void *src, const ossimIrect &src_rect)
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ loadTileFromBsq() [2/2]

void ossimImageData::loadTileFromBsq ( const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect 
)
protected

Definition at line 3661 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), loadTileFromBsqTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

3664 {
3665  switch (getScalarType())
3666  {
3667  case OSSIM_UINT8:
3668  loadTileFromBsqTemplate(ossim_uint8(0), src, src_rect, clip_rect);
3669  return;
3670 
3671  case OSSIM_SINT8:
3672  loadTileFromBsqTemplate(ossim_sint8(0), src, src_rect, clip_rect);
3673  return;
3674 
3675  case OSSIM_UINT16:
3676  case OSSIM_USHORT11:
3677  case OSSIM_USHORT12:
3678  case OSSIM_USHORT13:
3679  case OSSIM_USHORT14:
3680  case OSSIM_USHORT15:
3681  loadTileFromBsqTemplate(ossim_uint16(0), src, src_rect, clip_rect);
3682  return;
3683 
3684  case OSSIM_SINT16:
3685  loadTileFromBsqTemplate(ossim_sint16(0), src, src_rect, clip_rect);
3686  return;
3687 
3688  case OSSIM_UINT32:
3689  loadTileFromBsqTemplate(ossim_uint32(0), src, src_rect, clip_rect);
3690  return;
3691 
3692  case OSSIM_SINT32:
3693  loadTileFromBsqTemplate(ossim_sint32(0), src, src_rect, clip_rect);
3694  return;
3695 
3697  case OSSIM_FLOAT32:
3698  loadTileFromBsqTemplate(ossim_float32(0), src, src_rect, clip_rect);
3699  return;
3700 
3702  case OSSIM_FLOAT64:
3703  loadTileFromBsqTemplate(ossim_float64(0), src, src_rect, clip_rect);
3704  return;
3705 
3706  case OSSIM_SCALAR_UNKNOWN:
3707  default:
3710  "ossimImageData::loadTileFromBsq\n\
3711 File %s line %d\nUnsupported scalar type for method!",
3712 __FILE__,
3713 __LINE__);
3714  return;
3715  }
3716 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
void loadTileFromBsqTemplate(T, const void *src, const ossimIrect &src_rect)
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ loadTileFromBsqTemplate() [1/2]

template<class T >
void ossimImageData::loadTileFromBsqTemplate ( ,
const void *  src,
const ossimIrect src_rect 
)
protected

Definition at line 4318 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), and getImageRectangle().

Referenced by loadTileFromBsq().

4321 {
4322  const ossimIrect img_rect = getImageRectangle();
4323 
4324  // Get the clip rect.
4325  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
4326 
4327  loadTileFromBsqTemplate(T(0), src, src_rect, clip_rect);
4328 }
void loadTileFromBsqTemplate(T, const void *src, const ossimIrect &src_rect)
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501

◆ loadTileFromBsqTemplate() [2/2]

template<class T >
void ossimImageData::loadTileFromBsqTemplate ( ,
const void *  src,
const ossimIrect src_rect,
const ossimIrect clip_rect 
)
protected

Definition at line 4331 of file ossimImageData.cpp.

References ossimIrect::completely_within(), getBuf(), ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::height(), initialize(), ossimIrect::intersects(), ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

4335 {
4336  static const char MODULE[] = "ossimImageData::loadTileFromBsq";
4337 
4338  // Check the pointer.
4339  if (!src)
4340  {
4341  // Set the error...
4344  "%s File %s line %d\nNULL pointer passed to method!",
4345  MODULE,
4346  __FILE__,
4347  __LINE__);
4348  return;
4349  }
4350 
4351  const ossimIrect img_rect = getImageRectangle();
4352 
4353  // Check for intersect.
4354  if ( ! img_rect.intersects(src_rect) )
4355  {
4356  return; // Nothing to do here.
4357  }
4358 
4359  // Check the clip rect.
4360  if (!clip_rect.completely_within(img_rect))
4361  {
4362  return;
4363  }
4364 
4365  // Check the status and allocate memory if needed.
4367 
4368  // Get the width of the buffers.
4369  ossim_uint32 num_bands = getNumberOfBands();
4370  ossim_uint32 s_width = src_rect.width();
4371  ossim_uint32 d_width = getWidth();
4372  ossim_uint32 s_band_offset = s_width * src_rect.height();
4373 
4374  const T* s = static_cast<const T*>(src);
4375 
4376  ossim_uint32 band;
4377  ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
4378  (clip_rect.ul().x - img_rect.ul().x);
4379  ossim_uint32 destinationIndex = destinationOffset;
4380  ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) * s_width +
4381  (clip_rect.ul().x - src_rect.ul().x);
4382  ossim_uint32 sourceIndex = sourceOffset;
4383  ossim_uint32 clipHeight = clip_rect.height();
4384  ossim_uint32 clipWidth = clip_rect.width();
4385 
4386  // Copy the data.
4387  for (band=0; band<num_bands; band++)
4388  {
4389  T* destinationBand = static_cast<T*>(getBuf(band));
4390  destinationIndex = destinationOffset;
4391  sourceIndex = sourceOffset + s_band_offset*band;
4392 
4393  for (ossim_uint32 line = 0; line < clipHeight; ++line)
4394  {
4395  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4396  {
4397  destinationBand[destinationIndex + sample]
4398  = s[sourceIndex+sample];
4399  }
4400  sourceIndex += s_width;
4401  destinationIndex += d_width;
4402  }
4403  }
4404 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ loadTileWithAlpha()

void ossimImageData::loadTileWithAlpha ( const void *  src,
const ossimIrect src_rect,
ossimInterleaveType  il_type 
)
virtual

Definition at line 3191 of file ossimImageData.cpp.

References ossimObject::getClassName(), loadTileFromBipAlpha(), OSSIM_BIP, ossimErrorCodes::OSSIM_ERROR, ossimNotify(), ossimNotifyLevel_WARN, and ossimSetError().

3194 {
3195  switch (il_type)
3196  {
3197  case OSSIM_BIP:
3198  loadTileFromBipAlpha(src, src_rect);
3199  return;
3200  /* case OSSIM_BIL:
3201  loadTileFromBil(src, src_rect);
3202  return;
3203  case OSSIM_BSQ:
3204  loadTileFromBsq(src, src_rect);
3205  return;
3206  */
3207  default:
3209  << "ossimImageData::loadTileWithAlpha ERROR: unsupported interleave type!"
3210  << std::endl;
3213  "ossimImageData::loadTile\n\
3214 File %s line %d\nUnknown interleave type!",
3215 __FILE__,
3216 __LINE__);
3217  return;
3218  } // End of "switch (type)"
3219 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
void loadTileFromBipAlpha(const void *src, const ossimIrect &src_rect)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ makeBlank() [1/2]

void ossimImageData::makeBlank ( )
virtual

Initializes data to null pixel values.

Definition at line 1251 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), ossimRectilinearDataObject::getScalarType(), ossimRectilinearDataObject::m_dataBuffer, OSSIM_EMPTY, ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_STATUS_UNKNOWN, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and ossimDataObject::setDataObjectStatus().

Referenced by ossimCastTileSourceFilter::applyCast(), ossimPixelFlipper::clipTile(), ossimBlendMosaic::combineNorm(), ossim::copyRegionToTile(), ossimMaskFilter::executeMaskFilterInvertSelection(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimTilePatch::fillPatch(), ossimCacheTileSource::fillTile(), ossimTilePatch::fillTile(), ossimImageCacheTileSource::fillTile(), ossimJpegTileSource::fillTile(), ossimOverviewSequencer::getNextTile(), ossimHsvToRgbSource::getTile(), ossimBlendMosaic::getTile(), ossimDespeckleFilter::getTile(), ossim3x3ConvolutionFilter::getTile(), ossimFeatherMosaic::getTile(), ossimImageMosaic::getTile(), ossimElevationMosaic::getTile(), ossimBandMergeSource::getTile(), ossimGammaRemapper::getTile(), ossimMaxMosaic::getTile(), ossimPolyCutter::getTile(), ossimSFIMFusion::getTile(), ossimClosestToCenterCombiner::getTile(), ossimBandSelector::getTile(), ossimTwoColorView::getTile(), ossimMapCompositionSource::getTile(), ossimShiftFilter::getTile(), ossimLinearStretchRemapper::getTile(), ossimLocalCorrelationFusion::getTile(), ossimUsgsDemTileSource::getTile(), ossimAnnotationSource::getTile(), ossimJpegTileSource::getTile(), ossimConvolutionSource::getTile(), ossimTiledImagePatch::getTile(), ossimBandAverageFilter::getTile(), ossimElevImageSource::getTile(), ossimScaleFilter::getTile(), ossimHsiRemapper::getTile(), ossimNBandToIndexFilter::getTile(), ossimGpkgReader::getTile(), ossimMemoryImageSource::getTile(), ossimHdf5ImageHandler::getTile(), ossimValueAssignImageSourceFilter::getTile(), ossimCcfTileSource::getTile(), ossimRgbToIndexFilter::getTile(), ossimDtedTileSource::getTile(), ossimConvolutionFilter1D::getTile(), ossimSubImageTileSource::getTile(), ossimPngReader::getTile(), ossimH5ImageHandler::getTile(), ossimHistogramRemapper::getTile(), ossimOpjJp2Reader::getTile(), ossimGdalTileSource::getTile(), ossimKMeansFilter::getTile(), ossimAdrgTileSource::getTile(), ossimHdfReader::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimBitMaskTileSource::getTile(), ossimPointCloudImageHandler::getTile(), ossimWatermarkFilter::getTile(), ossimMrSidReader::getTile(), ossimMG4LidarReader::getTile(), ossimLasReader::getTile(), ossimTiffTileSource::getTile(), ossimImageSourceSequencer::getTile(), ossimGeoPdfReader::getTile(), ossimImageCacheTileSource::getTile(), ossimRpfCacheTileSource::getTile(), ossimKakaduJ2kReader::getTile(), ossimKakaduJp2Reader::getTile(), ossimTiledImageHandler::getTile(), ossimNitfTileSource::getTile(), ossimCibCadrgTileSource::getTile(), ossimBandLutFilter::getTile(), ossimIndexToRgbLutFilter::getTile(), ossimBumpShadeTileSource::getTile(), ossimEquationCombiner::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimImageRenderer::getTileAtResLevel(), ossimGdalTileSource::getTileBlockRead(), initialize(), ossimGeoPdfReader::resetCacheBuffer(), ossimEdgeFilter::runFilter(), and ossimKakaduNitfReader::setNullPixelValue().

1252 {
1253  if ( (m_dataBuffer.size() == 0) || (getDataObjectStatus() == OSSIM_EMPTY) )
1254  {
1255  return; // nothing to do...
1256  }
1257 
1258  switch (getScalarType())
1259  {
1260  case OSSIM_UINT8:
1261  {
1262  makeBlank(ossim_uint8(0));
1263  return;
1264  }
1265  case OSSIM_SINT8:
1266  {
1267  makeBlank(ossim_sint8(0));
1268  return;
1269  }
1270  case OSSIM_UINT16:
1271  case OSSIM_USHORT11:
1272  case OSSIM_USHORT12:
1273  case OSSIM_USHORT13:
1274  case OSSIM_USHORT14:
1275  case OSSIM_USHORT15:
1276  {
1277  makeBlank(ossim_uint16(0));
1278  return;
1279  }
1280  case OSSIM_SINT16:
1281  {
1282  makeBlank(ossim_sint16(0));
1283  return;
1284  }
1285  case OSSIM_UINT32:
1286  {
1287  makeBlank(ossim_uint32(0));
1288  return;
1289  }
1290  case OSSIM_SINT32:
1291  {
1292  makeBlank(ossim_sint32(0));
1293  return;
1294  }
1295  case OSSIM_FLOAT32:
1297  {
1298  makeBlank(ossim_float32(0.0));
1299  return;
1300  }
1302  case OSSIM_FLOAT64:
1303  {
1304  makeBlank(ossim_float64(0.0));
1305  return;
1306  }
1307  case OSSIM_SCALAR_UNKNOWN:
1308  default:
1309  {
1313  "ossimImageData::makeBlank File %s line %d\n\
1314 Invalid scalar type: %d",
1315 __FILE__,
1316 __LINE__,
1317 getScalarType());
1318  break;
1319  }
1320  }
1321 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
std::vector< ossim_uint8 > m_dataBuffer
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ makeBlank() [2/2]

template<class T >
void ossimImageData::makeBlank ( dummyTemplate)
protected

Templated makeBlank method.

Definition at line 1323 of file ossimImageData.cpp.

References getBuf(), getNumberOfBands(), getSizePerBand(), getSizePerBandInBytes(), m_nullPixelValue, OSSIM_EMPTY, and ossimDataObject::setDataObjectStatus().

1324 {
1325  // Note: Empty buffer or already OSSIM_EMPTY checked in public method.
1326 
1327  const ossim_uint32 BANDS = getNumberOfBands();
1328  const ossim_uint32 SPB = getSizePerBand();
1329  ossim_uint32 sizePerBandInBytes = getSizePerBandInBytes();
1330  for(ossim_uint32 band = 0; band < BANDS; ++band)
1331  {
1332  const T NP = static_cast<T>(m_nullPixelValue[band]);
1333  if(NP == 0.0)
1334  {
1335  // do an optimize byte fill
1336  memset(getBuf(band), '\0', sizePerBandInBytes);
1337  }
1338  else
1339  {
1340  // slower assign call
1341  T* p = static_cast<T*>(getBuf(band));
1342  for (ossim_uint32 i = 0; i < SPB; ++i)
1343  {
1344  p[i] = NP;
1345  }
1346  }
1347  }
1348 
1350 }
virtual ossim_uint32 getNumberOfBands() const
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.

◆ newNormalizedDouble()

ossimImageData * ossimImageData::newNormalizedDouble ( ) const
virtual

Will take this tile and normalize it to a newly allocated double point tile.

Definition at line 679 of file ossimImageData.cpp.

References convertToNormalizedDouble(), getHeight(), getNumberOfBands(), getWidth(), initialize(), OSSIM_NORMALIZED_DOUBLE, and ossimImageData().

680 {
681  ossimImageData* result = new ossimImageData(0,
683  this->getNumberOfBands(),
684  this->getWidth(),
685  this->getHeight());
686  result->initialize();
687 
689 
690  return result;
691 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual ossim_uint32 getHeight() const
virtual void initialize()
Initialize the data buffer.
64 bit normalized floating point
virtual void convertToNormalizedDouble(ossimImageData *result) const
Will use the memory that you pass in to normalize this data object.

◆ newNormalizedFloat()

ossimRefPtr< ossimImageData > ossimImageData::newNormalizedFloat ( ) const
virtual

Will take this tile and normalize it to a newly allocated floating point tile.

Definition at line 641 of file ossimImageData.cpp.

References convertToNormalizedFloat(), ossimRefPtr< T >::get(), getHeight(), getNumberOfBands(), getWidth(), initialize(), OSSIM_NORMALIZED_FLOAT, and ossimImageData().

642 {
644  new ossimImageData(0,
646  this->getNumberOfBands(),
647  this->getWidth(),
648  this->getHeight());
649 
650  result->initialize();
651 
652  convertToNormalizedFloat(result.get());
653 
654  return result;
655 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual ossim_uint32 getHeight() const
virtual void initialize()
Initialize the data buffer.
32 bit normalized floating point
virtual void convertToNormalizedFloat(ossimImageData *result) const
Will use the memory that you pass in to normalize this data object.

◆ nullTileAlpha() [1/2]

void ossimImageData::nullTileAlpha ( const ossim_uint8 src,
const ossimIrect src_rect,
bool  mutliplyAlphaFlag = false 
)
virtual

Definition at line 3252 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), and getImageRectangle().

Referenced by ossimGdalTileSource::getTile().

3255 {
3256  const ossimIrect img_rect = getImageRectangle();
3257 
3258  // Get the clip rect.
3259  const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
3260 
3261  nullTileAlpha(src, src_rect, clip_rect, multiplyAlphaFlag);
3262 }
virtual void nullTileAlpha(const ossim_uint8 *src, const ossimIrect &src_rect, bool mutliplyAlphaFlag=false)
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501

◆ nullTileAlpha() [2/2]

void ossimImageData::nullTileAlpha ( const ossim_uint8 src,
const ossimIrect src_rect,
const ossimIrect clip_rect,
bool  multiplyAlphaFlag = false 
)
virtual

Definition at line 3264 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), nullTileAlphaTemplate(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimSetError().

3268 {
3269  switch (getScalarType())
3270  {
3271  case OSSIM_UINT8:
3272  nullTileAlphaTemplate(ossim_uint8(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3273  return;
3274 
3275  case OSSIM_SINT8:
3276  nullTileAlphaTemplate(ossim_sint8(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3277  return;
3278 
3279  case OSSIM_UINT16:
3280  case OSSIM_USHORT11:
3281  case OSSIM_USHORT12:
3282  case OSSIM_USHORT13:
3283  case OSSIM_USHORT14:
3284  case OSSIM_USHORT15:
3285  nullTileAlphaTemplate(ossim_uint16(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3286  return;
3287 
3288  case OSSIM_SINT16:
3289  nullTileAlphaTemplate(ossim_sint16(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3290  return;
3291 
3292  case OSSIM_UINT32:
3293  nullTileAlphaTemplate(ossim_uint32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3294  return;
3295 
3296  case OSSIM_SINT32:
3297  nullTileAlphaTemplate(ossim_sint32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3298  return;
3299 
3301  case OSSIM_FLOAT32:
3302  nullTileAlphaTemplate(ossim_float32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3303  return;
3304 
3306  case OSSIM_FLOAT64:
3307  nullTileAlphaTemplate(ossim_float64(0), src, src_rect, clip_rect, multiplyAlphaFlag);
3308  return;
3309 
3310  case OSSIM_SCALAR_UNKNOWN:
3311  default:
3314  "ossimImageData::nullTileAlpha\n\
3315 File %s line %d\nUnsupported scalar type for method!",
3316 __FILE__,
3317 __LINE__);
3318  return;
3319  }
3320 
3321 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
void nullTileAlphaTemplate(T, const ossim_uint8 *src, const ossimIrect &src_rect, const ossimIrect &clip_rect, bool multiplyAlphaFlag=false)
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ nullTileAlphaTemplate()

template<class T >
void ossimImageData::nullTileAlphaTemplate ( ,
const ossim_uint8 src,
const ossimIrect src_rect,
const ossimIrect clip_rect,
bool  multiplyAlphaFlag = false 
)
protected

Definition at line 5417 of file ossimImageData.cpp.

References ossimIrect::completely_within(), getBuf(), ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getMinPix(), getNullPix(), getNumberOfBands(), getWidth(), ossimIrect::height(), initialize(), ossimIrect::intersects(), ossimErrorCodes::OSSIM_ERROR, OSSIM_NULL, ossimSetError(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by nullTileAlpha().

5423 {
5424  static const char MODULE[] = "ossimImageData::nullTileAlphaTemplate";
5425 
5426  // Check the pointer.
5427  if (!src)
5428  {
5429  // Set the error...
5432  "%s File %s line %d\nNULL pointer passed to method!",
5433  MODULE,
5434  __FILE__,
5435  __LINE__);
5436  return;
5437  }
5438 
5439  const ossimIrect img_rect = getImageRectangle();
5440 
5441  // Check for intersect.
5442  if ( ! img_rect.intersects(src_rect) )
5443  {
5444  return; // Nothing to do here.
5445  }
5446 
5447  // Check the clip rect.
5448  if (!clip_rect.completely_within(img_rect))
5449  {
5450  return;
5451  }
5452 
5453  // Check the status and allocate memory if needed.
5455 
5456  // Get the width of the buffers.
5457  ossim_uint32 num_bands = getNumberOfBands();
5458  ossim_uint32 s_width = src_rect.width();
5459  ossim_uint32 d_width = getWidth();
5460  ossim_uint32 band;
5461  ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
5462  (clip_rect.ul().x - img_rect.ul().x);
5463  ossim_uint32 destinationIndex = destinationOffset;
5464  ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) * s_width +
5465  (clip_rect.ul().x - src_rect.ul().x);
5466  ossim_uint32 sourceIndex = sourceOffset;
5467  ossim_uint32 clipHeight = clip_rect.height();
5468  ossim_uint32 clipWidth = clip_rect.width();
5469 
5470  if(!multiplyAlphaFlag)
5471  {
5472  // Copy the data.
5473  for (band=0; band<num_bands; band++)
5474  {
5475  T* destinationBand = static_cast<T*>(getBuf(band));
5476  destinationIndex = destinationOffset;
5477  sourceIndex = sourceOffset;
5478  T nullPix = (T)getNullPix(band);
5479  T minPix = (T)getMinPix(band);
5480  for (ossim_uint32 line = 0; line < clipHeight; ++line)
5481  {
5482  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
5483  {
5484  if(src[sourceIndex+sample] == 0)
5485  {
5486  destinationBand[destinationIndex + sample] = nullPix;
5487  }
5488  else if(destinationBand[destinationIndex + sample] == nullPix)
5489  {
5490  destinationBand[destinationIndex + sample] = minPix;
5491  }
5492  }
5493  sourceIndex += s_width;
5494  destinationIndex += d_width;
5495  }
5496  }
5497  }
5498  else
5499  {
5500  ossim_float64 normalizer = 1.0/255.0;
5501  // Copy the data.
5502  for (band=0; band<num_bands; band++)
5503  {
5504  T* destinationBand = static_cast<T*>(getBuf(band));
5505  destinationIndex = destinationOffset;
5506  sourceIndex = sourceOffset;
5507  T nullPix = (T)getNullPix(band);
5508  T minPix = (T)getMinPix(band);
5509  for (ossim_uint32 line = 0; line < clipHeight; ++line)
5510  {
5511  for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
5512  {
5513  if(src[sourceIndex+sample] != 255)
5514  {
5515  if(src[sourceIndex+sample] != 0)
5516  {
5517  destinationBand[destinationIndex + sample] = (T)(destinationBand[destinationIndex + sample]*
5518  (src[sourceIndex+sample]*normalizer));
5519  if(destinationBand[destinationIndex + sample] == nullPix)
5520  {
5521  destinationBand[destinationIndex + sample] = minPix;
5522  }
5523  }
5524  else
5525  {
5526  destinationBand[destinationIndex + sample] = nullPix;
5527  }
5528  }
5529  else if(destinationBand[destinationIndex + sample] == nullPix)
5530  {
5531  destinationBand[destinationIndex + sample] = minPix;
5532  }
5533  }
5534  sourceIndex += s_width;
5535  destinationIndex += d_width;
5536  }
5537  }
5538 
5539  }
5540 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
double ossim_float64
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual const ossim_float64 * getMinPix() const
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ operator=()

const ossimImageData & ossimImageData::operator= ( const ossimImageData rhs)
virtual

assignment operator=

Parameters
rhsThe data to assign from.
Areference to this object.

Definition at line 114 of file ossimImageData.cpp.

References m_alpha, m_indexedFlag, m_maxPixelValue, m_minPixelValue, m_nullPixelValue, m_origin, and ossimRectilinearDataObject::operator=().

115 {
116  if (this != &rhs)
117  {
118  // ossimRectilinearDataObject initialization:
120 
121  // ossimImageData (this) members:
125  m_alpha = rhs.m_alpha;
126  m_origin = rhs.m_origin;
128  }
129  return *this;
130 }
std::vector< ossim_uint8 > m_alpha
Alpha channel.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
bool m_indexedFlag
Indicates data contains palette indexes.
virtual const ossimRectilinearDataObject & operator=(const ossimRectilinearDataObject &rhs)
assignment operator=

◆ percentFull()

ossim_float64 ossimImageData::percentFull ( ) const
inline

Returns the percentage (0-100) of data buffer containing non-null (valid) entries.

Undefined until validate() is called.

Definition at line 922 of file ossimImageData.h.

922 { return m_percentFull; }
ossim_float64 m_percentFull
percentage (0-100) of image tile that has valid (non-null) pixel values.

◆ populateHistogram()

void ossimImageData::populateHistogram ( ossimRefPtr< ossimMultiBandHistogram histo)
virtual

Definition at line 852 of file ossimImageData.cpp.

References DBL_EPSILON, FLT_EPSILON, getBuf(), ossimHistogram::GetCounts(), ossimDataObject::getDataObjectStatus(), getHeight(), ossimMultiBandHistogram::getHistogram(), getNullPix(), getNumberOfBands(), ossimHistogram::GetRes(), ossimRectilinearDataObject::getScalarType(), getWidth(), OSSIM_EMPTY, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), ossimNotifyLevel_WARN, ossimHistogram::UpCount(), and ossimRefPtr< T >::valid().

Referenced by ossimImageHistogramSource::computeFastModeHistogram(), ossimHistogramRemapper::computeHistogram(), ossimImageHistogramSource::computeNormalModeHistogram(), and ossimImageSourceSequencer::getTile().

853 {
854  ossim_uint32 numberOfBands = getNumberOfBands();
855 
856  if( (getDataObjectStatus() == OSSIM_NULL) ||
858  (!histo))
859  {
860  return;
861  }
862  switch(getScalarType())
863  {
864  case OSSIM_UINT8:
865  {
866  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
867  {
868  ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
869  if(currentHisto.valid())
870  {
871  ossim_uint8 nullpix = (ossim_uint8)getNullPix(band);
872  float* histoBins = currentHisto->GetCounts();
873  int binCount = currentHisto->GetRes();
874  ossim_uint8* buffer = (ossim_uint8*)getBuf(band);
875  ossim_uint32 upperBound = getWidth()*getHeight();
876  if ( binCount == 256 )
877  {
878  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
879  {
880  if (buffer[offset] != nullpix)
881  ++histoBins[ buffer[offset] ];
882  }
883  }
884  else
885  {
886  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
887  {
888  if (buffer[offset] != nullpix)
889  currentHisto->UpCount((float)buffer[offset]);
890  }
891  }
892  }
893  }
894  break;
895  }
896  case OSSIM_UINT16:
897  case OSSIM_USHORT11:
898  case OSSIM_USHORT12:
899  case OSSIM_USHORT13:
900  case OSSIM_USHORT14:
901  case OSSIM_USHORT15:
902  {
903  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
904  {
905  ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
906  if(currentHisto.valid())
907  {
908  ossim_uint16 nullpix = (ossim_uint16)getNullPix(band);
909  ossim_uint16* buffer = (ossim_uint16*)getBuf(band);
910  ossim_uint32 upperBound = getWidth()*getHeight();
911  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
912  {
913  if (buffer[offset] != nullpix)
914  currentHisto->UpCount((float)buffer[offset]);
915  }
916  }
917  }
918  break;
919  }
920  case OSSIM_SINT16:
921  {
922  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
923  {
924  ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
925  if(currentHisto.valid())
926  {
927  ossim_sint16 nullpix = (ossim_sint16)getNullPix(band);
928  ossim_sint16* buffer = (ossim_sint16*)getBuf(band);
929  ossim_uint32 upperBound = getWidth()*getHeight();
930  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
931  {
932  if (buffer[offset] != nullpix)
933  currentHisto->UpCount((float)buffer[offset]);
934  }
935  }
936  }
937  break;
938  }
939  case OSSIM_SINT32:
940  {
941  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
942  {
943  ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
944  if(currentHisto.valid())
945  {
946  ossim_sint32 nullpix = (ossim_sint32)getNullPix(band);
947  ossim_sint32* buffer = (ossim_sint32*)getBuf(band);
948  ossim_uint32 upperBound = getWidth()*getHeight();
949  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
950  {
951  if (buffer[offset] != nullpix)
952  currentHisto->UpCount((float)buffer[offset]);
953  }
954  }
955  }
956  break;
957  }
958  case OSSIM_UINT32:
959  {
960  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
961  {
962  ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
963  if(currentHisto.valid())
964  {
965  ossim_uint32 nullpix = (ossim_uint32)getNullPix(band);
966  ossim_uint32* buffer = (ossim_uint32*)getBuf(band);
967  ossim_uint32 upperBound = getWidth()*getHeight();
968  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
969  {
970  if (buffer[offset] != nullpix)
971  currentHisto->UpCount((float)buffer[offset]);
972  }
973  }
974  }
975  break;
976  }
978  case OSSIM_FLOAT64:
979  {
980  ossim_float64 epsilon = 2*DBL_EPSILON;
981  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
982  {
983  ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
984  if(currentHisto.valid())
985  {
986  ossim_float64 nullpix = (ossim_float64)getNullPix(band);
987  if (nullpix == 0.0)
988  epsilon = 0;
989  ossim_float64* buffer = (ossim_float64*)getBuf(band);
990  ossim_uint32 upperBound = getWidth()*getHeight();
991  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
992  {
993  if (!ossim::almostEqual<ossim_float64>(buffer[offset], nullpix, epsilon))
994  currentHisto->UpCount((float)buffer[offset]);
995  }
996  }
997  }
998  break;
999  }
1001  case OSSIM_FLOAT32:
1002  {
1003  ossim_float32 epsilon = 2*FLT_EPSILON;
1004  for(ossim_uint32 band = 0; band < numberOfBands; ++band)
1005  {
1006  ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
1007  if(currentHisto.valid())
1008  {
1009  ossim_float32 nullpix = (ossim_float32)getNullPix(band);
1010  if (nullpix == 0.0)
1011  epsilon = 0;
1012  ossim_float32* buffer = (ossim_float32*)getBuf(band);
1013  ossim_uint32 upperBound = getWidth()*getHeight();
1014  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
1015  {
1016  if (!ossim::almostEqual<ossim_float32>(buffer[offset], nullpix, epsilon))
1017  currentHisto->UpCount((float)buffer[offset]);
1018  }
1019  }
1020  }
1021  break;
1022  }
1023  case OSSIM_SCALAR_UNKNOWN:
1024  default:
1025  {
1026  //ERROR
1028  << "ossimImageData::populateHistogram\n"
1029  << "Unknown scalar type." << std::endl;
1030  }
1031  } // end of switch
1032 }
16 bit unsigned integer (15 bits used)
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
bool valid() const
Definition: ossimRefPtr.h:75
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
int GetRes() const
signed short ossim_sint16
#define FLT_EPSILON
32 bit signed integer
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
ossimRefPtr< ossimHistogram > getHistogram(ossim_int32 band)
signed int ossim_sint32
void UpCount(float newval, float occurences=1)
#define DBL_EPSILON
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
float * GetCounts()
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ print()

std::ostream & ossimImageData::print ( std::ostream &  out) const
virtual

Generic print method.

Derived classes should re-implement as they see fit.

Returns
std::ostream&

Reimplemented from ossimRectilinearDataObject.

Definition at line 6934 of file ossimImageData.cpp.

References ossimObject::getClassName(), getHeight(), getImageRectangle(), getNumberOfBands(), getWidth(), m_alpha, m_indexedFlag, m_maxPixelValue, m_minPixelValue, m_nullPixelValue, m_origin, and ossimRectilinearDataObject::print().

6935 {
6936  out << getClassName() << "::print:"
6937  << "\nm_origin: " << m_origin << "\n";
6938  if(m_nullPixelValue.size())
6939  {
6940  out << "Null values: ";
6941 
6942  copy(m_nullPixelValue.begin(),
6943  m_nullPixelValue.begin() + getNumberOfBands(),
6944  std::ostream_iterator<ossim_float64>(out, " "));
6945  out << "\n";
6946  }
6947  if(m_minPixelValue.size())
6948  {
6949  out << "Min values: ";
6950 
6951  copy(m_minPixelValue.begin(),
6952  m_minPixelValue.begin() + getNumberOfBands(),
6953  std::ostream_iterator<ossim_float64>(out, " "));
6954  out << "\n";
6955  }
6956  if(m_maxPixelValue.size())
6957  {
6958  out << "Max values: ";
6959 
6960  copy(m_maxPixelValue.begin(),
6961  m_maxPixelValue.begin() + getNumberOfBands(),
6962  std::ostream_iterator<ossim_float64>(out, " "));
6963  out << "\n";
6964  }
6965  out << "width: " << getWidth()
6966  << "\nheight: " << getHeight()
6967  << "\nimage rectangle: " << getImageRectangle()
6968  << "\nindexed: " << m_indexedFlag
6969  << "\nalpha size: " << m_alpha.size()
6970  << std::endl;
6971 
6973 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
std::vector< ossim_uint8 > m_alpha
Alpha channel.
virtual ossim_uint32 getHeight() const
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
virtual ossimIrect getImageRectangle() const
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
bool m_indexedFlag
Indicates data contains palette indexes.
virtual std::ostream & print(std::ostream &out) const
Generic print method.

◆ saveState()

bool ossimImageData::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of the object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimRectilinearDataObject.

Definition at line 7445 of file ossimImageData.cpp.

References ossimKeywordlist::add(), m_alpha, m_indexedFlag, m_maxPixelValue, m_minPixelValue, m_nullPixelValue, m_origin, ossimRectilinearDataObject::saveState(), ossim::toSimpleStringList(), and ossimIpt::toString().

Referenced by ossimMemoryImageSource::saveState().

7446 {
7447  bool result = ossimRectilinearDataObject::saveState(kwl, prefix);
7448  ossimString null_pixels;
7449  ossimString min_pixels;
7450  ossimString max_pixels;
7454 
7455  kwl.add(prefix, "null_pixels", null_pixels, true);
7456  kwl.add(prefix, "min_pixels", min_pixels, true);
7457  kwl.add(prefix, "max_pixels", max_pixels, true);
7458 
7459  ossimString alpha;
7461  kwl.add(prefix, "alpha", alpha, true);
7462  kwl.add(prefix, "indexed", m_indexedFlag, true);
7463  kwl.add(prefix, "origin", m_origin.toString(), true);
7464  return result;
7465 
7466 }
ossimString toString() const
Definition: ossimIpt.cpp:139
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
std::vector< ossim_uint8 > m_alpha
Alpha channel.
void toSimpleStringList(ossimString &result, const std::vector< T > &valuesList)
This will output a vector of values inst a string.
Definition: ossimCommon.h:484
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
bool m_indexedFlag
Indicates data contains palette indexes.

◆ setHeight()

void ossimImageData::setHeight ( ossim_uint32  height)
virtual

◆ setHistogram()

void ossimImageData::setHistogram ( ossimRefPtr< ossimMultiResLevelHistogram histo)
virtual

Definition at line 7548 of file ossimImageData.cpp.

References m_histogram.

7549 {
7550  m_histogram = histo;
7551 }
ossimRefPtr< ossimMultiResLevelHistogram > m_histogram

◆ setImageRectangle()

void ossimImageData::setImageRectangle ( const ossimIrect rect)
virtual

Definition at line 2701 of file ossimImageData.cpp.

References getHeight(), getWidth(), ossimIrect::hasNans(), ossimIrect::height(), initialize(), OSSIM_NULL, setOrigin(), setWidthHeight(), ossimDataObject::theDataObjectStatus, ossimIrect::ul(), and ossimIrect::width().

Referenced by ossimTableRemapper::allocate(), ossimJpegTileSource::allocate(), ossimPngReader::allocate(), ossimPixelFlipper::allocateClipTileBuffer(), ossimPixelFlipper::clipTile(), ossimHlzTool::computeHLZ(), ossimBrightnessMatch::computeInputBrightness(), ossimViewshedTool::computeViewshed(), demo2(), demo3(), ossimCacheTileSource::fillTile(), ossimImageCacheTileSource::fillTile(), ossimMpiMasterOverviewSequencer::getNextTile(), ossimImageSourceSequencer::getNextTile(), ossimOverviewSequencer::getNextTile(), ossimKakaduJp2Reader::getOverviewTile(), ossimIntensityAdjustmentFilter::getTile(), ossimHsiToRgbSource::getTile(), ossimRgbToHsiSource::getTile(), ossimRgbToHsvSource::getTile(), ossimImageToPlaneNormalFilter::getTile(), ossimBlendMosaic::getTile(), ossimErosionFilter::getTile(), ossimMultiBandHistogramTileSource::getTile(), ossimFftFilter::getTile(), ossimDilationFilter::getTile(), ossimSICDToDetectedImage::getTile(), ossim3x3ConvolutionFilter::getTile(), ossimFeatherMosaic::getTile(), ATP::ossimCorrelationSource::getTile(), ATP::ossimDescriptorSource::getTile(), ossimRgbToGreyFilter::getTile(), ossimBrightnessContrastSource::getTile(), ossimPolyCutter::getTile(), ossimSFIMFusion::getTile(), ossimClosestToCenterCombiner::getTile(), ossimBandSelector::getTile(), ossimTwoColorView::getTile(), ossimMapCompositionSource::getTile(), ossimTableRemapper::getTile(), ossimShiftFilter::getTile(), ossimLinearStretchRemapper::getTile(), ossimLocalCorrelationFusion::getTile(), ossimUsgsDemTileSource::getTile(), ossimJpegTileSource::getTile(), ossimSlopeFilter::getTile(), ossimTiledImagePatch::getTile(), ossimBandAverageFilter::getTile(), ossimHsiRemapper::getTile(), ossimScaleFilter::getTile(), ossimMemoryImageSource::getTile(), ossimNBandToIndexFilter::getTile(), ossimGpkgReader::getTile(), ossimHdf5ImageHandler::getTile(), ossimValueAssignImageSourceFilter::getTile(), ossimCcfTileSource::getTile(), ossimRgbToIndexFilter::getTile(), ossimMeanMedianFilter::getTile(), ossimDtedTileSource::getTile(), ossimConvolutionFilter1D::getTile(), ossimPngReader::getTile(), ossimSubImageTileSource::getTile(), ossimH5ImageHandler::getTile(), ossimHistogramRemapper::getTile(), ossimOpjJp2Reader::getTile(), ossimGdalTileSource::getTile(), ossimKMeansFilter::getTile(), ossimAdrgTileSource::getTile(), ossimImageCacheTileSource::getTile(), ossimHdfReader::getTile(), ossimBitMaskTileSource::getTile(), ossimPointCloudImageHandler::getTile(), ossimWatermarkFilter::getTile(), ossimMG4LidarReader::getTile(), ossimMrSidReader::getTile(), ossimLasReader::getTile(), ossimTiffTileSource::getTile(), ossimImageSourceSequencer::getTile(), ossimGeoPdfReader::getTile(), ossimKakaduJ2kReader::getTile(), ossimRpfCacheTileSource::getTile(), ossimRangeDomeTileSource::getTile(), ossimKakaduJp2Reader::getTile(), ossimTiledImageHandler::getTile(), ossimNitfTileSource::getTile(), ossimCibCadrgTileSource::getTile(), ossimBandLutFilter::getTile(), ossimBumpShadeTileSource::getTile(), ossimIndexToRgbLutFilter::getTile(), ossimMaskFilter::getTile(), ossimEquationCombiner::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimImageRenderer::getTileAtResLevel(), ossimGdalTileSource::getTileBlockRead(), ossimViewshedTool::initProcessingChain(), ossimKakaduNitfReader::loadBlock(), ossimIntensityAdjustmentFilter::loadNormTile(), loadState(), ossimKakaduJp2Reader::loadTile(), ossimKakaduJ2kReader::loadTile(), ossimGeoPdfReader::resetCacheBuffer(), ossimMultiThreadSequencer::ossimGetTileJob::run(), and ossimMemoryImageSource::setRect().

2702 {
2703  if(rect.hasNans())
2704  {
2705  return;
2706  }
2707 
2708  ossim_uint32 w = getWidth();
2709  ossim_uint32 h = getHeight();
2710  ossim_uint32 nw = rect.width();
2711  ossim_uint32 nh = rect.height();
2712 
2713  setOrigin(rect.ul());
2714  setWidthHeight(nw, nh);
2715 
2716  // we will try to be non destructive on the resize of the number of bands
2717  if ( (w*h != nw*nh) && (theDataObjectStatus != OSSIM_NULL) )
2718  {
2719  initialize();
2720  }
2721 }
virtual ossim_uint32 getWidth() const
virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h)
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossim_uint32 getHeight() const
virtual void initialize()
Initialize the data buffer.
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual void setOrigin(const ossimIpt &origin)
bool hasNans() const
Definition: ossimIrect.h:337
ossimDataObjectStatus theDataObjectStatus

◆ setImageRectangleAndBands()

void ossimImageData::setImageRectangleAndBands ( const ossimIrect rect,
ossim_uint32  numberOfBands 
)
virtual

Definition at line 2675 of file ossimImageData.cpp.

References getHeight(), getNumberOfBands(), getWidth(), ossimIrect::hasNans(), ossimIrect::height(), initialize(), OSSIM_NULL, setNumberOfBands(), setOrigin(), setWidthHeight(), ossimDataObject::theDataObjectStatus, ossimIrect::ul(), and ossimIrect::width().

Referenced by ossimJpegCodec::decodeJpegToRgb(), ossimImageCombiner::getNextNormTile(), ossimFusionCombiner::getNormIntensity(), ossimFusionCombiner::getNormTile(), ossimColorNormalizedFusion::getTile(), ossimHistogramEqualization::getTile(), ossimErosionFilter::getTile(), ossimDilationFilter::getTile(), ossimEdgeFilter::getTile(), ossimClosestToCenterCombiner::getTile(), ossimAnnotationSource::getTile(), and ossimMeanMedianFilter::getTile().

2677 {
2678  if(rect.hasNans())
2679  {
2680  return;
2681  }
2682 
2683  ossim_uint32 bands = getNumberOfBands();
2684  ossim_uint32 w = getWidth();
2685  ossim_uint32 h = getHeight();
2686  ossim_uint32 nw = rect.width();
2687  ossim_uint32 nh = rect.height();
2688 
2689  setOrigin(rect.ul());
2690  setWidthHeight(nw, nh);
2691  setNumberOfBands(numberOfBands, false);
2692 
2693  // we will try to be non destructive on the resize of the number of bands
2694  if( ( (w*h != nw*nh) || ( bands != numberOfBands) ) &&
2696  {
2697  initialize();
2698  }
2699 }
virtual ossim_uint32 getWidth() const
virtual void setNumberOfBands(ossim_uint32 bands, bool reallocate=false)
virtual ossim_uint32 getNumberOfBands() const
virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h)
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossim_uint32 getHeight() const
virtual void initialize()
Initialize the data buffer.
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual void setOrigin(const ossimIpt &origin)
bool hasNans() const
Definition: ossimIrect.h:337
ossimDataObjectStatus theDataObjectStatus

◆ setIndexedFlag()

void ossimImageData::setIndexedFlag ( bool  flag)

Sets the indexed flag.

This indicates the data contains palette indexes. Default is false.

Parameters
flagIf true data is indexed.

Definition at line 7435 of file ossimImageData.cpp.

References m_indexedFlag.

Referenced by ossimGdalTileSource::setPreservePaletteIndexesFlag().

7436 {
7437  m_indexedFlag = flag;
7438 }
bool m_indexedFlag
Indicates data contains palette indexes.

◆ setMaxPix() [1/3]

void ossimImageData::setMaxPix ( ossim_float64  max_pix)
virtual

◆ setMaxPix() [2/3]

void ossimImageData::setMaxPix ( ossim_float64  max_pix,
ossim_uint32  band 
)
virtual

Definition at line 2595 of file ossimImageData.cpp.

References initializeMaxDefault(), m_maxPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

2596 {
2598  {
2599  return;
2600  }
2602  {
2604  }
2605  m_maxPixelValue[band] = max_pix;
2606 }
virtual void initializeMaxDefault()
initializeMaxDefault() Resizes theMaxPixelValue array to number of bands and initializes to the defau...
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.

◆ setMaxPix() [3/3]

void ossimImageData::setMaxPix ( const ossim_float64 maxPixArray,
ossim_uint32  numberOfValues 
)
virtual

Definition at line 2608 of file ossimImageData.cpp.

References initializeMaxDefault(), m_maxPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

2610 {
2611  if(!maxPixArray || !m_numberOfDataComponents )
2612  {
2613  return;
2614  }
2615 
2617  {
2619  }
2620 
2621  for(ossim_uint32 band = 0;
2622  (band < m_numberOfDataComponents) &&
2623  (band < m_numberOfDataComponents);
2624  ++band)
2625  {
2626  m_maxPixelValue[band] = maxPixArray[band];
2627  }
2628 }
virtual void initializeMaxDefault()
initializeMaxDefault() Resizes theMaxPixelValue array to number of bands and initializes to the defau...
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32

◆ setMinPix() [1/3]

void ossimImageData::setMinPix ( ossim_float64  min_pix)
virtual

◆ setMinPix() [2/3]

void ossimImageData::setMinPix ( ossim_float64  min_pix,
ossim_uint32  band 
)
virtual

Definition at line 2548 of file ossimImageData.cpp.

References initializeMinDefault(), m_minPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

2549 {
2551  {
2552  return;
2553  }
2555  {
2557  }
2558  m_minPixelValue[band] = min_pix;
2559 }
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual void initializeMinDefault()
initializeMinDefault() Resizes theMinPixelValue array to number of bands and initializes to the defau...

◆ setMinPix() [3/3]

void ossimImageData::setMinPix ( const ossim_float64 minPixArray,
ossim_uint32  numberOfValues 
)
virtual

Definition at line 2561 of file ossimImageData.cpp.

References initializeMinDefault(), m_minPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

2563 {
2564  if( !minPixArray || !m_numberOfDataComponents )
2565  {
2566  return;
2567  }
2568 
2570  {
2572  }
2573 
2574  for(ossim_uint32 band = 0;
2575  (band < numberOfValues) && (band < m_numberOfDataComponents);
2576  ++band)
2577  {
2578  m_minPixelValue[band] = minPixArray[band];
2579  }
2580 }
unsigned int ossim_uint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual void initializeMinDefault()
initializeMinDefault() Resizes theMinPixelValue array to number of bands and initializes to the defau...

◆ setNormalizedFloat()

void ossimImageData::setNormalizedFloat ( ossim_uint32  offset,
ossim_uint32  bandNumber,
ossim_float32  input 
)
virtual

This will assign to this object a normalized value by unnormalizing to its native type.

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 524 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getDoubleBuf(), getFloatBuf(), ossimRectilinearDataObject::getNumberOfDataComponents(), ossimRectilinearDataObject::getScalarType(), getSshortBuf(), getUcharBuf(), getUshortBuf(), m_maxPixelValue, m_minPixelValue, m_nullPixelValue, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by loadTile().

527 {
528  // Make sure that the types and width and height are good.
529  if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
530  {
531 
532  ossim_float32 p = 0.0;
533 
534  if ( inputValue )
535  {
536  const ossim_float32 DELTA = m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber] - 1;
537  const ossim_float32 OFFSET_TO_MIN = m_minPixelValue[bandNumber] - 1;
538  p = inputValue * DELTA + OFFSET_TO_MIN + 0.5;
539  if ( p > m_maxPixelValue[bandNumber] )
540  {
541  p = m_maxPixelValue[bandNumber];
542  }
543  }
544  else
545  {
546  p = m_nullPixelValue[bandNumber];
547  }
548 
549  switch (getScalarType())
550  {
551  case OSSIM_UINT8:
552  {
553  unsigned char* sourceBuf = getUcharBuf(bandNumber);
554  sourceBuf[offset] = static_cast<ossim_uint8>( p );
555  break;
556  }
557  case OSSIM_SINT8:
558  {
559  ossim_sint8* sourceBuf = static_cast<ossim_sint8*>(getBuf(bandNumber));
560  sourceBuf[offset] = static_cast<ossim_sint8>( p );
561  break;
562  }
563  case OSSIM_USHORT11:
564  case OSSIM_USHORT12:
565  case OSSIM_USHORT13:
566  case OSSIM_USHORT14:
567  case OSSIM_USHORT15:
568  case OSSIM_UINT16:
569  {
570  ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
571  sourceBuf[offset] = static_cast<ossim_uint16>( p );
572  break;
573  }
574  case OSSIM_SINT16:
575  {
576  ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
577  sourceBuf[offset] = static_cast<ossim_sint16>( p );
578  break;
579  }
580  case OSSIM_UINT32:
581  {
582  ossim_uint32* sourceBuf = static_cast<ossim_uint32*>(getBuf(bandNumber));
583  sourceBuf[offset] = static_cast<ossim_uint32>( p );
584  break;
585  }
586  case OSSIM_SINT32:
587  {
588  ossim_sint32* sourceBuf = static_cast<ossim_sint32*>(getBuf(bandNumber));
589  sourceBuf[offset] = static_cast<ossim_sint32>( p );
590  break;
591  }
593  case OSSIM_FLOAT32:
594  {
595  ossim_float32* sourceBuf = getFloatBuf(bandNumber);
596  sourceBuf[offset] = p;
597  break;
598  }
599  case OSSIM_FLOAT64:
601  {
602  ossim_float64* sourceBuf = getDoubleBuf(bandNumber);
603  sourceBuf[offset] = p;
604  break;
605  }
607  default:
608  // Shouldn't hit this.
610  << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
611  << std::endl;
612 
613  } // Matches: switch (getScalarType())
614 
615  } // Matches: if( (getDataObjectStatus() ...
616 
617 } // End: ossimImageData::setNormalizedFloat
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
virtual const ossim_uint16 * getUshortBuf() const
16 bit unsigned integer
virtual const ossim_uint8 * getUcharBuf() const
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
virtual const ossim_sint16 * getSshortBuf() const
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual const ossim_float32 * getFloatBuf() const
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const
virtual ossim_uint32 getNumberOfDataComponents() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)
virtual const ossim_float64 * getDoubleBuf() const

◆ setNull() [1/4]

void ossimImageData::setNull ( ossim_uint32  offset)

Definition at line 2288 of file ossimImageData.cpp.

References getBuf(), getNullPix(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by ossimPixelFlipper::clipTile(), ossimConvolutionSource::convolve(), ossimTilePatch::fillTileTemplate(), ossimRectangleCutFilter::getTile(), and setNull().

2289 {
2290  ossim_uint32 numberOfBands = getNumberOfBands();
2291  ossim_uint32 band=0;
2292  switch(getScalarType())
2293  {
2294  case OSSIM_UINT8:
2295  {
2296  for(band = 0; band < numberOfBands; ++band)
2297  {
2298  ossim_uint8* buf = static_cast<ossim_uint8*>(getBuf(band))+offset;
2299  *buf = (ossim_uint8)getNullPix(band);
2300  }
2301  break;
2302  }
2303  case OSSIM_SINT8:
2304  {
2305  for(band = 0; band < numberOfBands; ++band)
2306  {
2307  ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+offset;
2308  *buf = (ossim_sint8)getNullPix(band);
2309  }
2310  break;
2311  }
2312  case OSSIM_UINT16:
2313  case OSSIM_USHORT11:
2314  case OSSIM_USHORT12:
2315  case OSSIM_USHORT13:
2316  case OSSIM_USHORT14:
2317  case OSSIM_USHORT15:
2318  {
2319  for(band = 0; band < numberOfBands; band++)
2320  {
2321  ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+
2322  offset;
2323  *buf = (ossim_uint16)getNullPix(band);
2324  }
2325  break;
2326  }
2327  case OSSIM_SINT16:
2328  {
2329  for(band = 0; band < numberOfBands; band++)
2330  {
2331  ossim_sint16* buf = static_cast<ossim_sint16*>(getBuf(band))+
2332  offset;
2333  *buf = (ossim_sint16)getNullPix(band);
2334  }
2335  break;
2336  }
2337  case OSSIM_UINT32:
2338  {
2339  for(band = 0; band < numberOfBands; band++)
2340  {
2341  ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+
2342  offset;
2343  *buf = (ossim_uint32)getNullPix(band);
2344  }
2345  break;
2346  }
2347  case OSSIM_SINT32:
2348  {
2349  for(band = 0; band < numberOfBands; band++)
2350  {
2351  ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+
2352  offset;
2353  *buf = (ossim_sint32)getNullPix(band);
2354  }
2355  break;
2356  }
2358  case OSSIM_FLOAT32:
2359  {
2360  for(band = 0; band < numberOfBands; band++)
2361  {
2362  ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
2363  *buf = (ossim_float32)getNullPix(band);
2364  }
2365  break;
2366  }
2367  case OSSIM_FLOAT64:
2369  {
2370  for(band = 0; band < numberOfBands; band++)
2371  {
2372  ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
2373  *buf = getNullPix(band);
2374  }
2375  break;
2376  }
2377  case OSSIM_SCALAR_UNKNOWN:
2378  default:
2379  {
2380  //ERROR
2382  << "ossimImageData::isNull Unsupported scalar type!"
2383  << std::endl;
2384  }
2385  }
2386 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ setNull() [2/4]

void ossimImageData::setNull ( ossim_uint32  offset,
ossim_uint32  band 
)

Definition at line 2388 of file ossimImageData.cpp.

References getBuf(), getNullPix(), ossimRectilinearDataObject::getScalarType(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), and ossimNotifyLevel_WARN.

2389 {
2390  switch(getScalarType())
2391  {
2392  case OSSIM_UINT8:
2393  {
2394  ossim_uint8* buf = static_cast<ossim_uint8*>(getBuf(band))+offset;
2395  *buf = (ossim_uint8)getNullPix(band);
2396  break;
2397  }
2398  case OSSIM_SINT8:
2399  {
2400  ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+offset;
2401  *buf = (ossim_sint8)getNullPix(band);
2402  break;
2403  }
2404  case OSSIM_UINT16:
2405  case OSSIM_USHORT11:
2406  case OSSIM_USHORT12:
2407  case OSSIM_USHORT13:
2408  case OSSIM_USHORT14:
2409  case OSSIM_USHORT15:
2410  {
2411  ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+offset;
2412  *buf = (ossim_uint16)getNullPix(band);
2413  break;
2414  }
2415  case OSSIM_SINT16:
2416  {
2417  ossim_sint16* buf = static_cast<ossim_sint16*>(getBuf(band))+offset;
2418  *buf = (ossim_sint16)getNullPix(band);
2419  break;
2420  }
2421  case OSSIM_UINT32:
2422  {
2423  ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+offset;
2424  *buf = (ossim_uint32)getNullPix(band);
2425  break;
2426  }
2427  case OSSIM_SINT32:
2428  {
2429  ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+offset;
2430  *buf = (ossim_sint32)getNullPix(band);
2431  break;
2432  }
2434  case OSSIM_FLOAT32:
2435  {
2436  ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
2437  *buf = (ossim_float32)getNullPix(band);
2438  break;
2439  }
2440  case OSSIM_FLOAT64:
2442  {
2443  ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
2444  *buf = getNullPix(band);
2445  break;
2446  }
2447  case OSSIM_SCALAR_UNKNOWN:
2448  default:
2449  {
2450  //ERROR
2452  << "ossimImageData::isNull Unsupported scalar type!"
2453  << std::endl;
2454  }
2455  }
2456 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual const void * getBuf() const
8 bit unsigned integer
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
16 bit unsigned integer (12 bits used)

◆ setNull() [3/4]

void ossimImageData::setNull ( const ossimIpt pt)

Definition at line 2458 of file ossimImageData.cpp.

References getWidth(), m_origin, ossimRectilinearDataObject::m_spatialExtents, setNull(), ossimIpt::x, and ossimIpt::y.

2459 {
2460  ossim_int32 xNew = (pt.x - m_origin.x);
2461  ossim_int32 yNew = (pt.y - m_origin.y);
2462 
2463  if(xNew < 0 || xNew >= (int)m_spatialExtents[0] ||
2464  yNew < 0 || yNew >= (int)m_spatialExtents[1])
2465  {
2466  return;
2467  }
2468  ossim_uint32 offset = ((int)getWidth())*yNew + xNew;
2469 
2470  setNull(offset);
2471 }
virtual ossim_uint32 getWidth() const
unsigned int ossim_uint32
std::vector< ossim_uint32 > m_spatialExtents
void setNull(ossim_uint32 offset)
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ setNull() [4/4]

void ossimImageData::setNull ( const ossimIpt pt,
ossim_uint32  band 
)

Definition at line 2473 of file ossimImageData.cpp.

References getWidth(), m_origin, ossimRectilinearDataObject::m_spatialExtents, setNull(), ossimIpt::x, and ossimIpt::y.

2474 {
2475  ossim_int32 xNew = (pt.x - m_origin.x);
2476  ossim_int32 yNew = (pt.y - m_origin.y);
2477 
2478  if(xNew < 0 || xNew >= (int)m_spatialExtents[0] ||
2479  yNew < 0 || yNew >= (int)m_spatialExtents[1])
2480  {
2481  return;
2482  }
2483  ossim_uint32 offset = ((int)getWidth())*yNew + xNew;
2484 
2485  setNull(offset, band);
2486 }
virtual ossim_uint32 getWidth() const
unsigned int ossim_uint32
std::vector< ossim_uint32 > m_spatialExtents
void setNull(ossim_uint32 offset)
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ setNullPix() [1/3]

void ossimImageData::setNullPix ( ossim_float64  null_pix)
virtual

◆ setNullPix() [2/3]

void ossimImageData::setNullPix ( ossim_float64  null_pix,
ossim_uint32  band 
)
virtual

Definition at line 2501 of file ossimImageData.cpp.

References initializeNullDefault(), m_nullPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

2502 {
2504  {
2505  return;
2506  }
2508  {
2510  }
2511  m_nullPixelValue[band] = null_pix;
2512 }
virtual void initializeNullDefault()
initializeNullDefault() Resizes theNullPixelValue array to number of bands and initializes to the def...
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ setNullPix() [3/3]

void ossimImageData::setNullPix ( const ossim_float64 nullPixArray,
ossim_uint32  numberOfValues 
)
virtual

Definition at line 2514 of file ossimImageData.cpp.

References initializeNullDefault(), m_nullPixelValue, and ossimRectilinearDataObject::m_numberOfDataComponents.

2516 {
2517  if(!nullPixArray || !m_numberOfDataComponents)
2518  {
2519  return;
2520  }
2521 
2523  {
2525  }
2526 
2527  for(ossim_uint32 band = 0;
2528  (band < numberOfValues) && (band < m_numberOfDataComponents);
2529  ++band)
2530  {
2531  m_nullPixelValue[band] = nullPixArray[band];
2532  }
2533 }
virtual void initializeNullDefault()
initializeNullDefault() Resizes theNullPixelValue array to number of bands and initializes to the def...
unsigned int ossim_uint32
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ setNumberOfBands()

void ossimImageData::setNumberOfBands ( ossim_uint32  bands,
bool  reallocate = false 
)
virtual

Definition at line 2630 of file ossimImageData.cpp.

References getNumberOfBands(), ossimRectilinearDataObject::initialize(), m_maxPixelValue, m_minPixelValue, m_nullPixelValue, ossim::min(), and ossimRectilinearDataObject::setNumberOfDataComponents().

Referenced by setImageRectangleAndBands().

2632 {
2634  if(bands && (b != bands))
2635  {
2637  if(reallocate)
2638  {
2640  }
2641 
2642  ossim_uint32 minBands = ossim::min(b, bands);
2643 
2644 
2645  vector<ossim_float64> newNull(bands);
2646  vector<ossim_float64> newMin(bands);
2647  vector<ossim_float64> newMax(bands);
2648 
2649  ossim_uint32 i = 0;
2650  while (i < minBands)
2651  {
2652  newNull[i] = m_nullPixelValue[i];
2653  newMin[i] = m_minPixelValue[i];
2654  newMax[i] = m_maxPixelValue[i];
2655  ++i;
2656  }
2657 
2658  if(b)
2659  {
2660  while (i < bands)
2661  {
2662  newNull[i] = m_nullPixelValue[b-1];
2663  newMin[i] = m_minPixelValue[b-1];
2664  newMax[i] = m_maxPixelValue[b-1];
2665  ++i;
2666  }
2667  }
2668 
2669  m_nullPixelValue = newNull;
2670  m_minPixelValue = newMin;
2671  m_maxPixelValue = newMax;
2672  }
2673 }
virtual ossim_uint32 getNumberOfBands() const
virtual void setNumberOfDataComponents(ossim_uint32 n)
How many components make up this data object.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
T min(T a, T b)
Definition: ossimCommon.h:203
virtual void initialize()
Initializes m_dataBuffer to current spatial extents.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ setOrigin()

void ossimImageData::setOrigin ( const ossimIpt origin)
virtual

Definition at line 7267 of file ossimImageData.cpp.

References m_origin.

Referenced by ossimCastTileSourceFilter::allocate(), ossimCastTileSourceFilter::applyCast(), ossimTilePatch::convolve(), ossimMaskFilter::executeMaskFilter(), ossimWatermarkFilter::getCenterRect(), ossimWatermarkFilter::getLowerCenterRect(), ossimWatermarkFilter::getLowerLeftRect(), ossimWatermarkFilter::getLowerRightRect(), ossimImageMpiMWriterSequenceConnection::getNextTile(), ossimHsvToRgbSource::getTile(), ossimJpegYCbCrToRgbSource::getTile(), ossimRgbToJpegYCbCrSource::getTile(), ossimDespeckleFilter::getTile(), ossimFeatherMosaic::getTile(), ossimHistoMatchRemapper::getTile(), ossimImageMosaic::getTile(), ossimElevationMosaic::getTile(), ossimGammaRemapper::getTile(), ossimMaxMosaic::getTile(), ossimBandMergeSource::getTile(), ossimAOD::getTile(), ossimConvolutionSource::getTile(), ossimElevImageSource::getTile(), ossimSubImageTileSource::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimMaskFilter::getTile(), ossimWatermarkFilter::getUniformDenseRects(), ossimWatermarkFilter::getUniformSparceRects(), ossimWatermarkFilter::getUpperCenterRect(), ossimWatermarkFilter::getUpperLeftRect(), ossimWatermarkFilter::getUpperRightRect(), ossimEquationCombiner::parseStdFuncs(), ossimResampler::resampleTile(), ossimScaleFilter::runFilterTemplate(), setImageRectangle(), setImageRectangleAndBands(), ossimTilePatch::setRect(), ossimGeoAnnotationBitmap::transform(), ossimPdfWriter::writeJpegTile(), and ossimPdfWriter::writeRawTile().

7268 {
7269  m_origin = origin;
7270 }

◆ setValue()

void ossimImageData::setValue ( ossim_int32  x,
ossim_int32  y,
ossim_float64  color 
)
virtual

Reimplemented in ossimU8ImageData, and ossimS16ImageData.

Definition at line 1424 of file ossimImageData.cpp.

References getBuf(), ossimRectilinearDataObject::getScalarType(), isWithin(), ossimRectilinearDataObject::m_dataBuffer, ossimRectilinearDataObject::m_numberOfDataComponents, m_origin, ossimRectilinearDataObject::m_spatialExtents, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimNotify(), ossimNotifyLevel_WARN, ossimIpt::x, x, ossimIpt::y, and y.

Referenced by RadialProcessor::doRadial(), ossimPointCloudUtilityFilter::getTile(), ossimRangeDomeTileSource::getTile(), and ossimViewshedTool::paintReticle().

1425 {
1426  if(m_dataBuffer.size() > 0 && isWithin(x, y))
1427  {
1428  ossim_uint32 band=0;
1429 
1430  //***
1431  // Compute the offset into the buffer for (x,y). This should always
1432  // come out positive.
1433  //***
1434  ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
1435  ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
1436 
1437  ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
1438 
1439  switch (getScalarType())
1440  {
1441  case OSSIM_UINT8:
1442  {
1443  for(band = 0; band < m_numberOfDataComponents; band++)
1444  {
1445  unsigned char* buf = static_cast<unsigned char*>(getBuf(band))+
1446  offset;
1447  *buf = (unsigned char)color;
1448  }
1449  break;
1450  }
1451  case OSSIM_SINT8:
1452  {
1453  for(band = 0; band < m_numberOfDataComponents; band++)
1454  {
1455  ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+
1456  offset;
1457  *buf = (ossim_sint8)color;
1458  }
1459  break;
1460  }
1461  case OSSIM_UINT16:
1462  case OSSIM_USHORT11:
1463  case OSSIM_USHORT12:
1464  case OSSIM_USHORT13:
1465  case OSSIM_USHORT14:
1466  case OSSIM_USHORT15:
1467  {
1468  for(band = 0; band < m_numberOfDataComponents; band++)
1469  {
1470  ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+
1471  offset;
1472  *buf = (ossim_uint16)color;
1473  }
1474  break;
1475  }
1476  case OSSIM_SINT16:
1477  {
1478  for(band = 0; band < m_numberOfDataComponents; band++)
1479  {
1480  signed short* buf = static_cast<signed short*>(getBuf(band))+
1481  offset;
1482  *buf = (signed short)color;
1483  }
1484  break;
1485  }
1486  case OSSIM_UINT32:
1487  {
1488  for(band = 0; band < m_numberOfDataComponents; band++)
1489  {
1490  ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+
1491  offset;
1492  *buf = (ossim_uint32)color;
1493  }
1494  break;
1495  }
1496  case OSSIM_SINT32:
1497  {
1498  for(band = 0; band < m_numberOfDataComponents; band++)
1499  {
1500  ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+
1501  offset;
1502  *buf = (ossim_sint32)color;
1503  }
1504  break;
1505  }
1507  case OSSIM_FLOAT32:
1508  {
1509  for(band = 0; band < m_numberOfDataComponents; band++)
1510  {
1511  ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
1512  *buf = (ossim_float32)color;
1513  }
1514  break;
1515  }
1516  case OSSIM_FLOAT64:
1518  {
1519  for(band = 0; band < m_numberOfDataComponents; band++)
1520  {
1521  ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
1522  *buf = color;
1523  }
1524  break;
1525  }
1526  case OSSIM_SCALAR_UNKNOWN:
1527  default:
1528  {
1529  //ERROR
1531  << "ossimImageData::setValue Unsupported scalar type!"
1532  << std::endl;
1533 
1534  }
1535 
1536  } // End of: switch (getScalarType())
1537  }
1538 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
ossim_uint32 x
64 bit floating point
16 bit unsigned integer
ossim_uint32 y
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
std::vector< ossim_uint8 > m_dataBuffer
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
std::vector< ossim_uint32 > m_spatialExtents
virtual bool isWithin(ossim_int32 x, ossim_int32 y)
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
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)

◆ setWidth()

void ossimImageData::setWidth ( ossim_uint32  width)
virtual

◆ setWidthHeight()

void ossimImageData::setWidthHeight ( ossim_uint32  w,
ossim_uint32  h 
)
virtual

◆ stretchMinMax() [1/2]

void ossimImageData::stretchMinMax ( )
virtual

Performs linear stretch on tile data from min/max to limits of scalar type.

Definition at line 6975 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimDataObject::getDataObjectStatus(), ossimRectilinearDataObject::getScalarType(), OSSIM_EMPTY, ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_STATUS_UNKNOWN, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and ossimDataObject::setDataObjectStatus().

6976 {
6977  if ( (getDataObjectStatus() != OSSIM_NULL) &&
6979  {
6980  switch (getScalarType())
6981  {
6982  case OSSIM_UINT8:
6983  {
6985  return;
6986  }
6987  case OSSIM_SINT8:
6988  {
6990  return;
6991  }
6992  case OSSIM_UINT16:
6993  case OSSIM_USHORT11:
6994  case OSSIM_USHORT12:
6995  case OSSIM_USHORT13:
6996  case OSSIM_USHORT14:
6997  case OSSIM_USHORT15:
6998  {
7000  return;
7001  }
7002  case OSSIM_SINT16:
7003  {
7005  return;
7006  }
7007  case OSSIM_UINT32:
7008  {
7010  return;
7011  }
7012  case OSSIM_SINT32:
7013  {
7015  return;
7016  }
7017  case OSSIM_FLOAT32:
7019  {
7021  return;
7022  }
7024  case OSSIM_FLOAT64:
7025  {
7027  return;
7028  }
7029  case OSSIM_SCALAR_UNKNOWN:
7030  default:
7031  {
7035  "ossimImageData::stretchMinMax File %s line %d\n\
7036 Invalid scalar type: %d",
7037 __FILE__,
7038 __LINE__,
7039 getScalarType());
7040  break;
7041  }
7042  }
7043  }
7044 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
virtual ossimDataObjectStatus getDataObjectStatus() const
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
8 bit unsigned integer
unsigned char ossim_uint8
virtual void stretchMinMax()
Performs linear stretch on tile data from min/max to limits of scalar type.
16 bit unsigned integer (12 bits used)

◆ stretchMinMax() [2/2]

template<class T >
void ossimImageData::stretchMinMax ( dummyTemplate)
protected

Templated stretch method.

Performs linear stretches on tile data from min/max to limits of scalar type.

Definition at line 7046 of file ossimImageData.cpp.

References ossim::defaultMax(), ossim::defaultMin(), ossim::defaultNull(), getBuf(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getSizePerBand(), m_maxPixelValue, m_minPixelValue, and m_nullPixelValue.

7047 {
7048  const ossim_uint32 BANDS = getNumberOfBands();
7049  const ossim_uint32 SPB = getSizePerBand();
7050 
7051  // scalar min
7053 
7054  // scalar max
7056 
7057  // scalar null
7059 
7060  // scalar range
7061  const ossim_float64 S_RNG = S_MAX-S_MIN+1.0;
7062 
7063  for(ossim_uint32 band = 0; band < BANDS; ++band)
7064  {
7065  T* s = static_cast<T*>(getBuf(band));
7066 
7067  if (s)
7068  {
7069  const ossim_float64 T_NUL = m_nullPixelValue[band]; // tile null
7070  const ossim_float64 T_MIN = m_minPixelValue[band]; // tile min
7071  const ossim_float64 T_MAX = m_maxPixelValue[band]; // tile max
7072  const ossim_float64 T_RNG = (T_MAX-T_MIN)+1; // tile range
7073  const ossim_float64 SPP = S_RNG / T_RNG; // stretch per pixel
7074 
7075  for(ossim_uint32 i = 0; i < SPB; ++i)
7076  {
7077  ossim_float64 p = s[i];
7078  if ( p == T_NUL )
7079  {
7080  p = S_NUL;
7081  }
7082  else if (p <= T_MIN)
7083  {
7084  p = S_MIN;
7085  }
7086  else if (p >= T_MAX)
7087  {
7088  p = S_MAX;
7089  }
7090  else
7091  {
7092  // Stretch...
7093  p = (p - T_MIN + 1.0) * SPP + S_MIN - 1.0;
7094  }
7095  s[i] = ossim::round<T>(p);
7096  }
7097 
7098  // Set the min, max, null:
7099  m_minPixelValue[band] = S_MIN;
7100  m_maxPixelValue[band] = S_MAX;
7101  m_nullPixelValue[band] = S_NUL;
7102 
7103  }
7104  }
7105 }
virtual ossim_uint32 getNumberOfBands() const
double ossim_float64
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual ossimScalarType getScalarType() const
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const

◆ unloadBand() [1/4]

void ossimImageData::unloadBand ( void *  dest,
ossim_uint32  src_band,
ossim_uint32  dest_band,
const ossimIrect dest_rect,
ossimInterleaveType  il_type = OSSIM_BSQ,
OverwriteBandRule  ow_type = NULL_RULE 
) const
virtual

This routine is designed for overwriting a selected band of the destination buffer 'dest' by an independent selected band of the source buffer according to a user-selected rule, defined by OverwriteBandRule.

Currently the rules available in OverwriteBandRule are:

The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected band of a pixel of the destination buffer is to be overwritten if any one of the other bands of the same destination pixel have color values that deviate from its color. Same as the deprecated COLOR_DISCREPANCY.

The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected band of a pixel of the destination buffer is to be overwritten only if all of the other bands of the same destination pixel have color values that deviate from its color.

The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected band of a pixel of the destination buffer is to be overwritten if any one of the other bands of the same destination pixel have color values that are equal to the color of the selected band of the source pixel.

The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected band of a pixel of the destination buffer is to be overwritten only if all of the other bands of the same destination pixel have color values that are equal to the color of the selected band of the source pixel.

The NULL_RULE rule directs that the selected band of the destination buffer is to be overwritten by the selected band of the source image data (no questions asked).

Note
: The 'dest' buffer should have at least the same number of bands as the 'src' object.

Currently this routine is only implemented for il_type set to OSSIM_BSQ.

Parameters
destThe destination buffer, which should have at least the same number of bands as the 'src' object.
src_bandThe 0-based band of the source image data.
dest_bandThe 0-based band of the dest buffer.
dest_rectThe rectangle of the destination buffer.
il_typeThe interleave type. Only OSSIM_BSQ available.
ow_typeThe rule for overwriting the destination buffer.

Definition at line 4847 of file ossimImageData.cpp.

References getImageRectangle().

Referenced by ossimGdalDatasetRasterBand::IReadBlock(), and unloadBand().

4853 {
4854  unloadBand( dest, src_band, dest_band, dest_rect, getImageRectangle(), il_type, ow_type );
4855 }
virtual void unloadBand(void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, ossimInterleaveType il_type=OSSIM_BSQ, OverwriteBandRule ow_type=NULL_RULE) const
This routine is designed for overwriting a selected band of the destination buffer &#39;dest&#39; by an indep...
virtual ossimIrect getImageRectangle() const

◆ unloadBand() [2/4]

void ossimImageData::unloadBand ( void *  dest,
ossim_uint32  src_band,
ossim_uint32  dest_band,
const ossimIrect dest_rect,
const ossimIrect clip_rect,
ossimInterleaveType  il_type = OSSIM_BSQ,
OverwriteBandRule  ow_type = NULL_RULE 
) const
virtual

This routine is designed for overwriting a selected band of the destination buffer 'dest' by an independent selected band of the source buffer according to a user-selected rule, defined by OverwriteBandRule.

Currently the rules available in OverwriteBandRule are:

The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected band of a pixel of the destination buffer is to be overwritten if any one of the other bands of the same destination pixel have color values that deviate from its color. Same as the deprecated COLOR_DISCREPANCY.

The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected band of a pixel of the destination buffer is to be overwritten only if all of the other bands of the same destination pixel have color values that deviate from its color.

The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected band of a pixel of the destination buffer is to be overwritten if any one of the other bands of the same destination pixel have color values that are equal to the color of the selected band of the source pixel.

The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected band of a pixel of the destination buffer is to be overwritten only if all of the other bands of the same destination pixel have color values that are equal to the color of the selected band of the source pixel.

The NULL_RULE rule directs that the selected band of the destination buffer is to be overwritten by the selected band of the source image data (no questions asked).

Note
: The 'dest' buffer should have at least the same number of bands as the 'src' object.

Currently this routine is only implemented for il_type set to OSSIM_BSQ.

Parameters
destThe destination buffer, which should have at least the same number of bands as the 'src' object.
src_bandThe 0-based band of the source image data.
dest_bandThe 0-based band of the dest buffer.
dest_rectThe rectangle of the destination buffer.
clip_rectOnly data within will be copied.
il_typeThe interleave type. Only OSSIM_BSQ available.
ow_typeThe rule for overwriting the destination buffer.

Definition at line 4857 of file ossimImageData.cpp.

References OSSIM_BSQ, ossimNotify(), ossimNotifyLevel_WARN, and unloadBandToBsq().

4864 {
4865  static const char MODULE[] = "ossimImageData::unloadBand";
4866 
4867  if ( il_type == OSSIM_BSQ )
4868  {
4869  unloadBandToBsq( dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4870  }
4871  else
4872  {
4874  << MODULE << " NOTICE:"
4875  << "\nUnsupported interleave type: " << il_type << " Returning..."
4876  << std::endl;
4877  }
4878 }
virtual void unloadBandToBsq(void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, const ossimIrect &clip_rect, OverwriteBandRule ow_type=NULL_RULE) const
Called from public unloadBand() routines that have an OverwriteBandRule interface.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ unloadBand() [3/4]

void ossimImageData::unloadBand ( void *  dest,
const ossimIrect dest_rect,
ossim_uint32  src_band 
) const
virtual
Parameters
destThe destination buffer. It is assumed this is a single band and the size of dest_rect.
dest_rectThe rectangle of the destination buffer.
src_bandThe band to copy (unload) from the tile.

Definition at line 4781 of file ossimImageData.cpp.

References getImageRectangle(), and unloadBand().

4784 {
4785  unloadBand(dest, dest_rect, getImageRectangle(), band);
4786 }
virtual void unloadBand(void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, ossimInterleaveType il_type=OSSIM_BSQ, OverwriteBandRule ow_type=NULL_RULE) const
This routine is designed for overwriting a selected band of the destination buffer &#39;dest&#39; by an indep...
virtual ossimIrect getImageRectangle() const

◆ unloadBand() [4/4]

void ossimImageData::unloadBand ( void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect,
ossim_uint32  src_band 
) const
virtual
Parameters
destThe destination buffer. It is assumed this is a single band and the size of dest_rect.
dest_rectThe rectangle of the destination buffer. param clip_rect Only data within the clip_rect will be copied.
src_bandThe band to copy (unload) from the tile.

Definition at line 4788 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and unloadBandTemplate().

4792 {
4793  // Call the appropriate load method.
4794  switch (getScalarType())
4795  {
4796  case OSSIM_UINT8:
4797  unloadBandTemplate(ossim_uint8(0), dest, dest_rect, clip_rect, band);
4798  return;
4799 
4800  case OSSIM_SINT8:
4801  unloadBandTemplate(ossim_sint8(0), dest, dest_rect, clip_rect, band);
4802  return;
4803 
4804  case OSSIM_UINT16:
4805  case OSSIM_USHORT11:
4806  case OSSIM_USHORT12:
4807  case OSSIM_USHORT13:
4808  case OSSIM_USHORT14:
4809  case OSSIM_USHORT15:
4810  unloadBandTemplate(ossim_uint16(0), dest, dest_rect, clip_rect, band);
4811  return;
4812 
4813  case OSSIM_SINT16:
4814  unloadBandTemplate(ossim_sint16(0), dest, dest_rect, clip_rect, band);
4815  return;
4816 
4817  case OSSIM_UINT32:
4818  unloadBandTemplate(ossim_uint32(0), dest, dest_rect, clip_rect, band);
4819  return;
4820 
4821  case OSSIM_SINT32:
4822  unloadBandTemplate(ossim_sint32(0), dest, dest_rect, clip_rect, band);
4823  return;
4824 
4826  case OSSIM_FLOAT32:
4827  unloadBandTemplate(ossim_float32(0), dest, dest_rect, clip_rect, band);
4828  return;
4829 
4831  case OSSIM_FLOAT64:
4832  unloadBandTemplate(ossim_float64(0), dest, dest_rect, clip_rect, band);
4833  return;
4834 
4835  case OSSIM_SCALAR_UNKNOWN:
4836  default:
4839  "ossimImageData::unloadBand\n\
4840 File %s line %d\nUnsupported scalar type for method!",
4841 __FILE__,
4842 __LINE__);
4843  return;
4844  }
4845 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
void unloadBandTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect, ossim_uint32 band) const
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ unloadBandTemplate()

template<class T >
void ossimImageData::unloadBandTemplate ( ,
void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect,
ossim_uint32  band 
) const
protected

Definition at line 4941 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), getBuf(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getWidth(), ossimIrect::intersects(), isValidBand(), ossimIrect::lr(), OSSIM_NULL, ossimNotify(), ossimNotifyLevel_WARN, ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

Referenced by unloadBand().

4946 {
4947  static const char MODULE[] = "ossimImageData::unloadBand";
4948 
4949  // Check the pointers.
4950  if (!dest)
4951  {
4953  << MODULE << " ERROR:"
4954  << "\nNULL pointer passed to method! Returning..." << std::endl;
4955  return;
4956  }
4957 
4959  {
4961  << MODULE << " ERROR:"
4962  << "\nThis object is null! Returning..." << std::endl;
4963  return;
4964  }
4965 
4966  ossimIrect img_rect = getImageRectangle();
4967 
4968  // Clip the clip_rect to the tile rect.
4969  ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
4970 
4971  // Clip it again to the destination rect.
4972  output_clip_rect = dest_rect.clipToRect(output_clip_rect);
4973 
4974  // Check the output clip rect for intersection.
4975  if (!output_clip_rect.intersects(img_rect))
4976  {
4977  return;
4978  }
4979  if ( !(output_clip_rect.intersects(dest_rect)) )
4980  {
4981  return;
4982  }
4983 
4984  // Check for valid band.
4985  if (!isValidBand(band))
4986  {
4988  << MODULE << " NOTICE:"
4989  << "\nInvalid band: " << band << " Returning..."
4990  << std::endl;
4991  return;
4992  }
4993 
4994  ossim_uint32 buf_width = dest_rect.lr().x - dest_rect.ul().x + 1;
4995 
4996  // Get a pointer to the source band buffer.
4997  const T* s = reinterpret_cast<const T*>(getBuf(band));
4998 
4999  // Get the offset for each source band.
5000  ossim_uint32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
5001  getWidth() + output_clip_rect.ul().x - img_rect.ul().x;
5002 
5003  // Move the pointers to the start.
5004  T* d = reinterpret_cast<T*>(dest);
5005 
5006  ossim_uint32 dest_offset = (output_clip_rect.ul().y - dest_rect.ul().y) *
5007  buf_width + output_clip_rect.ul().x - dest_rect.ul().x;
5008 
5009  d += dest_offset;
5010  s += src_offset;
5011 
5012  for (ossim_int32 line=output_clip_rect.ul().y;
5013  line<=output_clip_rect.lr().y; ++line)
5014  {
5015  ossim_uint32 i=0;
5016  for (ossim_int32 samp=clip_rect.ul().x;
5017  samp<=output_clip_rect.lr().x; ++samp)
5018  {
5019  d[i] = s[i];
5020  ++i;
5021  }
5022  d += buf_width;
5023  s += getWidth();
5024  }
5025 }
virtual ossim_uint32 getWidth() const
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual bool isValidBand(ossim_uint32 band) const
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ unloadBandToBsq()

void ossimImageData::unloadBandToBsq ( void *  dest,
ossim_uint32  src_band,
ossim_uint32  dest_band,
const ossimIrect dest_rect,
const ossimIrect clip_rect,
OverwriteBandRule  ow_type = NULL_RULE 
) const
protectedvirtual

Called from public unloadBand() routines that have an OverwriteBandRule interface.

Parameters
destThe destination buffer.
src_bandThe 0-based band of the source image data.
dest_bandThe 0-based band of the destination buffer.
dest_rectThe rectangle of the destination buffer.
clip_rectOnly data within will be copied.
ow_typeThe rule for overwriting the destination buffer.

Definition at line 4880 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and unloadBandToBsqTemplate().

Referenced by unloadBand().

4886 {
4887  switch (getScalarType())
4888  {
4889  case OSSIM_UINT8:
4890  unloadBandToBsqTemplate(ossim_uint8(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4891  return;
4892 
4893  case OSSIM_SINT8:
4894  unloadBandToBsqTemplate(ossim_sint8(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4895  return;
4896 
4897  case OSSIM_UINT16:
4898  case OSSIM_USHORT11:
4899  case OSSIM_USHORT12:
4900  case OSSIM_USHORT13:
4901  case OSSIM_USHORT14:
4902  case OSSIM_USHORT15:
4903  unloadBandToBsqTemplate(ossim_uint16(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4904  return;
4905 
4906  case OSSIM_SINT16:
4907  unloadBandToBsqTemplate(ossim_sint16(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4908  return;
4909 
4910  case OSSIM_UINT32:
4911  unloadBandToBsqTemplate(ossim_uint32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4912  return;
4913 
4914  case OSSIM_SINT32:
4915  unloadBandToBsqTemplate(ossim_sint32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4916  return;
4917 
4919  case OSSIM_FLOAT32:
4920  unloadBandToBsqTemplate(ossim_float32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4921  return;
4922 
4924  case OSSIM_FLOAT64:
4925  unloadBandToBsqTemplate(ossim_float64(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4926  return;
4927 
4928  case OSSIM_SCALAR_UNKNOWN:
4929  default:
4932  "ossimImageData::unloadBandToBsq\n\
4933  File %s line %d\nUnsupported scalar type for method!",
4934  __FILE__,
4935  __LINE__);
4936  return;
4937  }
4938 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
void unloadBandToBsqTemplate(T, void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, const ossimIrect &clip_rect, OverwriteBandRule ow_type=NULL_RULE) const
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ unloadBandToBsqTemplate()

template<class T >
void ossimImageData::unloadBandToBsqTemplate ( ,
void *  dest,
ossim_uint32  src_band,
ossim_uint32  dest_band,
const ossimIrect dest_rect,
const ossimIrect clip_rect,
OverwriteBandRule  ow_type = NULL_RULE 
) const
protected

Definition at line 5668 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), COLOR_DISCREPANCY, COLOR_DISCREPANCY_OF_ALL_FROM_DEST, COLOR_DISCREPANCY_OF_ANY_FROM_DEST, COLOR_EQUALITY_OF_ALL_TO_SRC, COLOR_EQUALITY_OF_ANY_TO_SRC, getBuf(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::hasNans(), ossimIrect::intersects(), ossimIrect::lr(), m_nullPixelValue, NULL_RULE, OSSIM_NULL, ossimNotify(), ossimNotifyLevel_WARN, ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

Referenced by unloadBandToBsq().

5675 {
5676  static const char MODULE[] = "ossimImageData::unloadBandToBsq";
5677 
5678  // Check the pointers.
5679  if (!dest)
5680  {
5682  << MODULE << " ERROR:"
5683  << "\nNULL pointer passed to method! Returning..." << std::endl;
5684  return;
5685  }
5686 
5687  bool dataIsNull = false;
5689  {
5690  dataIsNull = true;
5691  }
5692 
5693  ossimIrect img_rect = getImageRectangle();
5694 
5695  // Clip the clip_rect to the tile rect.
5696  ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
5697 
5698  // Clip it again to the destination rect.
5699  output_clip_rect = dest_rect.clipToRect(output_clip_rect);
5700 
5701  // Check the output clip rect for intersection.
5702  if (output_clip_rect.hasNans())
5703  {
5704  return;
5705  }
5706  if ( !(output_clip_rect.intersects(dest_rect)) )
5707  {
5708  return;
5709  }
5710 
5711  ossim_uint32 num_bands = getNumberOfBands();
5712  ossim_uint32 band = 0;
5713  if(!dataIsNull)
5714  {
5715  ossim_uint32 d_width = dest_rect.lr().x - dest_rect.ul().x + 1;
5716  ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
5717  ossim_uint32 s_width = getWidth();
5718  ossim_uint32 s_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
5719  s_width + (output_clip_rect.ul().x - img_rect.ul().x);
5720 
5721  T* d = static_cast<T*>(dest);
5722  const T** s = new const T*[num_bands];
5723 
5724  // Grab a pointers to each one.
5725  for (band=0; band<num_bands; ++band)
5726  {
5727  s[band] = reinterpret_cast<const T*>(getBuf(band));
5728 
5729  // Move to first valid pixel.
5730  s[band] += s_offset;
5731  }
5732 
5733  // Move to first valid pixel.
5734  d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
5735  (output_clip_rect.ul().x - dest_rect.ul().x);
5736 
5737  ossim_uint32 d_dest_band_offset = dest_band * d_band_offset;
5738  ossim_uint32 d_buf_offset = 0;
5739 
5740  for (ossim_int32 line=output_clip_rect.ul().y;
5741  line<=output_clip_rect.lr().y; ++line)
5742  {
5743  ossim_int32 i=0;
5744  for (ossim_int32 samp=output_clip_rect.ul().x;
5745  samp<=output_clip_rect.lr().x; ++samp)
5746  {
5747  ossim_uint32 d_pixel_offset = d_buf_offset+i;
5748  ossim_uint32 d_dest_band_pixel_offset = d_pixel_offset + d_dest_band_offset;
5749 
5750  switch( ow_type )
5751  {
5752  case COLOR_DISCREPANCY:
5754  {
5755  T d_dest_band = d[d_dest_band_pixel_offset];
5756 
5757  for ( band=0; band<num_bands && band!=dest_band; ++band )
5758  {
5759  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5760 
5761  // test for color discrepancy
5762  if ( d_other_band != d_dest_band )
5763  {
5764  d[d_dest_band_pixel_offset] = s[src_band][i];
5765  break;
5766  }
5767  }
5768  }
5769  break;
5770 
5772  {
5773  T d_dest_band = d[d_dest_band_pixel_offset];
5774 
5775  bool bFoundSameValue = false;
5776  for ( band=0; band<num_bands && band!=dest_band; ++band )
5777  {
5778  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5779 
5780  // test for color sameness
5781  if ( d_other_band == d_dest_band )
5782  {
5783  bFoundSameValue = true;
5784  break;
5785  }
5786  }
5787  if ( bFoundSameValue == false )
5788  {
5789  d[d_dest_band_pixel_offset] = s[src_band][i];
5790  }
5791  }
5792  break;
5793 
5795  {
5796  T d_src_band = s[src_band][i];
5797 
5798  for ( band=0; band<num_bands && band!=dest_band; ++band )
5799  {
5800  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5801 
5802  // test for color discrepancy
5803  if ( d_other_band == d_src_band )
5804  {
5805  d[d_dest_band_pixel_offset] = s[src_band][i];
5806  break;
5807  }
5808  }
5809  }
5810  break;
5811 
5813  {
5814  T d_src_band = s[src_band][i];
5815 
5816  bool bFoundDifferentValue = false;
5817  for ( band=0; band<num_bands && band!=dest_band; ++band )
5818  {
5819  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5820 
5821  // test for color discrepancy
5822  if ( d_other_band != d_src_band )
5823  {
5824  bFoundDifferentValue = true;
5825  break;
5826  }
5827  }
5828  if ( bFoundDifferentValue == false )
5829  {
5830  d[d_dest_band_pixel_offset] = s[src_band][i];
5831  }
5832  }
5833  break;
5834 
5835  case NULL_RULE:
5836  default:
5837  {
5838  d[d_dest_band_pixel_offset] = s[src_band][i];
5839  }
5840  break;
5841  }
5842 
5843  ++i;
5844  }
5845 
5846  d_buf_offset += d_width;
5847  s[src_band] += s_width;
5848  }
5849 
5850  // Free up memory allocated for pointers.
5851  delete [] s;
5852  }
5853  else
5854  {
5855  ossim_uint32 d_width = dest_rect.lr().x - dest_rect.ul().x + 1;
5856  ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
5857 
5858  ossim_uint8* d = static_cast<ossim_uint8*>(dest);
5859 
5860  // Move to first valid pixel.
5861  d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
5862  (output_clip_rect.ul().x - dest_rect.ul().x);
5863 
5864  for (band=0; band<num_bands; ++band)
5865  {
5866  ossim_uint8 np = static_cast<ossim_uint8>(m_nullPixelValue[band]);
5867  ossim_uint32 d_buf_offset = 0;
5868 
5869  for (ossim_int32 line=output_clip_rect.ul().y;
5870  line<=output_clip_rect.lr().y; ++line)
5871  {
5872  ossim_int32 i=0;
5873  for (ossim_int32 samp=output_clip_rect.ul().x;
5874  samp<=output_clip_rect.lr().x; ++samp)
5875  {
5876  d[d_buf_offset+i] = np;
5877  ++i;
5878  }
5879 
5880  d_buf_offset += d_width;
5881  }
5882  d += d_band_offset;
5883  }
5884  }
5885 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ unloadTile() [1/2]

void ossimImageData::unloadTile ( void *  dest,
const ossimIrect dest_rect,
ossimInterleaveType  il_type 
) const
virtual

Definition at line 4519 of file ossimImageData.cpp.

References getImageRectangle().

4522 {
4523  unloadTile(dest, dest_rect, getImageRectangle(), type);
4524 }
virtual ossimIrect getImageRectangle() const
virtual void unloadTile(void *dest, const ossimIrect &dest_rect, ossimInterleaveType il_type) const

◆ unloadTile() [2/2]

void ossimImageData::unloadTile ( void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect,
ossimInterleaveType  il_type 
) const
virtual

Definition at line 4526 of file ossimImageData.cpp.

References ossimObject::getClassName(), OSSIM_BIL, OSSIM_BIP, OSSIM_BSQ, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), unloadTileToBil(), unloadTileToBip(), and unloadTileToBsq().

4530 {
4531  switch (type)
4532  {
4533  case OSSIM_BIP:
4534  unloadTileToBip(dest, dest_rect, clip_rect);
4535  return;
4536  case OSSIM_BIL:
4537  unloadTileToBil(dest, dest_rect, clip_rect);
4538  return;
4539  case OSSIM_BSQ:
4540  unloadTileToBsq(dest, dest_rect, clip_rect);
4541  return;
4542  default:
4545  "ossimImageData::unloadTile\n\
4546 File %s line %d\nUnknown scalar type!",
4547 __FILE__,
4548 __LINE__);
4549  return;
4550  }
4551 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
void unloadTileToBsq(void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
void unloadTileToBip(void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
void unloadTileToBil(void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const

◆ unloadTileToBil()

void ossimImageData::unloadTileToBil ( void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
protected

Definition at line 4667 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and unloadTileToBilTemplate().

Referenced by unloadTile().

4670 {
4671  switch (getScalarType())
4672  {
4673  case OSSIM_UINT8:
4674  unloadTileToBilTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
4675  return;
4676 
4677  case OSSIM_SINT8:
4678  unloadTileToBilTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
4679  return;
4680 
4681  case OSSIM_UINT16:
4682  case OSSIM_USHORT11:
4683  case OSSIM_USHORT12:
4684  case OSSIM_USHORT13:
4685  case OSSIM_USHORT14:
4686  case OSSIM_USHORT15:
4687  unloadTileToBilTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
4688  return;
4689 
4690  case OSSIM_SINT16:
4691  unloadTileToBilTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
4692  return;
4693 
4694  case OSSIM_UINT32:
4695  unloadTileToBilTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
4696  return;
4697 
4698  case OSSIM_SINT32:
4699  unloadTileToBilTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
4700  return;
4701 
4703  case OSSIM_FLOAT32:
4704  unloadTileToBilTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
4705  return;
4706 
4708  case OSSIM_FLOAT64:
4709  unloadTileToBilTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
4710  return;
4711 
4712  case OSSIM_SCALAR_UNKNOWN:
4713  default:
4716  "ossimImageData::unloadTileToBil\n\
4717 File %s line %d\nUnsupported scalar type for method!",
4718 __FILE__,
4719 __LINE__);
4720  return;
4721  }
4722 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
void unloadTileToBilTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ unloadTileToBilTemplate()

template<class T >
void ossimImageData::unloadTileToBilTemplate ( ,
void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
protected

Definition at line 5293 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), getBuf(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::hasNans(), ossimIrect::intersects(), ossimIrect::lr(), m_nullPixelValue, OSSIM_NULL, ossimNotify(), ossimNotifyLevel_WARN, ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by unloadTileToBil().

5297 {
5298  static const char MODULE[] = "ossimImageData::unloadTileToBil";
5299 
5300  // Check the pointers.
5301  if (!dest)
5302  {
5304  << MODULE << " ERROR:"
5305  << "\nNULL pointer passed to method! Returning..." << std::endl;
5306  return;
5307  }
5308  bool dataIsNull = false;
5310  {
5311  dataIsNull = true;
5312  }
5313 
5314  ossimIrect img_rect = getImageRectangle();
5315 
5316  // Clip the clip_rect to the tile rect.
5317  ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
5318 
5319  // Clip it again to the destination rect.
5320  output_clip_rect = dest_rect.clipToRect(output_clip_rect);
5321 
5322  // Check the output clip rect for intersection.
5323  if (output_clip_rect.hasNans())
5324  {
5325  return;
5326  }
5327  if ( !(output_clip_rect.intersects(dest_rect)) )
5328  {
5329  return;
5330  }
5331 
5332  ossim_uint32 num_bands = getNumberOfBands();
5333 
5334  ossim_uint32 buf_width = dest_rect.width();
5335 
5336  if(!dataIsNull)
5337  {
5338  // Get the number of bands and grab a pointers to each one.
5339  const T** s = new const T*[num_bands];
5340 
5341  ossim_uint32 band;
5342 
5343  for (band=0; band<num_bands; band++)
5344  {
5345  s[band] = reinterpret_cast<const T*>(getBuf(band));
5346  }
5347 
5348  // Get the offset for each source band.
5349  ossim_uint32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
5350  getWidth() + (output_clip_rect.ul().x - img_rect.ul().x);
5351 
5352  // Move the pointers to the start.
5353  T* d = reinterpret_cast<T*>(dest);
5354 
5355  d += (output_clip_rect.ul().y - dest_rect.ul().y) *
5356  buf_width * num_bands +
5357  (output_clip_rect.ul().x-dest_rect.ul().x);
5358 
5359  for (band=0; band<num_bands; ++band)
5360  {
5361  s[band] += src_offset;
5362  }
5363 
5364  for (ossim_int32 line=output_clip_rect.ul().y;
5365  line<=output_clip_rect.lr().y; ++line)
5366  {
5367  for (band=0; band<num_bands; ++band)
5368  {
5369  ossim_uint32 i=0;
5370  for (ossim_int32 samp=output_clip_rect.ul().x;
5371  samp<=output_clip_rect.lr().x; ++samp)
5372  {
5373  d[i] = s[band][i];
5374  ++i;
5375  }
5376  d += buf_width;
5377  s[band] += getWidth();
5378  }
5379  }
5380  // Free up memory allocated for pointers.
5381  delete [] s;
5382  }
5383  else
5384  {
5385  ossim_uint32 band = 0;
5386  T* nulls = new T[num_bands];
5387  for(band = 0; band < num_bands; ++band)
5388  {
5389  nulls[band] = static_cast<T>(m_nullPixelValue[band]);
5390  }
5391 
5392  // Move the pointers to the start.
5393  T* d = reinterpret_cast<T*>(dest);
5394 
5395  d += (output_clip_rect.ul().y - dest_rect.ul().y) *
5396  buf_width * num_bands + (output_clip_rect.ul().x - dest_rect.ul().x);
5397 
5398  for (ossim_int32 line=output_clip_rect.ul().y;
5399  line<=output_clip_rect.lr().y; ++line)
5400  {
5401  for (band=0; band<num_bands; ++band)
5402  {
5403  ossim_uint32 i=0;
5404  for (ossim_int32 samp=output_clip_rect.ul().x;
5405  samp<=output_clip_rect.lr().x; ++samp)
5406  {
5407  d[i] = nulls[band];
5408  ++i;
5409  }
5410  d += buf_width;
5411  }
5412  }
5413  delete [] nulls;
5414  }
5415 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ unloadTileToBip()

void ossimImageData::unloadTileToBip ( void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
protected

Definition at line 4553 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and unloadTileToBipTemplate().

Referenced by unloadTile().

4556 {
4557  switch (getScalarType())
4558  {
4559  case OSSIM_UINT8:
4560  unloadTileToBipTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
4561  return;
4562 
4563  case OSSIM_SINT8:
4564  unloadTileToBipTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
4565  return;
4566 
4567  case OSSIM_UINT16:
4568  case OSSIM_USHORT11:
4569  case OSSIM_USHORT12:
4570  case OSSIM_USHORT13:
4571  case OSSIM_USHORT14:
4572  case OSSIM_USHORT15:
4573  unloadTileToBipTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
4574  return;
4575 
4576  case OSSIM_SINT16:
4577  unloadTileToBipTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
4578  return;
4579 
4580  case OSSIM_UINT32:
4581  unloadTileToBipTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
4582  return;
4583 
4584  case OSSIM_SINT32:
4585  unloadTileToBipTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
4586  return;
4587 
4589  case OSSIM_FLOAT32:
4590  unloadTileToBipTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
4591  return;
4592 
4594  case OSSIM_FLOAT64:
4595  unloadTileToBipTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
4596  return;
4597 
4598  case OSSIM_SCALAR_UNKNOWN:
4599  default:
4602  "ossimImageData::unloadTileToBip\n\
4603 File %s line %d\nUnsupported scalar type for method!",
4604 __FILE__,
4605 __LINE__);
4606  return;
4607  }
4608 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
void unloadTileToBipTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ unloadTileToBipAlpha()

void ossimImageData::unloadTileToBipAlpha ( void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
virtual
Parameters
destThe destination buffer.
dest_rectThe rectangle of the destination buffer. param clip_rect Only data within the clip_rect will be copied.
src_bandThe band to copy (unload) from the tile.

Definition at line 4610 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and unloadTileToBipAlphaTemplate().

4613 {
4614  switch (getScalarType())
4615  {
4616  case OSSIM_UINT8:
4617  unloadTileToBipAlphaTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
4618  return;
4619 
4620  case OSSIM_SINT8:
4621  unloadTileToBipAlphaTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
4622  return;
4623 
4624  case OSSIM_UINT16:
4625  case OSSIM_USHORT11:
4626  case OSSIM_USHORT12:
4627  case OSSIM_USHORT13:
4628  case OSSIM_USHORT14:
4629  case OSSIM_USHORT15:
4630  unloadTileToBipAlphaTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
4631  return;
4632 
4633  case OSSIM_SINT16:
4634  unloadTileToBipAlphaTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
4635  return;
4636 
4637  case OSSIM_UINT32:
4638  unloadTileToBipAlphaTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
4639  return;
4640 
4641  case OSSIM_SINT32:
4642  unloadTileToBipAlphaTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
4643  return;
4644 
4646  case OSSIM_FLOAT32:
4647  unloadTileToBipAlphaTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
4648  return;
4649 
4651  case OSSIM_FLOAT64:
4652  unloadTileToBipAlphaTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
4653  return;
4654 
4655  case OSSIM_SCALAR_UNKNOWN:
4656  default:
4659  "ossimImageData::unloadTileToBipAlpha\n\
4660 File %s line %d\nUnsupported scalar type for method!",
4661 __FILE__,
4662 __LINE__);
4663  return;
4664  }
4665 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
void unloadTileToBipAlphaTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ unloadTileToBipAlphaTemplate()

template<class T >
void ossimImageData::unloadTileToBipAlphaTemplate ( ,
void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
protected

Definition at line 5164 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), getAlphaBuf(), getBuf(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getMaxPix(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getWidth(), hasAlpha(), ossimIrect::hasNans(), ossimIrect::height(), ossimIrect::intersects(), OSSIM_NULL, OSSIM_UINT8, ossimNotify(), ossimNotifyLevel_WARN, ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by unloadTileToBipAlpha().

5168 {
5169  static const char M[] = "ossimImageData::unloadTileToBipAlphaTemplate";
5170 
5171  // Sanity checks:
5172 
5173  // Are we null:
5175  {
5177  << M << " ERROR:"
5178  << "\nAttempting to copy null tile! Returning..." << std::endl;
5179  return;
5180  }
5181 
5182  // Check the pointer.
5183  if (!dest)
5184  {
5186  << M << " ERROR:"
5187  << "\nNULL pointer passed to method! Returning..." << std::endl;
5188  return;
5189  }
5190 
5191  if ( !hasAlpha() )
5192  {
5194  << M << " ERROR:"
5195  << "\nTile has no alpha! Returning..." << std::endl;
5196  return;
5197  }
5198 
5199  ossimIrect img_rect = getImageRectangle();
5200 
5201  // Clip the clip_rect to the tile rect.
5202  ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
5203 
5204  // Clip it again to the destination rect.
5205  output_clip_rect = dest_rect.clipToRect(output_clip_rect);
5206 
5207  // Check the output clip rect for intersection.
5208  if (output_clip_rect.hasNans())
5209  {
5210  return;
5211  }
5212  if ( !(output_clip_rect.intersects(dest_rect)) )
5213  {
5214  return;
5215  }
5216 
5217  const ossim_int32 NUM_DATA_BANDS = getNumberOfBands();
5218  const ossim_int32 BANDS = NUM_DATA_BANDS + 1; // Has data plus alpha.
5219  const ossim_float64 MAX_PIX = static_cast<T>(getMaxPix(0));
5220  const ossim_float64 ALPHA_MAX_PIX = 255.00;
5221  const ossim_int32 S_WIDTH = getWidth();
5222  const ossim_int32 D_WIDTH = dest_rect.width() * BANDS;
5223  const ossim_int32 OUTPUT_CLIP_WIDTH = output_clip_rect.width();
5224  const ossim_int32 OUTPUT_CLIP_HEIGHT = output_clip_rect.height();
5225 
5226  bool uint8Flag = ( getScalarType() == OSSIM_UINT8 );
5227 
5228  // Get the offset for each source band relative to start of clip rect.
5229  const ossim_int32 SRC_OFFSET = (output_clip_rect.ul().y - img_rect.ul().y) *
5230  S_WIDTH + (output_clip_rect.ul().x - img_rect.ul().x);
5231 
5232  // Get pointers to each one band of image data.
5233  std::vector<const T*> s(NUM_DATA_BANDS);
5234  ossim_int32 band;
5235  for (band = 0; band < NUM_DATA_BANDS; ++band)
5236  {
5237  s[band] = reinterpret_cast<const T*>(getBuf(band));
5238 
5239  // Move to start of clip rect.
5240  s[band] += SRC_OFFSET;
5241  }
5242 
5243  // Get pointer to the alpha channel:
5244  const ossim_uint8* a = getAlphaBuf();
5245 
5246  // Move to start of clip rect.
5247  a += SRC_OFFSET;
5248 
5249  // Pointer to the destination buffer.
5250  T* d = reinterpret_cast<T*>(dest);
5251 
5252  // Move to start of clip rect.
5253  d += (output_clip_rect.ul().y - dest_rect.ul().y) * D_WIDTH +
5254  (output_clip_rect.ul().x - dest_rect.ul().x) * BANDS;
5255 
5256 
5257  // Loop to copy data:
5258  for (ossim_int32 line = 0; line < OUTPUT_CLIP_HEIGHT; ++line)
5259  {
5260  ossim_int32 j = 0;
5261  ossim_int32 alphaIdx = 0;
5262  for (ossim_int32 samp = 0; samp < OUTPUT_CLIP_WIDTH; ++samp, j +=BANDS)
5263  {
5264  // Copy the pixels:
5265  for (band = 0; band < NUM_DATA_BANDS; ++band)
5266  {
5267  d[j+band] = s[band][samp];
5268  }
5269 
5270  // Copy alpha channel converting to scalar type.
5271  if ( uint8Flag )
5272  {
5273  d[j+NUM_DATA_BANDS] = a[alphaIdx++];
5274  }
5275  else
5276  {
5277  d[j+NUM_DATA_BANDS] =
5278  static_cast<T>( (a[alphaIdx++]/ALPHA_MAX_PIX) * MAX_PIX );
5279  }
5280  }
5281 
5282  // Increment pointers to next line...
5283  d += D_WIDTH;
5284  for (band = 0; band < NUM_DATA_BANDS; ++band)
5285  {
5286  s[band] += S_WIDTH;
5287  }
5288  a += S_WIDTH;
5289  }
5290 }
virtual ossim_uint32 getWidth() const
virtual const ossim_float64 * getMaxPix() const
virtual ossim_uint32 getNumberOfBands() const
virtual bool hasAlpha() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
double ossim_float64
virtual ossimIrect getImageRectangle() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual ossimScalarType getScalarType() const
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
8 bit unsigned integer
virtual const ossim_uint8 * getAlphaBuf() const
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ unloadTileToBipTemplate()

template<class T >
void ossimImageData::unloadTileToBipTemplate ( ,
void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
protected

Definition at line 5028 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), getBuf(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::hasNans(), ossimIrect::height(), ossimIrect::intersects(), ossimIrect::lr(), m_nullPixelValue, OSSIM_NULL, ossimNotify(), ossimNotifyLevel_WARN, ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by unloadTileToBip().

5032 {
5033  static const char MODULE[] = "ossimImageData::unloadTileToBip";
5034 
5035  // Check the pointer.
5036  if (!dest)
5037  {
5039  << MODULE << " ERROR:"
5040  << "\nNULL pointer passed to method! Returning..." << std::endl;
5041  return;
5042  }
5043 
5044  bool dataIsNull = false;
5046  {
5047  dataIsNull = true;
5048  }
5049 
5050  ossimIrect img_rect = getImageRectangle();
5051 
5052  // Clip the clip_rect to the tile rect.
5053  ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
5054 
5055  // Clip it again to the destination rect.
5056  output_clip_rect = dest_rect.clipToRect(output_clip_rect);
5057 
5058  // Check the output clip rect for intersection.
5059  if (output_clip_rect.hasNans())
5060  {
5061  return;
5062  }
5063  if ( !(output_clip_rect.intersects(dest_rect)) )
5064  {
5065  return;
5066  }
5067 
5068  ossim_int32 num_bands = getNumberOfBands();
5069 
5070  ossim_int32 buf_width = dest_rect.width() * num_bands;
5071 
5072  if(!dataIsNull)
5073  {
5074  // Get the number of bands and grab a pointers to each one.
5075  const T** s = new const T*[num_bands];
5076 
5077  ossim_int32 band;
5078  ossim_int32 s_width = getWidth();
5079 
5080  for (band=0; band<num_bands; band++)
5081  {
5082  s[band] = reinterpret_cast<const T*>(getBuf(band));
5083  }
5084 
5085  // Move the pointers to the start.
5086  T* d = reinterpret_cast<T*>(dest);
5087 
5088  d += (output_clip_rect.ul().y - dest_rect.ul().y) * buf_width +
5089  (output_clip_rect.ul().x - dest_rect.ul().x) * num_bands;
5090 
5091  // Get the offset for each source band.
5092  ossim_int32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
5093  s_width + (output_clip_rect.ul().x - img_rect.ul().x);
5094 
5095  ossim_int32 output_clip_width = output_clip_rect.width();
5096  ossim_int32 output_clip_height = output_clip_rect.height();
5097 
5098  for (band=0; band<(ossim_int32)getNumberOfBands(); band++)
5099  {
5100  s[band] += src_offset;
5101  }
5102 
5103  ossim_int32 j;
5104  for (ossim_int32 line=0; line<output_clip_height; ++line)
5105  {
5106  j = 0;
5107  for (ossim_int32 samp=0; samp<output_clip_width; ++samp, j+=num_bands)
5108  {
5109  for (band=0; band<num_bands; ++band)
5110  {
5111  d[j+band] = s[band][samp];
5112  }
5113  }
5114 
5115  // increment to next line...
5116  d += buf_width;
5117  for (band=0; band<num_bands; ++band)
5118  {
5119  s[band] += s_width;
5120  }
5121 
5122  }
5123  delete [] s;
5124  }
5125  else
5126  {
5127  ossim_int32 band = 0;
5128  T* nulls = new T[num_bands];
5129  for(band = 0; band < num_bands; ++band)
5130  {
5131  nulls[band] = static_cast<T>(m_nullPixelValue[band]);
5132  }
5133  // Move the pointers to the start.
5134  T* d = reinterpret_cast<T*>(dest);
5135 
5136  d += (output_clip_rect.ul().y - dest_rect.ul().y) * buf_width +
5137  (output_clip_rect.ul().x - dest_rect.ul().x) * num_bands;
5138 
5139  for (ossim_int32 line=output_clip_rect.ul().y;
5140  line<=output_clip_rect.lr().y; ++line)
5141  {
5142  ossim_int32 i=0;
5143  ossim_int32 j=0;
5144  for (ossim_int32 samp=output_clip_rect.ul().x;
5145  samp<=output_clip_rect.lr().x; ++samp)
5146  {
5147  for (band=0; band<num_bands; ++band)
5148  {
5149  d[j+band] = nulls[band];
5150  }
5151  ++i; // increment to next pixel...
5152  j+= num_bands;
5153  }
5154 
5155  // increment to next line...
5156  d += buf_width;
5157  }
5158  delete [] nulls;
5159  nulls = 0;
5160  }
5161 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ unloadTileToBsq()

void ossimImageData::unloadTileToBsq ( void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
protected

Definition at line 4724 of file ossimImageData.cpp.

References ossimObject::getClassName(), ossimRectilinearDataObject::getScalarType(), ossimErrorCodes::OSSIM_ERROR, OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, ossimSetError(), and unloadTileToBsqTemplate().

Referenced by unloadTile().

4727 {
4728  switch (getScalarType())
4729  {
4730  case OSSIM_UINT8:
4731  unloadTileToBsqTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
4732  return;
4733 
4734  case OSSIM_SINT8:
4735  unloadTileToBsqTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
4736  return;
4737 
4738  case OSSIM_UINT16:
4739  case OSSIM_USHORT11:
4740  case OSSIM_USHORT12:
4741  case OSSIM_USHORT13:
4742  case OSSIM_USHORT14:
4743  case OSSIM_USHORT15:
4744  unloadTileToBsqTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
4745  return;
4746 
4747  case OSSIM_SINT16:
4748  unloadTileToBsqTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
4749  return;
4750 
4751  case OSSIM_UINT32:
4752  unloadTileToBsqTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
4753  return;
4754 
4755  case OSSIM_SINT32:
4756  unloadTileToBsqTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
4757  return;
4758 
4760  case OSSIM_FLOAT32:
4761  unloadTileToBsqTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
4762  return;
4763 
4765  case OSSIM_FLOAT64:
4766  unloadTileToBsqTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
4767  return;
4768 
4769  case OSSIM_SCALAR_UNKNOWN:
4770  default:
4773  "ossimImageData::unloadTileToBsq\n\
4774 File %s line %d\nUnsupported scalar type for method!",
4775 __FILE__,
4776 __LINE__);
4777  return;
4778  }
4779 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
void unloadTileToBsqTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ unloadTileToBsqTemplate()

template<class T >
void ossimImageData::unloadTileToBsqTemplate ( ,
void *  dest,
const ossimIrect dest_rect,
const ossimIrect clip_rect 
) const
protected

Definition at line 5543 of file ossimImageData.cpp.

References ossimIrect::clipToRect(), getBuf(), ossimDataObject::getDataObjectStatus(), getImageRectangle(), getNumberOfBands(), getWidth(), ossimIrect::hasNans(), ossimIrect::intersects(), ossimIrect::lr(), m_nullPixelValue, OSSIM_NULL, ossimNotify(), ossimNotifyLevel_WARN, ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

Referenced by unloadTileToBsq().

5547 {
5548  static const char MODULE[] = "ossimImageData::unloadTileToBsq";
5549 
5550  // Check the pointers.
5551  if (!dest)
5552  {
5554  << MODULE << " ERROR:"
5555  << "\nNULL pointer passed to method! Returning..." << std::endl;
5556  return;
5557  }
5558 
5559  bool dataIsNull = false;
5561  {
5562  dataIsNull = true;
5563  }
5564 
5565  ossimIrect img_rect = getImageRectangle();
5566 
5567  // Clip the clip_rect to the tile rect.
5568  ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
5569 
5570  // Clip it again to the destination rect.
5571  output_clip_rect = dest_rect.clipToRect(output_clip_rect);
5572 
5573  // Check the output clip rect for intersection.
5574  if (output_clip_rect.hasNans())
5575  {
5576  return;
5577  }
5578  if ( !(output_clip_rect.intersects(dest_rect)) )
5579  {
5580  return;
5581  }
5582 
5583  ossim_uint32 num_bands = getNumberOfBands();
5584  ossim_uint32 band = 0;
5585  if(!dataIsNull)
5586  {
5587  ossim_uint32 d_width = dest_rect.lr().x - dest_rect.ul().x + 1;
5588  ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
5589  ossim_uint32 s_width = getWidth();
5590  ossim_uint32 s_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
5591  s_width + (output_clip_rect.ul().x - img_rect.ul().x);
5592 
5593  T* d = static_cast<T*>(dest);
5594  const T** s = new const T*[num_bands];
5595 
5596  // Grab a pointers to each one.
5597  for (band=0; band<num_bands; ++band)
5598  {
5599  s[band] = reinterpret_cast<const T*>(getBuf(band));
5600 
5601  // Move to first valid pixel.
5602  s[band] += s_offset;
5603  }
5604 
5605  // Move to first valid pixel.
5606  d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
5607  (output_clip_rect.ul().x - dest_rect.ul().x);
5608 
5609  for (band=0; band<num_bands; ++band)
5610  {
5611  ossim_uint32 d_buf_offset = 0;
5612 
5613  for (ossim_int32 line=output_clip_rect.ul().y;
5614  line<=output_clip_rect.lr().y; ++line)
5615  {
5616  ossim_int32 i=0;
5617  for (ossim_int32 samp=output_clip_rect.ul().x;
5618  samp<=output_clip_rect.lr().x; ++samp)
5619  {
5620  d[d_buf_offset+i] = s[band][i];
5621  ++i;
5622  }
5623 
5624  d_buf_offset += d_width;
5625  s[band] += s_width;
5626  }
5627  d += d_band_offset;
5628  }
5629 
5630  // Free up memory allocated for pointers.
5631  delete [] s;
5632  }
5633  else
5634  {
5635  ossim_uint32 d_width = dest_rect.lr().x - dest_rect.ul().x + 1;
5636  ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
5637 
5638  ossim_uint8* d = static_cast<ossim_uint8*>(dest);
5639 
5640  // Move to first valid pixel.
5641  d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
5642  (output_clip_rect.ul().x - dest_rect.ul().x);
5643 
5644  for (band=0; band<num_bands; ++band)
5645  {
5646  ossim_uint8 np = static_cast<ossim_uint8>(m_nullPixelValue[band]);
5647  ossim_uint32 d_buf_offset = 0;
5648 
5649  for (ossim_int32 line=output_clip_rect.ul().y;
5650  line<=output_clip_rect.lr().y; ++line)
5651  {
5652  ossim_int32 i=0;
5653  for (ossim_int32 samp=output_clip_rect.ul().x;
5654  samp<=output_clip_rect.lr().x; ++samp)
5655  {
5656  d[d_buf_offset+i] = np;
5657  ++i;
5658  }
5659 
5660  d_buf_offset += d_width;
5661  }
5662  d += d_band_offset;
5663  }
5664  }
5665 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ unnormalizeInput()

void ossimImageData::unnormalizeInput ( ossimImageData normalizedInput)
virtual

Will take the normalized input and convert it to this tile's data type.

Example: if this tile is of type UCHAR and its input is of type NORALIZED_FLOAT it will unnormalize the data by doing:

minPix + normalizedInput*(maxPix-minPix)

on a per band basis.

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 694 of file ossimImageData.cpp.

References copyNormalizedBufferToTile(), getBuf(), ossimRectilinearDataObject::getScalarType(), OSSIM_NORMALIZED_DOUBLE, and OSSIM_NORMALIZED_FLOAT.

695 {
696  if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
697  (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
698  {
699  //ERROR
700  return;
701  }
702 
703  if(normalizedInput->getScalarType() == OSSIM_NORMALIZED_DOUBLE)
704  {
705  copyNormalizedBufferToTile((ossim_float64*)normalizedInput->getBuf());
706  }
707  else
708  {
709  copyNormalizedBufferToTile((ossim_float32*)normalizedInput->getBuf());
710  }
711 }
float ossim_float32
double ossim_float64
32 bit normalized floating point
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
virtual const void * getBuf() const

◆ validate() [1/2]

ossimDataObjectStatus ossimImageData::validate ( ) const
virtual

Reimplemented in ossimU16ImageData, ossimU8ImageData, ossimU11ImageData, ossimU12ImageData, ossimU13ImageData, ossimU14ImageData, ossimU15ImageData, and ossimS16ImageData.

Definition at line 1149 of file ossimImageData.cpp.

References ossimRectilinearDataObject::getScalarType(), OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_STATUS_UNKNOWN, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, and ossimDataObject::setDataObjectStatus().

Referenced by ossimCastTileSourceFilter::applyCast(), ossimPixelFlipper::clipTile(), ossimImageMosaic::combine(), ossimMaxMosaic::combine(), ossimBlendMosaic::combine(), ossimFeatherMosaic::combine(), ossimImageMosaic::combineNorm(), ossimMaxMosaic::combineNorm(), ossimBlendMosaic::combineNorm(), ossimNBandToIndexFilter::convertInputTileToOutputTemplate(), ossimTilePatch::convolve(), ossim::copyRegionToTile(), createTestTile(), ossimJpegCodec::decodeJpegToRgb(), demo3(), ossimDilationFilter::doDilation(), ossimErosionFilter::doErosion(), ossimGdalOgrVectorAnnotation::drawAnnotations(), ossimMaskFilter::executeMaskFilterBinarySelection(), ossimMaskFilter::executeMaskFilterInvertSelection(), ossimMaskFilter::executeMaskFilterSelection(), ossimMaskFilter::executeMaskFilterWeighted(), ossimWatermarkFilter::fill(), ossimDtedTileSource::fillBuffer(), ossimCacheTileSource::fillTile(), ossimShiftFilter::fillTile(), ossimGpkgReader::fillTile(), ossimGeoPdfReader::fillTile(), ossimPixelFlipper::flipPixels(), ossimImageMpiMWriterSequenceConnection::getNextTile(), ossimMpiMasterOverviewSequencer::getNextTile(), ossimHsvToRgbSource::getTile(), ossimIntensityAdjustmentFilter::getTile(), ossimJpegYCbCrToRgbSource::getTile(), ossimRgbToHsiSource::getTile(), ossimRgbToHsvSource::getTile(), ossimRgbToJpegYCbCrSource::getTile(), ossimHsiToRgbSource::getTile(), ossimImageToPlaneNormalFilter::getTile(), ossimColorNormalizedFusion::getTile(), ossimMultiBandHistogramTileSource::getTile(), ossimDespeckleFilter::getTile(), ossimFftFilter::getTile(), ossimSICDToDetectedImage::getTile(), ossim3x3ConvolutionFilter::getTile(), ossimPointCloudUtilityFilter::getTile(), ossimRgbToGreyFilter::getTile(), ossimBrightnessContrastSource::getTile(), ossimBandMergeSource::getTile(), ossimPolyCutter::getTile(), ossimSFIMFusion::getTile(), ossimBandSelector::getTile(), ossimClosestToCenterCombiner::getTile(), ossimTwoColorView::getTile(), ossimMapCompositionSource::getTile(), ossimRectangleCutFilter::getTile(), ossimLinearStretchRemapper::getTile(), ossimTableRemapper::getTile(), ossimShiftFilter::getTile(), ossimLocalCorrelationFusion::getTile(), ossimAnnotationSource::getTile(), ossimConvolutionSource::getTile(), ossimSlopeFilter::getTile(), ossimElevImageSource::getTile(), ossimBandAverageFilter::getTile(), ossimHsiRemapper::getTile(), ossimScaleFilter::getTile(), ossimMemoryImageSource::getTile(), ossimValueAssignImageSourceFilter::getTile(), ossimMeanMedianFilter::getTile(), ossimConvolutionFilter1D::getTile(), ossimUsgsDemTileSource::getTile(), ossimSubImageTileSource::getTile(), ossimTiledImagePatch::getTile(), ossimGdalTileSource::getTile(), ossimKMeansFilter::getTile(), ossimHdf5ImageHandler::getTile(), ossimCcfTileSource::getTile(), ossimTopographicCorrectionFilter::getTile(), ossimHdfReader::getTile(), ossimBitMaskTileSource::getTile(), ossimH5ImageHandler::getTile(), ossimMG4LidarReader::getTile(), ossimMrSidReader::getTile(), ossimGridRemapSource::getTile(), ossimAdrgTileSource::getTile(), ossimImageCacheTileSource::getTile(), ossimKakaduJ2kReader::getTile(), ossimPointCloudImageHandler::getTile(), ossimRangeDomeTileSource::getTile(), ossimKakaduJp2Reader::getTile(), ossimLasReader::getTile(), ossimTiledImageHandler::getTile(), ossimTiffTileSource::getTile(), ossimRpfCacheTileSource::getTile(), ossimNitfTileSource::getTile(), ossimBandLutFilter::getTile(), ossimBumpShadeTileSource::getTile(), ossimIndexToRgbLutFilter::getTile(), ossimCibCadrgTileSource::getTile(), ossimPixelFlipper::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimImageRenderer::getTileAtResLevel(), ossimGdalTileSource::getTileBlockRead(), ossimIntensityAdjustmentFilter::loadNormTile(), loadShortBand(), ossimEquationCombiner::parseAssignBand(), ossimEquationCombiner::parseEquation(), ossimEquationCombiner::parseStdFuncs(), ossimGeoPdfReader::resetCacheBuffer(), ossimBandClipFilter::runClip(), ossimHistogramEqualization::runEqualizationAlgorithm(), ossimScaleFilter::runFilterTemplate(), ossimEdgeFilter::runLaplacianFilter(), ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(), ossimEdgeFilter::runLocalMax8Filter(), ossimEdgeFilter::runPrewittFilter(), ossimEdgeFilter::runRobertsFilter(), ossimEdgeFilter::runSimpleFilter(), ossimEdgeFilter::runSobelFilter(), and ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm().

1150 {
1151  switch (getScalarType())
1152  {
1153  case OSSIM_UINT8:
1154  {
1155  return validate(ossim_uint8(0));
1156  }
1157  case OSSIM_SINT8:
1158  {
1159  return validate(ossim_sint8(0));
1160  }
1161 
1162  case OSSIM_UINT16:
1163  case OSSIM_USHORT11:
1164  case OSSIM_USHORT12:
1165  case OSSIM_USHORT13:
1166  case OSSIM_USHORT14:
1167  case OSSIM_USHORT15:
1168  {
1169  return validate(ossim_uint16(0));
1170  }
1171  case OSSIM_SINT16:
1172  {
1173  return validate(ossim_sint16(0));
1174  }
1175 
1176  case OSSIM_UINT32:
1177  {
1178  return validate(ossim_uint32(0));
1179  }
1180  case OSSIM_SINT32:
1181  {
1182  return validate(ossim_sint32(0));
1183  }
1184  case OSSIM_FLOAT32:
1186  {
1187  return validate(ossim_float32(0.0));
1188  }
1189 
1191  case OSSIM_FLOAT64:
1192  {
1193  return validate(ossim_float64(0.0));
1194  }
1195  case OSSIM_SCALAR_UNKNOWN:
1196  default:
1197  {
1199  break;
1200  }
1201  }
1202 
1203  return OSSIM_STATUS_UNKNOWN;
1204 }
16 bit unsigned integer (15 bits used)
8 bit signed integer
64 bit floating point
16 bit unsigned integer
float ossim_float32
16 bit signed integer
16 bit unsigned integer (14 bits used)
signed char ossim_sint8
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
32 bit unsigned integer
double ossim_float64
virtual ossimDataObjectStatus validate() const
signed short ossim_sint16
32 bit signed integer
unsigned int ossim_uint32
32 bit normalized floating point
signed int ossim_sint32
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
8 bit unsigned integer
unsigned char ossim_uint8
16 bit unsigned integer (12 bits used)

◆ validate() [2/2]

template<class T >
ossimDataObjectStatus ossimImageData::validate ( dummyTemplate) const
protected

Templated validate method.

Returns
The status of the ossimImageDataMethod.
Note
See ossimConstants.h for ossimDataObjectStatus enumerations.

Definition at line 1207 of file ossimImageData.cpp.

References getBuf(), ossimDataObject::getDataObjectStatus(), getNumberOfBands(), getSize(), getSizePerBand(), ossimRectilinearDataObject::m_dataBuffer, m_nullPixelValue, m_percentFull, OSSIM_EMPTY, OSSIM_FULL, OSSIM_NULL, OSSIM_PARTIAL, and ossimDataObject::setDataObjectStatus().

1208 {
1209  if (m_dataBuffer.size() == 0)
1210  {
1212  m_percentFull = 0;
1213  return OSSIM_NULL;
1214  }
1215 
1216  ossim_uint32 count = 0;
1217  const ossim_uint32 SIZE = getSize();
1218  const ossim_uint32 BOUNDS = getSizePerBand();
1219  const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
1220 
1221  for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
1222  {
1223  const T NP = static_cast<T>(m_nullPixelValue[band]);
1224  const T* p = static_cast<const T*>(getBuf(band));
1225 
1226  for (ossim_uint32 i = 0; i < BOUNDS; ++i)
1227  {
1228  // check if the band is null
1229  if (p[i] != NP) ++count;
1230  }
1231  }
1232 
1233  if (!count)
1234  {
1236  m_percentFull = 0;
1237  }
1238  else if (count == SIZE)
1239  {
1241  m_percentFull = 100;
1242  }
1243  else
1244  {
1246  m_percentFull = 100.0 * count / SIZE;
1247  }
1248  return getDataObjectStatus();
1249 }
virtual ossim_uint32 getNumberOfBands() const
virtual ossimDataObjectStatus getDataObjectStatus() const
std::vector< ossim_uint8 > m_dataBuffer
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
ossim_float64 m_percentFull
percentage (0-100) of image tile that has valid (non-null) pixel values.
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual ossim_uint32 getSize() const
Returns the total number of pixels in a tile for all bands.
virtual const void * getBuf() const
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.

◆ write()

bool ossimImageData::write ( const ossimFilename f) const
virtual

Writes tile to stream.

This will write the buffer to file with an associated header file. Assuming a contiguous buffer in BSQ format. Currently does not support converting to BIP or BIL or byte swapping but probably should add at some point.

Parameters
fFile to write.
Returns
true on success, false on error.

Definition at line 1364 of file ossimImageData.cpp.

References ossimString::c_str(), getBuf(), ossimLookUpTable::getEntryString(), getHeight(), getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), getSizeInBytes(), getWidth(), ossimScalarTypeLut::instance(), m_indexedFlag, m_maxPixelValue, m_minPixelValue, m_nullPixelValue, m_origin, ossimFilename::setExtension(), and ossimString::toString().

Referenced by ossim::copyRegionToTile(), ATP::ossimDescriptorSource::getTile(), and ATP::ossimCorrelationSource::OpenCVCorrelation().

1365 {
1366  bool result = false;
1367 
1368  std::ofstream os;
1369  os.open(f.c_str(), ios::out | ios::binary);
1370  if (os.good())
1371  {
1372  // Write the tile out.
1373  os.write(static_cast<const char*>(getBuf()),
1374  static_cast<std::streamsize>(getSizeInBytes()));
1375 
1376  result = os.good();
1377  if (result)
1378  {
1379  // Write a header file that we can use to read the tile.
1380  os.close();
1381  ossimFilename hdrFile = f;
1382  hdrFile.setExtension("hdr");
1383  os.open(hdrFile.c_str(), ios::out);
1384  result = os.good();
1385  if (result)
1386  {
1387  os << "filename: " << f.c_str()
1388  << "\nimage_type: general_raster_bsq"
1389  << "\nindexed: " << m_indexedFlag
1390  << "\ninterleave_type: bsq"
1391  << "\norigin: " << m_origin
1392  << "\nnumber_bands: " << ossimString::toString(getNumberOfBands())
1393  << "\nnumber_lines: " << ossimString::toString(getHeight())
1394  << "\nnumber_samples: " << ossimString::toString(getWidth())
1395  << "\nscalar_type: "
1397  << "\n";
1398  for(ossim_uint32 band=0; band < getNumberOfBands(); ++band)
1399  {
1400  ossimString bs = "band";
1401  bs += ossimString::toString(band+1);
1402  os << bs.c_str() << ".min_value: " << m_minPixelValue[band] << "\n"
1403  << bs.c_str() << ".max_value: " << m_maxPixelValue[band] << "\n"
1404  << bs.c_str() << ".null_value: " << m_nullPixelValue[band]
1405  << std::endl;
1406  }
1407  }
1408  }
1409  }
1410  os.close();
1411 
1412  return result;
1413 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual ossimString getEntryString(ossim_int32 entry_number) const
static ossimString toString(bool aValue)
Numeric to string methods.
virtual ossim_uint32 getHeight() const
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual ossimScalarType getScalarType() const
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const
bool m_indexedFlag
Indicates data contains palette indexes.
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
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.

Member Data Documentation

◆ m_alpha

std::vector<ossim_uint8> ossimImageData::m_alpha
protected

Alpha channel.

Definition at line 1225 of file ossimImageData.h.

Referenced by computeAlphaChannel(), getAlphaBuf(), hasAlpha(), loadState(), operator=(), print(), and saveState().

◆ m_histogram

ossimRefPtr<ossimMultiResLevelHistogram> ossimImageData::m_histogram
protected

Definition at line 1232 of file ossimImageData.h.

Referenced by getHistogram(), and setHistogram().

◆ m_indexedFlag

bool ossimImageData::m_indexedFlag
protected

Indicates data contains palette indexes.

Definition at line 1230 of file ossimImageData.h.

Referenced by getIndexedFlag(), loadState(), operator=(), print(), saveState(), setIndexedFlag(), and write().

◆ m_maxPixelValue

std::vector<ossim_float64> ossimImageData::m_maxPixelValue
protected

◆ m_minPixelValue

std::vector<ossim_float64> ossimImageData::m_minPixelValue
protected

◆ m_nullPixelValue

std::vector<ossim_float64> ossimImageData::m_nullPixelValue
protected

◆ m_origin

ossimIpt ossimImageData::m_origin
protected

◆ m_percentFull

ossim_float64 ossimImageData::m_percentFull
mutableprotected

percentage (0-100) of image tile that has valid (non-null) pixel values.

This is computed in validate() method.

Definition at line 1237 of file ossimImageData.h.

Referenced by validate().


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