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

#include <ossimU8ImageData.h>

Inheritance diagram for ossimU8ImageData:
ossimImageData ossimRectilinearDataObject ossimDataObject ossimObject ossimReferenced

Public Member Functions

 ossimU8ImageData (ossimSource *source=NULL, ossim_uint32 bands=1)
 
 ossimU8ImageData (ossimSource *source, ossim_uint32 bands, ossim_uint32 width, ossim_uint32 height)
 
 ossimU8ImageData (const ossimU8ImageData &rhs)
 
virtual ossimObjectdup () const
 
void fill (ossim_uint32 band, double value)
 
void fill (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 copyTileToNormalizedBuffer (float *buf) const
 
virtual void copyTileToNormalizedBuffer (ossim_uint32 band, double *buf) const
 
virtual void copyTileToNormalizedBuffer (ossim_uint32 band, float *buf) const
 
virtual void copyNormalizedBufferToTile (double *buf)
 
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 ~ossimU8ImageData ()
 
- 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 ossimNormalizedU8RemapTable 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 ossimU8ImageData.h.

Constructor & Destructor Documentation

◆ ossimU8ImageData() [1/3]

ossimU8ImageData::ossimU8ImageData ( ossimSource source = NULL,
ossim_uint32  bands = 1 
)

Definition at line 36 of file ossimU8ImageData.cpp.

Referenced by dup().

38  :
39  ossimImageData(source,
41  bands)
42 {
43 }
8 bit unsigned iteger

◆ ossimU8ImageData() [2/3]

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

Definition at line 45 of file ossimU8ImageData.cpp.

49  :
50  ossimImageData(source,
52  bands,
53  width,
54  height)
55 {
56 }
8 bit unsigned iteger

◆ ossimU8ImageData() [3/3]

ossimU8ImageData::ossimU8ImageData ( const ossimU8ImageData rhs)
inline

Definition at line 41 of file ossimU8ImageData.h.

42  :ossimImageData(rhs)
43  {}

◆ ~ossimU8ImageData()

ossimU8ImageData::~ossimU8ImageData ( )
protectedvirtual

Definition at line 58 of file ossimU8ImageData.cpp.

59 {
60 }

Member Function Documentation

◆ computeAverageBandValue()

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

This will compute the average value for the band.

Definition at line 288 of file ossimU8ImageData.cpp.

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

289 {
290  double result = 0.0;
291  ossim_uint32 index = 0;
292  ossim_uint32 validPixelCount=0;
293 
294  ossim_uint8* buffer = getUcharBuf(bandNumber);
295  if(buffer)
296  {
297  ossim_uint32 bounds = getWidth()*getHeight();
298  for(index = 0; index < bounds; ++index)
299  {
300  if(!isNull(index))
301  {
302  result += *buffer;
303  ++validPixelCount;
304  }
305  ++buffer;
306  }
307  if(validPixelCount > 0)
308  {
309  result /= validPixelCount;
310  }
311  }
312 
313  return result;
314 }
virtual ossim_uint32 getWidth() const
virtual const ossim_uint8 * getUcharBuf() const
virtual ossim_uint32 getHeight() const
bool isNull(ossim_uint32 offset) const
unsigned int ossim_uint32
unsigned char ossim_uint8

◆ computeMeanSquaredError()

double ossimU8ImageData::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 257 of file ossimU8ImageData.cpp.

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

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

◆ convertToNormalizedDouble()

void ossimU8ImageData::convertToNormalizedDouble ( ossimImageData result) const
virtual

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

Reimplemented from ossimImageData.

Definition at line 173 of file ossimU8ImageData.cpp.

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

174 {
175  if(!result)
176  {
177  return;
178  }
179 
180  // make sure that the types and width and height are
181  // good.
182  if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
183  (result->getNumberOfBands() != this->getNumberOfBands())||
184  (result->getWidth() != this->getWidth()) ||
185  (result->getHeight() != this->getHeight())||
186  (result->getDataObjectStatus() == OSSIM_NULL) ||
188  {
189  return;
190  }
191 
193 
194  if(size > 0)
195  {
196  for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
197  {
198  const ossim_uint8* sourceBuf = getUcharBuf(bandCount);
199  double* resultBuf = static_cast<double*>(result->getBuf(bandCount));
200  for(ossim_uint32 counter = 0; counter < size; ++counter)
201  {
202  resultBuf[counter] = m_remapTable.normFromPix(sourceBuf[counter]);
203  }
204  }
205  }
206 }
virtual ossim_uint32 getWidth() const
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint8 * getUcharBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual ossimScalarType getScalarType() const
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ convertToNormalizedFloat()

void ossimU8ImageData::convertToNormalizedFloat ( ossimImageData result) const
virtual

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

Reimplemented from ossimImageData.

Definition at line 137 of file ossimU8ImageData.cpp.

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

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

◆ copyNormalizedBufferToTile() [1/4]

void ossimU8ImageData::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 516 of file ossimU8ImageData.cpp.

References ossimImageData::getBuf(), ossimObject::getClassName(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), ossimImageData::getUcharBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), ossimNormalizedU8RemapTable::pixFromNorm(), and size.

