pub struct Transform { /* private fields */ }
Expand description
Affine Geotransform
Ported from affine library (used by rasterio).
a
, b
, c
, d
, e
and f
are typed as f64
and are coefficients of an augmented affine
transformation matrix:
| x' | | a b c | | x |
| y' | = | d e f | | y |
| 1 | | 0 0 1 | | 1 |
a
, b
, and c
are the elements of the first row of the matrix. d
, e
, and f
are the elements of the second row.
Other sources:
Implementations§
Source§impl Transform
impl Transform
pub const fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Self
Sourcepub const fn from_rasterio(transform: &[f64; 6]) -> Self
pub const fn from_rasterio(transform: &[f64; 6]) -> Self
create from an f64 slice in the ordering used by rasterio
Sourcepub const fn from_gdal(transform: &[f64; 6]) -> Self
pub const fn from_gdal(transform: &[f64; 6]) -> Self
create from an f64 slice in the ordering used by gdal
Sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
The determinant of the transform matrix
Sourcepub fn is_degenerate(&self) -> bool
pub fn is_degenerate(&self) -> bool
True if this transform is degenerate.
Which means that it will collapse a shape to an effective area of zero. Degenerate transforms cannot be inverted.
pub fn invert(&self) -> Result<Self, Error>
Trait Implementations§
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
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 more