opencv 0.5.3

Rust bindings for OpenCV
Documentation
extern "C" {
   #[doc(hidden)] fn cv_new_VectorOfMat() -> *mut c_void;
   #[doc(hidden)] fn cv_delete_VectorOfMat(ptr: *mut c_void);
   #[doc(hidden)] fn cv_push_VectorOfMat(ptr: *mut c_void, ptr2: *const c_void);
   #[doc(hidden)] fn cv_VectorOfMat_len(ptr: *mut c_void) -> i32;
   #[doc(hidden)] fn cv_VectorOfMat_get(ptr: *mut c_void, index: i32) -> *mut c_void;
}

#[allow(dead_code)]
pub struct VectorOfMat {
    pub(crate) ptr: *mut c_void
}

impl VectorOfMat {
    pub fn new() -> Self {
        unsafe { Self { ptr: cv_new_VectorOfMat() } }
    }

    pub fn len(&self) -> i32 {
        unsafe { cv_VectorOfMat_len(self.ptr) }
    }

    #[doc(hidden)]
    pub fn as_raw_VectorOfMat(&self) -> *mut c_void {
        self.ptr
    }
}

impl Drop for VectorOfMat {
    fn drop(&mut self) {
        unsafe { cv_delete_VectorOfMat(self.ptr) };
    }
}
// BoxedClassTypeInfo
impl VectorOfMat {
    pub fn push(&mut self, val: core::Mat) {
        unsafe { cv_push_VectorOfMat(self.ptr, val.ptr) }
    }

    pub fn get(&self, index: i32) -> core::Mat {
        core::Mat { ptr: unsafe { cv_VectorOfMat_get(self.ptr, index) } }
    }

    pub fn to_vec(&self) -> Vec<core::Mat> {
        (0..self.len()).map(|x| self.get(x)).collect()
    }
}