#[repr(C)]pub struct Point_<T> {
pub x: T,
pub y: T,
}
Expand description
Fields§
§x: T
§y: T
Implementations§
Source§impl<T> Point_<T>
impl<T> Point_<T>
pub const fn new(x: T, y: T) -> Self
pub fn from_vec2(vec: VecN<T, 2>) -> Self
pub fn from_size(sz: Size_<T>) -> Self
pub fn cross(self, pt: Point_<T>) -> f64
pub fn dot(self, pt: Point_<T>) -> Twhere
T: NumOps,
pub fn ddot(self, pt: Point_<T>) -> f64
pub fn inside(self, rect: Rect_<T>) -> bool
pub fn norm(self) -> f64
Sourcepub fn to<D: NumCast>(self) -> Option<Point_<D>>where
T: ToPrimitive,
pub fn to<D: NumCast>(self) -> Option<Point_<D>>where
T: ToPrimitive,
Cast Point
to the other coord type
pub fn to_vec2(self) -> VecN<T, 2>
Trait Implementations§
Source§impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
Source§fn add_assign(&mut self, rhs: Point_<P>)
fn add_assign(&mut self, rhs: Point_<P>)
Performs the
+=
operation. Read moreSource§impl<T: AddAssign> AddAssign for Point_<T>
impl<T: AddAssign> AddAssign for Point_<T>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl<T: DataType> DataType for Point_<T>
impl<T: DataType> DataType for Point_<T>
Source§fn opencv_depth() -> i32
fn opencv_depth() -> i32
The shape of bytes occupied by the single layer/channel of the element. E.g. for an 8-bit BGR
image it’s
CV_8U
because a single channel for a pixel is unsigned 8 bits. You should use one
of the depth constants for this like CV_8U
, CV_8S
, CV_32F
, etc.Source§fn opencv_channels() -> i32
fn opencv_channels() -> i32
Amount of layers/channels per element. E.g. for an 8-bit BGR image it’s 3 because one pixel
consists of 3 channels: B, G and R.
Source§fn opencv_type() -> i32
fn opencv_type() -> i32
OpenCV value for this type as produced by
CV_MAKETYPE()
functionSource§impl<T: DivAssign + Copy> DivAssign<T> for Point_<T>
impl<T: DivAssign + Copy> DivAssign<T> for Point_<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moreSource§impl<T: MulAssign + Copy> MulAssign<T> for Point_<T>
impl<T: MulAssign + Copy> MulAssign<T> for Point_<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moreSource§impl<T: PartialOrd> PartialOrd for Point_<T>
impl<T: PartialOrd> PartialOrd for Point_<T>
Source§impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
Source§fn sub_assign(&mut self, rhs: Point_<P>)
fn sub_assign(&mut self, rhs: Point_<P>)
Performs the
-=
operation. Read moreSource§impl<T: SubAssign> SubAssign for Point_<T>
impl<T: SubAssign> SubAssign for Point_<T>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl<T: Copy> Copy for Point_<T>
impl<T: Eq> Eq for Point_<T>
impl<T> StructuralPartialEq for Point_<T>
Auto Trait Implementations§
impl<T> Freeze for Point_<T>where
T: Freeze,
impl<T> RefUnwindSafe for Point_<T>where
T: RefUnwindSafe,
impl<T> Send for Point_<T>where
T: Send,
impl<T> Sync for Point_<T>where
T: Sync,
impl<T> Unpin for Point_<T>where
T: Unpin,
impl<T> UnwindSafe for Point_<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more