5#include "../_decl/decl_point_cloud.hpp"
8#include "../global.hpp"
15 inline HandleGuard<PlaneEnumerator>::HandleGuard(
void *handle) noexcept
16 : HandleGuard<PlaneEnumerator>(handle, [](
void *handle) { CVB_CALL_CAPI(
ReleaseObject(handle)); })
33 using GuardType = HandleGuard<PlaneEnumerator>;
73 if (!guard.Handle() || CVB_CALL_CAPI(CVCIsComposite(guard.Handle())))
74 throw std::runtime_error(
"handle must not be null and object must not be a composite");
95 return handle_.Handle();
105 CExports::cvbdim_t numPlanes = 0;
106 CVB_CALL_CAPI(CVCPlaneEnumGetCount(
Handle(), numPlanes));
107 return static_cast<int>(numPlanes);
148 if (
auto plane = planes_[index].lock())
151 CExports::CVPLANE handle =
nullptr;
152 CVB_CALL_CAPI_CHECKED(CVCPlaneEnumGetAt(
Handle(),
static_cast<CExports::cvbdim_t
>(index), handle));
154 planes_[index] = plane;
161 HandleGuard<PlaneEnumerator> handle_;
T back_inserter(T... args)
PlanePtr Plane(int index) const
Index based plane access.
Definition decl_plane_enumerator.hpp:143
int PlaneCount() const noexcept
Gets the number of planes enumerated by this object.
Definition decl_plane_enumerator.hpp:103
static PlaneEnumerator FromObject(const T &object)
Create a plane enumerator for a given object.
static PlaneEnumeratorPtr FromHandle(HandleGuard< PlaneEnumerator > &&guard)
Creates a plane enumerator from a classic API handle.
Definition decl_plane_enumerator.hpp:71
PlaneEnumerator(HandleGuard< PlaneEnumerator > &&guard, PrivateTag) noexcept
Plane enumerator constructor.
Definition decl_plane_enumerator.hpp:49
PlanePtr operator[](int index) const
Index based plane access.
Definition decl_plane_enumerator.hpp:130
PlaneEnumerator() noexcept
Plane enumerator constructor.
Definition decl_plane_enumerator.hpp:39
std::vector< PlanePtr > Planes() const
Gets all available planes enumerated by this object.
Definition decl_plane_enumerator.hpp:115
void * Handle() const noexcept
Classic API device handle.
Definition decl_plane_enumerator.hpp:93
static PlanePtr FromHandle(HandleGuard< Plane > &&guard)
Creates a plane from a classic API handle.
Definition decl_plane.hpp:76
cvbbool_t ReleaseObject(OBJ &Object)
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
std::shared_ptr< PlaneEnumerator > PlaneEnumeratorPtr
Convenience shared pointer for PlaneEnumerator.
Definition global.hpp:82
std::shared_ptr< Plane > PlanePtr
Convenience shared pointer for Plane.
Definition global.hpp:78