pub struct PointT<T> {
pub x: T,
pub y: T,
}Expand description
Encapsulates a point of interest in an image containing a barcode. Typically, this would be the location of a finder pattern or the corner of the barcode, for example.
@author Sean Owen
Fields§
§x: T§y: TImplementations§
source§impl<T> PointT<T>where
T: Copy,
impl<T> PointT<T>where
T: Copy,
pub const fn new(x: T, y: T) -> PointT<T>
pub const fn with_single(x: T) -> Self
source§impl<T> PointT<T>
impl<T> PointT<T>
pub fn dot(self, p: Self) -> T
pub fn cross(self, p: Self) -> T
sourcepub fn sumAbsComponent(self) -> T
pub fn sumAbsComponent(self) -> T
L1 norm
sourcepub fn maxAbsComponent(self) -> T
pub fn maxAbsComponent(self) -> T
L-inf norm
pub fn squaredDistance(self, p: Self) -> T
pub fn distance(self, p: Self) -> T
pub fn abs(self) -> Self
pub fn fold<U, F: Fn(T, T) -> U>(self, f: F) -> U
pub fn middle(self, p: Self) -> Self
pub fn normalized(self) -> Self
pub fn bresenhamDirection(self) -> Self
pub fn mainDirection(self) -> Self
pub fn round(self) -> Self
sourcepub fn centered(self) -> PointT<f32>
pub fn centered(self) -> PointT<f32>
Calculate a floating point pixel coordinate representing the ‘center’ of the pixel. This is sort of the inverse operation of the PointI(PointF) conversion constructor. See also the documentation of the GridSampler API.
pub fn floor(self) -> Self
sourcepub fn crossProductZ(a: PointT<T>, b: PointT<T>, c: PointT<T>) -> T
pub fn crossProductZ(a: PointT<T>, b: PointT<T>, c: PointT<T>) -> T
Returns the z component of the cross product between vectors BC and BA.
Trait Implementations§
source§impl<T> AddAssign for PointT<T>
impl<T> AddAssign for PointT<T>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl<T> ResultPoint for PointT<T>
impl<T> ResultPoint for PointT<T>
This impl is temporary and is there to ease refactoring.
source§impl<T> SubAssign for PointT<T>
impl<T> SubAssign for PointT<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 PointT<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for PointT<T>where
T: RefUnwindSafe,
impl<T> Send for PointT<T>where
T: Send,
impl<T> Sync for PointT<T>where
T: Sync,
impl<T> Unpin for PointT<T>where
T: Unpin,
impl<T> UnwindSafe for PointT<T>where
T: UnwindSafe,
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 P
impl<R, P> ReadPrimitive<R> for P
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.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.