264 typename ColorFormat,
265 typename = std::enable_if_t<Detail::SupportedImageDeviceArrayColorFormat<ColorFormat>::value>>
279 template<
typename DataFormat>
283 HasCopyDataImplReturnArray1DTag<DataFormat>::value,
284 "The provided DataFormat is unsupported. Please refer to the documentation for "
285 "this method for the supported DataFormats.");
286 return copyDataImpl(ReturnArray1DTag<DataFormat>{});
338 template<
typename DataFormat>
342 HasCopyDataImpl<DataFormat *>::value,
343 "The provided DataFormat is unsupported. Please refer to the documentation for "
344 "this method for the supported data formats.");
345 return copyDataImpl(destination);
372 struct ReturnArray1DTag
375 template<
typename... Args>
376 class HasCopyDataImplReturnArray1DTag
380 typename =
decltype(std::declval<C>().copyDataImpl(std::declval<ReturnArray1DTag<Args>>()...))>
381 static std::true_type test(
int);
383 static std::false_type test(...);
386 static constexpr bool value =
decltype(test<UnorganizedPointCloud>(0))::value;
389 template<
typename... Args>
390 class HasCopyDataImpl
392 template<typename C, typename = decltype(std::declval<C>().copyDataImpl(std::declval<Args>()...))>
393 static std::true_type test(
int);
395 static std::false_type test(...);
398 static constexpr bool value =
decltype(test<UnorganizedPointCloud>(0))::value;
401 ZIVID_CORE_EXPORT Array1D<PointXYZ> copyDataImpl(ReturnArray1DTag<PointXYZ> )
const;
402 ZIVID_CORE_EXPORT Array1D<PointXYZW> copyDataImpl(ReturnArray1DTag<PointXYZW> )
const;
403 ZIVID_CORE_EXPORT Array1D<ColorRGBA> copyDataImpl(ReturnArray1DTag<ColorRGBA> )
const;
404 ZIVID_CORE_EXPORT Array1D<ColorBGRA> copyDataImpl(ReturnArray1DTag<ColorBGRA> )
const;
405 ZIVID_CORE_EXPORT Array1D<ColorRGBA_SRGB> copyDataImpl(ReturnArray1DTag<ColorRGBA_SRGB> )
const;
406 ZIVID_CORE_EXPORT Array1D<ColorBGRA_SRGB> copyDataImpl(ReturnArray1DTag<ColorBGRA_SRGB> )
const;
417 std::shared_ptr<class UnorganizedPointCloudImpl> m_impl;
422 std::ostream &stream,
434# define ZIVID_UNORGANIZED_PC_EXTERN(Format) \
435 extern template ZIVID_CORE_EXPORT DeviceArray<Format> UnorganizedPointCloud::deviceColors<Format>( \
438 ZIVID_UNORGANIZED_PC_EXTERN(ColorRGBA);
440 ZIVID_UNORGANIZED_PC_EXTERN(ColorBGRA);
441 ZIVID_UNORGANIZED_PC_EXTERN(ColorBGRA_SRGB);
442 ZIVID_UNORGANIZED_PC_EXTERN(ColorRGBAf);
443# undef ZIVID_UNORGANIZED_PC_EXTERN
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
One-dimensional container of data.
Definition Array1D.h:72
Reference-counted handle to data on a GPU device.
Definition DeviceArray.h:94
Point cloud with x, y, z, RGB color and SNR laid out as a linear list of only valid points.
Definition UnorganizedPointCloud.h:75
ZIVID_CORE_EXPORT Array1D< PointXYZW > copyPointsXYZW() const
Array1D of point coordinates in 4D.
ZIVID_CORE_EXPORT UnorganizedPointCloud paintedUniformColor(const Zivid::ColorRGBA &color) const
Create a clone of this point cloud with all points colored according to the given value.
ZIVID_CORE_EXPORT std::optional< PointXYZ > centroid() const
Get the centroid of the point cloud, i.e. average of all XYZ point positions.
ZIVID_CORE_EXPORT Array1D< SNR > copySNRs() const
Get the SNR data of every point.
ZIVID_CORE_EXPORT Array1D< ColorRGBA > copyColorsRGBA() const
Get the color data of every point on 8-bit RGBA format.
ZIVID_CORE_EXPORT std::string toString() const
Get string representation of the point cloud.
ZIVID_CORE_EXPORT UnorganizedPointCloud clone() const
Returns a clone of the point cloud. The clone will include a copy of all of the point cloud data on t...
ZIVID_CORE_EXPORT UnorganizedPointCloud extended(const UnorganizedPointCloud &other) const
Create a new point cloud containing the combined data of this point cloud and another.
ZIVID_CORE_EXPORT UnorganizedPointCloud & center()
Translate the point cloud in-place so that its centroid lands at the origin (0,0,0)
ZIVID_CORE_EXPORT Array1D< ColorRGBA_SRGB > copyColorsRGBA_SRGB() const
Get the color data of every point on 8-bit RGBA format in the sRGB color space.
Array1D< DataFormat > copyData() const
Array1D with point cloud data using specified DataFormat.
Definition UnorganizedPointCloud.h:280
ZIVID_CORE_EXPORT UnorganizedPointCloud & transform(const Zivid::Matrix4x4 &matrix)
Transform the point cloud in-place by the given 4x4 transformation matrix.
ZIVID_CORE_EXPORT UnorganizedPointCloud voxelDownsampled(float voxelSize, int minPointsPerVoxel) const
Create a new point cloud that is a voxel downsampling of this point cloud.
void copyData(DataFormat *destination) const
Copy data in the specified DataFormat to a destination buffer.
Definition UnorganizedPointCloud.h:339
ZIVID_CORE_EXPORT DeviceArray< PointXYZ > devicePointsXYZ(StreamOrQueue streamOrQueue) const
Get a device buffer containing XYZ point coordinates, synced to the user's stream/queue.
ZIVID_CORE_EXPORT size_t size() const
Get the size of the point cloud (total number of points)
ZIVID_CORE_EXPORT UnorganizedPointCloud transformed(const Zivid::Matrix4x4 &matrix) const
Transform the point cloud by the given 4x4 transformation matrix.
ZIVID_CORE_EXPORT DeviceArray< PointXYZW > devicePointsXYZW(StreamOrQueue streamOrQueue) const
Get a device buffer containing XYZW point coordinates, synced to the user's stream/queue.
ZIVID_CORE_EXPORT UnorganizedPointCloud & paintUniformColor(const Zivid::ColorRGBA &color)
Set point cloud colors in-place according to the given value.
ZIVID_CORE_EXPORT UnorganizedPointCloud & extend(const UnorganizedPointCloud &other)
Extend this point cloud in-place by adding the points from another point cloud.
ZIVID_CORE_EXPORT DeviceArray< SNR > deviceSNRs(StreamOrQueue streamOrQueue) const
Get a device buffer containing SNR values, synced to the user's stream/queue.
ZIVID_CORE_EXPORT Array1D< ColorBGRA > copyColorsBGRA() const
Get the color data of every point on 8-bit BGRA format.
ZIVID_CORE_EXPORT Array1D< PointXYZ > copyPointsXYZ() const
Get the XYZ data of every point.
ZIVID_CORE_EXPORT Array1D< ColorBGRA_SRGB > copyColorsBGRA_SRGB() const
Get the color data of every point on 8-bit BGRA format in the sRGB color space.
ZIVID_CORE_EXPORT UnorganizedPointCloud()
Create an empty point cloud.
DeviceArray< ColorFormat > deviceColors(StreamOrQueue streamOrQueue) const
Get a device buffer containing color data in the specified format, synced to the user's stream/queue.
Definition EnvironmentInfo.h:74
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:85
ColorSRGB ColorRGBA_SRGB
Color with 8-bit red, green, blue and alpha channels in the sRGB color space.
Definition Color.h:93
Matrix< float, 4, 4 > Matrix4x4
Matrix of size 4x4 containing floats.
Definition Matrix.h:329
std::ostream & operator<<(std::ostream &stream, const Array1D< T > &array)
Serialize array information to a stream.
Definition Array1D.h:183
Color with 8-bit red, green, blue and alpha channels.
Definition Color.h:189
A user CUDA stream or OpenCL command queue, selected by which member is populated.
Definition ComputeWrappers.h:106