3#include "components_pointers_3d.hpp"
78 return components_.
XInc();
88 return components_.
YInc();
98 return components_.
ZInc();
108 return components_.
WInc();
139 return InternalPointAt(index, TypeTag<T>{});
151 return InternalSetPointAt(index, point);
157 : components_(components)
164 template <
class TYPE>
165 Point3DH<TYPE> InternalPointAt(
std::size_t index, TypeTag<Point3DH<TYPE>>) const noexcept
167 auto x = *
reinterpret_cast<TYPE*
>(
BasePtrX() + index *
XInc());
168 auto y = *
reinterpret_cast<TYPE*
>(
BasePtrY() + index *
YInc());
169 auto z = *
reinterpret_cast<TYPE*
>(
BasePtrZ() + index *
ZInc());
170 auto w = *
reinterpret_cast<TYPE*
>(
BasePtrW() + index *
WInc());
171 return Point3DH<TYPE>(x, y, z, w);
174 template <
class TYPE>
175 Point3D<TYPE> InternalPointAt(
std::size_t index, TypeTag<Point3D<TYPE>>) const noexcept
177 auto x = *
reinterpret_cast<TYPE*
>(
BasePtrX() + index *
XInc());
178 auto y = *
reinterpret_cast<TYPE*
>(
BasePtrY() + index *
YInc());
179 auto z = *
reinterpret_cast<TYPE*
>(
BasePtrZ() + index *
ZInc());
180 return Point3D<TYPE>(x, y, z);
183 template <
class TYPE>
184 void InternalSetPointAt(
std::size_t index, Point3DH<TYPE> point)
noexcept
186 *
reinterpret_cast<TYPE*
>(
BasePtrX() + index *
XInc()) = point.X();
187 *
reinterpret_cast<TYPE*
>(
BasePtrY() + index *
YInc()) = point.Y();
188 *
reinterpret_cast<TYPE*
>(
BasePtrZ() + index *
ZInc()) = point.Z();
189 *
reinterpret_cast<TYPE*
>(
BasePtrW() + index *
WInc()) = point.W();
193 template <
class TYPE>
194 void InternalSetPointAt(
std::size_t index, Point3D<TYPE> point)
noexcept
196 *
reinterpret_cast<TYPE*
>(
BasePtrX() + index *
XInc()) = point.X();
197 *
reinterpret_cast<TYPE*
>(
BasePtrY() + index *
YInc()) = point.Y();
198 *
reinterpret_cast<TYPE*
>(
BasePtrZ() + index *
ZInc()) = point.Z();
201 ComponentsPointers3D components_;
Point components of the point cloud.
Definition: components_pointers_3d.hpp:19
std::intptr_t ZInc() const noexcept
Increment to the next Z-component of the next point in bytes.
Definition: components_pointers_3d.hpp:102
std::uintptr_t BasePtrX() const noexcept
Variable to receive the pointer to the first X-component of the first point.
Definition: components_pointers_3d.hpp:32
std::intptr_t XInc() const noexcept
Increment to the next X-component of the next point in bytes.
Definition: components_pointers_3d.hpp:82
std::uintptr_t BasePtrZ() const noexcept
Variable to receive the pointer to the first Z-component of the first point.
Definition: components_pointers_3d.hpp:52
std::intptr_t ConfidenceInc() const noexcept
Increment to the next confidence-component of the next point in bytes (if present; nullptr if not).
Definition: components_pointers_3d.hpp:122
std::uintptr_t BasePtrConfidence() const noexcept
Variable to receive the pointer to the first confidence-component of the first point.
Definition: components_pointers_3d.hpp:72
std::uintptr_t BasePtrY() const noexcept
Variable to receive the pointer to the first Y-component of the first point.
Definition: components_pointers_3d.hpp:42
std::intptr_t YInc() const noexcept
Increment to the next Y-component of the next point in bytes.
Definition: components_pointers_3d.hpp:92
std::uintptr_t BasePtrW() const noexcept
Variable to receive the pointer to the first W-component of the first point.
Definition: components_pointers_3d.hpp:62
std::intptr_t WInc() const noexcept
Increment to the next W-component of the next point in bytes (if present; nullptr if not).
Definition: components_pointers_3d.hpp:112
std::size_t NumPoints() const noexcept
Variable to be filled with the number of points in point cloud.
Definition: components_pointers_3d.hpp:132
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:149
T PointAt(std::size_t index) const noexcept
Gets the point at the specified index.
Definition: sparse_components_pointers_3d.hpp:137
std::intptr_t ZInc() const noexcept
Increment to the next Z-component of the next point in bytes.
Definition: sparse_components_pointers_3d.hpp:96
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:26
std::intptr_t XInc() const noexcept
Increment to the next X-component of the next point in bytes.
Definition: sparse_components_pointers_3d.hpp:76
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:46
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:116
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:66
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:36
std::intptr_t YInc() const noexcept
Increment to the next Y-component of the next point in bytes.
Definition: sparse_components_pointers_3d.hpp:86
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:56
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:106
std::size_t NumPoints() const noexcept
Variable to be filled with the number of points in point cloud.
Definition: sparse_components_pointers_3d.hpp:126
A sparse Cartesian 3D point cloud object.
Definition: decl_sparse_point_cloud.hpp:30
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24