use std::os::raw::{c_char, c_void};
use libc::{ptrdiff_t, size_t};
use crate::{Error, Result, core, sys, types};
use crate::core::{_InputArray, _OutputArray};
pub trait DPMDetector {
#[inline(always)] fn as_raw_DPMDetector(&self) -> *mut c_void;
fn is_empty(&self) -> Result<bool> {
unsafe { sys::cv_dpm_DPMDetector_isEmpty_const(self.as_raw_DPMDetector()) }.into_result()
}
fn detect(&mut self, image: &mut core::Mat, objects: &mut types::VectorOfObjectDetection) -> Result<()> {
unsafe { sys::cv_dpm_DPMDetector_detect_Mat_VectorOfObjectDetection(self.as_raw_DPMDetector(), image.as_raw_Mat(), objects.as_raw_VectorOfObjectDetection()) }.into_result()
}
fn get_class_count(&self) -> Result<size_t> {
unsafe { sys::cv_dpm_DPMDetector_getClassCount_const(self.as_raw_DPMDetector()) }.into_result()
}
}
impl dyn DPMDetector + '_ {
}
pub struct DPMDetector_ObjectDetection {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::dpm::DPMDetector_ObjectDetection {
fn drop(&mut self) {
unsafe { sys::cv_DPMDetector_ObjectDetection_delete(self.ptr) };
}
}
impl crate::dpm::DPMDetector_ObjectDetection {
#[inline(always)] pub fn as_raw_DPMDetector_ObjectDetection(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for DPMDetector_ObjectDetection {}
impl DPMDetector_ObjectDetection {
pub fn default() -> Result<crate::dpm::DPMDetector_ObjectDetection> {
unsafe { sys::cv_dpm_DPMDetector_ObjectDetection_ObjectDetection() }.into_result().map(|ptr| crate::dpm::DPMDetector_ObjectDetection { ptr })
}
pub fn new(rect: core::Rect, score: f32, class_id: i32) -> Result<crate::dpm::DPMDetector_ObjectDetection> {
unsafe { sys::cv_dpm_DPMDetector_ObjectDetection_ObjectDetection_Rect_float_int(rect, score, class_id) }.into_result().map(|ptr| crate::dpm::DPMDetector_ObjectDetection { ptr })
}
}