#include <PointData.h>
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 |
Definition at line 279 of file PointData.h.
ChannelData::~ChannelData | ( | void | ) |
ChannelData::ChannelData | ( | void | ) |
void ChannelData::init | ( | const ChannelInfo & | info, | |
size_t | numSamples | |||
) |
size_t ChannelData::getNumSamples | ( | void | ) | const |
This method returns the maximum number of samples that can be stored in the object.
const void* ChannelData::getData | ( | void | ) | const |
This method returns the data buffer. The caller must cast it to the appropriate datatype.
void* ChannelData::getData | ( | void | ) |
This method returns the data buffer. The caller must cast it to the appropriate datatype.
static void ChannelData::copy | ( | ChannelData & | dst, | |
size_t | dstOffset, | |||
const ChannelData & | src, | |||
size_t | srcOffset, | |||
size_t | length | |||
) | [static] |
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 |
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.
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 |
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.
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 |
When converting integer to float: dst = scale * src + offset.
When converting float to integer: dst = floor((src - offset) / scale + 0.5)
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.
void ChannelData::resize | ( | size_t | newNumSamples | ) |
This method change the size of the data buffer.
newNumSamples | the new size of the buffer |
void ChannelData::setOffset | ( | size_t | offset | ) |
size_t ChannelData::m_numSamples [protected] |
Definition at line 398 of file PointData.h.
size_t ChannelData::m_offset [protected] |
Definition at line 399 of file PointData.h.
void* ChannelData::m_data [protected] |
Definition at line 400 of file PointData.h.
LizardTech |