MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
LTIPixel Class Reference

basic properties of a pixel More...

#include <lti_pixel.h>

Inheritance diagram for LTIPixel:
LTIPixelLookupTable

Public Member Functions

 LTIPixel (void)
 constructor More...
 
 LTIPixel (LTIColorSpace colorSpace, lt_uint16 numBands, LTIDataType dataType, const LTISample *samples=NULL)
 constructor More...
 
 LTIPixel (const LTIPixel &pixel, const lt_uint16 *bandSelection, lt_uint16 numBands)
 constructor More...
 
 LTIPixel (const LTIPixel &pixel, const lt_uint16 *bandSelection, lt_uint16 numBands, LTIColorSpace colorSpace)
 constructor More...
 
 LTIPixel (const LTISample *samples, lt_uint16 numBands, LTIColorSpace colorSpace=LTI_COLORSPACE_INVALID)
 constructor More...
 
 LTIPixel (const LTIPixel &)
 copy constructor More...
 
virtual ~LTIPixel ()
 destructor More...
 
LTIPixeloperator= (const LTIPixel &)
 assignment operator More...
 
bool operator== (const LTIPixel &) const
 equality operator More...
 
bool operator!= (const LTIPixel &) const
 equality operator More...
 
lt_uint16 getNumBands () const
 get the number of bands More...
 
lt_uint16 getNumBandsWithoutAlpha () const
 get the number of bands not counting alpha More...
 
LTIDataType getDataType () const
 get the sample datatype More...
 
bool isSignedData () const
 
LTIColorSpace getColorSpace () const
 get the colorspace More...
 
LTIColorSpace getColorSpaceWithoutAlpha () const
 get the colorspace without alpha More...
 
bool hasAlphaBand () const
 returns true if colorspace has alpha channel flags More...
 
bool hasPreMultipliedAlphaBand () const
 returns true if colorspace has the pre-multiplied alpha channel flag More...
 
bool isMultiSpectral () const
 returns true if the pixel has multi-spectral bands More...
 
lt_uint32 getNumBytes () const
 get the size of a pixel More...
 
lt_uint32 getNumBytesWithoutAlpha () const
 get the size of a pixel not counting the alpha band More...
 
lt_uint32 getMaxBytesPerSample () const
 returns the largest size of any sample More...
 
LT_STATUS checkImpedance (const LTIPixel &pixel, bool enforceColorSpace=true) const
 returns status code comparing two pixels More...
 
LT_STATUS checkImpedanceWithoutAlpha (const LTIPixel &pixel) const
 
LTISamplegetSamples () const
 
