Trait opencv::ovis::WindowScene

source ·
pub trait WindowScene: WindowSceneConst {
Show 27 methods // Required method fn as_raw_mut_WindowScene(&mut self) -> *mut c_void; // Provided methods fn set_background(&mut self, image: &dyn ToInputArray) -> Result<()> { ... } fn set_background_color(&mut self, color: Scalar) -> Result<()> { ... } fn set_compositors(&mut self, names: &Vector<String>) -> Result<()> { ... } fn create_entity( &mut self, name: &str, meshname: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray ) -> Result<()> { ... } fn remove_entity(&mut self, name: &str) -> Result<()> { ... } fn set_entity_property( &mut self, name: &str, prop: i32, value: &str, sub_entity_idx: i32 ) -> Result<()> { ... } fn set_entity_property_1( &mut self, name: &str, prop: i32, value: Scalar ) -> Result<()> { ... } fn get_entity_property( &mut self, name: &str, prop: i32, value: &mut dyn ToOutputArray ) -> Result<()> { ... } fn create_camera_entity( &mut self, name: &str, k: &dyn ToInputArray, imsize: Size, z_far: f32, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, color: Scalar ) -> Result<Rect2d> { ... } fn create_light_entity( &mut self, name: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, diffuse_color: Scalar, specular_color: Scalar ) -> Result<()> { ... } fn update_entity_pose( &mut self, name: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray ) -> Result<()> { ... } fn set_entity_pose( &mut self, name: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, invert: bool ) -> Result<()> { ... } fn get_entity_pose( &mut self, name: &str, r: &mut dyn ToOutputArray, tvec: &mut dyn ToOutputArray, invert: bool ) -> Result<()> { ... } fn get_entity_animations( &mut self, name: &str, out: &mut Vector<String> ) -> Result<()> { ... } fn play_entity_animation( &mut self, name: &str, animname: &str, loop_: bool ) -> Result<()> { ... } fn stop_entity_animation(&mut self, name: &str, animname: &str) -> Result<()> { ... } fn get_screenshot(&mut self, frame: &mut dyn ToOutputArray) -> Result<()> { ... } fn get_compositor_texture( &mut self, compname: &str, texname: &str, out: &mut dyn ToOutputArray, mrt_index: i32 ) -> Result<()> { ... } fn get_depth(&mut self, depth: &mut dyn ToOutputArray) -> Result<()> { ... } fn fix_camera_yaw_axis( &mut self, use_fixed: bool, up: &dyn ToInputArray ) -> Result<()> { ... } fn set_camera_pose( &mut self, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, invert: bool ) -> Result<()> { ... } fn set_camera_look_at( &mut self, target: &str, offset: &dyn ToInputArray ) -> Result<()> { ... } fn set_entity_look_at( &mut self, origin: &str, target: &str, offset: &dyn ToInputArray ) -> Result<()> { ... } fn get_camera_pose( &mut self, r: &mut dyn ToOutputArray, tvec: &mut dyn ToOutputArray, invert: bool ) -> Result<()> { ... } fn set_camera_intrinsics( &mut self, k: &dyn ToInputArray, imsize: Size, z_near: f32, z_far: f32 ) -> Result<()> { ... } fn update(&mut self) -> Result<()> { ... }
}
Expand description

A 3D viewport and the associated scene

Required Methods§

Provided Methods§

source

fn set_background(&mut self, image: &dyn ToInputArray) -> Result<()>

set window background to custom image/ color

Parameters
  • image:
source

fn set_background_color(&mut self, color: Scalar) -> Result<()>

set window background to custom image/ color

Parameters
  • image:
Overloaded parameters
source

fn set_compositors(&mut self, names: &Vector<String>) -> Result<()>

enable an ordered chain of full-screen post processing effects

this way you can add distortion or SSAO effects. The effects themselves must be defined inside Ogre .compositor scripts.

