3#include "components_pointers_3d.hpp"
79 return components_.
XInc();
89 return components_.
YInc();
99 return components_.
ZInc();
109 return components_.
WInc();
131 return InternalPointAt(indexX, indexY, TypeTag<T>{});
143 return InternalSetPointAt(indexX, indexY, point);
159 : components_(components)
160 , latticeSize_(latticeSize)
167 template <
class TYPE>
168 Point3DC<TYPE> InternalPointAt(
std::size_t indexX,
std::size_t indexY, TypeTag<Point3DC<TYPE>>) const noexcept
170 auto x = *
reinterpret_cast<TYPE*
>(
BasePtrX() + indexY * latticeSize_.
Width() *
XInc() + indexX *
XInc());
171 auto y = *
reinterpret_cast<TYPE*
>(
BasePtrY() + indexY * latticeSize_.
Width() *
YInc() + indexX *
YInc());
172 auto z = *
reinterpret_cast<TYPE*
>(
BasePtrZ() + indexY * latticeSize_.
Width() *
ZInc() + indexX *
ZInc());
174 return Point3DC<TYPE>(x, y, z, c);
177 template <
class TYPE>
178 Point3DH<TYPE> InternalPointAt(
std::size_t indexX,
std::size_t indexY, TypeTag<Point3DH<TYPE>>) const noexcept
180 auto x = *
reinterpret_cast<TYPE*
>(
BasePtrX() + indexY * latticeSize_.
Width() *
XInc() + indexX *
XInc());
181 auto y = *
reinterpret_cast<TYPE*
>(
BasePtrY() + indexY * latticeSize_.
Width() *
YInc() + indexX *
YInc());
182 auto z = *
reinterpret_cast<TYPE*
>(
BasePtrZ() + indexY * latticeSize_.
Width() *
ZInc() + indexX *
ZInc());
183 auto w = *
reinterpret_cast<TYPE*
>(
BasePtrW() + indexY * latticeSize_.
Width() *
WInc() + indexX *
WInc());
184 return Point3DH<TYPE>(x, y, z, w);
187 template <
class TYPE>
188 Point3D<TYPE> InternalPointAt(
std::size_t indexX,
std::size_t indexY, TypeTag<Point3D<TYPE>>) const noexcept
190 auto x = *
reinterpret_cast<TYPE*
>(
BasePtrX() + indexY * latticeSize_.
Width() *
XInc() + indexX *
XInc());
191 auto y = *
reinterpret_cast<TYPE*
>(
BasePtrY() + indexY * latticeSize_.
Width() *
YInc() + indexX *
YInc());
192 auto z = *
reinterpret_cast<TYPE*
>(
BasePtrZ() + indexY * latticeSize_.
Width() *
ZInc() + indexX *
ZInc());
193 return Point3D<TYPE>(x, y, z);
196 template <
class TYPE>
199 *
reinterpret_cast<TYPE*
>(
BasePtrX() + indexY * latticeSize_.
Width() *
XInc() + indexX *
XInc()) = point.X();
200 *
reinterpret_cast<TYPE*
>(
BasePtrY() + indexY * latticeSize_.
Width() *
YInc() + indexX *
YInc()) = point.Y();
201 *
reinterpret_cast<TYPE*
>(
BasePtrZ() + indexY * latticeSize_.
Width() *
ZInc() + indexX *
ZInc()) = point.Z();
205 template <
class TYPE>
208 *
reinterpret_cast<TYPE*
>(
BasePtrX() + indexY * latticeSize_.
Width() *
XInc() + indexX *
XInc()) = point.X();
209 *
reinterpret_cast<TYPE*
>(
BasePtrY() + indexY * latticeSize_.
Width() *
YInc() + indexX *
YInc()) = point.Y();
210 *
reinterpret_cast<TYPE*
>(
BasePtrZ() + indexY * latticeSize_.
Width() *
ZInc() + indexX *
ZInc()) = point.Z();
211 *
reinterpret_cast<TYPE*
>(
BasePtrW() + indexY * latticeSize_.
Width() *
WInc() + indexX *
WInc()) = point.W();
214 template <
class TYPE>
217 *
reinterpret_cast<TYPE*
>(
BasePtrX() + indexY * latticeSize_.
Width() *
XInc() + indexX *
XInc()) = point.X();
218 *
reinterpret_cast<TYPE*
>(
BasePtrY() + indexY * latticeSize_.
Width() *
YInc() + indexX *
YInc()) = point.Y();
219 *
reinterpret_cast<TYPE*
>(
BasePtrZ() + indexY * latticeSize_.
Width() *
ZInc() + indexX *
ZInc()) = point.Z();
222 ComponentsPointers3D components_;
223 Size2D<int> latticeSize_;
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
Point components of a dense point cloud.
Definition: dense_components_pointers_3d.hpp:15
void SetPointAt(std::size_t indexX, std::size_t indexY, T point) noexcept
Sets the point at the specified index.
Definition: dense_components_pointers_3d.hpp:141
Size2D< int > LatticeSize() const noexcept
Gets the number of x,y,z(,w) point rows and columns of the PointCloud these components refer to.
Definition: dense_components_pointers_3d.hpp:151
std::intptr_t ZInc() const noexcept
Increment to the next Z-component of the next point in bytes.
Definition: dense_components_pointers_3d.hpp:97
std::uintptr_t BasePtrX() const noexcept
Variable to receive the pointer to the first X-component of the first point.
Definition: dense_components_pointers_3d.hpp:27
std::intptr_t XInc() const noexcept
Increment to the next X-component of the next point in bytes.
Definition: dense_components_pointers_3d.hpp:77
std::uintptr_t BasePtrZ() const noexcept
Variable to receive the pointer to the first Z-component of the first point.
Definition: dense_components_pointers_3d.hpp:47
std::intptr_t ConfidenceInc() const noexcept
Increment to the next confidence-component of the next point in bytes (if present; nullptr if not).
Definition: dense_components_pointers_3d.hpp:117
std::uintptr_t BasePtrConfidence() const noexcept
Variable to receive the pointer to the first confidence-component of the first point.
Definition: dense_components_pointers_3d.hpp:67
std::uintptr_t BasePtrY() const noexcept
Variable to receive the pointer to the first Y-component of the first point.
Definition: dense_components_pointers_3d.hpp:37
std::intptr_t YInc() const noexcept
Increment to the next Y-component of the next point in bytes.
Definition: dense_components_pointers_3d.hpp:87
T PointAt(std::size_t indexX, std::size_t indexY) const noexcept
Gets the point at the specified index.
Definition: dense_components_pointers_3d.hpp:129
std::uintptr_t BasePtrW() const noexcept
Variable to receive the pointer to the first W-component of the first point.
Definition: dense_components_pointers_3d.hpp:57
std::intptr_t WInc() const noexcept
Increment to the next W-component of the next point in bytes (if present; nullptr if not).
Definition: dense_components_pointers_3d.hpp:107
A dense Cartesian 3D point cloud object.
Definition: decl_dense_point_cloud.hpp:31
T Width() const noexcept
Gets the horizontal component of the size.
Definition: size_2d.hpp:59
Root namespace for the Image Manager interface.
Definition: c_barcode.h:15