pub struct Window {
pub col_off: isize,
pub row_off: isize,
pub width: usize,
pub height: usize,
}
Expand description
A data window representing a section of a raster image
Fields§
§col_off: isize
§row_off: isize
§width: usize
§height: usize
Implementations§
Source§impl Window
impl Window
Sourcepub fn new(col_off: isize, row_off: isize, width: usize, height: usize) -> Self
pub fn new(col_off: isize, row_off: isize, width: usize, height: usize) -> Self
Create a new window.
§Argument
col_off
- Column pixel index of the upper-left cornerrow_off
- Row pixel index of the upper-left cornerwidth
- Window width in pixelsheight
- Window height in pixels
Sourcepub fn toranges(self) -> ((isize, isize), (isize, isize))
pub fn toranges(self) -> ((isize, isize), (isize, isize))
Get the start and end pixel indices in the row and column space
Sourcepub fn intersects(&self, other: &Window) -> bool
pub fn intersects(&self, other: &Window) -> bool
Check if both windows intersect
Sourcepub fn geotransform(&self, geo: &GeoTransform) -> GeoTransform
pub fn geotransform(&self, geo: &GeoTransform) -> GeoTransform
Get a GeoTransform relative to this window
Sourcepub fn bounds(&self, geo: &GeoTransform) -> (f64, f64, f64, f64)
pub fn bounds(&self, geo: &GeoTransform) -> (f64, f64, f64, f64)
Get the spatial bounds of the window
pub fn bounds_lat_long( &self, spatial_ref_code: i32, geo: &GeoTransform, ) -> (f64, f64, f64, f64)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Window
impl<'de> Deserialize<'de> for Window
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
impl Copy for Window
impl StructuralPartialEq for Window
Auto Trait Implementations§
impl Freeze for Window
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnwindSafe for Window
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
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, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more