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<'de, T> Deserialize<'de> for PointT<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for PointT<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: PartialOrd> PartialOrd for PointT<T>
impl<T: PartialOrd> PartialOrd for PointT<T>
Source§impl<T> ResultPoint for PointT<T>
This impl is temporary and is there to ease refactoring.
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>
impl<T> Eq for PointT<T>where
T: PartialEq,
impl<T> StructuralPartialEq for PointT<T>
Auto Trait Implementations§
impl<T> Freeze for PointT<T>where
T: Freeze,
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.