MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
LTISample Class Reference

basic properties of a sample More...

#include <lti_sample.h>

Public Member Functions

 LTISample (lt_uint16 srcBandIndex, LTIColor color, LTIDataType dataType, const void *data=NULL)
 default constructor More...
 
 LTISample ()
 
 LTISample (const LTISample &)
 copy constructor More...
 
virtual ~LTISample ()
 destructor More...
 
virtual LTISampleoperator= (const LTISample &)
 assignment operator More...
 
bool operator== (const LTISample &) const
 equality operator More...
 
bool operator!= (const LTISample &) const
 equality operator More...
 
lt_uint16 getSourceBandIndex () const
 get the sample source band index More...
 
LTIDataType getDataType () const
 get the sample datatype More...
 
LTIColor getColor () const
 get the color More...
 
void setPrecision (lt_uint32 precision)
 sets the precision of the sample More...
 
lt_uint32 getPrecision () const
 returns the precision of the sample More...
 
lt_uint32 getNumBytes () const
 get the size of a sample More...
 
LT_STATUS checkImpedance (const LTISample &sample) const
 returns status code comparing two samples More...
 
bool isValueMin () const
 is the sample value minimum More...
 
bool isValueMax () const
 is the sample value maximum More...
 
void setValueToMin ()
 sets the sample value minimum More...
 
void setValueToMax ()
 sets the sample value maximum More...
 
void setValueToMin (const LTISample &)
 sets the sample value minimum More...
 
void setValueToMax (const LTISample &)
 sets the sample value maximum More...
 
Sample value functions

Sets the sample's value to the value given.

The sample is assumed to be known to have the given datatype. (For the void* "addr" functions, the caller must assure datatype correctness underneath the void* pointer.)

void setValueAddr (const void *)
 
const void * getValueAddr () const
 
void setValueUint8 (lt_uint8)
 
void setValueUint16 (lt_uint16)
 
void setValueUint32 (lt_uint32)
 
void setValueSint8 (lt_int8)
 
void setValueSint16 (lt_int16)
 
void setValueSint32 (lt_int32)
 
void setValueFloat32 (float)
 
void setValueFloat64 (double)
 
lt_uint8 getValueUint8 () const
 
lt_uint16 getValueUint16 () const
 
lt_uint32 getValueUint32 () const
 
lt_int8 getValueSint8 () const
 
lt_int16 getValueSint16 () const
 
lt_int32 getValueSint32 () const
 
float getValueFloat32 () const
 
double getValueFloat64 () const
 
void setValueFromDouble (double)
 
double getValueAsDouble () const
 

Detailed Description

This class stores the basic properties of a sample: the color and the datatype. A set of one or more (possibly dissimilar) LTISample objects is used in the representation of a pixel (LTIPixel).

Definition at line 28 of file lti_sample.h.

Constructor & Destructor Documentation

LTISample::LTISample ( lt_uint16  srcBandIndex,
LTIColor  color,
LTIDataType  dataType,
const void *  data = NULL 
)

This constructor creates an LTISample object with the given properties.

Parameters
srcBandIndexthe location in the source image
colorthe sample's color
dataTypethe datatype of the sample
datainitial data for sample value (defaults to 0)
LTISample::LTISample ( )
LTISample::LTISample ( const LTISample )
virtual LTISample::~LTISample ( )
virtual

Member Function Documentation

LT_STATUS LTISample::checkImpedance ( const LTISample sample) const

Returns status code comparing two samples. This is just a different version of operator==, which returns a status code instead of a bool.

Parameters
samplethe sample to compare this sample to
Returns
a specific code indicating if impedance matches
LTIColor LTISample::getColor ( ) const

This function returns the color of the sample.

Returns
the color of the sample
LTIDataType LTISample::getDataType ( ) const

This function returns the datatype of the sample.

Returns
the datatype of the sample
lt_uint32 LTISample::getNumBytes ( ) const

This function returns the size of the sample, in bytes.

This is equivalent to calling LTITypes::getNumBytes(getDataType()).

Returns
the number of bytes in the sample
Examples:
DerivedImageReader.cpp, and DerivedImageWriter.cpp.
lt_uint32 LTISample::getPrecision ( ) const

Returns the precision of the sample.

Returns
the number of bits used in the datatype
lt_uint16 LTISample::getSourceBandIndex ( ) const

This function returns the source band index of the sample.

Returns
the source band index of the sample
const void* LTISample::getValueAddr ( ) const
double LTISample::getValueAsDouble ( ) const
Examples:
ImageInfo.cpp.
float LTISample::getValueFloat32 ( ) const
double LTISample::getValueFloat64 ( ) const
lt_int16 LTISample::getValueSint16 ( ) const
lt_int32 LTISample::getValueSint32 ( ) const
lt_int8 LTISample::getValueSint8 ( ) const
lt_uint16 LTISample::getValueUint16 ( ) const
lt_uint32 LTISample::getValueUint32 ( ) const
lt_uint8 LTISample::getValueUint8 ( ) const
bool LTISample::isValueMax ( ) const

Returns true if the sample's value is the datatype's maximum.

bool LTISample::isValueMin ( ) const

Returns true if the sample's value is the datatype's minimum.

bool LTISample::operator!= ( const LTISample ) const
virtual LTISample& LTISample::operator= ( const LTISample )
virtual
bool LTISample::operator== ( const LTISample ) const
void LTISample::setPrecision ( lt_uint32  precision)

Sets the precision of the sample. By default, the number of bits of precision is equal to the number of bits in the underlying datatype.

Note
The data is assumed to be justified to the least significant bit of the word.
Parameters
precisionthe number of bits
void LTISample::setValueAddr ( const void *  )
void LTISample::setValueFloat32 ( float  )
void LTISample::setValueFloat64 ( double  )
void LTISample::setValueFromDouble ( double  )
void LTISample::setValueSint16 ( lt_int16  )
void LTISample::setValueSint32 ( lt_int32  )
void LTISample::setValueSint8 ( lt_int8  )
void LTISample::setValueToMax ( )

Sets the sample's value to the datatype's maximum.

void LTISample::setValueToMax ( const LTISample )

Sets the sample's value to max of itself and the argument. (The argument sample assumed to have the same datatype.)

void LTISample::setValueToMin ( )

Sets the sample's value to the datatype's minimum.

void LTISample::setValueToMin ( const LTISample )

Sets the sample's value to the min of itself and the argument (The argument sample assumed to have the same datatype.)

void LTISample::setValueUint16 ( lt_uint16  )
void LTISample::setValueUint32 ( lt_uint32  )
void LTISample::setValueUint8 ( lt_uint8  )
Examples:
SceneBuffer.cpp.

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

LizardTech