LTISamplegetSample (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 More...
 
lt_uint8 getSampleValueUint8 (lt_uint16 band) const
 returns the specified sample's value More...
 
lt_int8 getSampleValueSint8 (lt_uint16 band) const
 returns the specified sample's value More...
 
lt_uint16 getSampleValueUint16 (lt_uint16 band) const
 returns the specified sample's value More...
 
lt_int16 getSampleValueSint16 (lt_uint16 band) const
 returns the specified sample's value More...
 
lt_uint32 getSampleValueUint32 (lt_uint16 band) const
 returns the specified sample's value More...
 
lt_int32 getSampleValueSint32 (lt_uint16 band) const
 returns the specified sample's value More...
 
float getSampleValueFloat32 (lt_uint16 band) const
 returns the specified sample's value More...
 
double getSampleValueFloat64 (lt_uint16 band) const
 returns the specified sample's value More...
 
bool areSampleValuesMin () const
 are all samples equal to the minimum value More...
 
bool areSampleValuesMax () const
 are all samples equal to the maximum value More...
 
Helper functions to set sample values
void setSampleValuesToMin ()
 sets all samples to minimum More...
 
void setSampleValuesToMax ()
 sets all samples to maximum More...
 
void setSampleValueAddr (lt_uint16 band, const void *data) const
 sets sample value by address More...
 
void setSampleValuesUint8 (lt_uint8 value)
 sets all samples to the given value More...
 
void setSampleValuesSint8 (lt_int8 value)
 sets all samples to the given value More...
 
void setSampleValuesUint16 (lt_uint16 value)
 sets all samples to the given value More...
 
void setSampleValuesSint16 (lt_int16 value)
 sets all samples to the given value More...
 
void setSampleValuesUint32 (lt_uint32 value)
 sets all samples to the given value More...
 
void setSampleValuesSint32 (lt_int32 value)
 sets all samples to the given value More...
 
void setSampleValuesFloat32 (float value)
 sets all samples to the given value More...
 
void setSampleValuesFloat64 (double value)
 sets all samples to the given value More...
 
void setSampleValuesFromDouble (double value)
 sets all samples to the given value More...
 
void setNonAlphaSampleValuesFromDouble (double value)
 sets all samples to minimum More...
 
void setSampleValuesFromPixel (const LTIPixel &src)
 sets all samples to minimum More...
 
void setNonAlphaSampleValuesFromPixel (const LTIPixel &src)
 sets all samples to minimum More...
 
void setSampleValueUint8 (lt_uint16 band, lt_uint8 value)
 sets the given sample to the given value More...
 
void setSampleValueSint8 (lt_uint16 band, lt_int8 value)
 sets the given sample to the given value More...
 
void setSampleValueUint16 (lt_uint16 band, lt_uint16 value)
 sets the given sample to the given value More...
 
void setSampleValueSint16 (lt_uint16 band, lt_int16 value)
 sets the given sample to the given value More...
 
void setSampleValueUint32 (lt_uint16 band, lt_uint32 value)
 sets the given sample to the given value More...
 
void setSampleValueSint32 (lt_uint16 band, lt_int32 value)
 sets the given sample to the given value More...
 
void setSampleValueFloat32 (lt_uint16 band, float value)
 sets the given sample to the given value More...
 
void setSampleValueFloat64 (lt_uint16 band, double value)
 sets the given sample to the given value More...
 
void setSampleValuesUint8 (const lt_uint8 values[])
 sets all samples to the given values More...
 
void setSampleValuesSint8 (const lt_int8 values[])
 sets all samples to the given values More...
 
void setSampleValuesUint16 (const lt_uint16 values[])
 sets all samples to the given values More...
 
void setSampleValuesSint16 (const lt_int16 values[])
 sets all samples to the given values More...
 
void setSampleValuesUint32 (const lt_uint32 values[])
 sets all samples to the given values More...
 
void setSampleValuesSint32 (const lt_int32 values[])
 sets all samples to the given values More...
 
void setSampleValuesFloat32 (const float values[])
 sets all samples to the given values More...
 
void setSampleValuesFloat64 (const double values[])
 sets all samples to the given values More...
 

Static Public Member Functions

static LT_STATUS checkCompatible (const LTIPixel &dstPixelProps, const LTIPixel &srcPixelProps)
 checks to ensure band mapping is valid More...
 

Detailed Description

This class stores the basic properties of a pixel:

  • the number of bands
  • the colorspace
  • the datatype

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.

Examples:
DecodeMrSIDBandSelection.cpp, DerivedImageFilter.cpp, DerivedImageReader.cpp, DerivedImageWriter.cpp, ImageInfo.cpp, Pipeline.cpp, and SceneBuffer.cpp.

Definition at line 36 of file lti_pixel.h.

Constructor & Destructor Documentation

§ LTIPixel() [1/6]

LTIPixel::LTIPixel ( void  )

This constructor creates an invalid LTIPixel object.

§ LTIPixel() [2/6]

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.

Parameters
colorSpacethe pixel colorspace
numBandsthe number of bands (samples per pixel)
dataTypethe datatype of the samples
samplesoptional sample objects (default is uint8 set to 0)

§ LTIPixel() [3/6]

LTIPixel::LTIPixel ( const LTIPixel pixel,
const lt_uint16 bandSelection,
lt_uint16  numBands 
)

TBD

Parameters
pixelthe pixel to copy
bandSelectionthe band to choose (if NULL use the first numBands)
numBandsthe length of bandSelection
keepAlpha

§ LTIPixel() [4/6]

LTIPixel::LTIPixel ( const LTIPixel pixel,
const lt_uint16 bandSelection,
lt_uint16  numBands,
LTIColorSpace  colorSpace 
)

TBD

Parameters
pixelthe pixel to copy
bandSelectionthe band to choose (if NULL use the first numBands)
numBandsthe length of bandSeclection
colorSpace

§ LTIPixel() [5/6]

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.

Parameters
samplesthe samples of the pixel
numBandsthe number of bands (samples per pixel)
colorSpacethe overall colorspace

§ LTIPixel() [6/6]

LTIPixel::LTIPixel ( const LTIPixel )

§ ~LTIPixel()

virtual LTIPixel::~LTIPixel ( )
virtual

Member Function Documentation

§ areSampleValuesMax()

bool LTIPixel::areSampleValuesMax ( ) const

Returns true if all samples are the the maximum value of the datatype.

§ areSampleValuesMin()

bool LTIPixel::areSampleValuesMin ( ) const

Returns true if all samples are the the minimum value of the datatype.

§ checkCompatible()

static LT_STATUS LTIPixel::checkCompatible ( const LTIPixel dstPixelProps,
const LTIPixel srcPixelProps 
)
static

This checks that the datatypes are the same and that the bandmapping in dstPixelProps is valid for the srcPixelProps (that is, you can't ask for the 5th band of a 3-banded image)

Parameters
dstPixelPropshas the subset of the bands we are interested in
srcPixelPropshas all the bands

§ checkImpedance()

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.

Parameters
pixelthe sample to compare this sample to
Returns
a specific code indicating if impedance matches

§ checkImpedanceWithoutAlpha()

LT_STATUS LTIPixel::checkImpedanceWithoutAlpha ( const LTIPixel pixel) const

§ getBandSelection()

LT_STATUS LTIPixel::getBandSelection ( lt_uint16 *&  bandSelection) const

§ getColorSpace()

LTIColorSpace LTIPixel::getColorSpace ( ) const

This function returns the colorspace of the pixel.

Returns
the colorspace of the pixel

§ getColorSpaceWithoutAlpha()

LTIColorSpace LTIPixel::getColorSpaceWithoutAlpha ( ) const

This function returns the colorspace of the pixel.

Returns
the colorspace of the pixel

§ getDataType()

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.

Returns
the datatype of the samples
Examples:
DerivedImageReader.cpp, and DerivedImageWriter.cpp.

§ getMaxBytesPerSample()

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.

Returns
the number of bytes per sample

§ getNumBands()

lt_uint16 LTIPixel::getNumBands ( ) const

This function returns the number of bands in the pixel (samples per pixel).

Returns
the number of bands
Examples:
ImageInfo.cpp.

§ getNumBandsWithoutAlpha()

lt_uint16 LTIPixel::getNumBandsWithoutAlpha ( ) const

This function returns the number of bands in the pixel (samples per pixel).

Returns
the number of bands without counting the alpha band

§ getNumBytes()

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.

Returns
the number of bytes per pixel
Examples:
DerivedImageReader.cpp, and DerivedImageWriter.cpp.

§ getNumBytesWithoutAlpha()

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.

Returns
the number of bytes per pixel

§ getSample()

§ getSamples()

LTISample* LTIPixel::getSamples ( ) const

§ getSampleValueAddr()

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.

Parameters
bandthe band number of the sample to use
Returns
the address of the sample's value

§ getSampleValueFloat32()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ getSampleValueFloat64()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ getSampleValueSint16()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ getSampleValueSint32()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ getSampleValueSint8()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ getSampleValueUint16()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ getSampleValueUint32()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ getSampleValueUint8()

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.

Parameters
bandthe band number of the sample to use
Returns
the sample's value

§ hasAlphaBand()

bool LTIPixel::hasAlphaBand ( ) const
Returns
true for colorspaces with alpha channel flags

§ hasPreMultipliedAlphaBand()

bool LTIPixel::hasPreMultipliedAlphaBand ( ) const
Returns
true for colorspaces with pre-multiplied alpha channel flag

§ isMultiSpectral()

bool LTIPixel::isMultiSpectral ( ) const

§ isSignedData()

bool LTIPixel::isSignedData ( ) const

§ operator!=()

bool LTIPixel::operator!= ( const LTIPixel ) const

§ operator=()

LTIPixel& LTIPixel::operator= ( const LTIPixel )

§ operator==()

bool LTIPixel::operator== ( const LTIPixel ) const

§ setNonAlphaSampleValuesFromDouble()

void LTIPixel::setNonAlphaSampleValuesFromDouble ( double  value)

Sets all samples to the minimum value of the datatype.

§ setNonAlphaSampleValuesFromPixel()

void LTIPixel::setNonAlphaSampleValuesFromPixel ( const LTIPixel src)

§ setSampleValueAddr()

void LTIPixel::setSampleValueAddr ( lt_uint16  band,
const void *  data 
) const

Sets sample value to value pointed to.

Parameters
bandwhich sample to set
datavalue to use

§ setSampleValueFloat32()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

§ setSampleValueFloat64()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

§ setSampleValuesFloat32() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesFloat32() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValuesFloat64() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesFloat64() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValuesFromDouble()

void LTIPixel::setSampleValuesFromDouble ( double  value)

Sets all samples to the given value. The value will be coerced to each sample's actual datatype.

§ setSampleValuesFromPixel()

void LTIPixel::setSampleValuesFromPixel ( const LTIPixel src)

Sets all samples to the minimum value of the datatype.

§ setSampleValueSint16()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

§ setSampleValueSint32()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

§ setSampleValueSint8()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

§ setSampleValuesSint16() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesSint16() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValuesSint32() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesSint32() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValuesSint8() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesSint8() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValuesToMax()

void LTIPixel::setSampleValuesToMax ( )

Sets all samples to the maximum value of the datatype.

§ setSampleValuesToMin()

void LTIPixel::setSampleValuesToMin ( )

Sets all samples to the minimum value of the datatype.

§ setSampleValuesUint16() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesUint16() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValuesUint32() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesUint32() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValuesUint8() [1/2]

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.

Parameters
valuethe value to set the samples to

§ setSampleValuesUint8() [2/2]

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.

Parameters
valuesthe values to set the samples to

§ setSampleValueUint16()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

§ setSampleValueUint32()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

§ setSampleValueUint8()

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.

Parameters
bandthe band number of the sample to use
valuethe value to set the samples to

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

LizardTech