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
sourceimpl 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
sourceimpl Boxed for RotatedRect
impl Boxed for RotatedRect
sourceimpl Debug for RotatedRect
impl Debug for RotatedRect
sourceimpl Drop for RotatedRect
impl Drop for RotatedRect
sourceimpl RotatedRectTrait for RotatedRect
impl RotatedRectTrait for RotatedRect
fn as_raw_mut_RotatedRect(&mut self) -> *mut c_void
sourcefn set_center(&mut self, val: Point2f)
fn set_center(&mut self, val: Point2f)
returns the rectangle mass center
sourceimpl RotatedRectTraitConst for RotatedRect
impl RotatedRectTraitConst for RotatedRect
fn as_raw_RotatedRect(&self) -> *const c_void
sourcefn 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.
sourcefn points(&self, pts: &mut [Point2f]) -> Result<()>
fn points(&self, pts: &mut [Point2f]) -> Result<()>
returns 4 vertices of the rectangle Read more
sourcefn bounding_rect(&self) -> Result<Rect>
fn bounding_rect(&self) -> Result<Rect>
returns the minimal up-right integer rectangle containing the rotated rectangle
sourcefn bounding_rect2f(&self) -> Result<Rect_<f32>>
fn bounding_rect2f(&self) -> Result<Rect_<f32>>
returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images
impl Send for RotatedRect
impl VectorElement for RotatedRectwhere
Vector<RotatedRect>: VectorExtern<RotatedRect>,
Auto Trait Implementations
impl RefUnwindSafe for RotatedRect
impl !Sync for RotatedRect
impl Unpin for RotatedRect
impl UnwindSafe for RotatedRect
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more