#[non_exhaustive]pub struct GridTransform { /* private fields */ }Expand description
An affine integer lattice-coordinate transform:
destination = matrix * source + translation.
The source and destination coordinates belong to the same LatticeKind.
Pure D4/D6 symmetry transforms have zero translation; target-detector
alignments use the same type with a board-frame translation. This type
contains no image-space or pixel-space coordinates.
Implementations§
Source§impl GridTransform
impl GridTransform
Sourcepub const IDENTITY: Self
pub const IDENTITY: Self
The identity transform for a square lattice.
Prefer Self::identity when the lattice family is dynamic. This
constant exists for the workspace’s square-target result defaults.
Sourcepub const fn new(
lattice: LatticeKind,
matrix: [[i32; 2]; 2],
translation: [i32; 2],
) -> Self
pub const fn new( lattice: LatticeKind, matrix: [[i32; 2]; 2], translation: [i32; 2], ) -> Self
Construct a lattice transform from its family, row-major linear part, and destination-frame translation.
Sourcepub const fn identity(lattice: LatticeKind) -> Self
pub const fn identity(lattice: LatticeKind) -> Self
Construct the identity transform for lattice.
Sourcepub const fn lattice(self) -> LatticeKind
pub const fn lattice(self) -> LatticeKind
Lattice family of both the source and destination coordinates.
Sourcepub const fn translation(self) -> [i32; 2]
pub const fn translation(self) -> [i32; 2]
Destination-frame translation applied after the linear part.
Sourcepub const fn with_translation(self, translation: [i32; 2]) -> Self
pub const fn with_translation(self, translation: [i32; 2]) -> Self
Return this transform with a replacement destination-frame translation.
Sourcepub const fn determinant(self) -> i32
pub const fn determinant(self) -> i32
Determinant of the linear part.
Trait Implementations§
Source§impl Clone for GridTransform
impl Clone for GridTransform
Source§fn clone(&self) -> GridTransform
fn clone(&self) -> GridTransform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GridTransform
Source§impl Debug for GridTransform
impl Debug for GridTransform
Source§impl<'de> Deserialize<'de> for GridTransform
impl<'de> Deserialize<'de> for GridTransform
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>,
impl Eq for GridTransform
Source§impl Hash for GridTransform
impl Hash for GridTransform
Source§impl PartialEq for GridTransform
impl PartialEq for GridTransform
Source§impl Serialize for GridTransform
impl Serialize for GridTransform
impl StructuralPartialEq for GridTransform
Auto Trait Implementations§
impl Freeze for GridTransform
impl RefUnwindSafe for GridTransform
impl Send for GridTransform
impl Sync for GridTransform
impl Unpin for GridTransform
impl UnsafeUnpin for GridTransform
impl UnwindSafe for GridTransform
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
impl<T> Scalar for T
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.