Parameters
  • names: compositor names that will be applied in order of appearance
See also

addResourceLocation

source

fn create_entity( &mut self, name: &str, meshname: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray ) -> Result<()>

place an entity of a mesh in the scene

the mesh needs to be created beforehand. Either programmatically by e.g. [createPointCloudMesh] or by placing the respective file in a resource location.

Parameters
  • name: entity name
  • meshname: mesh name
  • tvec: translation
  • rot: [Rodrigues] vector or 3x3 rotation matrix
See also

addResourceLocation

C++ default parameters
  • tvec: noArray()
  • rot: noArray()
source

fn remove_entity(&mut self, name: &str) -> Result<()>

remove an entity from the scene

Parameters
  • name: entity name
source

fn set_entity_property( &mut self, name: &str, prop: i32, value: &str, sub_entity_idx: i32 ) -> Result<()>

set the property of an entity to the given value

Parameters
  • name: entity name
  • prop: EntityProperty
  • value: the value
  • subEntityIdx: index of the sub-entity (default: all)
C++ default parameters
  • sub_entity_idx: -1
source

fn set_entity_property_1( &mut self, name: &str, prop: i32, value: Scalar ) -> Result<()>

set the property of an entity to the given value

Parameters
  • name: entity name
  • prop: EntityProperty
  • value: the value
  • subEntityIdx: index of the sub-entity (default: all)
Overloaded parameters
source

fn get_entity_property( &mut self, name: &str, prop: i32, value: &mut dyn ToOutputArray ) -> Result<()>

get the property of an entity

Parameters
source

fn create_camera_entity( &mut self, name: &str, k: &dyn ToInputArray, imsize: Size, z_far: f32, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, color: Scalar ) -> Result<Rect2d>

convenience method to visualize a camera position

Parameters
  • name: entity name
  • K: intrinsic matrix
  • imsize: image size
  • zFar: far plane in camera coordinates
  • tvec: translation
  • rot: [Rodrigues] vector or 3x3 rotation matrix
  • color: line color
Returns

the extents of the Frustum at far plane, where the top left corner denotes the principal point offset

C++ default parameters
  • tvec: noArray()
  • rot: noArray()
  • color: Scalar::all(1)
source

fn create_light_entity( &mut self, name: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, diffuse_color: Scalar, specular_color: Scalar ) -> Result<()>

creates a point light in the scene

Parameters
  • name: entity name
  • tvec: translation
  • rot: [Rodrigues] vector or 3x3 rotation matrix
  • diffuseColor:
  • specularColor:
C++ default parameters
  • tvec: noArray()
  • rot: noArray()
  • diffuse_color: Scalar::all(1)
  • specular_color: Scalar::all(1)
source

fn update_entity_pose( &mut self, name: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray ) -> Result<()>

update entity pose by transformation in the parent coordinate space. (pre-rotation)

Parameters
  • name: entity name
  • tvec: translation
  • rot: [Rodrigues] vector or 3x3 rotation matrix
C++ default parameters
  • tvec: noArray()
  • rot: noArray()
source

fn set_entity_pose( &mut self, name: &str, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, invert: bool ) -> Result<()>

set entity pose in the world coordinate space.

Parameters
  • name: enitity name
  • tvec: translation
  • rot: [Rodrigues] vector or 3x3 rotation matrix
  • invert: use the inverse of the given pose
C++ default parameters
  • tvec: noArray()
  • rot: noArray()
  • invert: false
source

fn get_entity_pose( &mut self, name: &str, r: &mut dyn ToOutputArray, tvec: &mut dyn ToOutputArray, invert: bool ) -> Result<()>

Retrieves the current pose of an entity

Parameters
  • name: entity name
  • R: 3x3 rotation matrix
  • tvec: translation vector
  • invert: return the inverted pose
C++ default parameters
  • r: noArray()
  • tvec: noArray()
  • invert: false