517 {
518  if (!buf)
519  {
522  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
523  __FILE__,
524  __LINE__);
525  return;
526  }
527  if(!getBuf()) return;
529 
530  if(size > 0)
531  {
532  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
533  {
534  double* s = buf + (band*size); // source
535  ossim_uint8* d = getUcharBuf(band); // destination
536 
537  for(ossim_uint32 index = 0; index < size; ++index)
538  {
539  d[index] = m_remapTable.pixFromNorm(s[index]);
540  }
541  }
542  }
543 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.
unsigned char ossim_uint8

◆ copyNormalizedBufferToTile() [2/4]

void ossimU8ImageData::copyNormalizedBufferToTile ( float *  buf)
virtual

Reimplemented from ossimImageData.

Definition at line 545 of file ossimU8ImageData.cpp.

References ossimImageData::getBuf(), ossimObject::getClassName(), ossimImageData::getNumberOfBands(), ossimImageData::getSizePerBand(), ossimImageData::getUcharBuf(), m_remapTable, ossimErrorCodes::OSSIM_ERROR, ossimSetError(), ossimNormalizedU8RemapTable::pixFromNorm(), and size.

546 {
547  if (!buf)
548  {
551  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
552  __FILE__,
553  __LINE__);
554  return;
555  }
556  if(!getBuf()) return;
558 
559  if(size > 0)
560  {
561  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
562  {
563  float* s = buf + (band*size); // source
564  ossim_uint8* d = getUcharBuf(band); // destination
565 
566  for(ossim_uint32 index = 0; index < size; ++index)
567  {
568  d[index] = m_remapTable.pixFromNorm(s[index]);
569  }
570  }
571  }
572 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.
unsigned char ossim_uint8

◆ copyNormalizedBufferToTile() [3/4]

void ossimU8ImageData::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 574 of file ossimU8ImageData.cpp.

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

576 {
577  if (!buf)
578  {
581  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
582  __FILE__,
583  __LINE__);
584  return;
585  }
586  if(!getBuf(band)) return;
588 
589  if(size > 0)
590  {
591  double* s = buf; // source
592  ossim_uint8* d = getUcharBuf(band); // destination
593 
594  for(ossim_uint32 index = 0; index < size; ++index)
595  {
596  d[index] = m_remapTable.pixFromNorm(s[index]);
597  }
598  }
599 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.
unsigned char ossim_uint8

◆ copyNormalizedBufferToTile() [4/4]

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

Reimplemented from ossimImageData.

Definition at line 601 of file ossimU8ImageData.cpp.

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

603 {
604  if (!buf)
605  {
608  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
609  __FILE__,
610  __LINE__);
611  return;
612  }
613  if(!getBuf(band)) return;
615 
616  if(size > 0)
617  {
618  float* s = buf; // source
619  ossim_uint8* d = getUcharBuf(band); // destination
620 
621  for(ossim_uint32 index = 0; index < size; ++index)
622  {
623  d[index] = m_remapTable.pixFromNorm(s[index]);
624  }
625  }
626 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.
unsigned char ossim_uint8

◆ copyTileToNormalizedBuffer() [1/4]

void ossimU8ImageData::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 378 of file ossimU8ImageData.cpp.

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

379 {
380  if (!buf)
381  {
384  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
385  __FILE__,
386  __LINE__);
387  return;
388  }
390  if(!getBuf())
391  {
392  memset(buf, '\0', size);
393  return;
394  }
395 
396  if(size > 0)
397  {
398  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
399  {
400  const ossim_uint8* s = getUcharBuf(band); // source
401  double* d = buf + (band*size); // destination
402  if(s&&d)
403  {
404  for(ossim_uint32 index = 0; index < size; ++index)
405  {
406  d[index] = m_remapTable.
407  normFromPix(static_cast<ossim_int32>(s[index]));
408  }
409  }
410  }
411  }
412 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ copyTileToNormalizedBuffer() [2/4]

