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

#include <ossimS16ImageData.h>

Inheritance diagram for ossimS16ImageData:
ossimImageData ossimRectilinearDataObject ossimDataObject ossimObject ossimReferenced

Public Member Functions

 ossimS16ImageData (ossimSource *source, ossim_uint32 bands=1)
 
 ossimS16ImageData (ossimSource *source, ossim_uint32 bands, ossim_uint32 width, ossim_uint32 height)
 
 ossimS16ImageData (const ossimS16ImageData &rhs)
 
virtual ossimObjectdup () const
 
void fill (ossim_uint32 band, double value)
 
bool isNull (ossim_uint32 offset) const
 
void setNull (ossim_uint32 offset)
 
virtual ossimDataObjectStatus validate () const
 
virtual void getNormalizedFloat (ossim_uint32 offset, ossim_uint32 bandNumber, float &result) const
 
virtual void setNormalizedFloat (ossim_uint32 offset, ossim_uint32 bandNumber, float input)
 
virtual void convertToNormalizedFloat (ossimImageData *result) const
 
virtual void convertToNormalizedDouble (ossimImageData *result) const
 
virtual void unnormalizeInput (ossimImageData *normalizedInput)
 
virtual double computeAverageBandValue (ossim_uint32 bandNumber=0)
 
virtual double computeMeanSquaredError (double meanValue, ossim_uint32 bandNumber=0)
 
virtual void setValue (ossim_int32 x, ossim_int32 y, double color)
 
virtual void copyTileToNormalizedBuffer (double *buf) const
 
virtual void copyNormalizedBufferToTile (double *buf)
 
virtual void copyTileToNormalizedBuffer (ossim_uint32 band, double *buf) const
 
virtual void copyTileToNormalizedBuffer (ossim_uint32 band, float *buf) const
 
virtual void copyTileToNormalizedBuffer (float *buf) const
 
virtual void copyNormalizedBufferToTile (float *buf)
 
virtual void copyNormalizedBufferToTile (ossim_uint32 band, double *buf)
 
virtual void copyNormalizedBufferToTile (ossim_uint32 band, float *buf)
 
virtual ossim_float64 getMinNormalizedPix () const
 
- Public Member Functions inherited from ossimImageData
 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 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 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 ossimRefPtr< ossimImageDatanewNormalizedFloat () const
 Will take this tile and normalize it to a newly allocated floating point tile. More...
 
virtual ossimImageDatanewNormalizedDouble () const
 Will take this tile and normalize it to a newly allocated double point tile. More...
 
template<class T >
void copyTileToFloatBuffer (T, ossim_float32 *buf) const
 
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 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 bool isWithin (ossim_int32 x, ossim_int32 y)
 
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

virtual ~ossimS16ImageData ()
 
 ossimS16ImageData ()
 
- Protected Member Functions inherited from ossimImageData
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 ()
 

Static Private Attributes

static const ossimNormalizedS16RemapTable m_remapTable
 

Additional Inherited Members

- Public Types inherited from ossimImageData
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...
 
- Protected Attributes inherited from ossimImageData
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 24 of file ossimS16ImageData.h.

Constructor & Destructor Documentation

◆ ossimS16ImageData() [1/4]

ossimS16ImageData::ossimS16ImageData ( ossimSource source,
ossim_uint32  bands = 1 
)

Definition at line 33 of file ossimS16ImageData.cpp.

35  :
36  ossimImageData(source,
38  bands)
39 {
40 }
16 bit signed integer

◆ ossimS16ImageData() [2/4]

ossimS16ImageData::ossimS16ImageData ( ossimSource source,
ossim_uint32  bands,
ossim_uint32  width,
ossim_uint32  height 
)

Definition at line 42 of file ossimS16ImageData.cpp.

46  :
47  ossimImageData(source,
49  bands,
50  width,
51  height)
52 {
53 }
16 bit signed integer

◆ ossimS16ImageData() [3/4]

ossimS16ImageData::ossimS16ImageData ( const ossimS16ImageData rhs)

