Struct opencv::core::RotatedRect
source · pub struct RotatedRect { /* private fields */ }
Expand description
The class represents rotated (i.e. not up-right) rectangles on a plane.
Each rectangle is specified by the center point (mass center), length of each side (represented by #Size2f structure) and the rotation angle in degrees.
The sample below demonstrates how to use RotatedRect:
RotatedRect_demo
See also
CamShift, fitEllipse, minAreaRect, CvBox2D
Implementations§
source§impl RotatedRect
impl RotatedRect
sourcepub fn default() -> Result<RotatedRect>
pub fn default() -> Result<RotatedRect>
default constructor
sourcepub fn new(center: Point2f, size: Size2f, angle: f32) -> Result<RotatedRect>
pub fn new(center: Point2f, size: Size2f, angle: f32) -> Result<RotatedRect>
full constructor
Parameters
- center: The rectangle mass center.
- size: Width and height of the rectangle.
- angle: The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
sourcepub fn for_points(
point1: Point2f,
point2: Point2f,
point3: Point2f
) -> Result<RotatedRect>
pub fn for_points(
point1: Point2f,
point2: Point2f,
point3: Point2f
) -> Result<RotatedRect>
Any 3 end points of the RotatedRect. They must be given in order (either clockwise or anticlockwise).
Trait Implementations§
source§impl Boxed for RotatedRect
impl Boxed for RotatedRect
source§impl Debug for RotatedRect
impl Debug for RotatedRect
source§impl Drop for RotatedRect
impl Drop for RotatedRect
source§impl RotatedRectTrait for RotatedRect
impl RotatedRectTrait for RotatedRect
fn as_raw_mut_RotatedRect(&mut self) -> *mut c_void
source§fn set_center(&mut self, val: Point2f)
fn set_center(&mut self, val: Point2f)
returns the rectangle mass center
source§impl RotatedRectTraitConst for RotatedRect
impl RotatedRectTraitConst for RotatedRect
fn as_raw_RotatedRect(&self) -> *const c_void
source§fn angle(&self) -> f32
fn angle(&self) -> f32
returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
source§fn points(&self, pts: &mut [Point2f]) -> Result<()>
fn points(&self, pts: &mut [Point2f]) -> Result<()>
returns 4 vertices of the rectangle Read more
source§fn bounding_rect(&self) -> Result<Rect>
fn bounding_rect(&self) -> Result<Rect>
returns the minimal up-right integer rectangle containing the rotated rectangle