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>{});
150 return InternalSetPointAt(index, point);
156 : components_(components)
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();
192 template <
class TYPE>
193 void InternalSetPointAt(
std::size_t index, Point3D<TYPE> point)
noexcept
195 *
reinterpret_cast<TYPE*
>(
BasePtrX() + index *
XInc()) = point.X();
196 *
reinterpret_cast<TYPE*
>(
BasePtrY() + index *
YInc()) = point.Y();
197 *
reinterpret_cast<TYPE*
>(
BasePtrZ() + index *
ZInc()) = point.Z();
200 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:148
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:15