Definition at line 55 of file ossimS16ImageData.cpp.

56  :
57  ossimImageData(rhs)
58 {
59 }

◆ ~ossimS16ImageData()

ossimS16ImageData::~ossimS16ImageData ( )
protectedvirtual

Definition at line 61 of file ossimS16ImageData.cpp.

62 {
63 }

◆ ossimS16ImageData() [4/4]

ossimS16ImageData::ossimS16ImageData ( )
protected

Definition at line 26 of file ossimS16ImageData.cpp.

References ossimRectilinearDataObject::m_scalarType, and OSSIM_SINT16.

Referenced by dup().

27  :
29 {
31 }
16 bit signed integer

Member Function Documentation

◆ computeAverageBandValue()

double ossimS16ImageData::computeAverageBandValue ( ossim_uint32  bandNumber = 0)
virtual

This will compute the average value for the band.

Definition at line 285 of file ossimS16ImageData.cpp.

References ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), and isNull().

286 {
287  double result = 0.0;
288  ossim_uint32 index = 0;
289  ossim_uint32 validPixelCount=0;
290 
291  ossim_sint16* buffer = getSshortBuf(bandNumber);
292  if(buffer)
293  {
294  ossim_uint32 bounds = getSizePerBand();
295  for(index = 0; index < bounds; ++index)
296  {
297  if(!isNull(index))
298  {
299  result += *buffer;
300  ++validPixelCount;
301  }
302  ++buffer;
303  }
304  if(validPixelCount > 0)
305  {
306  result /= validPixelCount;
307  }
308  }
309 
310  return result;
311 }
bool isNull(ossim_uint32 offset) const
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32

◆ computeMeanSquaredError()

double ossimS16ImageData::computeMeanSquaredError ( double  meanValue,
ossim_uint32  bandNumber = 0 
)
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. Basically think of the mean as a completely grey image and we would like to see how this image varies from the passed in mean.

Definition at line 253 of file ossimS16ImageData.cpp.

References ossimImageData::getHeight(), ossimImageData::getSshortBuf(), ossimImageData::getWidth(), and isNull().

255 {
256  double result = -1; // invalid MSE
257  ossim_uint32 index = 0;
258  double delta = 0;
259  ossim_uint32 validPixelCount=0;
260 
261  ossim_sint16* buffer = getSshortBuf(bandNumber);
262  if(buffer)
263  {
264  ossim_uint32 bounds = getWidth()*getHeight();
265  for(index = 0; index < bounds; ++index)
266  {
267  if(!isNull(index))
268  {
269  delta = *buffer - meanValue;
270  result += (delta*delta);
271  ++validPixelCount;
272  }
273  ++buffer;
274  }
275  if(validPixelCount > 0)
276  {
277  result /= validPixelCount;
278  }
279  }
280 
281  return result;
282 }
virtual ossim_uint32 getWidth() const
bool isNull(ossim_uint32 offset) const
virtual ossim_uint32 getHeight() const
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
unsigned int ossim_uint32

◆ convertToNormalizedDouble()

void ossimS16ImageData::convertToNormalizedDouble ( ossimImageData result) const
virtual

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

Reimplemented from ossimImageData.

Definition at line 167 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), ossimImageData::getWidth(), ossimRectilinearDataObject::m_numberOfDataComponents, m_remapTable, ossimNormalizedS16RemapTable::normFromPix(), OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, and size.

