Struct rxing::common::Quadrilateral
source · pub struct Quadrilateral(pub [Point; 4]);Tuple Fields§
§0: [Point; 4]Implementations§
source§impl Quadrilateral
impl Quadrilateral
pub fn new(tl: Point, tr: Point, br: Point, bl: Point) -> Self
pub fn with_points(tl: Point, tr: Point, br: Point, bl: Point) -> Self
pub fn top_left(&self) -> &Point
pub fn top_right(&self) -> &Point
pub fn bottom_right(&self) -> &Point
pub fn bottom_left(&self) -> &Point
pub fn orientation(&self) -> f64
pub fn points(&self) -> &[Point]
source§impl Quadrilateral
impl Quadrilateral
pub fn rectangle(width: i32, height: i32, margin: Option<f32>) -> Quadrilateral
pub fn rectangle_from_xy( x0: f32, x1: f32, y0: f32, y1: f32, o: Option<f32> ) -> Self
pub fn centered_square(size: i32) -> Quadrilateral
pub fn line(y: i32, xStart: i32, xStop: i32) -> Quadrilateral
pub fn is_convex(&self) -> bool
pub fn scale(&self, factor: i32) -> Quadrilateral
pub fn center(&self) -> Point
pub fn rotated_corners( &self, n: Option<i32>, mirror: Option<bool> ) -> Quadrilateral
pub fn is_inside(&self, p: Point) -> bool
pub fn have_intersecting_bounding_boxes(&self, b: &Quadrilateral) -> bool
pub fn blend(a: &Quadrilateral, b: &Quadrilateral) -> Self
Trait Implementations§
source§impl Clone for Quadrilateral
impl Clone for Quadrilateral
source§fn clone(&self) -> Quadrilateral
fn clone(&self) -> Quadrilateral
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Quadrilateral
impl Debug for Quadrilateral
source§impl Default for Quadrilateral
impl Default for Quadrilateral
source§impl Index<usize> for Quadrilateral
impl Index<usize> for Quadrilateral
source§impl IndexMut<usize> for Quadrilateral
impl IndexMut<usize> for Quadrilateral
impl Copy for Quadrilateral
Auto Trait Implementations§
impl RefUnwindSafe for Quadrilateral
impl Send for Quadrilateral
impl Sync for Quadrilateral
impl Unpin for Quadrilateral
impl UnwindSafe for Quadrilateral
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.