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

#include <ossimU14ImageData.h>

Inheritance diagram for ossimU14ImageData:
ossimImageData ossimRectilinearDataObject ossimDataObject ossimObject ossimReferenced

Public Member Functions

 ossimU14ImageData (ossimSource *source, ossim_uint32 bands=1)
 
 ossimU14ImageData (ossimSource *source, ossim_uint32 bands, ossim_uint32 width, ossim_uint32 height)
 
 ossimU14ImageData (const ossimU14ImageData &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 (long x, long 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 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

virtual ~ossimU14ImageData ()
 
 ossimU14ImageData ()
 
- 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 ossimNormalizedU14RemapTable 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 30 of file ossimU14ImageData.h.

Constructor & Destructor Documentation

◆ ossimU14ImageData() [1/4]

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

Definition at line 40 of file ossimU14ImageData.cpp.

42  :
43  ossimImageData(source,
45  bands)
46 {
47 }
16 bit unsigned integer (14 bits used)

◆ ossimU14ImageData() [2/4]

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

Definition at line 49 of file ossimU14ImageData.cpp.

53  :
54  ossimImageData(source,
56  bands,
57  width,
58  height)
59 {
60 }
16 bit unsigned integer (14 bits used)

◆ ossimU14ImageData() [3/4]

ossimU14ImageData::ossimU14ImageData ( const ossimU14ImageData rhs)

Definition at line 62 of file ossimU14ImageData.cpp.

63  :
64  ossimImageData(rhs)
65 {}

◆ ~ossimU14ImageData()

ossimU14ImageData::~ossimU14ImageData ( )
protectedvirtual

Definition at line 67 of file ossimU14ImageData.cpp.

68 {
69 }

◆ ossimU14ImageData() [4/4]

ossimU14ImageData::ossimU14ImageData ( )
protected

Definition at line 33 of file ossimU14ImageData.cpp.

References ossimRectilinearDataObject::m_scalarType, and OSSIM_USHORT14.

Referenced by dup().

34  :
36 {
38 }
16 bit unsigned integer (14 bits used)

Member Function Documentation

◆ computeAverageBandValue()

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

This will compute the average value for the band.

Definition at line 286 of file ossimU14ImageData.cpp.

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

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

◆ computeMeanSquaredError()

double ossimU14ImageData::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 255 of file ossimU14ImageData.cpp.

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

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

◆ convertToNormalizedDouble()

void ossimU14ImageData::convertToNormalizedDouble ( ossimImageData result) const
virtual

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

Reimplemented from ossimImageData.

Definition at line 170 of file ossimU14ImageData.cpp.

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

171 {
172  if(!result)
173  {
174  return;
175  }
176 
177  // make sure that the types and width and height are
178  // good.
179  if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
180  (result->getNumberOfBands() != this->getNumberOfBands())||
181  (result->getWidth() != this->getWidth()) ||
182  (result->getHeight() != this->getHeight())||
183  (result->getDataObjectStatus() == OSSIM_NULL) ||
185  {
186  return;
187  }
188 
190 
191  if(size > 0)
192  {
193  for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
194  {
195  const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
196  double* resultBuf = static_cast<double*>(result->getBuf(bandCount));
197  for(ossim_uint32 counter = 0; counter < size; ++counter)
198  {
199  resultBuf[counter] = m_remapTable.normFromPix(sourceBuf[counter]);
200  }
201  }
202  }
203 
204 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
unsigned short ossim_uint16
virtual ossim_float64 normFromPix(ossim_int32 pix) const
Gets a normalized value (between &#39;0.0&#39; and &#39;1.0&#39;) from a pixel value.
yy_size_t size
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

◆ convertToNormalizedFloat()

void ossimU14ImageData::convertToNormalizedFloat ( ossimImageData result) const
virtual

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

Reimplemented from ossimImageData.

Definition at line 134 of file ossimU14ImageData.cpp.

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

135 {
136  if(!result)
137  {
138  return;
139  }
140  // make sure that the types and width and height are
141  // good.
142  if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
143  (result->getNumberOfBands() != this->getNumberOfBands())||
144  (result->getWidth() != this->getWidth()) ||
145  (result->getHeight() != this->getHeight())||
146  (result->getDataObjectStatus() == OSSIM_NULL) ||
148  {
149  return;
150  }
151 
153 
154  if(size > 0)
155  {
156  for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
157  {
158  const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
159  float* resultBuf = static_cast<float*>(result->getBuf(bandCount));
160  for(ossim_uint32 counter = 0; counter < size; ++counter)
161  {
162  resultBuf[counter]
163  = static_cast<float>(m_remapTable.
164  normFromPix(sourceBuf[counter]));
165  }
166  }
167  }
168 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
unsigned short ossim_uint16
yy_size_t size
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

◆ copyNormalizedBufferToTile() [1/4]

void ossimU14ImageData::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 439 of file ossimU14ImageData.cpp.

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

440 {
441  if (!buf)
442  {
445  "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
446  __FILE__,
447  __LINE__);
448  return;
449  }
450 
452 
453  if(size > 0)
454  {
455  for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
456  {
457  double* s = buf + (band*size); // source
458  ossim_uint16* d = getUshortBuf(band); // destination
459 
460  for(ossim_uint32 index = 0; index < size; index++)
461  {
462  d[index] = m_remapTable.pixFromNorm(s[index]);
463  }
464  }
465  }
466 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
unsigned short ossim_uint16
yy_size_t size
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
Returns an pixel value as an int from a normalized value.

◆ copyNormalizedBufferToTile() [2/4]

void ossimU14ImageData::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 556 of file ossimU14ImageData.cpp.

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

557 {
558  if (!buf)
559  {
562  "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
563  __FILE__,
564  __LINE__);
565  return;
566  }
567 
569 
570  if(size > 0)
571  {
572  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
573  {
574  float* s = buf + (band*size); // source
575  ossim_uint16* d = getUshortBuf(band); // destination
576 
577  for(ossim_uint32 index = 0; index < size; ++index)
578  {
579  d[index] = m_remapTable.pixFromNorm(s[index]);
580  }
581  }
582  }
583 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
unsigned short ossim_uint16
yy_size_t size
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
Returns an pixel value as an int from a normalized value.

◆ copyNormalizedBufferToTile() [3/4]

void ossimU14ImageData::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 468 of file ossimU14ImageData.cpp.

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

470 {
471  if (!buf)
472  {
475  "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
476  __FILE__,
477  __LINE__);
478  return;
479  }
480 
482 
483  if((size > 0)&&getBuf(band))
484  {
485  double* s = buf; // source
486  ossim_uint16* d = getUshortBuf(band); // destination
487 
488  for(ossim_uint32 index = 0; index < size; ++index)
489  {
490  *d = m_remapTable.pixFromNorm(*s);
491  ++d;
492  ++s;
493  }
494  }
495 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
unsigned short ossim_uint16
yy_size_t size
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_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.

◆ copyNormalizedBufferToTile() [4/4]

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

Reimplemented from ossimImageData.

Definition at line 586 of file ossimU14ImageData.cpp.

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

588 {
589  if (!buf)
590  {
593  "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
594  __FILE__,
595  __LINE__);
596  return;
597  }
598 
600 
601  if((size > 0)&&getBuf(band))
602  {
603  float* s = buf; // source
604  ossim_uint16* d = getUshortBuf(band); // destination
605 
606  for(ossim_uint32 index = 0; index < size; ++index)
607  {
608  *d = m_remapTable.pixFromNorm(*s);
609  ++d;
610  ++s;
611  }
612  }
613 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
unsigned short ossim_uint16
yy_size_t size
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_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.

◆ copyTileToNormalizedBuffer() [1/4]

void ossimU14ImageData::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 379 of file ossimU14ImageData.cpp.

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

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

◆ copyTileToNormalizedBuffer() [2/4]

void ossimU14ImageData::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 410 of file ossimU14ImageData.cpp.

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

412 {
413  if (!buf)
414  {
417  "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
418  __FILE__,
419  __LINE__);
420  return;
421  }
422 
423  if(!getBuf(band)) return;
424 
426 
427  if(size > 0)
428  {
429  const ossim_uint16* s = getUshortBuf(band); // source
430  double* d = buf; // destination
431 
432  for(ossim_uint32 index = 0; index < size; index++)
433  {
434  *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
435  }
436  }
437 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
unsigned short ossim_uint16
virtual ossim_float64 normFromPix(ossim_int32 pix) const
Gets a normalized value (between &#39;0.0&#39; and &#39;1.0&#39;) from a pixel value.
yy_size_t size
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() [3/4]

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

Definition at line 528 of file ossimU14ImageData.cpp.

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

530 {
531  if (!buf)
532  {
535  "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
536  __FILE__,
537  __LINE__);
538  return;
539  }
540  if(!getBuf(band)) return;
541 
543 
544  if(size > 0)
545  {
546  const ossim_uint16* s = getUshortBuf(band); // source
547  float* d = buf; // destination
548 
549  for(ossim_uint32 index = 0; index < size; ++index)
550  {
551  *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
552  }
553  }
554 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
unsigned short ossim_uint16
virtual ossim_float64 normFromPix(ossim_int32 pix) const
Gets a normalized value (between &#39;0.0&#39; and &#39;1.0&#39;) from a pixel value.
yy_size_t size
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() [4/4]

void ossimU14ImageData::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 498 of file ossimU14ImageData.cpp.

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

499 {
500  if (!buf)
501  {
504  "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
505  __FILE__,
506  __LINE__);
507  return;
508  }
509 
511 
512  if(size > 0)
513  {
514  for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
515  {
516  const ossim_uint16* s = getUshortBuf(band); // source
517  float* d = buf + (band*size); // destination
518 
519  for(ossim_uint32 index = 0; index < size; index++)
520  {
521  d[index] = m_remapTable.
522  normFromPix(static_cast<ossim_int32>(s[index]));
523  }
524  }
525  }
526 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
unsigned short ossim_uint16
yy_size_t size
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32

◆ dup()

ossimObject * ossimU14ImageData::dup ( ) const
virtual

Reimplemented from ossimImageData.

Definition at line 71 of file ossimU14ImageData.cpp.

References ossimU14ImageData().

72 {
73  return new ossimU14ImageData(*this);
74 }

◆ fill()

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

will fill the entire band with the value.

Definition at line 336 of file ossimU14ImageData.cpp.

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

337 {
338  void* s = getBuf(band);
339 
340  if (s == NULL) return; // nothing to do...
341 
342  ossim_uint32 size_in_pixels = getSizePerBand();
343  ossim_uint16* p = getUshortBuf(band);
344  ossim_uint16 np = static_cast<ossim_uint16>(value);
345 
346  for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
347 
348  // Set the status to unknown since we don't know about the other bands.
350 }
virtual const ossim_uint16 * getUshortBuf() const
unsigned short ossim_uint16
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 ossimU14ImageData::getMinNormalizedPix ( ) const
inlinevirtual
Returns
The first non-null index of the normalized remap table.

Reimplemented from ossimImageData.

Definition at line 183 of file ossimU14ImageData.h.

References m_remapTable.

184 {
185  return m_remapTable[1];
186 }
static const ossimNormalizedU14RemapTable m_remapTable

◆ getNormalizedFloat()

void ossimU14ImageData::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 109 of file ossimU14ImageData.cpp.

References ossimDataObject::getDataObjectStatus(), ossimImageData::getUshortBuf(), ossimImageData::isValidBand(), m_remapTable, ossimNormalizedU14RemapTable::normFromPix(), and OSSIM_NULL.

112 {
113  if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
114  {
115  const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
116  result =
117  static_cast<float>(m_remapTable.normFromPix(sourceBuf[offset]));
118  }
119 }
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
unsigned short ossim_uint16
virtual ossim_float64 normFromPix(ossim_int32 pix) const
Gets a normalized value (between &#39;0.0&#39; and &#39;1.0&#39;) from a pixel value.
virtual bool isValidBand(ossim_uint32 band) const

◆ isNull()

bool ossimU14ImageData::isNull ( ossim_uint32  offset) const

Definition at line 353 of file ossimU14ImageData.cpp.

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

Referenced by computeAverageBandValue(), and computeMeanSquaredError().

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

◆ setNormalizedFloat()

void ossimU14ImageData::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 121 of file ossimU14ImageData.cpp.

References ossimDataObject::getDataObjectStatus(), ossimImageData::getUshortBuf(), ossimImageData::isValidBand(), m_remapTable, OSSIM_NULL, and ossimNormalizedU14RemapTable::pixFromNorm().

124 {
125  if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
126  {
127  ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
128  sourceBuf[offset]
129  = static_cast<ossim_uint16>(m_remapTable.pixFromNorm(inputValue));
130  }
131 }
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
unsigned short ossim_uint16
virtual bool isValidBand(ossim_uint32 band) const
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.

◆ setNull()

void ossimU14ImageData::setNull ( ossim_uint32  offset)

Definition at line 368 of file ossimU14ImageData.cpp.

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

369 {
370  ossim_uint32 bands = getNumberOfBands();
371  for(ossim_uint32 band = 0; band < bands; ++band)
372  {
373  ossim_uint16* buf = getUshortBuf(band)+offset;
374  *buf = (ossim_uint16)m_nullPixelValue[band];
375  }
376 }
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint16 * getUshortBuf() const
unsigned short ossim_uint16
unsigned int ossim_uint32
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.

◆ setValue()

void ossimU14ImageData::setValue ( long  x,
long  y,
double  color 
)
virtual

Definition at line 314 of file ossimU14ImageData.cpp.

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

315 {
316  if(m_dataBuffer.size() > 0 && isWithin(x, y))
317  {
318  //***
319  // Compute the offset into the buffer for (x,y). This should always
320  // come out positive.
321  //***
322  ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
323  ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
324 
325  ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
326 
327  for(ossim_uint32 band = 0; offset < m_dataBuffer.size() && // prevent buffer overrun
328  band < m_numberOfDataComponents; band++)
329  {
330  ossim_uint16* buf = getUshortBuf(band)+offset;
331  *buf = (ossim_uint16)color;
332  }
333  }
334 }
ossim_uint32 x
virtual const ossim_uint16 * getUshortBuf() const
ossim_uint32 y
unsigned short ossim_uint16
std::vector< ossim_uint8 > m_dataBuffer
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
ossim_int32 x
Definition: ossimIpt.h:141

◆ unnormalizeInput()

void ossimU14ImageData::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 206 of file ossimU14ImageData.cpp.

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

207 {
208  if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
209  (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
210  {
211  //ERROR
212  return;
213  }
214 
215  ossim_uint32 counter = 0;
216  ossim_uint32 bandCount = 0;
218  ossimScalarType scalarType = normalizedInput->getScalarType();
219 
220  if(size > 0)
221  {
222  if(scalarType == OSSIM_NORMALIZED_FLOAT)
223  {
224  for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
225  {
226  float* sourceBuf =
227  static_cast<float*>(normalizedInput->getBuf(bandCount));
228  ossim_uint16* resultBuf = getUshortBuf(bandCount);
229  for(counter = 0; counter < size; ++counter)
230  {
231  resultBuf[counter]
232  = static_cast<ossim_uint16>(m_remapTable.
233  pixFromNorm(sourceBuf[counter]));
234  }
235  }
236  }
237  else // Double
238  {
239  for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
240  {
241  double* sourceBuf =
242  static_cast<double*>(normalizedInput->getBuf(bandCount));
243  ossim_uint16* resultBuf = getUshortBuf(bandCount);
244  for(counter = 0; counter < size; ++counter)
245  {
246  resultBuf[counter]
247  = static_cast<ossim_uint16>(m_remapTable.
248  pixFromNorm(sourceBuf[counter]));
249  }
250  }
251  }
252  }
253 }
static const ossimNormalizedU14RemapTable m_remapTable
virtual const ossim_uint16 * getUshortBuf() const
unsigned short ossim_uint16
yy_size_t size
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

◆ validate()

ossimDataObjectStatus ossimU14ImageData::validate ( ) const
virtual

Reimplemented from ossimImageData.

Definition at line 76 of file ossimU14ImageData.cpp.

References ossimDataObject::getDataObjectStatus(), ossimImageData::getNumberOfBands(), ossimImageData::getSize(), ossimImageData::getSizePerBand(), ossimImageData::getUshortBuf(), ossimRectilinearDataObject::m_dataBuffer, OSSIM_EMPTY, OSSIM_FULL, OSSIM_NULL, OSSIM_PARTIAL, and ossimDataObject::setDataObjectStatus().

77 {
78  if (m_dataBuffer.size() == 0)
79  {
81  return OSSIM_NULL;
82  }
83 
84  ossim_uint32 count = 0;
85  const ossim_uint32 SIZE = getSize();
86  const ossim_uint32 BOUNDS = getSizePerBand();
87  const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
88 
89  for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
90  {
91  const ossim_uint16* p = getUshortBuf(band);
92  for (ossim_uint32 i=0; i<BOUNDS; ++i)
93  {
94  // check if the band is null
95  if (p[i] != 0) ++count;
96  }
97  }
98 
99  if (!count)
101  else if (count == SIZE)
103  else
105 
106  return getDataObjectStatus();
107 }
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint16 * getUshortBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
unsigned short ossim_uint16
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
virtual ossim_uint32 getSize() const
Returns the total number of pixels in a tile for all bands.
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.

Member Data Documentation

◆ m_remapTable

const ossimNormalizedU14RemapTable ossimU14ImageData::m_remapTable
staticprivate

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