3#include "components_pointers_3d.hpp"
13 class SparseComponentsPointers3D final
15 friend class SparsePointCloud;
18 SparseComponentsPointers3D() =
default;
27 return components_.BasePtrX();
37 return components_.BasePtrY();
47 return components_.BasePtrZ();
57 return components_.BasePtrW();
67 return components_.BasePtrConfidence();
77 return components_.XInc();
87 return components_.YInc();
97 return components_.ZInc();
107 return components_.WInc();
117 return components_.ConfidenceInc();
127 return components_.NumPoints();
138 return InternalPointAt(index, TypeTag<T>{});
149 return InternalSetPointAt(index, point);
154 : components_(components)
158 template <
class TYPE>
163 template <
class TYPE>
164 Point3DH<TYPE> InternalPointAt(std::size_t index, TypeTag<Point3DH<TYPE>>) const noexcept
166 auto x = *
reinterpret_cast<TYPE *
>(
BasePtrX() + index *
XInc());
167 auto y = *
reinterpret_cast<TYPE *
>(
BasePtrY() + index *
YInc());
168 auto z = *
reinterpret_cast<TYPE *
>(
BasePtrZ() + index *
ZInc());
169 auto w = *
reinterpret_cast<TYPE *
>(
BasePtrW() + index *
WInc());
170 return Point3DH<TYPE>(x, y, z, w);
173 template <
class TYPE>
174 Point3D<TYPE> InternalPointAt(std::size_t index, TypeTag<Point3D<TYPE>>) const noexcept
176 auto x = *
reinterpret_cast<TYPE *
>(
BasePtrX() + index *
XInc());
177 auto y = *
reinterpret_cast<TYPE *
>(
BasePtrY() + index *
YInc());
178 auto z = *
reinterpret_cast<TYPE *
>(
BasePtrZ() + index *
ZInc());
179 return Point3D<TYPE>(x, y, z);
182 template <
class TYPE>
183 void InternalSetPointAt(std::size_t index, Point3DH<TYPE> point)
noexcept
185 *
reinterpret_cast<TYPE *
>(
BasePtrX() + index *
XInc()) = point.X();
186 *
reinterpret_cast<TYPE *
>(
BasePtrY() + index *
YInc()) = point.Y();
187 *
reinterpret_cast<TYPE *
>(
BasePtrZ() + index *
ZInc()) = point.Z();
188 *
reinterpret_cast<TYPE *
>(
BasePtrW() + index *
WInc()) = point.W();
191 template <
class TYPE>
192 void InternalSetPointAt(std::size_t index, Point3D<TYPE> point)
noexcept
194 *
reinterpret_cast<TYPE *
>(
BasePtrX() + index *
XInc()) = point.X();
195 *
reinterpret_cast<TYPE *
>(
BasePtrY() + index *
YInc()) = point.Y();
196 *
reinterpret_cast<TYPE *
>(
BasePtrZ() + index *
ZInc()) = point.Z();
199 ComponentsPointers3D components_;
13 class SparseComponentsPointers3D final {
…};
Point components of the point cloud.
Definition components_pointers_3d.hpp:18
Point components of a sparse point cloud.
Definition sparse_components_pointers_3d.hpp:14
void SetPointAt(std::size_t index, T point) noexcept
Sets the point at the specified index.
Definition sparse_components_pointers_3d.hpp:147
T PointAt(std::size_t index) const noexcept
Gets the point at the specified index.
Definition sparse_components_pointers_3d.hpp:136
std::intptr_t ZInc() const noexcept
Increment to the next Z-component of the next point in bytes.
Definition sparse_components_pointers_3d.hpp:95
std::uintptr_t BasePtrX() const noexcept
Variable to receive the pointer to the first X-component of the first point.
Definition sparse_components_pointers_3d.hpp:25
std::intptr_t XInc() const noexcept
Increment to the next X-component of the next point in bytes.
Definition sparse_components_pointers_3d.hpp:75
std::uintptr_t BasePtrZ() const noexcept
Variable to receive the pointer to the first Z-component of the first point.
Definition sparse_components_pointers_3d.hpp:45
std::intptr_t ConfidenceInc() const noexcept
Increment to the next confidence-component of the next point in bytes (if present; nullptr if not).
Definition sparse_components_pointers_3d.hpp:115
std::uintptr_t BasePtrConfidence() const noexcept
Variable to receive the pointer to the first confidence-component of the first point.
Definition sparse_components_pointers_3d.hpp:65
std::uintptr_t BasePtrY() const noexcept
Variable to receive the pointer to the first Y-component of the first point.
Definition sparse_components_pointers_3d.hpp:35
std::intptr_t YInc() const noexcept
Increment to the next Y-component of the next point in bytes.
Definition sparse_components_pointers_3d.hpp:85
std::uintptr_t BasePtrW() const noexcept
Variable to receive the pointer to the first W-component of the first point.
Definition sparse_components_pointers_3d.hpp:55
std::intptr_t WInc() const noexcept
Increment to the next W-component of the next point in bytes (if present; nullptr if not).
Definition sparse_components_pointers_3d.hpp:105
std::size_t NumPoints() const noexcept
Variable to be filled with the number of points in point cloud.
Definition sparse_components_pointers_3d.hpp:125
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17