extern "C" {
#[doc(hidden)] fn cv_new_VectorOfDetectionROI() -> *mut c_void;
#[doc(hidden)] fn cv_delete_VectorOfDetectionROI(ptr: *mut c_void);
#[doc(hidden)] fn cv_push_VectorOfDetectionROI(ptr: *mut c_void, ptr2: *const c_void);
#[doc(hidden)] fn cv_VectorOfDetectionROI_len(ptr: *mut c_void) -> i32;
#[doc(hidden)] fn cv_VectorOfDetectionROI_get(ptr: *mut c_void, index: i32) -> *mut c_void;
}
#[allow(dead_code)]
pub struct VectorOfDetectionROI {
pub(crate) ptr: *mut c_void
}
impl VectorOfDetectionROI {
pub fn new() -> Self {
unsafe { Self { ptr: cv_new_VectorOfDetectionROI() } }
}
pub fn len(&self) -> i32 {
unsafe { cv_VectorOfDetectionROI_len(self.ptr) }
}
#[doc(hidden)]
pub fn as_raw_VectorOfDetectionROI(&self) -> *mut c_void {
self.ptr
}
}
impl Drop for VectorOfDetectionROI {
fn drop(&mut self) {
unsafe { cv_delete_VectorOfDetectionROI(self.ptr) };
}
}
impl VectorOfDetectionROI {
pub fn push(&mut self, val: core::DetectionROI) {
unsafe { cv_push_VectorOfDetectionROI(self.ptr, val.ptr) }
}
pub fn get(&self, index: i32) -> core::DetectionROI {
core::DetectionROI { ptr: unsafe { cv_VectorOfDetectionROI_get(self.ptr, index) } }
}
pub fn to_vec(&self) -> Vec<core::DetectionROI> {
(0..self.len()).map(|x| self.get(x)).collect()
}
}