#[non_exhaustive]pub struct MapGrid { /* private fields */ }Expand description
Placement of a regular native map grid in input-pixel coordinates. Cells may cover only a cropped interior or extend beyond the image.
Implementations§
Source§impl MapGrid
impl MapGrid
Sourcepub fn new(input_width: u32, input_height: u32) -> MetricResult<Self>
pub fn new(input_width: u32, input_height: u32) -> MetricResult<Self>
One cell per input pixel; empty input geometry is refused.
Sourcepub fn with_cells(
self,
x: i64,
y: i64,
width: u32,
height: u32,
) -> MetricResult<Self>
pub fn with_cells( self, x: i64, y: i64, width: u32, height: u32, ) -> MetricResult<Self>
Set native cell placement without resizing, padding or resampling values.
Sourcepub const fn input_width(self) -> u32
pub const fn input_width(self) -> u32
Input image width.
Sourcepub const fn input_height(self) -> u32
pub const fn input_height(self) -> u32
Input image height.
Sourcepub const fn cell_width(self) -> u32
pub const fn cell_width(self) -> u32
Positive cell width and horizontal step.
Sourcepub const fn cell_height(self) -> u32
pub const fn cell_height(self) -> u32
Positive cell height and vertical step.
Trait Implementations§
impl Copy for MapGrid
impl Eq for MapGrid
impl StructuralPartialEq for MapGrid
Auto Trait Implementations§
impl Freeze for MapGrid
impl RefUnwindSafe for MapGrid
impl Send for MapGrid
impl Sync for MapGrid
impl Unpin for MapGrid
impl UnsafeUnpin for MapGrid
impl UnwindSafe for MapGrid
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