void ossimU8ImageData::copyTileToNormalizedBuffer ( float *  buf) const
virtual

Reimplemented from ossimImageData.

Definition at line 414 of file ossimU8ImageData.cpp.

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

415 {
416  if (!buf)
417  {
420  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
421  __FILE__,
422  __LINE__);
423  return;
424  }
426  if(!getBuf())
427  {
428  memset(buf, '\0', size);
429  return;
430  }
431 
432  if(size > 0)
433  {
434  for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
435  {
436  const ossim_uint8* s = getUcharBuf(band); // source
437  float* d = buf + (band*size); // destination
438  if(s&&d)
439  {
440  for(ossim_uint32 index = 0; index < size; ++index)
441  {
442  d[index] = m_remapTable.
443  normFromPix(static_cast<ossim_int32>(s[index]));
444  }
445  }
446  }
447  }
448 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ copyTileToNormalizedBuffer() [3/4]

void ossimU8ImageData::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 450 of file ossimU8ImageData.cpp.

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

452 {
453  if (!buf)
454  {
457  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
458  __FILE__,
459  __LINE__);
460  return;
461  }
463  if(!getBuf(band))
464  {
465  memset(buf, '\0', size);
466  return;
467  }
468 
469  if(size > 0)
470  {
471  const ossim_uint8* s = getUcharBuf(band); // source
472  double* d = buf; // destination
473  for(ossim_uint32 index = 0; index < size; ++index)
474  {
475  *d = m_remapTable.
476  normFromPix(static_cast<ossim_int32>(*s));
477  ++d;
478  ++s;
479  }
480  }
481 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ copyTileToNormalizedBuffer() [4/4]

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

Definition at line 483 of file ossimU8ImageData.cpp.

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

485 {
486  if (!buf)
487  {
490  "ossimU8ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
491  __FILE__,
492  __LINE__);
493  return;
494  }
496  if(!getBuf(band))
497  {
498  memset(buf, '\0', size);
499  return;
500  }
501 
502  if(size > 0)
503  {
504  const ossim_uint8* s = getUcharBuf(band); // source
505  float* d = buf; // destination
506  for(ossim_uint32 index = 0; index < size; ++index)
507  {
508  *d = m_remapTable.
509  normFromPix(static_cast<ossim_int32>(*s));
510  ++d;
511  ++s;
512  }
513  }
514 }
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
virtual const ossim_uint8 * getUcharBuf() const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
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
static const ossimNormalizedU8RemapTable m_remapTable
virtual const void * getBuf() const
unsigned char ossim_uint8

◆ dup()

ossimObject * ossimU8ImageData::dup ( ) const
virtual

Reimplemented from ossimImageData.

Definition at line 62 of file ossimU8ImageData.cpp.

References ossimU8ImageData().

63 {
64  return new ossimU8ImageData(*this);
65 }
ossimU8ImageData(ossimSource *source=NULL, ossim_uint32 bands=1)

◆ fill() [1/2]

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

will fill the entire band with the value.

Definition at line 337 of file ossimU8ImageData.cpp.

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

338 {
339  void* s = getBuf(band);
340 
341  if (s == NULL) return; // nothing to do...
342 
343  ossim_uint32 size_in_pixels = getSizePerBand();
344  ossim_uint8* p = getUcharBuf(band);
345  ossim_uint8 np = static_cast<ossim_uint8>(value);
346 
347  for (ossim_uint32 i=0; i<size_in_pixels; ++i) p[i] = np;
348 
349  // Set the status to unknown since we don't know about the other bands.
351 }
virtual const ossim_uint8 * getUcharBuf() const
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.
unsigned char ossim_uint8

◆ fill() [2/2]

void ossimU8ImageData::fill ( double  value)

Definition at line 67 of file ossimU8ImageData.cpp.

References ossimImageData::fill().

68 {
69  ossimImageData::fill(value);
70 }
void fill(ossim_uint32 band, ossim_float64 value)
will fill the entire band with the value.

◆ getMinNormalizedPix()

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

Reimplemented from ossimImageData.

Definition at line 170 of file ossimU8ImageData.h.

References m_remapTable.

171 {
172  return m_remapTable[1];
173 }
static const ossimNormalizedU8RemapTable m_remapTable

