ChannelData adds sample values to the ChannelInfo class.
#include <PointData.h>
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 279 of file PointData.h.
Constructor & Destructor Documentation
Member Function Documentation
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.
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)
- 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.
This method returns the data buffer. The caller must cast it to the appropriate datatype.
- See also:
- getDataType()
This method returns the data buffer. The caller must cast it to the appropriate datatype.
- See also:
- getDataType()
This method returns the maximum number of samples that can be stored in the object.
This method change the size of the data buffer.
- Parameters:
-
newNumSamples | the new size of the buffer |
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.
Member Data Documentation
The documentation for this class was generated from the following file: