[−][src]Struct opencv::core::RotatedRect
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: @snippet snippets/core_various.cpp RotatedRect_demo
See also
CamShift, fitEllipse, minAreaRect, CvBox2D
Methods
impl RotatedRect
[src]
pub fn as_raw_RotatedRect(&self) -> *mut c_void
[src]
pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self
[src]
impl RotatedRect
[src]
pub fn center(&self) -> Result<Point2f>
[src]
returns the rectangle mass center
pub fn set_center(&mut self, val: Point2f) -> Result<()>
[src]
returns the rectangle mass center
pub fn size(&self) -> Result<Size2f>
[src]
returns width and height of the rectangle
pub fn set_size(&mut self, val: Size2f) -> Result<()>
[src]
returns width and height of the rectangle
pub fn angle(&self) -> Result<f32>
[src]
returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
pub fn set_angle(&mut self, val: f32) -> Result<()>
[src]
returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
pub fn default() -> Result<RotatedRect>
[src]
default constructor
pub fn new(center: Point2f, size: Size2f, angle: f32) -> Result<RotatedRect>
[src]
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.
pub fn for_points(
point1: Point2f,
point2: Point2f,
point3: Point2f
) -> Result<RotatedRect>
[src]
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).
pub fn points(&self, pts: &mut [Point2f]) -> Result<()>
[src]
returns 4 vertices of the rectangle
Parameters
- pts: The points array for storing rectangle vertices. The order is bottomLeft, topLeft, topRight, bottomRight.
pub fn bounding_rect(&self) -> Result<Rect>
[src]
returns the minimal up-right integer rectangle containing the rotated rectangle
pub fn bounding_rect2f(&self) -> Result<Rect2f>
[src]
returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RotatedRect
impl !Sync for RotatedRect
impl Unpin for RotatedRect
impl UnwindSafe for RotatedRect
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,