8#ifndef __LIDAR_POINT_DATA_H__
9#define __LIDAR_POINT_DATA_H__
13LT_BEGIN_LIDAR_NAMESPACE
90#define CHANNEL_NAME_X "X"
91#define CHANNEL_NAME_Y "Y"
92#define CHANNEL_NAME_Z "Z"
93#define CHANNEL_NAME_Intensity "Intensity"
94#define CHANNEL_NAME_ReturnNum "ReturnNum"
95#define CHANNEL_NAME_NumReturns "NumReturns"
96#define CHANNEL_NAME_ScanDir "ScanDir"
97#define CHANNEL_NAME_EdgeFlightLine "EdgeFlightLine"
98#define CHANNEL_NAME_ScannerChannel "ScannerChannel"
99#define CHANNEL_NAME_ClassId "ClassId"
100#define CHANNEL_NAME_ClassFlags "ClassFlags"
101#define CHANNEL_NAME_ScanAngle "ScanAngle"
102#define CHANNEL_NAME_UserData "UserData"
103#define CHANNEL_NAME_SourceId "SourceId"
104#define CHANNEL_NAME_GPSTime_Week "GPSTime"
105#define CHANNEL_NAME_GPSTime_Adjusted "GPSTime_Adjusted"
106#define CHANNEL_NAME_Red "Red"
107#define CHANNEL_NAME_Green "Green"
108#define CHANNEL_NAME_Blue "Blue"
109#define CHANNEL_NAME_NearInfrared "NearInfrared"
112#define CHANNEL_NAME_Skip "@Skip"
129 void init(
const char *name,
DataType datatype,
int bits,
double quantization = 0);
192 void init(
const PointInfo &pointInfo,
const char *
const *channels,
size_t numChannels);
193 void init(
const PointData &pointData,
const char *
const *channels,
size_t numChannels);
195 void init(
const PointInfo &pointInfo,
const size_t *channels,
size_t numChannels);
196 void init(
const PointData &pointData,
const size_t *channels,
size_t numChannels);
389 double offset,
double scale,
511 const double *
getX(
void)
const;
525 const double *
getY(
void)
const;
539 const double *
getZ(
void)
const;
579 const PointData &src,
size_t srcNumPoints);
603LT_END_LIDAR_NAMESPACE
DataType
Channel data types.
Helper functions for interaction with the DataType enum.
static int byteWidth(DataType dt)
Get the data type size.
static const char * toString(DataType dt)
Get the string representation.
static DataType toDataType(const char *str)
static bool isFloat(DataType dt)
Determine if the datatype is a floating point type.
static bool isSigned(DataType dt)
Determine if the datatype is signed.
ChannelInfo stores the basic properties of a channel.
bool operator!=(const ChannelInfo &rhs) const
double getQuantization(void) const
Get the quantization scale.
const char * getName(void) const
Get the name.
DataType getDataType(void) const
Get the data type.
size_t getBits(void) const
Get the bit precision.
void setQuantization(double value)
void init(const char *name, DataType datatype, int bits, double quantization=0)
void init(const ChannelInfo &info)
bool operator==(const ChannelInfo &rhs) const
PointInfo is a group of ChannelInfo objects.
void init(const PointData &pointData)
bool hasChannel(const char *name) const
Determine if there is a channel with a given name.
ChannelInfo * getChannel(const char *name)
Access the channel data.
bool operator==(const PointInfo &rhs) const
size_t getChannelIndex(const char *name) const
Get the index for a given channel.
const ChannelInfo * getChannel(const char *name) const
Access the channel data.
void init(const PointInfo &pointInfo, const char *const *channels, size_t numChannels)
void init(const PointData &pointData, const size_t *channels, size_t numChannels)
void init(size_t numChannels)
void init(const PointInfo &pointInfo, const size_t *channels, size_t numChannels)
void init(const PointData &pointData, const char *const *channels, size_t numChannels)
bool hasValidXYZ(void) const
Make sure the PointInfo has X, Y, and Z channels.
size_t getBits(void) const
Get the total bits used by all channels.
void init(const PointInfo &pointInfo)
ChannelInfo & getChannel(size_t idx)
Access the channel info.
bool operator!=(const PointInfo &rhs) const
const ChannelInfo & getChannel(size_t idx) const
Access the channel info.
size_t getNumChannels(void) const
Get the number of channels.
ChannelData adds sample values to the ChannelInfo class.
size_t getNumSamples(void) const
Get the number of samples.
void setOffset(size_t offset)
dirty hack – only use this if you're the buffer onwer
void init(const ChannelInfo &info, size_t numSamples)
void setData(void *data, bool deleteData)
change the buffer
void setDataType(DataType datatype)
Channge the data type on the fly.
const void * getData(void) const
Get the data buffer.
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.
void * getData(void)
Get the data buffer.
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.
void resize(size_t newNumSamples)
Resize the data buffer.
PointData is a group of ChannelData objects.
double * getX(void)
Get the X values.
static void copy(PointData &dst, size_t dstOffset, const PointData &src, size_t srcOffset, size_t length)
Copy samples between buffers.
double * getY(void)
Get the Y values.
void init(const PointInfo &pointInfo, size_t numSamples)
void resize(size_t newNumSamples)
Resize the data buffer.
const double * getY(void) const
Get the Y values.
static void merge(PointData &dst, size_t dstNumPoints, const PointData &src, size_t srcNumPoints)
Merge points.
void setOffset(size_t offset)
dirty hack – only use this if you're the buffer onwer
const ChannelData & getChannel(size_t idx) const
Access the channel data.
ChannelData * getChannel(const char *name)
Access the channel data.
double * getZ(void)
Get the Z values.
ChannelData & getChannel(size_t idx)
Access the channel data.
size_t getNumChannels(void) const
Get the number of channels.
size_t getNumSamples(void) const
Get the number of samples.
bool hasChannel(const char *name) const
Determine if there is a channel with a given name.
const double * getX(void) const
Get the X values.
const double * getZ(void) const
Get the Z values.
const ChannelData * getChannel(const char *name) const
Access the channel data.