MrSID Decode SDK for LiDAR Reference Manual  1.1.4.4709
ChannelData Class Reference

ChannelData adds sample values to the ChannelInfo class. More...

#include <PointData.h>

Inheritance diagram for ChannelData:
ChannelInfo

Public Member Functions

 ~ChannelData (void)
 
 ChannelData (void)
 
void init (const ChannelInfo &info, size_t numSamples)
 
size_t getNumSamples (void) const
 Get the number of samples. More...
 
const void * getData (void) const
 Get the data buffer. More...
 
void * getData (void)
 Get the data buffer. More...
 
void setDataType (DataType datatype)
 Channge the data type on the fly. More...
 
void resize (size_t newNumSamples)
 Resize the data buffer. More...
 
void setOffset (size_t offset)
 dirty hack – only use this if you're the buffer onwer More...
 
void setData (void *data, bool deleteData)
 change the buffer More...
 
- Public Member Functions inherited from ChannelInfo
 ~ChannelInfo (void)
 
 ChannelInfo (void)
 
void init (const char *name, DataType datatype, int bits, double quantization=0)
 
void init (const ChannelInfo &info)
 
const char * getName (void) const
 Get the name. More...
 
DataType getDataType (void) const
 Get the data type. More...
 
size_t getBits (void) const
 Get the bit precision. More...
 
double getQuantization (void) const
 Get the quantization scale. More...
 
void setQuantization (double value)
 
bool operator== (const ChannelInfo &rhs) const
 
bool operator!= (const ChannelInfo &rhs) const
 

Static Public Member Functions

static void copy (ChannelData &dst, size_t dstOffset, const ChannelData &src, size_t srcOffset, size_t length)
 Copy samples between channels. More...
 
static void convert (ChannelData &dst, size_t dstOffset, const ChannelData &src, size_t srcOffset, size_t length)
 Copy and convert the data type of samples between channel. More...
 
static void convert (ChannelData &dst, size_t dstOffset, const ChannelData &src, size_t srcOffset, double offset, double scale, size_t length)
 Copy and convert the data type of samples between channel. More...
 

Protected Attributes

size_t m_numSamples
 
size_t m_offset
 
void * m_data
 
bool m_deleteData
 
- Protected Attributes inherited from ChannelInfo
char * m_name
 
DataType m_datatype
 
int m_bits
 
double m_quantization
 

Detailed Description

Definition at line 290 of file PointData.h.

Constructor & Destructor Documentation

ChannelData::~ChannelData ( void  )
ChannelData::ChannelData ( void  )

Member Function Documentation

static void ChannelData::convert ( ChannelData dst,
size_t  dstOffset,
const ChannelData src,
size_t  srcOffset,
size_t  length 
)
static

This function does a datatype convertion as it copies the source samples into the destination channel. This function does not support changing between integral and floating point types.

Parameters
dstthe destination channel
dstOffsetthe first sample to overwrite
srcthe source channel
srcOffsetthe fisrt sample to copy
lengththe number of samples to copy
Note
The source and destination may not be the same object.
static void ChannelData::convert ( ChannelData dst,
size_t  dstOffset,
const ChannelData src,
size_t  srcOffset,
double  offset,
double  scale,
size_t  length 
)
static

This function does a datatype convertion as it copies the source samples into the destination channel. This function does support changing between integral and floating point types.

Parameters
dstthe destination channel
dstOffsetthe first sample to overwrite
srcthe source channel
srcOffsetthe fisrt sample to copy
offsetthe quantization offset
scalethe quantization scale
lengththe number of samples to copy
Note
The source and destination may not be the same object.
When converting integer to float: dst = scale * src + offset.
When converting float to integer: dst = floor((src - offset) / scale + 0.5)
static void ChannelData::copy ( ChannelData dst,
size_t  dstOffset,
const ChannelData src,
size_t  srcOffset,
size_t  length 
)
static
Parameters
dstthe destination channel
dstOffsetthe first sample to overwrite
srcthe source channel
srcOffsetthe fisrt sample to copy
lengththe number of samples to copy
Note
The source and destination data types must be the same. The source and destination may be the same object and sample ranges may overlap.
const void* ChannelData::getData ( void  ) const

This method returns the data buffer. The caller must cast it to the appropriate datatype.

See also
getDataType()
void* ChannelData::getData ( void  )

This method returns the data buffer. The caller must cast it to the appropriate datatype.

See also
getDataType()
size_t ChannelData::getNumSamples ( void  ) const

This method returns the maximum number of samples that can be stored in the object.

void ChannelData::init ( const ChannelInfo info,
size_t  numSamples 
)
void ChannelData::resize ( size_t  newNumSamples)

This method change the size of the data buffer.

Parameters
newNumSamplesthe new size of the buffer
void ChannelData::setData ( void *  data,
bool  deleteData 
)
void ChannelData::setDataType ( DataType  datatype)

This method is used to change the data type on the fly. Use with care and it should only be used went the new data type is smaller than the old data type.

Note
internal LizardTech use only.
void ChannelData::setOffset ( size_t  offset)

Member Data Documentation

void* ChannelData::m_data
protected

Definition at line 415 of file PointData.h.

bool ChannelData::m_deleteData
protected

Definition at line 416 of file PointData.h.

size_t ChannelData::m_numSamples
protected

Definition at line 413 of file PointData.h.

size_t ChannelData::m_offset
protected

Definition at line 414 of file PointData.h.


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

LizardTech