pub struct CellMap {
pub cx0: i64,
pub cy0: i64,
pub cw: usize,
pub ch: usize,
pub rgbk: Vec<[u8; 4]>,
}Expand description
A CellRef built once from canvas pixels.
Fields§
§cx0: i64§cy0: i64§cw: usize§ch: usize§rgbk: Vec<[u8; 4]>RGB + known flag per cell.
Implementations§
Source§impl CellMap
impl CellMap
Sourcepub fn covering(x: i64, y: i64, width: usize, height: usize) -> Self
pub fn covering(x: i64, y: i64, width: usize, height: usize) -> Self
An empty map over the world cells covering the rectangle (x, y, width, height).
Sourcepub fn ingest(&mut self, view: &CanvasView<'_>)
pub fn ingest(&mut self, view: &CanvasView<'_>)
Fills the cells lying wholly inside view whose four pixels are covered. Tiles are world-aligned on even
coordinates, so a canvas fed tile by tile fills every wholly covered cell exactly once.
pub fn from_canvas(view: &CanvasView<'_>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CellMap
impl RefUnwindSafe for CellMap
impl Send for CellMap
impl Sync for CellMap
impl Unpin for CellMap
impl UnsafeUnpin for CellMap
impl UnwindSafe for CellMap
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> 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