53 template<
typename Po
intT>
124 PointCloudConstPtr inputCloud_arg)
127 for (
const auto& idx: indexVector_arg)
129 unsigned char diffX, diffY, diffZ;
132 const PointT& idxPoint = (*inputCloud_arg)[idx];
135 diffX =
static_cast<unsigned char> (std::max (-127, std::min<int>(127,
static_cast<int> ((idxPoint.x - referencePoint_arg[0]) /
pointCompressionResolution_))));
136 diffY =
static_cast<unsigned char> (std::max (-127, std::min<int>(127,
static_cast<int> ((idxPoint.y - referencePoint_arg[1]) /
pointCompressionResolution_))));
137 diffZ =
static_cast<unsigned char> (std::max (-127, std::min<int>(127,
static_cast<int> ((idxPoint.z - referencePoint_arg[2]) /
pointCompressionResolution_))));
156 assert (beginIdx_arg <= endIdx_arg);
158 const uindex_t pointCount = endIdx_arg - beginIdx_arg;
161 for (
uindex_t i = 0; i < pointCount; i++)
169 PointT& point = (*outputCloud_arg)[beginIdx_arg + i];
195 #define PCL_INSTANTIATE_ColorCoding(T) template class PCL_EXPORTS pcl::octree::ColorCoding<T>;
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
void encodePoints(const Indices &indexVector_arg, const double *referencePoint_arg, PointCloudConstPtr inputCloud_arg)
Encode differential point information for a subset of points from point cloud.
void initializeEncoding()
Initialize encoding of differential point.
std::vector< char > pointDiffDataVector_
Vector for storing differential point information
float pointCompressionResolution_
Precision of point coding.
std::vector< char > & getDifferentialDataVector()
Get reference to vector containing differential color data.
void initializeDecoding()
Initialize decoding of differential point.
void decodePoints(PointCloudPtr outputCloud_arg, const double *referencePoint_arg, uindex_t beginIdx_arg, uindex_t endIdx_arg)
Decode differential point information.
float getPrecision()
Retrieve precision of point information.
PointCoding()=default
Constructor.
virtual ~PointCoding()=default
Empty class constructor.
void setPointCount(unsigned int pointCount_arg)
Set amount of points within point cloud to be encoded and reserve memory.
std::vector< char >::const_iterator pointDiffDataVectorIterator_
Iterator on differential point information vector.
PointCloudPtr output_
Pointer to output point cloud dataset.
void setPrecision(float precision_arg)
Define precision of point information.
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.