168 {
169  if(!result)
170  {
171  return;
172  }
173 
174  // make sure that the types and width and height are
175  // good.
176  if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
177  (result->getNumberOfBands() != this->getNumberOfBands())||
178  (result->getWidth() != this->getWidth()) ||
179  (result->getHeight() != this->getHeight())||
180  (result->getDataObjectStatus() == OSSIM_NULL) ||
182  {
183  return;
184  }
185 
187 
188  if(size > 0)
189  {
190  for(ossim_uint32 bandCount = 0;
191  bandCount < m_numberOfDataComponents;
192  ++bandCount)
193  {
194  const ossim_sint16* sourceBuf = getSshortBuf(bandCount);
195  double* resultBuf = static_cast<double*>(result->getBuf(bandCount));
196  for(ossim_uint32 counter = 0; counter < size; ++counter)
197  {
198  resultBuf[counter] = m_remapTable.normFromPix(sourceBuf[counter]);
199  }
200  }
201  }
202 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
32 bit normalized floating point
virtual ossimScalarType getScalarType() const
virtual const void * getBuf() const
virtual ossim_float64 normFromPix(ossim_int32 pix) const
Gets normalized value (between &#39;0.0&#39; and &#39;1.0&#39;) from an int which should in scalar range of a signed ...
static const ossimNormalizedS16RemapTable m_remapTable

◆ convertToNormalizedFloat()

void ossimS16ImageData::convertToNormalizedFloat ( ossimImageData result) const
virtual

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

Reimplemented from ossimImageData.

Definition at line 129 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getHeight(), ossimImageData::getNumberOfBands(), ossimRectilinearDataObject::getScalarType(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), ossimImageData::getWidth(), ossimRectilinearDataObject::m_numberOfDataComponents, m_remapTable, OSSIM_NORMALIZED_FLOAT, OSSIM_NULL, and size.

130 {
131  if(!result)
132  {
133  return;
134  }
135  // make sure that the types and width and height are
136  // good.
137  if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
138  (result->getNumberOfBands() != this->getNumberOfBands())||
139  (result->getWidth() != this->getWidth()) ||
140  (result->getHeight() != this->getHeight())||
141  (result->getDataObjectStatus() == OSSIM_NULL) ||
143  {
144  return;
145  }
146 
148 
149  if(size > 0)
150  {
151  for(ossim_uint32 bandCount = 0;
152  bandCount < m_numberOfDataComponents;
153  ++bandCount)
154  {
155  const ossim_sint16* sourceBuf = getSshortBuf(bandCount);
156  float* resultBuf = static_cast<float*>(result->getBuf(bandCount));
157  for(ossim_uint32 counter = 0; counter < size; ++counter)
158  {
159  resultBuf[counter]
160  = static_cast<float>(m_remapTable.
161  normFromPix(sourceBuf[counter]));
162  }
163  }
164  }
165 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
32 bit normalized floating point
virtual ossimScalarType getScalarType() const
virtual const void * getBuf() const
static const ossimNormalizedS16RemapTable m_remapTable

◆ copyNormalizedBufferToTile() [1/4]

void ossimS16ImageData::copyNormalizedBufferToTile ( double *  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 from ossimImageData.

Definition at line 454 of file ossimS16ImageData.cpp.

References ossimObject::getClassName(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), ossimNormalizedS16RemapTable::pixFromNorm(), and size.

455 {
456  if (!buf)
457  {
460  "ossimS16ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
461  __FILE__,
462  __LINE__);
463  return;
464  }
465 
467 
468  if(size > 0)
469  {
470  for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
471  {
472  double* s = buf + (band*size); // source
473  ossim_sint16* d = getSshortBuf(band); // destination
474 
475  for(ossim_uint32 index = 0; index < size; index++)
476  {
477  d[index] = m_remapTable.pixFromNorm(s[index]);
478  }
479  }
480  }
481 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Gets pixel value from normalized value.
static const ossimNormalizedS16RemapTable m_remapTable

◆ copyNormalizedBufferToTile() [2/4]

void ossimS16ImageData::copyNormalizedBufferToTile ( float *  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 from ossimImageData.

Definition at line 570 of file ossimS16ImageData.cpp.

References ossimObject::getClassName(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), ossimNormalizedS16RemapTable::pixFromNorm(), and size.

571 {
572  if (!buf)
573  {
576  "ossimS16ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
577  __FILE__,
578  __LINE__);
579  return;
580  }
581 
583 
584  if(size > 0)
585  {
586  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
587  {
588  float* s = buf + (band*size); // source
589  ossim_sint16* d = getSshortBuf(band); // destination
590 
591  for(ossim_uint32 index = 0; index < size; ++index)
592  {
593  d[index] = m_remapTable.pixFromNorm(s[index]);
594  }
595  }
596  }
597 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Gets pixel value from normalized value.
static const ossimNormalizedS16RemapTable m_remapTable

◆ copyNormalizedBufferToTile() [3/4]

void ossimS16ImageData::copyNormalizedBufferToTile ( ossim_uint32  band,
double *  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 from ossimImageData.

Definition at line 483 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimObject::getClassName(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), ossimNormalizedS16RemapTable::pixFromNorm(), and size.

485 {
486  if (!buf)
487  {
490  "ossimS11ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
491  __FILE__,
492  __LINE__);
493  return;
494  }
495 
497 
498  if((size > 0)&&getBuf(band))
499  {
500  double* s = buf; // source
501  ossim_sint16* d = getSshortBuf(band); // destination
502 
503  for(ossim_uint32 index = 0; index < size; ++index)
504  {
505  *d = m_remapTable.pixFromNorm(*s);
506  ++d;
507  ++s;
508  }
509  }
510 }
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
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Gets pixel value from normalized value.
virtual const void * getBuf() const
static const ossimNormalizedS16RemapTable m_remapTable

◆ copyNormalizedBufferToTile() [4/4]

void ossimS16ImageData::copyNormalizedBufferToTile ( ossim_uint32  band,
float *  buf 
)
virtual

Reimplemented from ossimImageData.

Definition at line 599 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimObject::getClassName(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), ossimNormalizedS16RemapTable::pixFromNorm(), and size.

601 {
602  if (!buf)
603  {
606  "ossimS16ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
607  __FILE__,
608  __LINE__);
609  return;
610  }
611 
613 
614  if((size > 0)&&getBuf(band))
615  {
616  float* s = buf; // source
617  ossim_sint16* d = getSshortBuf(band); // destination
618 
619  for(ossim_uint32 index = 0; index < size; ++index)
620  {
621  *d = m_remapTable.pixFromNorm(*s);
622  ++d;
623  ++s;
624  }
625  }
626 }
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
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Gets pixel value from normalized value.
virtual const void * getBuf() const
static const ossimNormalizedS16RemapTable m_remapTable

◆ copyTileToNormalizedBuffer() [1/4]

void ossimS16ImageData::copyTileToNormalizedBuffer ( double *  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 from ossimImageData.

Definition at line 374 of file ossimS16ImageData.cpp.

References ossimObject::getClassName(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, and ossimSetError().

375 {
376  if (!buf)
377  {
380  "ossimS16ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
381  __FILE__,
382  __LINE__);
383  return;
384  }
385 
386  const ossim_uint32 SIZE = getSizePerBand();
387 
388  if(SIZE > 0)
389  {
390  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
391  {
392  const ossim_sint16* s = getSshortBuf(band); // source
393  double* d = buf + (band*SIZE); // destination
394 
395  for(ossim_uint32 index = 0; index < SIZE; ++index)
396  {
397  d[index] = m_remapTable.
398  normFromPix(static_cast<ossim_int32>(s[index]));
399  }
400  }
401  }
402 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
static const ossimNormalizedS16RemapTable m_remapTable

◆ copyTileToNormalizedBuffer() [2/4]

void ossimS16ImageData::copyTileToNormalizedBuffer ( ossim_uint32  band,
double *  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.

Definition at line 404 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimObject::getClassName(), ossimImageData::getMaxPix(), ossimImageData::getMinPix(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), ossimImageData::m_maxPixelValue, ossimImageData::m_minPixelValue, ossimImageData::m_nullPixelValue, ossimErrorCodes::OSSIM_ERROR, and ossimSetError().

406 {
407  if (!buf)
408  {
411  "ossimS16ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
412  __FILE__,
413  __LINE__);
414  return;
415  }
416 
417  if(!getBuf(band)) return;
418 
419  const ossim_uint32 SIZE = getSizePerBand();
420 
421  if(SIZE)
422  {
423  const ossim_float64 RANGE = (getMaxPix(band)-getMinPix(band)+1);
424 
425  const ossim_sint16* s = getSshortBuf(band); // source
426  double* d = buf; // destination
427 
428  for(ossim_uint32 index = 0; index < SIZE; ++index)
429  {
430  ossim_float64 p = s[index];
431 
432  if (p == m_nullPixelValue[band])
433  {
434  d[index] = 0.0;
435  }
436  else if (p >= m_maxPixelValue[band])
437  {
438  d[index] = 1.0;
439  }
440  else
441  {
442  //---
443  // Normalize...
444  // Note that this will shift any negatives to positive prior
445  // to dividing.
446  //---
447  d[index] =
448  ((p-m_minPixelValue[band]+1) / RANGE);
449  }
450  }
451  }
452 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual const ossim_float64 * getMaxPix() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual const ossim_sint16 * getSshortBuf() const
double ossim_float64
signed short ossim_sint16
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 const ossim_float64 * getMinPix() const
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual const void * getBuf() const

◆ copyTileToNormalizedBuffer() [3/4]

void ossimS16ImageData::copyTileToNormalizedBuffer ( ossim_uint32  band,
float *  buf 
) const
virtual

Definition at line 542 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimObject::getClassName(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), m_remapTable, ossimNormalizedS16RemapTable::normFromPix(), ossimErrorCodes::OSSIM_ERROR, ossimSetError(), and size.

544 {
545  if (!buf)
546  {
549  "ossimS16ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
550  __FILE__,
551  __LINE__);
552  return;
553  }
554  if(!getBuf(band)) return;
555 
557 
558  if(size > 0)
559  {
560  const ossim_sint16* s = getSshortBuf(band); // source
561  float* d = buf; // destination
562 
563  for(ossim_uint32 index = 0; index < size; ++index)
564  {
565  *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
566  }
567  }
568 }
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
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
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
virtual ossim_float64 normFromPix(ossim_int32 pix) const
Gets normalized value (between &#39;0.0&#39; and &#39;1.0&#39;) from an int which should in scalar range of a signed ...
static const ossimNormalizedS16RemapTable m_remapTable

◆ copyTileToNormalizedBuffer() [4/4]

void ossimS16ImageData::copyTileToNormalizedBuffer ( float *  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 from ossimImageData.

Definition at line 512 of file ossimS16ImageData.cpp.

References ossimObject::getClassName(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), and size.

513 {
514  if (!buf)
515  {
518  "ossimS16ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
519  __FILE__,
520  __LINE__);
521  return;
522  }
523 
525 
526  if(size > 0)
527  {
528  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
529  {
530  const ossim_sint16* s = getSshortBuf(band); // source
531  float* d = buf + (band*size); // destination
532 
533  for(ossim_uint32 index = 0; index < size; ++index)
534  {
535  d[index] = m_remapTable.
536  normFromPix(static_cast<ossim_int32>(s[index]));
537  }
538  }
539  }
540 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
static const ossimNormalizedS16RemapTable m_remapTable

◆ dup()

ossimObject * ossimS16ImageData::dup ( ) const
virtual

Perform object duplication.

Reimplemented from ossimImageData.

Definition at line 65 of file ossimS16ImageData.cpp.

References ossimS16ImageData().

66 {
67  return new ossimS16ImageData(*this);
68 }

◆ fill()

void ossimS16ImageData::fill ( ossim_uint32  band,
double  value 
)

will fill the entire band with the value.

Definition at line 334 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), OSSIM_STATUS_UNKNOWN, and ossimDataObject::setDataObjectStatus().

335 {
336  void* s = getBuf(band);
337 
338  if (s == NULL) return; // nothing to do...
339 
340  ossim_uint32 size_in_pixels = getSizePerBand();
341  ossim_sint16* p = getSshortBuf(band);
342 
343  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = (ossim_sint16)value;
344 
345  // Set the status to unknown since we don't know about the other bands.
347 }
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
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
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.

◆ getMinNormalizedPix()

ossim_float64 ossimS16ImageData::getMinNormalizedPix ( ) const
inlinevirtual
Returns
The first non-null index of the normalized remap table.

Reimplemented from ossimImageData.

Definition at line 179 of file ossimS16ImageData.h.

References m_remapTable.

180 {
181  return m_remapTable[1];
182 }
static const ossimNormalizedS16RemapTable m_remapTable

◆ getNormalizedFloat()

void ossimS16ImageData::getNormalizedFloat ( ossim_uint32  offset,
ossim_uint32  bandNumber,
float &  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 from ossimImageData.

Definition at line 104 of file ossimS16ImageData.cpp.

References ossimDataObject::getDataObjectStatus(), ossimImageData::getSshortBuf(), ossimImageData::isValidBand(), m_remapTable, ossimNormalizedS16RemapTable::normFromPix(), and OSSIM_NULL.

107 {
108  if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
109  {
110  const ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
111  result =
112  static_cast<float>(m_remapTable.normFromPix(sourceBuf[offset]));
113  }
114 }
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
virtual bool isValidBand(ossim_uint32 band) const
virtual ossim_float64 normFromPix(ossim_int32 pix) const
Gets normalized value (between &#39;0.0&#39; and &#39;1.0&#39;) from an int which should in scalar range of a signed ...
static const ossimNormalizedS16RemapTable m_remapTable

◆ isNull()

bool ossimS16ImageData::isNull ( ossim_uint32  offset) const

Definition at line 350 of file ossimS16ImageData.cpp.

References ossimImageData::getNumberOfBands(), ossimImageData::getSshortBuf(), and ossimImageData::m_nullPixelValue.

Referenced by computeAverageBandValue(), and computeMeanSquaredError().

351 {
352  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
353  {
354  const ossim_sint16* buf = getSshortBuf(band)+offset;
355 
356  if((*buf) != m_nullPixelValue[band])
357  {
358  return false;
359  }
360  }
361 
362  return true;
363 }
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
unsigned int ossim_uint32
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ setNormalizedFloat()

void ossimS16ImageData::setNormalizedFloat ( ossim_uint32  offset,
ossim_uint32  bandNumber,
float  input 
)
virtual

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

Reimplemented from ossimImageData.

Definition at line 116 of file ossimS16ImageData.cpp.

References ossimDataObject::getDataObjectStatus(), ossimImageData::getSshortBuf(), ossimImageData::isValidBand(), m_remapTable, OSSIM_NULL, and ossimNormalizedS16RemapTable::pixFromNorm().

119 {
120  if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
121  {
122  ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
123  sourceBuf[offset]
124  = static_cast<ossim_sint16>(m_remapTable.pixFromNorm(inputValue));
125  }
126 }
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
virtual bool isValidBand(ossim_uint32 band) const
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Gets pixel value from normalized value.
static const ossimNormalizedS16RemapTable m_remapTable

◆ setNull()

void ossimS16ImageData::setNull ( ossim_uint32  offset)

Definition at line 365 of file ossimS16ImageData.cpp.

References ossimImageData::getNumberOfBands(), ossimImageData::getSshortBuf(), and ossimImageData::m_nullPixelValue.

366 {
367  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
368  {
369  ossim_sint16* buf = getSshortBuf(band)+offset;
370  *buf = static_cast<ossim_sint16>(m_nullPixelValue[band]);
371  }
372 }
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
unsigned int ossim_uint32
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ setValue()

void ossimS16ImageData::setValue ( ossim_int32  x,
ossim_int32  y,
double  color 
)
virtual

Reimplemented from ossimImageData.

Definition at line 313 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimImageData::getSshortBuf(), ossimImageData::isWithin(), ossimRectilinearDataObject::m_numberOfDataComponents, ossimImageData::m_origin, ossimRectilinearDataObject::m_spatialExtents, ossimIpt::x, x, ossimIpt::y, and y.

314 {
315  if(getBuf() != NULL && isWithin(x, y))
316  {
317  //***
318  // Compute the offset into the buffer for (x,y). This should always
319  // come out positive.
320  //***
321  ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
322  ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
323 
324  ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
325 
326  for(ossim_uint32 band = 0; band < m_numberOfDataComponents; band++)
327  {
328  ossim_sint16* buf = getSshortBuf(band)+offset;
329  *buf = (ossim_sint16)color;
330  }
331  }
332 }
ossim_uint32 x
ossim_uint32 y
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
unsigned int ossim_uint32
std::vector< ossim_uint32 > m_spatialExtents
virtual bool isWithin(ossim_int32 x, ossim_int32 y)
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_int32 x
Definition: ossimIpt.h:141

◆ unnormalizeInput()

void ossimS16ImageData::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 from ossimImageData.

Definition at line 204 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimRectilinearDataObject::getScalarType(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), ossimRectilinearDataObject::m_numberOfDataComponents, m_remapTable, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, and size.

205 {
206  if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
207  (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
208  {
209  //ERROR
210  return;
211  }
212 
213  ossim_uint32 counter = 0;
214  ossim_uint32 bandCount = 0;
216  ossimScalarType scalarType = normalizedInput->getScalarType();
217 
218  if(size > 0)
219  {
220  if(scalarType == OSSIM_NORMALIZED_FLOAT)
221  {
222  for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
223  {
224  float* sourceBuf =
225  static_cast<float*>(normalizedInput->getBuf(bandCount));
226  ossim_sint16* resultBuf = getSshortBuf(bandCount);
227  for(counter = 0; counter < size; ++counter)
228  {
229  resultBuf[counter]
230  = static_cast<ossim_sint16>(m_remapTable.
231  pixFromNorm(sourceBuf[counter]));
232  }
233  }
234  }
235  else // Double
236  {
237  for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
238  {
239  double* sourceBuf =
240  static_cast<double*>(normalizedInput->getBuf(bandCount));
241  ossim_sint16* resultBuf = getSshortBuf(bandCount);
242  for(counter = 0; counter < size; ++counter)
243  {
244  resultBuf[counter]
245  = static_cast<ossim_sint16>(m_remapTable.
246  pixFromNorm(sourceBuf[counter]));
247  }
248  }
249  }
250  }
251 }
virtual const ossim_sint16 * getSshortBuf() const
yy_size_t size
signed short ossim_sint16
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
32 bit normalized floating point
ossimScalarType
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
virtual const void * getBuf() const
static const ossimNormalizedS16RemapTable m_remapTable

◆ validate()

ossimDataObjectStatus ossimS16ImageData::validate ( ) const
virtual

Reimplemented from ossimImageData.

Definition at line 70 of file ossimS16ImageData.cpp.

References ossimImageData::getBuf(), ossimDataObject::getDataObjectStatus(), ossimImageData::getNumberOfBands(), ossimImageData::getSize(), ossimImageData::getSizePerBand(), ossimImageData::getSshortBuf(), ossimImageData::m_nullPixelValue, OSSIM_EMPTY, OSSIM_FULL, OSSIM_NULL, OSSIM_PARTIAL, and ossimDataObject::setDataObjectStatus().

71 {
72  if (getBuf() == NULL)
73  {
75  return OSSIM_NULL;
76  }
77 
78  ossim_uint32 count = 0;
79  const ossim_uint32 SIZE = getSize();
80  const ossim_uint32 BOUNDS = getSizePerBand();
81  const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
82 
83  for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
84  {
86  const ossim_sint16* p = getSshortBuf(band);
87  for (ossim_uint32 i=0; i<BOUNDS; i++)
88  {
89  // check if the band is null
90  if (p[i] != np) count++;
91  }
92  }
93 
94  if (!count)
96  else if (count == SIZE)
98  else
100 
101  return getDataObjectStatus();
102 }
virtual ossim_uint32 getNumberOfBands() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual const ossim_sint16 * getSshortBuf() const
signed short ossim_sint16
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 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.

Member Data Documentation

◆ m_remapTable

const ossimNormalizedS16RemapTable ossimS16ImageData::m_remapTable
staticprivate

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