3#include "components_pointers_3d.hpp"
14 class DenseComponentsPointers3D final
16 friend class DensePointCloud;
19 DenseComponentsPointers3D() =
default;
28 return components_.BasePtrX();
38 return components_.BasePtrY();
48 return components_.BasePtrZ();
58 return components_.BasePtrW();
68 return components_.BasePtrConfidence();
78 return components_.XInc();
88 return components_.YInc();
98 return components_.ZInc();
108 return components_.WInc();
118 return components_.ConfidenceInc();
130 return InternalPointAt(indexX, indexY, TypeTag<T>{});
142 return InternalSetPointAt(indexX, indexY, point);
157 : components_(components)
158 , latticeSize_(latticeSize)
162 template <
class TYPE>
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());
175 return Point3DC<TYPE>(x, y, z, c);
178 template <
class TYPE>
179 Point3DH<TYPE> InternalPointAt(std::size_t indexX, std::size_t indexY, TypeTag<Point3DH<TYPE>>) const noexcept
181 auto x = *
reinterpret_cast<TYPE *
>(
BasePtrX() + indexY * latticeSize_.Width() *
XInc() + indexX *
XInc());
182 auto y = *
reinterpret_cast<TYPE *
>(
BasePtrY() + indexY * latticeSize_.Width() *
YInc() + indexX *
YInc());
183 auto z = *
reinterpret_cast<TYPE *
>(
BasePtrZ() + indexY * latticeSize_.Width() *
ZInc() + indexX *
ZInc());
184 auto w = *
reinterpret_cast<TYPE *
>(
BasePtrW() + indexY * latticeSize_.Width() *
WInc() + indexX *
WInc());
185 return Point3DH<TYPE>(x, y, z, w);
188 template <
class TYPE>
189 Point3D<TYPE> InternalPointAt(std::size_t indexX, std::size_t indexY, TypeTag<Point3D<TYPE>>) const noexcept
191 auto x = *
reinterpret_cast<TYPE *
>(
BasePtrX() + indexY * latticeSize_.Width() *
XInc() + indexX *
XInc());
192 auto y = *
reinterpret_cast<TYPE *
>(
BasePtrY() + indexY * latticeSize_.Width() *
YInc() + indexX *
YInc());
193 auto z = *
reinterpret_cast<TYPE *
>(
BasePtrZ() + indexY * latticeSize_.Width() *
ZInc() + indexX *
ZInc());
194 return Point3D<TYPE>(x, y, z);
197 template <
class TYPE>
198 void InternalSetPointAt(std::size_t indexX, std::size_t indexY, Point3DC<TYPE> point)
noexcept
200 *
reinterpret_cast<TYPE *
>(
BasePtrX() + indexY * latticeSize_.Width() *
XInc() + indexX *
XInc()) = point.X();
201 *
reinterpret_cast<TYPE *
>(
BasePtrY() + indexY * latticeSize_.Width() *
YInc() + indexX *
YInc()) = point.Y();
202 *
reinterpret_cast<TYPE *
>(
BasePtrZ() + indexY * latticeSize_.Width() *
ZInc() + indexX *
ZInc()) = point.Z();
207 template <
class TYPE>
208 void InternalSetPointAt(std::size_t indexX, std::size_t indexY, Point3DH<TYPE> point)
noexcept
210 *
reinterpret_cast<TYPE *
>(
BasePtrX() + indexY * latticeSize_.Width() *
XInc() + indexX *
XInc()) = point.X();
211 *
reinterpret_cast<TYPE *
>(
BasePtrY() + indexY * latticeSize_.Width() *
YInc() + indexX *
YInc()) = point.Y();
212 *
reinterpret_cast<TYPE *
>(
BasePtrZ() + indexY * latticeSize_.Width() *
ZInc() + indexX *
ZInc()) = point.Z();
213 *
reinterpret_cast<TYPE *
>(
BasePtrW() + indexY * latticeSize_.Width() *
WInc() + indexX *
WInc()) = point.W();
216 template <
class TYPE>
217 void InternalSetPointAt(std::size_t indexX, std::size_t indexY, Point3D<TYPE> point)
noexcept
219 *
reinterpret_cast<TYPE *
>(
BasePtrX() + indexY * latticeSize_.Width() *
XInc() + indexX *
XInc()) = point.X();
220 *
reinterpret_cast<TYPE *
>(
BasePtrY() + indexY * latticeSize_.Width() *
YInc() + indexX *
YInc()) = point.Y();
221 *
reinterpret_cast<TYPE *
>(
BasePtrZ() + indexY * latticeSize_.Width() *
ZInc() + indexX *
ZInc()) = point.Z();
224 ComponentsPointers3D components_;
225 Size2D<int> latticeSize_;
14 class DenseComponentsPointers3D final {
…};
Point components of the point cloud.
Definition components_pointers_3d.hpp:18
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:140
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:150
std::intptr_t ZInc() const noexcept
Increment to the next Z-component of the next point in bytes.
Definition dense_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 dense_components_pointers_3d.hpp:26
std::intptr_t XInc() const noexcept
Increment to the next X-component of the next point in bytes.
Definition dense_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 dense_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 dense_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 dense_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 dense_components_pointers_3d.hpp:36
std::intptr_t YInc() const noexcept
Increment to the next Y-component of the next point in bytes.
Definition dense_components_pointers_3d.hpp:86
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:128
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: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 dense_components_pointers_3d.hpp:106
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17