MrSID Decode SDK for Raster Reference Manual
9.0.0.3864
|
basic properties of a pixel More...
#include <lti_pixel.h>
Public Member Functions | |
LTIPixel (void) | |
constructor | |
LTIPixel (LTIColorSpace colorSpace, lt_uint16 numBands, LTIDataType dataType, const LTISample *samples=NULL) | |
constructor | |
LTIPixel (const LTIPixel &pixel, const lt_uint16 *bandSelection, lt_uint16 numBands) | |
constructor | |
LTIPixel (const LTISample *samples, lt_uint16 numBands, LTIColorSpace colorSpace=LTI_COLORSPACE_INVALID) | |
constructor | |
LTIPixel (const LTIPixel &) | |
copy constructor | |
virtual | ~LTIPixel () |
destructor | |
LTIPixel & | operator= (const LTIPixel &) |
assignment operator | |
bool | operator== (const LTIPixel &) const |
equality operator | |
bool | operator!= (const LTIPixel &) const |
equality operator | |
lt_uint16 | getNumBands () const |
get the number of bands | |
lt_uint16 | getNumBandsWithoutAlpha () const |
get the number of bands not counting alpha | |
LTIDataType | getDataType () const |
get the sample datatype | |
bool | isSignedData () const |
LTIColorSpace | getColorSpace () const |
get the colorspace | |
LTIColorSpace | getColorSpaceWithoutAlpha () const |
get the colorspace without alpha | |
bool | hasAlphaBand () const |
returns true if colorspace has alpha channel flags | |
bool | hasPreMultipliedAlphaBand () const |
returns true if colorspace has the pre-multiplied lpha channel flag | |
lt_uint32 | getNumBytes () const |
get the size of a pixel | |
lt_uint32 | getNumBytesWithoutAlpha () const |
get the size of a pixel not counting the alpha band | |
lt_uint32 | getMaxBytesPerSample () const |
returns the largest size of any sample | |
LT_STATUS | checkImpedance (const LTIPixel &pixel, bool enforceColorSpace=true) const |
returns status code comparing two pixels | |
LT_STATUS | checkImpedanceWithoutAlpha (const LTIPixel &pixel) const |
LTISample * | getSamples () const |
LTISample & | getSample (lt_uint16) const |
LT_STATUS | getBandSelection (lt_uint16 *&bandSelection) const |
Helper functions to get sample values | |
const void * | getSampleValueAddr (lt_uint16 band) const |
returns the address of the specified sample's value | |
lt_uint8 | getSampleValueUint8 (lt_uint16 band) const |
returns the specified sample's value | |
lt_int8 | getSampleValueSint8 (lt_uint16 band) const |
returns the specified sample's value | |
lt_uint16 | getSampleValueUint16 (lt_uint16 band) const |
returns the specified sample's value | |
lt_int16 | getSampleValueSint16 (lt_uint16 band) const |
returns the specified sample's value | |
lt_uint32 | getSampleValueUint32 (lt_uint16 band) const |
returns the specified sample's value | |
lt_int32 | getSampleValueSint32 (lt_uint16 band) const |
returns the specified sample's value | |
float | getSampleValueFloat32 (lt_uint16 band) const |
returns the specified sample's value | |
double | getSampleValueFloat64 (lt_uint16 band) const |
returns the specified sample's value | |
bool | areSampleValuesMin () const |
are all samples equal to the minimum value | |
bool | areSampleValuesMax () const |
are all samples equal to the maximum value | |
Helper functions to set sample values | |
void | setSampleValuesToMin () |
sets all samples to minimum | |
void | setSampleValuesToMax () |
sets all samples to maximum | |
void | setSampleValueAddr (lt_uint16 band, const void *data) const |
sets sample value by address | |
void | setSampleValuesUint8 (lt_uint8 value) |
sets all samples to the given value | |
void | setSampleValuesSint8 (lt_int8 value) |
sets all samples to the given value | |
void | setSampleValuesUint16 (lt_uint16 value) |
sets all samples to the given value | |
void | setSampleValuesSint16 (lt_int16 value) |
sets all samples to the given value | |
void | setSampleValuesUint32 (lt_uint32 value) |
sets all samples to the given value | |
void | setSampleValuesSint32 (lt_int32 value) |
sets all samples to the given value | |
void | setSampleValuesFloat32 (float value) |
sets all samples to the given value | |
void | setSampleValuesFloat64 (double value) |
sets all samples to the given value | |
void | setSampleValuesFromDouble (double value) |
sets all samples to the given value | |
void | setSampleValueUint8 (lt_uint16 band, lt_uint8 value) |
sets the given sample to the given value | |
void | setSampleValueSint8 (lt_uint16 band, lt_int8 value) |
sets the given sample to the given value | |
void | setSampleValueUint16 (lt_uint16 band, lt_uint16 value) |
sets the given sample to the given value | |
void | setSampleValueSint16 (lt_uint16 band, lt_int16 value) |
sets the given sample to the given value | |
void | setSampleValueUint32 (lt_uint16 band, lt_uint32 value) |
sets the given sample to the given value | |
void | setSampleValueSint32 (lt_uint16 band, lt_int32 value) |
sets the given sample to the given value | |
void | setSampleValueFloat32 (lt_uint16 band, float value) |
sets the given sample to the given value | |
void | setSampleValueFloat64 (lt_uint16 band, double value) |
sets the given sample to the given value | |
void | setSampleValuesUint8 (const lt_uint8 values[]) |
sets all samples to the given values | |
void | setSampleValuesSint8 (const lt_int8 values[]) |
sets all samples to the given values | |
void | setSampleValuesUint16 (const lt_uint16 values[]) |
sets all samples to the given values | |
void | setSampleValuesSint16 (const lt_int16 values[]) |
sets all samples to the given values | |
void | setSampleValuesUint32 (const lt_uint32 values[]) |
sets all samples to the given values | |
void | setSampleValuesSint32 (const lt_int32 values[]) |
sets all samples to the given values | |
void | setSampleValuesFloat32 (const float values[]) |
sets all samples to the given values | |
void | setSampleValuesFloat64 (const double values[]) |
sets all samples to the given values | |
Static Public Member Functions | |
static LT_STATUS | checkCompatible (const LTIPixel &dstPixelProps, const LTIPixel &srcPixelProps) |
This class stores the basic properties of a pixel:
This is done by representing the pixel as a set of samples. Since the colorspace cannot in general be inferred from the colors in the samples, the user must declare the colorspace for the pixel.
Definition at line 36 of file lti_pixel.h.
LTIPixel::LTIPixel | ( | void | ) |
This constructor creates an invaild LTIPixel object.
LTIPixel::LTIPixel | ( | LTIColorSpace | colorSpace, |
lt_uint16 | numBands, | ||
LTIDataType | dataType, | ||
const LTISample * | samples = NULL |
||
) |
This constructor creates an LTIPixel object with the given properties: all the samples will be of the same type.
colorSpace | the pixel colorspace |
numBands | the number of bands (samples per pixel) |
dataType | the datatype of the samples |
samples | optional sample objects (default is uint8 set to 0) |
LTIPixel::LTIPixel | ( | const LTIPixel & | pixel, |
const lt_uint16 * | bandSelection, | ||
lt_uint16 | numBands | ||
) |
TBD
pixel | the pixel to copy |
bandSelection | the band to choose (if NULL use the first numBands) |
numBands | the length of bandSeclection |
keepAlpha |
LTIPixel::LTIPixel | ( | const LTISample * | samples, |
lt_uint16 | numBands, | ||
LTIColorSpace | colorSpace = LTI_COLORSPACE_INVALID |
||
) |
This constructor creates an LTIPixel object made up of the given sample types. If the colorspace given is LTI_COLORSPACE_INVALID, then the function will attempt to infer the colorspace from the underlying samples; if there is no obvious colorspace, e.g. RGB, the LTI_COLORSPACE_MULTISPECTRAL will be used.
samples | the samples of the pixel |
numBands | the number of bands (samples per pixel) |
colorSpace | the overall colorspace |
LTIPixel::LTIPixel | ( | const LTIPixel & | ) |
virtual LTIPixel::~LTIPixel | ( | ) | [virtual] |
bool LTIPixel::areSampleValuesMax | ( | ) | const |
Returns true if all samples are the the maximum value of the datatype.
bool LTIPixel::areSampleValuesMin | ( | ) | const |
Returns true if all samples are the the minimum value of the datatype.
static LT_STATUS LTIPixel::checkCompatible | ( | const LTIPixel & | dstPixelProps, |
const LTIPixel & | srcPixelProps | ||
) | [static] |
LT_STATUS LTIPixel::checkImpedance | ( | const LTIPixel & | pixel, |
bool | enforceColorSpace = true |
||
) | const |
Returns status code comparing two pixels. This is just a different version of operator==, which returns a status code instead of a bool.
pixel | the sample to compare this sample to |
LT_STATUS LTIPixel::checkImpedanceWithoutAlpha | ( | const LTIPixel & | pixel | ) | const |
LT_STATUS LTIPixel::getBandSelection | ( | lt_uint16 *& | bandSelection | ) | const |
LTIColorSpace LTIPixel::getColorSpace | ( | ) | const |
This function returns the colorspace of the pixel.
This function returns the colorspace of the pixel.
LTIDataType LTIPixel::getDataType | ( | ) | const |
This function returns the datatype of the samples. Returns LTI_DATATYPE_INVALID if the samples are not all the same datatype.
lt_uint32 LTIPixel::getMaxBytesPerSample | ( | ) | const |
Returns the largest size of any sample. This is equivalent to the computing the maximum of getBytesPerSample() for each of the samples.
lt_uint16 LTIPixel::getNumBands | ( | ) | const |
This function returns the number of bands in the pixel (samples per pixel).
lt_uint16 LTIPixel::getNumBandsWithoutAlpha | ( | ) | const |
This function returns the number of bands in the pixel (samples per pixel).
lt_uint32 LTIPixel::getNumBytes | ( | ) | const |
This function returns the size of a single pixel, in bytes.
This is equivalent to the sum of getBytesPerSample() for each of the samples.
lt_uint32 LTIPixel::getNumBytesWithoutAlpha | ( | ) | const |
This function returns the size of a single pixel, in bytes.
This is equivalent to the sum of getBytesPerSample() for each of the samples.
LTISample& LTIPixel::getSample | ( | lt_uint16 | ) | const |
LTISample* LTIPixel::getSamples | ( | ) | const |
const void* LTIPixel::getSampleValueAddr | ( | lt_uint16 | band | ) | const |
Returns the address of the specified sample's value. The caller must cast the pointer to the appropriate type before using.
band | the band number of the sample to use |
float LTIPixel::getSampleValueFloat32 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the FLOAT32 datatype.
band | the band number of the sample to use |
double LTIPixel::getSampleValueFloat64 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the FLOAT64 datatype.
band | the band number of the sample to use |
lt_int16 LTIPixel::getSampleValueSint16 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the SINT16 datatype.
band | the band number of the sample to use |
lt_int32 LTIPixel::getSampleValueSint32 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the SINT32 datatype.
band | the band number of the sample to use |
lt_int8 LTIPixel::getSampleValueSint8 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the SINT8 datatype.
band | the band number of the sample to use |
lt_uint16 LTIPixel::getSampleValueUint16 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the UINT16 datatype.
band | the band number of the sample to use |
lt_uint32 LTIPixel::getSampleValueUint32 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the UINT32 datatype.
band | the band number of the sample to use |
lt_uint8 LTIPixel::getSampleValueUint8 | ( | lt_uint16 | band | ) | const |
Returns the specified sample's value. The sample is assumed to be known to have the UINT8 datatype.
band | the band number of the sample to use |
bool LTIPixel::hasAlphaBand | ( | ) | const |
bool LTIPixel::hasPreMultipliedAlphaBand | ( | ) | const |
bool LTIPixel::isSignedData | ( | ) | const |
bool LTIPixel::operator!= | ( | const LTIPixel & | ) | const |
bool LTIPixel::operator== | ( | const LTIPixel & | ) | const |
void LTIPixel::setSampleValueAddr | ( | lt_uint16 | band, |
const void * | data | ||
) | const |
Sets sample value to value pointed to.
band | which sample to set |
data | value to use |
void LTIPixel::setSampleValueFloat32 | ( | lt_uint16 | band, |
float | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the FLOAT32 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |
void LTIPixel::setSampleValueFloat64 | ( | lt_uint16 | band, |
double | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the FLOAT64 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |
void LTIPixel::setSampleValuesFloat32 | ( | float | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the FLOAT32 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesFloat32 | ( | const float | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the FLOAT32 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValuesFloat64 | ( | double | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the FLOAT64 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesFloat64 | ( | const double | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the FLOAT64 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValuesFromDouble | ( | double | value | ) |
Sets all samples to the given value. The value will be coerced to each sample's actual datatype.
void LTIPixel::setSampleValueSint16 | ( | lt_uint16 | band, |
lt_int16 | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the SINT16 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |
void LTIPixel::setSampleValueSint32 | ( | lt_uint16 | band, |
lt_int32 | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the SINT32 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |
void LTIPixel::setSampleValueSint8 | ( | lt_uint16 | band, |
lt_int8 | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the SINT8 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |
void LTIPixel::setSampleValuesSint16 | ( | lt_int16 | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the SINT16 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesSint16 | ( | const lt_int16 | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the SINT16 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValuesSint32 | ( | lt_int32 | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the SINT32 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesSint32 | ( | const lt_int32 | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the SINT32 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValuesSint8 | ( | lt_int8 | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the SINT8 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesSint8 | ( | const lt_int8 | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the SINT8 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValuesToMax | ( | ) |
Sets all samples to the maximum value of the datatype.
void LTIPixel::setSampleValuesToMin | ( | ) |
Sets all samples to the minimum value of the datatype.
void LTIPixel::setSampleValuesUint16 | ( | lt_uint16 | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the UINT16 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesUint16 | ( | const lt_uint16 | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the UINT16 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValuesUint32 | ( | lt_uint32 | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the UINT32 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesUint32 | ( | const lt_uint32 | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the UINT32 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValuesUint8 | ( | lt_uint8 | value | ) |
Sets all samples to the given value of the datatype. The samples are assumed to be known to have the UINT8 datatype.
value | the value to set the samples to |
void LTIPixel::setSampleValuesUint8 | ( | const lt_uint8 | values[] | ) |
Sets all samples to the given values of the datatype. The sample is assumed to be known to have the UINT8 datatype.
values | the values to set the samples to |
void LTIPixel::setSampleValueUint16 | ( | lt_uint16 | band, |
lt_uint16 | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the UINT16 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |
void LTIPixel::setSampleValueUint32 | ( | lt_uint16 | band, |
lt_uint32 | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the UINT32 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |
void LTIPixel::setSampleValueUint8 | ( | lt_uint16 | band, |
lt_uint8 | value | ||
) |
Sets the given sample to the given value of the datatype. The sample is assumed to be known to have the UINT8 datatype.
band | the band number of the sample to use |
value | the value to set the samples to |