◆ getNormalizedFloat()

void ossimU8ImageData::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 106 of file ossimU8ImageData.cpp.

References ossimDataObject::getDataObjectStatus(), ossimImageData::getUcharBuf(), ossimImageData::isValidBand(), m_remapTable, ossimNormalizedU8RemapTable::normFromPix(), and OSSIM_NULL.

109 {
110  // make sure that the types and width and height are good.
111  if( (getDataObjectStatus() == OSSIM_NULL) && isValidBand(bandNumber) )
112  {
113  return;
114  }
115 
116  const ossim_uint8* sourceBuf = getUcharBuf(bandNumber);
117  result = static_cast<float>(m_remapTable.normFromPix(sourceBuf[offset]));
118 }
virtual const ossim_uint8 * getUcharBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
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.
static const ossimNormalizedU8RemapTable m_remapTable
virtual bool isValidBand(ossim_uint32 band) const
unsigned char ossim_uint8

◆ isNull()

bool ossimU8ImageData::isNull ( ossim_uint32  offset) const

Definition at line 354 of file ossimU8ImageData.cpp.

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

Referenced by computeAverageBandValue(), and computeMeanSquaredError().

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

◆ setNormalizedFloat()

void ossimU8ImageData::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 120 of file ossimU8ImageData.cpp.

References ossimDataObject::getDataObjectStatus(), ossimImageData::getNumberOfBands(), ossimImageData::getUcharBuf(), m_remapTable, OSSIM_NULL, and ossimNormalizedU8RemapTable::pixFromNorm().

123 {
124  // make sure that the types and width and height are
125  // good.
126  if((getDataObjectStatus() == OSSIM_NULL)&&
127  (bandNumber < getNumberOfBands()))
128  {
129  return;
130  }
131 
132  ossim_uint8* sourceBuf = getUcharBuf(bandNumber);
133  sourceBuf[offset]
134  = static_cast<ossim_uint8>(m_remapTable.pixFromNorm(inputValue));
135 }
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint8 * getUcharBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
static const ossimNormalizedU8RemapTable m_remapTable
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const
Returns an pixel value as an int from a normalized value.
unsigned char ossim_uint8

◆ setNull()

void ossimU8ImageData::setNull ( ossim_uint32  offset)

Definition at line 369 of file ossimU8ImageData.cpp.

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

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

◆ setValue()

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

Reimplemented from ossimImageData.

Definition at line 316 of file ossimU8ImageData.cpp.

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

317 {
318  if(getBuf() != NULL && isWithin(x, y))
319  {
320  //***
321  // Compute the offset into the buffer for (x,y). This should always
322  // come out positive.
323  //***
324  ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
325  ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
326 
327  ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
328 
329  for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
330  {
331  ossim_uint8* buf = getUcharBuf(band)+offset;
332  *buf = (ossim_uint8)color;
333  }
334  }
335 }
ossim_uint32 x
virtual const ossim_uint8 * getUcharBuf() const
ossim_uint32 y
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
unsigned char ossim_uint8

◆ unnormalizeInput()

void ossimU8ImageData::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 208 of file ossimU8ImageData.cpp.

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

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

◆ validate()

ossimDataObjectStatus ossimU8ImageData::validate ( ) const
virtual

Reimplemented from ossimImageData.

Definition at line 72 of file ossimU8ImageData.cpp.

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

73 {
74  if (m_dataBuffer.size() == 0)
75  {
77  return OSSIM_NULL;
78  }
79 
80  ossim_uint32 count = 0;
81  const ossim_uint32 SIZE = getSize();
82  const ossim_uint32 BOUNDS = getSizePerBand();
83  const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
84 
85  for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
86  {
87  const ossim_uint8* p = getUcharBuf(band);
89  for (ossim_uint32 i=0; i<BOUNDS; ++i)
90  {
91  // check if the band is null
92  if (p[i] != np) ++count;
93  }
94  }
95 
96  if (!count)
98  else if (count == SIZE)
100  else
102 
103  return getDataObjectStatus();
104 }
virtual ossim_uint32 getNumberOfBands() const
virtual const ossim_uint8 * getUcharBuf() const
virtual ossimDataObjectStatus getDataObjectStatus() const
std::vector< ossim_uint8 > m_dataBuffer
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
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.
unsigned char ossim_uint8

Member Data Documentation

◆ m_remapTable

const ossimNormalizedU8RemapTable ossimU8ImageData::m_remapTable
staticprivate

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