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 const AMBIENT: i32 = 7;
pub const FONT_SIZE: i32 = 3;
pub const IMMEDIATE_RENDERING: i32 = 5;
pub const KeyboardEvent_ALT: i32 = 1;
pub const KeyboardEvent_CTRL: i32 = 2;
pub const KeyboardEvent_KEY_DOWN: i32 = 1;
pub const KeyboardEvent_KEY_UP: i32 = 0;
pub const KeyboardEvent_NONE: i32 = 0;
pub const KeyboardEvent_SHIFT: i32 = 4;
pub const LIGHTING: i32 = 8;
pub const LINE_WIDTH: i32 = 2;
pub const Mesh_LOAD_AUTO: i32 = 0;
pub const Mesh_LOAD_OBJ: i32 = 2;
pub const Mesh_LOAD_PLY: i32 = 1;
pub const MouseEvent_LeftButton: i32 = 0+1;
pub const MouseEvent_MiddleButton: i32 = 0+2;
pub const MouseEvent_MouseButtonPress: i32 = 1+1;
pub const MouseEvent_MouseButtonRelease: i32 = 1+2;
pub const MouseEvent_MouseDblClick: i32 = 1+5;
pub const MouseEvent_MouseMove: i32 = 1;
pub const MouseEvent_MouseScrollDown: i32 = 1+3;
pub const MouseEvent_MouseScrollUp: i32 = 1+4;
pub const MouseEvent_NoButton: i32 = 0;
pub const MouseEvent_RightButton: i32 = 0+3;
pub const MouseEvent_VScroll: i32 = 0+4;
pub const OPACITY: i32 = 1;
pub const POINT_SIZE: i32 = 0;
pub const REPRESENTATION: i32 = 4;
pub const REPRESENTATION_POINTS: i32 = 0;
pub const REPRESENTATION_SURFACE: i32 = 2;
pub const REPRESENTATION_WIREFRAME: i32 = 1;
pub const SHADING: i32 = 6;
pub const SHADING_FLAT: i32 = 0;
pub const SHADING_GOURAUD: i32 = 1;
pub const SHADING_PHONG: i32 = 2;
pub const WTrajectory_FRAMES: i32 = 1;
pub const WTrajectory_PATH: i32 = 2;
pub type KeyboardCallback = dyn FnMut(crate::viz::KeyboardEvent, &mut c_void) + Send + Sync + 'static;
#[doc(hidden)] pub type KeyboardCallbackExtern = Option<extern "C" fn(unnamed_arg: *mut c_void, unnamed_arg_1: *mut c_void)>;
pub type MouseCallback = dyn FnMut(crate::viz::MouseEvent, &mut c_void) + Send + Sync + 'static;
#[doc(hidden)] pub type MouseCallbackExtern = Option<extern "C" fn(unnamed_arg: *mut c_void, unnamed_arg_1: *mut c_void)>;
pub fn vec3b() -> Result<()> {
unsafe { sys::cv_Vec3b_const() }.into_result()
}
pub fn compute_normals(mesh: &crate::viz::Mesh, normals: &mut dyn core::ToOutputArray) -> Result<()> {
output_array_arg!(normals);
unsafe { sys::cv_viz_computeNormals_Mesh__OutputArray(mesh.as_raw_Mesh(), normals.as_raw__OutputArray()) }.into_result()
}
pub fn get_window_by_name(window_name: &str) -> Result<crate::viz::Viz3d> {
string_arg!(window_name);
unsafe { sys::cv_viz_getWindowByName_String(window_name.as_ptr()) }.into_result().map(|ptr| crate::viz::Viz3d { ptr })
}
pub fn imshow(window_name: &str, image: &dyn core::ToInputArray, window_size: core::Size) -> Result<crate::viz::Viz3d> {
string_arg!(window_name);
input_array_arg!(image);
unsafe { sys::cv_viz_imshow_String__InputArray_Size(window_name.as_ptr(), image.as_raw__InputArray(), window_size) }.into_result().map(|ptr| crate::viz::Viz3d { ptr })
}
pub fn is_nan(x: f64) -> Result<bool> {
unsafe { sys::cv_viz_isNan_double(x) }.into_result()
}
pub fn is_nan_1(x: f32) -> Result<bool> {
unsafe { sys::cv_viz_isNan_float(x) }.into_result()
}
pub fn read_cloud(file: &str, colors: &mut dyn core::ToOutputArray, normals: &mut dyn core::ToOutputArray) -> Result<core::Mat> {
string_arg!(file);
output_array_arg!(colors);
output_array_arg!(normals);
unsafe { sys::cv_viz_readCloud_String__OutputArray__OutputArray(file.as_ptr(), colors.as_raw__OutputArray(), normals.as_raw__OutputArray()) }.into_result().map(|ptr| core::Mat { ptr })
}
pub fn read_mesh(file: &str) -> Result<crate::viz::Mesh> {
string_arg!(file);
unsafe { sys::cv_viz_readMesh_String(file.as_ptr()) }.into_result().map(|ptr| crate::viz::Mesh { ptr })
}
pub fn read_trajectory(traj: &mut dyn core::ToOutputArray, files_format: &str, start: i32, end: i32, tag: &str) -> Result<()> {
output_array_arg!(traj);
string_arg!(files_format);
string_arg!(tag);
unsafe { sys::cv_viz_readTrajectory__OutputArray_String_int_int_String(traj.as_raw__OutputArray(), files_format.as_ptr(), start, end, tag.as_ptr()) }.into_result()
}
pub fn unregister_all_windows() -> Result<()> {
unsafe { sys::cv_viz_unregisterAllWindows() }.into_result()
}
pub fn write_cloud(file: &str, cloud: &dyn core::ToInputArray, colors: &dyn core::ToInputArray, normals: &dyn core::ToInputArray, binary: bool) -> Result<()> {
string_arg!(file);
input_array_arg!(cloud);
input_array_arg!(colors);
input_array_arg!(normals);
unsafe { sys::cv_viz_writeCloud_String__InputArray__InputArray__InputArray_bool(file.as_ptr(), cloud.as_raw__InputArray(), colors.as_raw__InputArray(), normals.as_raw__InputArray(), binary) }.into_result()
}
pub fn write_trajectory(traj: &dyn core::ToInputArray, files_format: &str, start: i32, tag: &str) -> Result<()> {
input_array_arg!(traj);
string_arg!(files_format);
string_arg!(tag);
unsafe { sys::cv_viz_writeTrajectory__InputArray_String_int_String(traj.as_raw__InputArray(), files_format.as_ptr(), start, tag.as_ptr()) }.into_result()
}
pub struct Camera {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::Camera {
fn drop(&mut self) {
unsafe { sys::cv_Camera_delete(self.ptr) };
}
}
impl crate::viz::Camera {
#[inline(always)] pub fn as_raw_Camera(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for Camera {}
impl Camera {
pub fn new(fx: f64, fy: f64, cx: f64, cy: f64, window_size: core::Size) -> Result<crate::viz::Camera> {
unsafe { sys::cv_viz_Camera_Camera_double_double_double_double_Size(fx, fy, cx, cy, window_size) }.into_result().map(|ptr| crate::viz::Camera { ptr })
}
pub fn new_1(fov: core::Vec2d, window_size: core::Size) -> Result<crate::viz::Camera> {
unsafe { sys::cv_viz_Camera_Camera_Vec2d_Size(fov, window_size) }.into_result().map(|ptr| crate::viz::Camera { ptr })
}
pub fn get_clip(&self) -> Result<core::Vec2d> {
unsafe { sys::cv_viz_Camera_getClip_const(self.as_raw_Camera()) }.into_result()
}
pub fn set_clip(&mut self, clip: core::Vec2d) -> Result<()> {
unsafe { sys::cv_viz_Camera_setClip_Vec2d(self.as_raw_Camera(), clip) }.into_result()
}
pub fn get_window_size(&self) -> Result<core::Size> {
unsafe { sys::cv_viz_Camera_getWindowSize_const(self.as_raw_Camera()) }.into_result()
}
pub fn set_window_size(&mut self, window_size: core::Size) -> Result<()> {
unsafe { sys::cv_viz_Camera_setWindowSize_Size(self.as_raw_Camera(), window_size) }.into_result()
}
pub fn get_fov(&self) -> Result<core::Vec2d> {
unsafe { sys::cv_viz_Camera_getFov_const(self.as_raw_Camera()) }.into_result()
}
pub fn set_fov(&mut self, fov: core::Vec2d) -> Result<()> {
unsafe { sys::cv_viz_Camera_setFov_Vec2d(self.as_raw_Camera(), fov) }.into_result()
}
pub fn get_principal_point(&self) -> Result<core::Vec2d> {
unsafe { sys::cv_viz_Camera_getPrincipalPoint_const(self.as_raw_Camera()) }.into_result()
}
pub fn get_focal_length(&self) -> Result<core::Vec2d> {
unsafe { sys::cv_viz_Camera_getFocalLength_const(self.as_raw_Camera()) }.into_result()
}
pub fn kinect_camera(window_size: core::Size) -> Result<crate::viz::Camera> {
unsafe { sys::cv_viz_Camera_KinectCamera_Size(window_size) }.into_result().map(|ptr| crate::viz::Camera { ptr })
}
}
pub struct Color {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::Color {
fn drop(&mut self) {
unsafe { sys::cv_Color_delete(self.ptr) };
}
}
impl crate::viz::Color {
#[inline(always)] pub fn as_raw_Color(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for Color {}
impl Color {
pub fn default() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_Color() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn new(gray: f64) -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_Color_double(gray) }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn new_1(blue: f64, green: f64, red: f64) -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_Color_double_double_double(blue, green, red) }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn new_2(color: core::Scalar) -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_Color_Scalar(color) }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn to_vec3b(&self) -> Result<core::Vec3b> {
unsafe { sys::cv_viz_Color_operator_Vec3b_const(self.as_raw_Color()) }.into_result()
}
pub fn black() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_black() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn blue() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_blue() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn green() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_green() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn cyan() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_cyan() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn red() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_red() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn magenta() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_magenta() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn yellow() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_yellow() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn white() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_white() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn gray() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_gray() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn mlab() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_mlab() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn navy() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_navy() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn olive() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_olive() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn maroon() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_maroon() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn teal() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_teal() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn rose() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_rose() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn azure() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_azure() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn lime() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_lime() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn gold() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_gold() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn brown() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_brown() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn orange() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_orange() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn chartreuse() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_chartreuse() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn orange_red() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_orange_red() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn purple() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_purple() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn indigo() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_indigo() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn pink() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_pink() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn cherry() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_cherry() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn bluberry() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_bluberry() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn raspberry() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_raspberry() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn silver() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_silver() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn violet() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_violet() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn apricot() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_apricot() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn turquoise() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_turquoise() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn celestial_blue() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_celestial_blue() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn amethyst() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_amethyst() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
pub fn not_set() -> Result<crate::viz::Color> {
unsafe { sys::cv_viz_Color_not_set() }.into_result().map(|ptr| crate::viz::Color { ptr })
}
}
pub struct KeyboardEvent {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::KeyboardEvent {
fn drop(&mut self) {
unsafe { sys::cv_KeyboardEvent_delete(self.ptr) };
}
}
impl crate::viz::KeyboardEvent {
#[inline(always)] pub fn as_raw_KeyboardEvent(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for KeyboardEvent {}
impl KeyboardEvent {
}
pub struct Mesh {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::Mesh {
fn drop(&mut self) {
unsafe { sys::cv_Mesh_delete(self.ptr) };
}
}
impl crate::viz::Mesh {
#[inline(always)] pub fn as_raw_Mesh(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for Mesh {}
impl Mesh {
pub fn load(file: &str, _type: i32) -> Result<crate::viz::Mesh> {
string_arg!(file);
unsafe { sys::cv_viz_Mesh_load_String_int(file.as_ptr(), _type) }.into_result().map(|ptr| crate::viz::Mesh { ptr })
}
}
pub struct MouseEvent {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::MouseEvent {
fn drop(&mut self) {
unsafe { sys::cv_MouseEvent_delete(self.ptr) };
}
}
impl crate::viz::MouseEvent {
#[inline(always)] pub fn as_raw_MouseEvent(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for MouseEvent {}
impl MouseEvent {
}
pub struct Viz3d {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::Viz3d {
fn drop(&mut self) {
unsafe { sys::cv_Viz3d_delete(self.ptr) };
}
}
impl crate::viz::Viz3d {
#[inline(always)] pub fn as_raw_Viz3d(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for Viz3d {}
impl Viz3d {
pub fn new(window_name: &str) -> Result<crate::viz::Viz3d> {
string_arg!(window_name);
unsafe { sys::cv_viz_Viz3d_Viz3d_String(window_name.as_ptr()) }.into_result().map(|ptr| crate::viz::Viz3d { ptr })
}
pub fn copy(unnamed_arg: &crate::viz::Viz3d) -> Result<crate::viz::Viz3d> {
unsafe { sys::cv_viz_Viz3d_Viz3d_Viz3d(unnamed_arg.as_raw_Viz3d()) }.into_result().map(|ptr| crate::viz::Viz3d { ptr })
}
pub fn remove_widget(&mut self, id: &str) -> Result<()> {
string_arg!(id);
unsafe { sys::cv_viz_Viz3d_removeWidget_String(self.as_raw_Viz3d(), id.as_ptr()) }.into_result()
}
pub fn remove_all_widgets(&mut self) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_removeAllWidgets(self.as_raw_Viz3d()) }.into_result()
}
pub fn show_image(&mut self, image: &dyn core::ToInputArray, window_size: core::Size) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_viz_Viz3d_showImage__InputArray_Size(self.as_raw_Viz3d(), image.as_raw__InputArray(), window_size) }.into_result()
}
pub fn set_camera(&mut self, camera: &crate::viz::Camera) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setCamera_Camera(self.as_raw_Viz3d(), camera.as_raw_Camera()) }.into_result()
}
pub fn get_camera(&self) -> Result<crate::viz::Camera> {
unsafe { sys::cv_viz_Viz3d_getCamera_const(self.as_raw_Viz3d()) }.into_result().map(|ptr| crate::viz::Camera { ptr })
}
pub fn reset_camera_viewpoint(&mut self, id: &str) -> Result<()> {
string_arg!(id);
unsafe { sys::cv_viz_Viz3d_resetCameraViewpoint_String(self.as_raw_Viz3d(), id.as_ptr()) }.into_result()
}
pub fn reset_camera(&mut self) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_resetCamera(self.as_raw_Viz3d()) }.into_result()
}
pub fn get_window_size(&self) -> Result<core::Size> {
unsafe { sys::cv_viz_Viz3d_getWindowSize_const(self.as_raw_Viz3d()) }.into_result()
}
pub fn set_window_size(&mut self, window_size: core::Size) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setWindowSize_Size(self.as_raw_Viz3d(), window_size) }.into_result()
}
pub fn get_window_name(&self) -> Result<String> {
unsafe { sys::cv_viz_Viz3d_getWindowName_const(self.as_raw_Viz3d()) }.into_result().map(crate::templ::receive_string_mut)
}
pub fn get_screenshot(&self) -> Result<core::Mat> {
unsafe { sys::cv_viz_Viz3d_getScreenshot_const(self.as_raw_Viz3d()) }.into_result().map(|ptr| core::Mat { ptr })
}
pub fn save_screenshot(&mut self, file: &str) -> Result<()> {
string_arg!(file);
unsafe { sys::cv_viz_Viz3d_saveScreenshot_String(self.as_raw_Viz3d(), file.as_ptr()) }.into_result()
}
pub fn set_window_position(&mut self, window_position: core::Point) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setWindowPosition_Point(self.as_raw_Viz3d(), window_position) }.into_result()
}
pub fn set_full_screen(&mut self, mode: bool) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setFullScreen_bool(self.as_raw_Viz3d(), mode) }.into_result()
}
pub fn set_background_color(&mut self, color: &crate::viz::Color, color2: &crate::viz::Color) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setBackgroundColor_Color_Color(self.as_raw_Viz3d(), color.as_raw_Color(), color2.as_raw_Color()) }.into_result()
}
pub fn set_background_texture(&mut self, image: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_viz_Viz3d_setBackgroundTexture__InputArray(self.as_raw_Viz3d(), image.as_raw__InputArray()) }.into_result()
}
pub fn set_background_mesh_lab(&mut self) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setBackgroundMeshLab(self.as_raw_Viz3d()) }.into_result()
}
pub fn spin(&mut self) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_spin(self.as_raw_Viz3d()) }.into_result()
}
pub fn spin_once(&mut self, time: i32, force_redraw: bool) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_spinOnce_int_bool(self.as_raw_Viz3d(), time, force_redraw) }.into_result()
}
pub fn set_off_screen_rendering(&mut self) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setOffScreenRendering(self.as_raw_Viz3d()) }.into_result()
}
pub fn remove_all_lights(&mut self) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_removeAllLights(self.as_raw_Viz3d()) }.into_result()
}
pub fn add_light(&mut self, position: core::Vec3d, focal_point: core::Vec3d, color: &crate::viz::Color, diffuse_color: &crate::viz::Color, ambient_color: &crate::viz::Color, specular_color: &crate::viz::Color) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_addLight_Vec3d_Vec3d_Color_Color_Color_Color(self.as_raw_Viz3d(), position, focal_point, color.as_raw_Color(), diffuse_color.as_raw_Color(), ambient_color.as_raw_Color(), specular_color.as_raw_Color()) }.into_result()
}
pub fn was_stopped(&self) -> Result<bool> {
unsafe { sys::cv_viz_Viz3d_wasStopped_const(self.as_raw_Viz3d()) }.into_result()
}
pub fn close(&mut self) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_close(self.as_raw_Viz3d()) }.into_result()
}
pub fn set_rendering_property(&mut self, id: &str, property: i32, value: f64) -> Result<()> {
string_arg!(id);
unsafe { sys::cv_viz_Viz3d_setRenderingProperty_String_int_double(self.as_raw_Viz3d(), id.as_ptr(), property, value) }.into_result()
}
pub fn get_rendering_property(&mut self, id: &str, property: i32) -> Result<f64> {
string_arg!(id);
unsafe { sys::cv_viz_Viz3d_getRenderingProperty_String_int(self.as_raw_Viz3d(), id.as_ptr(), property) }.into_result()
}
pub fn set_representation(&mut self, representation: i32) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setRepresentation_int(self.as_raw_Viz3d(), representation) }.into_result()
}
pub fn set_global_warnings(&mut self, enabled: bool) -> Result<()> {
unsafe { sys::cv_viz_Viz3d_setGlobalWarnings_bool(self.as_raw_Viz3d(), enabled) }.into_result()
}
}
pub struct WArrow {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WArrow {
fn drop(&mut self) {
unsafe { sys::cv_WArrow_delete(self.ptr) };
}
}
impl crate::viz::WArrow {
#[inline(always)] pub fn as_raw_WArrow(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WArrow {}
impl crate::viz::Widget for WArrow {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WArrow {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WArrow {
}
pub struct WCameraPosition {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCameraPosition {
fn drop(&mut self) {
unsafe { sys::cv_WCameraPosition_delete(self.ptr) };
}
}
impl crate::viz::WCameraPosition {
#[inline(always)] pub fn as_raw_WCameraPosition(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCameraPosition {}
impl crate::viz::Widget for WCameraPosition {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCameraPosition {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCameraPosition {
pub fn new(scale: f64) -> Result<crate::viz::WCameraPosition> {
unsafe { sys::cv_viz_WCameraPosition_WCameraPosition_double(scale) }.into_result().map(|ptr| crate::viz::WCameraPosition { ptr })
}
pub fn new_1(fov: core::Vec2d, scale: f64, color: &crate::viz::Color) -> Result<crate::viz::WCameraPosition> {
unsafe { sys::cv_viz_WCameraPosition_WCameraPosition_Vec2d_double_Color(fov, scale, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WCameraPosition { ptr })
}
pub fn new_2(fov: core::Vec2d, image: &dyn core::ToInputArray, scale: f64, color: &crate::viz::Color) -> Result<crate::viz::WCameraPosition> {
input_array_arg!(image);
unsafe { sys::cv_viz_WCameraPosition_WCameraPosition_Vec2d__InputArray_double_Color(fov, image.as_raw__InputArray(), scale, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WCameraPosition { ptr })
}
}
pub struct WCircle {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCircle {
fn drop(&mut self) {
unsafe { sys::cv_WCircle_delete(self.ptr) };
}
}
impl crate::viz::WCircle {
#[inline(always)] pub fn as_raw_WCircle(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCircle {}
impl crate::viz::Widget for WCircle {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCircle {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCircle {
pub fn new(radius: f64, thickness: f64, color: &crate::viz::Color) -> Result<crate::viz::WCircle> {
unsafe { sys::cv_viz_WCircle_WCircle_double_double_Color(radius, thickness, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WCircle { ptr })
}
}
pub struct WCloud {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCloud {
fn drop(&mut self) {
unsafe { sys::cv_WCloud_delete(self.ptr) };
}
}
impl crate::viz::WCloud {
#[inline(always)] pub fn as_raw_WCloud(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCloud {}
impl crate::viz::Widget for WCloud {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCloud {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCloud {
pub fn new(cloud: &dyn core::ToInputArray, colors: &dyn core::ToInputArray) -> Result<crate::viz::WCloud> {
input_array_arg!(cloud);
input_array_arg!(colors);
unsafe { sys::cv_viz_WCloud_WCloud__InputArray__InputArray(cloud.as_raw__InputArray(), colors.as_raw__InputArray()) }.into_result().map(|ptr| crate::viz::WCloud { ptr })
}
pub fn new_1(cloud: &dyn core::ToInputArray, color: &crate::viz::Color) -> Result<crate::viz::WCloud> {
input_array_arg!(cloud);
unsafe { sys::cv_viz_WCloud_WCloud__InputArray_Color(cloud.as_raw__InputArray(), color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WCloud { ptr })
}
pub fn new_2(cloud: &dyn core::ToInputArray, colors: &dyn core::ToInputArray, normals: &dyn core::ToInputArray) -> Result<crate::viz::WCloud> {
input_array_arg!(cloud);
input_array_arg!(colors);
input_array_arg!(normals);
unsafe { sys::cv_viz_WCloud_WCloud__InputArray__InputArray__InputArray(cloud.as_raw__InputArray(), colors.as_raw__InputArray(), normals.as_raw__InputArray()) }.into_result().map(|ptr| crate::viz::WCloud { ptr })
}
pub fn new_3(cloud: &dyn core::ToInputArray, color: &crate::viz::Color, normals: &dyn core::ToInputArray) -> Result<crate::viz::WCloud> {
input_array_arg!(cloud);
input_array_arg!(normals);
unsafe { sys::cv_viz_WCloud_WCloud__InputArray_Color__InputArray(cloud.as_raw__InputArray(), color.as_raw_Color(), normals.as_raw__InputArray()) }.into_result().map(|ptr| crate::viz::WCloud { ptr })
}
}
pub struct WCloudCollection {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCloudCollection {
fn drop(&mut self) {
unsafe { sys::cv_WCloudCollection_delete(self.ptr) };
}
}
impl crate::viz::WCloudCollection {
#[inline(always)] pub fn as_raw_WCloudCollection(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCloudCollection {}
impl crate::viz::Widget for WCloudCollection {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCloudCollection {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCloudCollection {
pub fn default() -> Result<crate::viz::WCloudCollection> {
unsafe { sys::cv_viz_WCloudCollection_WCloudCollection() }.into_result().map(|ptr| crate::viz::WCloudCollection { ptr })
}
pub fn finalize(&mut self) -> Result<()> {
unsafe { sys::cv_viz_WCloudCollection_finalize(self.as_raw_WCloudCollection()) }.into_result()
}
}
pub struct WCloudNormals {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCloudNormals {
fn drop(&mut self) {
unsafe { sys::cv_WCloudNormals_delete(self.ptr) };
}
}
impl crate::viz::WCloudNormals {
#[inline(always)] pub fn as_raw_WCloudNormals(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCloudNormals {}
impl crate::viz::Widget for WCloudNormals {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCloudNormals {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCloudNormals {
pub fn new(cloud: &dyn core::ToInputArray, normals: &dyn core::ToInputArray, level: i32, scale: f64, color: &crate::viz::Color) -> Result<crate::viz::WCloudNormals> {
input_array_arg!(cloud);
input_array_arg!(normals);
unsafe { sys::cv_viz_WCloudNormals_WCloudNormals__InputArray__InputArray_int_double_Color(cloud.as_raw__InputArray(), normals.as_raw__InputArray(), level, scale, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WCloudNormals { ptr })
}
}
pub struct WCone {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCone {
fn drop(&mut self) {
unsafe { sys::cv_WCone_delete(self.ptr) };
}
}
impl crate::viz::WCone {
#[inline(always)] pub fn as_raw_WCone(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCone {}
impl crate::viz::Widget for WCone {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCone {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCone {
pub fn new(length: f64, radius: f64, resolution: i32, color: &crate::viz::Color) -> Result<crate::viz::WCone> {
unsafe { sys::cv_viz_WCone_WCone_double_double_int_Color(length, radius, resolution, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WCone { ptr })
}
}
pub struct WCoordinateSystem {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCoordinateSystem {
fn drop(&mut self) {
unsafe { sys::cv_WCoordinateSystem_delete(self.ptr) };
}
}
impl crate::viz::WCoordinateSystem {
#[inline(always)] pub fn as_raw_WCoordinateSystem(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCoordinateSystem {}
impl crate::viz::Widget for WCoordinateSystem {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCoordinateSystem {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCoordinateSystem {
pub fn new(scale: f64) -> Result<crate::viz::WCoordinateSystem> {
unsafe { sys::cv_viz_WCoordinateSystem_WCoordinateSystem_double(scale) }.into_result().map(|ptr| crate::viz::WCoordinateSystem { ptr })
}
}
pub struct WCube {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCube {
fn drop(&mut self) {
unsafe { sys::cv_WCube_delete(self.ptr) };
}
}
impl crate::viz::WCube {
#[inline(always)] pub fn as_raw_WCube(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCube {}
impl crate::viz::Widget for WCube {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCube {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCube {
}
pub struct WCylinder {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WCylinder {
fn drop(&mut self) {
unsafe { sys::cv_WCylinder_delete(self.ptr) };
}
}
impl crate::viz::WCylinder {
#[inline(always)] pub fn as_raw_WCylinder(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WCylinder {}
impl crate::viz::Widget for WCylinder {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WCylinder {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WCylinder {
}
pub struct WGrid {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WGrid {
fn drop(&mut self) {
unsafe { sys::cv_WGrid_delete(self.ptr) };
}
}
impl crate::viz::WGrid {
#[inline(always)] pub fn as_raw_WGrid(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WGrid {}
impl crate::viz::Widget for WGrid {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WGrid {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WGrid {
pub fn new(cells: core::Vec2i, cells_spacing: core::Vec2d, color: &crate::viz::Color) -> Result<crate::viz::WGrid> {
unsafe { sys::cv_viz_WGrid_WGrid_Vec2i_Vec2d_Color(cells, cells_spacing, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WGrid { ptr })
}
}
pub struct WImage3D {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WImage3D {
fn drop(&mut self) {
unsafe { sys::cv_WImage3D_delete(self.ptr) };
}
}
impl crate::viz::WImage3D {
#[inline(always)] pub fn as_raw_WImage3D(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WImage3D {}
impl crate::viz::Widget for WImage3D {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WImage3D {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WImage3D {
pub fn new(image: &dyn core::ToInputArray, size: core::Size2d) -> Result<crate::viz::WImage3D> {
input_array_arg!(image);
unsafe { sys::cv_viz_WImage3D_WImage3D__InputArray_Size2d(image.as_raw__InputArray(), size) }.into_result().map(|ptr| crate::viz::WImage3D { ptr })
}
pub fn new_1(image: &dyn core::ToInputArray, size: core::Size2d, center: core::Vec3d, normal: core::Vec3d, up_vector: core::Vec3d) -> Result<crate::viz::WImage3D> {
input_array_arg!(image);
unsafe { sys::cv_viz_WImage3D_WImage3D__InputArray_Size2d_Vec3d_Vec3d_Vec3d(image.as_raw__InputArray(), size, center, normal, up_vector) }.into_result().map(|ptr| crate::viz::WImage3D { ptr })
}
pub fn set_image(&mut self, image: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_viz_WImage3D_setImage__InputArray(self.as_raw_WImage3D(), image.as_raw__InputArray()) }.into_result()
}
pub fn set_size(&mut self, size: core::Size) -> Result<()> {
unsafe { sys::cv_viz_WImage3D_setSize_Size(self.as_raw_WImage3D(), size) }.into_result()
}
}
pub struct WImageOverlay {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WImageOverlay {
fn drop(&mut self) {
unsafe { sys::cv_WImageOverlay_delete(self.ptr) };
}
}
impl crate::viz::WImageOverlay {
#[inline(always)] pub fn as_raw_WImageOverlay(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WImageOverlay {}
impl crate::viz::Widget for WImageOverlay {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget2D for WImageOverlay {
#[inline(always)] fn as_raw_Widget2D(&self) -> *mut c_void { self.ptr }
}
impl WImageOverlay {
pub fn new(image: &dyn core::ToInputArray, rect: core::Rect) -> Result<crate::viz::WImageOverlay> {
input_array_arg!(image);
unsafe { sys::cv_viz_WImageOverlay_WImageOverlay__InputArray_Rect(image.as_raw__InputArray(), rect) }.into_result().map(|ptr| crate::viz::WImageOverlay { ptr })
}
pub fn set_image(&mut self, image: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_viz_WImageOverlay_setImage__InputArray(self.as_raw_WImageOverlay(), image.as_raw__InputArray()) }.into_result()
}
}
pub struct WLine {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WLine {
fn drop(&mut self) {
unsafe { sys::cv_WLine_delete(self.ptr) };
}
}
impl crate::viz::WLine {
#[inline(always)] pub fn as_raw_WLine(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WLine {}
impl crate::viz::Widget for WLine {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WLine {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WLine {
}
pub struct WMesh {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WMesh {
fn drop(&mut self) {
unsafe { sys::cv_WMesh_delete(self.ptr) };
}
}
impl crate::viz::WMesh {
#[inline(always)] pub fn as_raw_WMesh(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WMesh {}
impl crate::viz::Widget for WMesh {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WMesh {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WMesh {
pub fn new(mesh: &crate::viz::Mesh) -> Result<crate::viz::WMesh> {
unsafe { sys::cv_viz_WMesh_WMesh_Mesh(mesh.as_raw_Mesh()) }.into_result().map(|ptr| crate::viz::WMesh { ptr })
}
pub fn new_1(cloud: &dyn core::ToInputArray, polygons: &dyn core::ToInputArray, colors: &dyn core::ToInputArray, normals: &dyn core::ToInputArray) -> Result<crate::viz::WMesh> {
input_array_arg!(cloud);
input_array_arg!(polygons);
input_array_arg!(colors);
input_array_arg!(normals);
unsafe { sys::cv_viz_WMesh_WMesh__InputArray__InputArray__InputArray__InputArray(cloud.as_raw__InputArray(), polygons.as_raw__InputArray(), colors.as_raw__InputArray(), normals.as_raw__InputArray()) }.into_result().map(|ptr| crate::viz::WMesh { ptr })
}
}
pub struct WPaintedCloud {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WPaintedCloud {
fn drop(&mut self) {
unsafe { sys::cv_WPaintedCloud_delete(self.ptr) };
}
}
impl crate::viz::WPaintedCloud {
#[inline(always)] pub fn as_raw_WPaintedCloud(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WPaintedCloud {}
impl crate::viz::Widget for WPaintedCloud {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WPaintedCloud {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WPaintedCloud {
pub fn new(cloud: &dyn core::ToInputArray) -> Result<crate::viz::WPaintedCloud> {
input_array_arg!(cloud);
unsafe { sys::cv_viz_WPaintedCloud_WPaintedCloud__InputArray(cloud.as_raw__InputArray()) }.into_result().map(|ptr| crate::viz::WPaintedCloud { ptr })
}
}
pub struct WPlane {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WPlane {
fn drop(&mut self) {
unsafe { sys::cv_WPlane_delete(self.ptr) };
}
}
impl crate::viz::WPlane {
#[inline(always)] pub fn as_raw_WPlane(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WPlane {}
impl crate::viz::Widget for WPlane {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WPlane {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WPlane {
pub fn new(size: core::Size2d, color: &crate::viz::Color) -> Result<crate::viz::WPlane> {
unsafe { sys::cv_viz_WPlane_WPlane_Size2d_Color(size, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WPlane { ptr })
}
}
pub struct WPolyLine {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WPolyLine {
fn drop(&mut self) {
unsafe { sys::cv_WPolyLine_delete(self.ptr) };
}
}
impl crate::viz::WPolyLine {
#[inline(always)] pub fn as_raw_WPolyLine(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WPolyLine {}
impl crate::viz::Widget for WPolyLine {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WPolyLine {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WPolyLine {
pub fn new(points: &dyn core::ToInputArray, colors: &dyn core::ToInputArray) -> Result<crate::viz::WPolyLine> {
input_array_arg!(points);
input_array_arg!(colors);
unsafe { sys::cv_viz_WPolyLine_WPolyLine__InputArray__InputArray(points.as_raw__InputArray(), colors.as_raw__InputArray()) }.into_result().map(|ptr| crate::viz::WPolyLine { ptr })
}
pub fn new_1(points: &dyn core::ToInputArray, color: &crate::viz::Color) -> Result<crate::viz::WPolyLine> {
input_array_arg!(points);
unsafe { sys::cv_viz_WPolyLine_WPolyLine__InputArray_Color(points.as_raw__InputArray(), color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WPolyLine { ptr })
}
}
pub struct WSphere {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WSphere {
fn drop(&mut self) {
unsafe { sys::cv_WSphere_delete(self.ptr) };
}
}
impl crate::viz::WSphere {
#[inline(always)] pub fn as_raw_WSphere(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WSphere {}
impl crate::viz::Widget for WSphere {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WSphere {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WSphere {
}
pub struct WText {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WText {
fn drop(&mut self) {
unsafe { sys::cv_WText_delete(self.ptr) };
}
}
impl crate::viz::WText {
#[inline(always)] pub fn as_raw_WText(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WText {}
impl crate::viz::Widget for WText {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget2D for WText {
#[inline(always)] fn as_raw_Widget2D(&self) -> *mut c_void { self.ptr }
}
impl WText {
pub fn new(text: &str, pos: core::Point, font_size: i32, color: &crate::viz::Color) -> Result<crate::viz::WText> {
string_arg!(text);
unsafe { sys::cv_viz_WText_WText_String_Point_int_Color(text.as_ptr(), pos, font_size, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WText { ptr })
}
pub fn set_text(&mut self, text: &str) -> Result<()> {
string_arg!(text);
unsafe { sys::cv_viz_WText_setText_String(self.as_raw_WText(), text.as_ptr()) }.into_result()
}
pub fn get_text(&self) -> Result<String> {
unsafe { sys::cv_viz_WText_getText_const(self.as_raw_WText()) }.into_result().map(crate::templ::receive_string_mut)
}
}
pub struct WText3D {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WText3D {
fn drop(&mut self) {
unsafe { sys::cv_WText3D_delete(self.ptr) };
}
}
impl crate::viz::WText3D {
#[inline(always)] pub fn as_raw_WText3D(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WText3D {}
impl crate::viz::Widget for WText3D {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WText3D {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WText3D {
pub fn set_text(&mut self, text: &str) -> Result<()> {
string_arg!(text);
unsafe { sys::cv_viz_WText3D_setText_String(self.as_raw_WText3D(), text.as_ptr()) }.into_result()
}
pub fn get_text(&self) -> Result<String> {
unsafe { sys::cv_viz_WText3D_getText_const(self.as_raw_WText3D()) }.into_result().map(crate::templ::receive_string_mut)
}
}
pub struct WTrajectory {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WTrajectory {
fn drop(&mut self) {
unsafe { sys::cv_WTrajectory_delete(self.ptr) };
}
}
impl crate::viz::WTrajectory {
#[inline(always)] pub fn as_raw_WTrajectory(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WTrajectory {}
impl crate::viz::Widget for WTrajectory {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WTrajectory {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WTrajectory {
pub fn new(path: &dyn core::ToInputArray, display_mode: i32, scale: f64, color: &crate::viz::Color) -> Result<crate::viz::WTrajectory> {
input_array_arg!(path);
unsafe { sys::cv_viz_WTrajectory_WTrajectory__InputArray_int_double_Color(path.as_raw__InputArray(), display_mode, scale, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WTrajectory { ptr })
}
}
pub struct WTrajectoryFrustums {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WTrajectoryFrustums {
fn drop(&mut self) {
unsafe { sys::cv_WTrajectoryFrustums_delete(self.ptr) };
}
}
impl crate::viz::WTrajectoryFrustums {
#[inline(always)] pub fn as_raw_WTrajectoryFrustums(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WTrajectoryFrustums {}
impl crate::viz::Widget for WTrajectoryFrustums {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WTrajectoryFrustums {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WTrajectoryFrustums {
pub fn new(path: &dyn core::ToInputArray, fov: core::Vec2d, scale: f64, color: &crate::viz::Color) -> Result<crate::viz::WTrajectoryFrustums> {
input_array_arg!(path);
unsafe { sys::cv_viz_WTrajectoryFrustums_WTrajectoryFrustums__InputArray_Vec2d_double_Color(path.as_raw__InputArray(), fov, scale, color.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WTrajectoryFrustums { ptr })
}
}
pub struct WTrajectorySpheres {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WTrajectorySpheres {
fn drop(&mut self) {
unsafe { sys::cv_WTrajectorySpheres_delete(self.ptr) };
}
}
impl crate::viz::WTrajectorySpheres {
#[inline(always)] pub fn as_raw_WTrajectorySpheres(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WTrajectorySpheres {}
impl crate::viz::Widget for WTrajectorySpheres {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WTrajectorySpheres {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WTrajectorySpheres {
pub fn new(path: &dyn core::ToInputArray, line_length: f64, radius: f64, from: &crate::viz::Color, to: &crate::viz::Color) -> Result<crate::viz::WTrajectorySpheres> {
input_array_arg!(path);
unsafe { sys::cv_viz_WTrajectorySpheres_WTrajectorySpheres__InputArray_double_double_Color_Color(path.as_raw__InputArray(), line_length, radius, from.as_raw_Color(), to.as_raw_Color()) }.into_result().map(|ptr| crate::viz::WTrajectorySpheres { ptr })
}
}
pub struct WWidgetMerger {
#[doc(hidden)] pub(crate) ptr: *mut c_void
}
impl Drop for crate::viz::WWidgetMerger {
fn drop(&mut self) {
unsafe { sys::cv_WWidgetMerger_delete(self.ptr) };
}
}
impl crate::viz::WWidgetMerger {
#[inline(always)] pub fn as_raw_WWidgetMerger(&self) -> *mut c_void { self.ptr }
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self {
Self { ptr }
}
}
unsafe impl Send for WWidgetMerger {}
impl crate::viz::Widget for WWidgetMerger {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void { self.ptr }
}
impl crate::viz::Widget3D for WWidgetMerger {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void { self.ptr }
}
impl WWidgetMerger {
pub fn default() -> Result<crate::viz::WWidgetMerger> {
unsafe { sys::cv_viz_WWidgetMerger_WWidgetMerger() }.into_result().map(|ptr| crate::viz::WWidgetMerger { ptr })
}
pub fn finalize(&mut self) -> Result<()> {
unsafe { sys::cv_viz_WWidgetMerger_finalize(self.as_raw_WWidgetMerger()) }.into_result()
}
}
pub trait Widget {
#[inline(always)] fn as_raw_Widget(&self) -> *mut c_void;
fn set_rendering_property(&mut self, property: i32, value: f64) -> Result<()> {
unsafe { sys::cv_viz_Widget_setRenderingProperty_int_double(self.as_raw_Widget(), property, value) }.into_result()
}
fn get_rendering_property(&self, property: i32) -> Result<f64> {
unsafe { sys::cv_viz_Widget_getRenderingProperty_const_int(self.as_raw_Widget(), property) }.into_result()
}
}
impl dyn Widget + '_ {
}
pub trait Widget2D: crate::viz::Widget {
#[inline(always)] fn as_raw_Widget2D(&self) -> *mut c_void;
fn set_color(&mut self, color: &crate::viz::Color) -> Result<()> {
unsafe { sys::cv_viz_Widget2D_setColor_Color(self.as_raw_Widget2D(), color.as_raw_Color()) }.into_result()
}
}
pub trait Widget3D: crate::viz::Widget {
#[inline(always)] fn as_raw_Widget3D(&self) -> *mut c_void;
fn set_color(&mut self, color: &crate::viz::Color) -> Result<()> {
unsafe { sys::cv_viz_Widget3D_setColor_Color(self.as_raw_Widget3D(), color.as_raw_Color()) }.into_result()
}
}
pub const WTrajectory_BOTH: i32 = 0x3;