pub struct MinimalTransform {
pub x0: f32,
pub dx: f32,
pub rx: f32,
pub y0: f32,
pub ry: f32,
pub dy: f32,
}Expand description
Minimal transformation (affine transform coefficients)
Fields§
§x0: f32Top-left X coordinate
dx: f32Pixel width
rx: f32Rotation (usually 0)
y0: f32Top-left Y coordinate
ry: f32Rotation (usually 0)
dy: f32Pixel height (usually negative)
Implementations§
Source§impl MinimalTransform
impl MinimalTransform
Sourcepub const fn new_simple(
x0: f32,
y0: f32,
pixel_width: f32,
pixel_height: f32,
) -> Self
pub const fn new_simple( x0: f32, y0: f32, pixel_width: f32, pixel_height: f32, ) -> Self
Create simple transform (no rotation)
Sourcepub fn pixel_to_world(&self, col: u16, row: u16) -> MinimalCoordinate
pub fn pixel_to_world(&self, col: u16, row: u16) -> MinimalCoordinate
Transform pixel coordinates to world coordinates
Sourcepub fn world_to_pixel(&self, coord: &MinimalCoordinate) -> Result<(u16, u16)>
pub fn world_to_pixel(&self, coord: &MinimalCoordinate) -> Result<(u16, u16)>
Transform world coordinates to pixel coordinates
Trait Implementations§
Source§impl Clone for MinimalTransform
impl Clone for MinimalTransform
Source§fn clone(&self) -> MinimalTransform
fn clone(&self) -> MinimalTransform
Returns a duplicate 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 MinimalTransform
impl Debug for MinimalTransform
impl Copy for MinimalTransform
Auto Trait Implementations§
impl Freeze for MinimalTransform
impl RefUnwindSafe for MinimalTransform
impl Send for MinimalTransform
impl Sync for MinimalTransform
impl Unpin for MinimalTransform
impl UnsafeUnpin for MinimalTransform
impl UnwindSafe for MinimalTransform
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