11public abstract class PointCloud : IDisposable, IHasSafeHandle
13 internal Handle _handle;
21 var handle =
new Handle();
22 DllHelper.ExecuteAndMapReturnCodes(() => CInterface.peak_icv_PointCloud_Create(out handle));
38 GC.SuppressFinalize(
this);
41 SafeHandle IHasSafeHandle.Handle => _handle;
43 internal sealed class Handle : SafeHandleZeroOrMinusOneIsInvalid
45 internal Handle() : base(true)
49 protected override bool ReleaseHandle()
51 return CInterface.peak_icv_PointCloud_Destroy(handle) ==
52 Backend.Types.peak_icv_status.PEAK_ICV_STATUS_SUCCESS;
56 internal class CInterface
58 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
59 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_Create(
60 out Handle pointCloudHandle);
62 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
63 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_Destroy(IntPtr pointCloudHandle);
65 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
66 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_IncreaseUseCount(
67 Handle pointCloudHandle);
69 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
70 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_CreateFromXYZImage(
71 out Handle pointCloudHandle, Image.Handle imageHandle);
73 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
74 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_CreateFromFile(
75 out Handle pointCloudHandle, Backend.Types.peak_icv_point_type pointType,
byte[] filePath);
77 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
78 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_CreateFromPoints(
79 out Handle pointCloudHandle, Backend.Types.peak_icv_point_xyz[] points, nuint numPoints,
80 Backend.Types.peak_icv_point_type pointType);
82 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
83 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_CreateFromXYZImageAndIntensityImage(
84 out Handle pointCloudHandle, Image.Handle imageHandle, Image.Handle intensityImageHandle);
86 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
87 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_CreateFromPoints(
88 out Handle pointCloudHandle, Backend.Types.peak_icv_point_xyzi[] points, nuint numPoints,
89 Backend.Types.peak_icv_point_type pointType);
91 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
92 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_GetPoints_GetCount(
93 Handle pointCloudHandle, out nuint count);
95 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
96 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_GetPoints(
97 Handle pointCloudHandle, IntPtr points, nuint numPoints);
99 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
100 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_Transform(
101 Handle pointCloudHandle,
float[] matrix,
102 ref Handle outputHandle);
104 [DllImport(Global.LibraryName, CallingConvention = Global.CallingConvention)]
105 public static extern Backend.Types.peak_icv_status peak_icv_PointCloud_TransformToWorkspace(
106 Handle pointCloudHandle, Backend.Types.peak_icv_extrinsic_parameters extrinsicParameters,
107 nuint sizeOfExtrinsicParameters,
108 ref Handle outputHandle);