pub struct Region {
pub x0: usize,
pub x1: usize,
pub y0: usize,
pub y1: usize,
}Expand description
An inclusive pixel rectangle. Grouping the four bounds keeps the scan signatures readable — they were long enough that clippy flagged them, and the bounds always travel together anyway.
Fields§
§x0: usizeFirst column.
x1: usizeLast column (inclusive).
y0: usizeFirst row.
y1: usizeLast row (inclusive).
Implementations§
Source§impl Region
impl Region
Sourcepub fn whole(img: &ImageBuffer) -> Self
pub fn whole(img: &ImageBuffer) -> Self
The whole frame. The image must be at least 1×1.
Sourcepub fn inset(img: &ImageBuffer) -> Self
pub fn inset(img: &ImageBuffer) -> Self
The frame minus a one-pixel border, which is what the star scan wants: the hot-pixel test reads a neighbour on each side. The image must be at least 3×3.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
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