MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
LTISample Class Reference

basic properties of a sample More...

#include <lti_sample.h>

List of all members.

Public Member Functions

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

This function returns the color of the sample.

Returns:
the color of the sample

This function returns the datatype of the sample.

Returns:
the datatype of the sample

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.

Returns the precision of the sample.

Returns:
the number of bits used in the datatype

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
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  )

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.)

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.)


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