ChannelData Class Reference

ChannelData adds sample values to the ChannelInfo class.

#include <PointData.h>

Inheritance diagram for ChannelData:
ChannelInfo

List of all members.

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.
const void * getData (void) const
 Get the data buffer.
void * getData (void)
 Get the data buffer.
void setDataType (DataType datatype)
 Channge the data type on the fly.
void resize (size_t newNumSamples)
 Resize the data buffer.
void setOffset (size_t offset)
 dirty hack -- only use this if you're the buffer onwer

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

Protected Attributes

size_t m_numSamples
size_t m_offset
void * m_data

Detailed Description

Definition at line 265 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,
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:
dst the destination channel
dstOffset the first sample to overwrite
src the source channel
srcOffset the fisrt sample to copy
offset the quantization offset
scale the quantization scale
length the 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::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:
dst the destination channel
dstOffset the first sample to overwrite
src the source channel
srcOffset the fisrt sample to copy
length the number of samples to copy
Note:
The source and destination may not be the same object.
static void ChannelData::copy ( ChannelData dst,
size_t  dstOffset,
const ChannelData src,
size_t  srcOffset,
size_t  length 
) [static]
Parameters:
dst the destination channel
dstOffset the first sample to overwrite
src the source channel
srcOffset the fisrt sample to copy
length the 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.
void* ChannelData::getData ( void   ) 

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

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

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:
newNumSamples the new size of the buffer
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 386 of file PointData.h.

size_t ChannelData::m_numSamples [protected]

Definition at line 384 of file PointData.h.

size_t ChannelData::m_offset [protected]

Definition at line 385 of file PointData.h.


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

LizardTech