source

fn get_entity_animations( &mut self, name: &str, out: &mut Vector<String> ) -> Result<()>

get a list of available entity animations

Parameters
  • name: entity name
  • out: the animation names
source

fn play_entity_animation( &mut self, name: &str, animname: &str, loop_: bool ) -> Result<()>

play entity animation

Parameters
  • name: entity name
  • animname: animation name
  • loop: enable or disable animation loop
See also

getEntityAnimations

C++ default parameters
  • loop_: true
source

fn stop_entity_animation(&mut self, name: &str, animname: &str) -> Result<()>

stop entity animation

Parameters
  • name: enitity name
  • animname: animation name
source

fn get_screenshot(&mut self, frame: &mut dyn ToOutputArray) -> Result<()>

read back the image generated by the last call to [waitKey]

source

fn get_compositor_texture( &mut self, compname: &str, texname: &str, out: &mut dyn ToOutputArray, mrt_index: i32 ) -> Result<()>

read back the texture of an active compositor

Parameters
  • compname: name of the compositor
  • texname: name of the texture inside the compositor
  • mrtIndex: if texture is a MRT, specifies the attachment
  • out: the texture contents
C++ default parameters
  • mrt_index: 0
source

fn get_depth(&mut self, depth: &mut dyn ToOutputArray) -> Result<()>

get the depth for the current frame.

return the per pixel distance to the camera in world units

source

fn fix_camera_yaw_axis( &mut self, use_fixed: bool, up: &dyn ToInputArray ) -> Result<()>

convenience method to force the “up” axis to stay fixed

works with both programmatic changes and SCENE_INTERACTIVE

Parameters
  • useFixed: whether to enforce the fixed yaw axis
  • up: the axis to be fixed
C++ default parameters
  • up: noArray()
source

fn set_camera_pose( &mut self, tvec: &dyn ToInputArray, rot: &dyn ToInputArray, invert: bool ) -> Result<()>

Sets the current camera pose

Parameters
  • tvec: translation
  • rot: [Rodrigues] vector or 3x3 rotation matrix
  • invert: use the inverse of the given pose
C++ default parameters
  • tvec: noArray()
  • rot: noArray()
  • invert: false
source

fn set_camera_look_at( &mut self, target: &str, offset: &dyn ToInputArray ) -> Result<()>

convenience method to orient the camera to a specific entity

Parameters
  • target: entity name
  • offset: offset from entity centre
C++ default parameters
  • offset: noArray()
source

fn set_entity_look_at( &mut self, origin: &str, target: &str, offset: &dyn ToInputArray ) -> Result<()>

convenience method to orient an entity to a specific entity. If target is an empty string the entity looks at the given offset point

Parameters
  • origin: entity to make look at
  • target: name of target entity
  • offset: offset from entity centre
C++ default parameters
  • offset: noArray()
source

fn get_camera_pose( &mut self, r: &mut dyn ToOutputArray, tvec: &mut dyn ToOutputArray, invert: bool ) -> Result<()>

Retrieves the current camera pose

Parameters
  • R: 3x3 rotation matrix
  • tvec: translation vector
  • invert: return the inverted pose
C++ default parameters
  • r: noArray()
  • tvec: noArray()
  • invert: false
source

fn set_camera_intrinsics( &mut self, k: &dyn ToInputArray, imsize: Size, z_near: f32, z_far: f32 ) -> Result<()>

set intrinsics of the camera

Parameters
  • K: intrinsic matrix or noArray(). If noArray() is specified, imsize is ignored and zNear/ zFar can be set separately.
  • imsize: image size
  • zNear: near clip distance or -1 to keep the current
  • zFar: far clip distance or -1 to keep the current
C++ default parameters
  • z_near: -1
  • z_far: -1
source

fn update(&mut self) -> Result<()>

render this window, but do not swap buffers. Automatically called by [ovis::waitKey]

Implementors§