pub trait PixelStrictPositionInterface<const H: usize, const W: usize> {
Show 14 methods
// Required methods
fn row(&self) -> usize;
fn column(&self) -> usize;
// Provided methods
fn expand(&self) -> (usize, usize) { ... }
fn unbound(&self) -> PixelPosition { ... }
fn checked_up(&self, amount: usize) -> StrictPositionValidationResult<H, W> { ... }
fn checked_left(
&self,
amount: usize,
) -> StrictPositionValidationResult<H, W> { ... }
fn checked_down(
&self,
amount: usize,
) -> StrictPositionValidationResult<H, W> { ... }
fn checked_right(
&self,
amount: usize,
) -> StrictPositionValidationResult<H, W> { ... }
fn checked_direction(
&self,
dir: Direction,
amount: usize,
) -> StrictPositionValidationResult<H, W> { ... }
fn bounding_up(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ { ... }
fn bounding_left(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ { ... }
fn bounding_down(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ { ... }
fn bounding_right(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ { ... }
fn bounding_direction(
&self,
dir: Direction,
amount: usize,
) -> PixelStrictPosition<H, W> ⓘ { ... }
}Expand description
Interface for a pixel position.
This type of position is limited between a H (height) and W (width).
Required Methods§
Provided Methods§
Sourcefn unbound(&self) -> PixelPosition
fn unbound(&self) -> PixelPosition
Convert this PixelStrictPosition to a PixelPosition, breaking the bounds.
Sourcefn checked_up(&self, amount: usize) -> StrictPositionValidationResult<H, W>
fn checked_up(&self, amount: usize) -> StrictPositionValidationResult<H, W>
Returns a PixelStrictPosition above this one IF its possible.
Sourcefn checked_left(&self, amount: usize) -> StrictPositionValidationResult<H, W>
fn checked_left(&self, amount: usize) -> StrictPositionValidationResult<H, W>
Returns a PixelStrictPosition at the left side of this one IF its possible.
Sourcefn checked_down(&self, amount: usize) -> StrictPositionValidationResult<H, W>
fn checked_down(&self, amount: usize) -> StrictPositionValidationResult<H, W>
Returns a PixelStrictPosition below this one IF its possible.
Sourcefn checked_right(&self, amount: usize) -> StrictPositionValidationResult<H, W>
fn checked_right(&self, amount: usize) -> StrictPositionValidationResult<H, W>
Returns a PixelStrictPosition at the right side of this one IF its possible.
Sourcefn checked_direction(
&self,
dir: Direction,
amount: usize,
) -> StrictPositionValidationResult<H, W>
fn checked_direction( &self, dir: Direction, amount: usize, ) -> StrictPositionValidationResult<H, W>
Returns a PixelStrictPosition at the Direction side of this one IF its possible.
Sourcefn bounding_up(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
fn bounding_up(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
Returns a PixelStrictPosition above this one as far as possible (0).
Sourcefn bounding_left(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
fn bounding_left(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
Returns a PixelStrictPosition at the left side of this one as far as possible (0).
Sourcefn bounding_down(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
fn bounding_down(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
Returns a PixelStrictPosition below this one as far as possible.
Sourcefn bounding_right(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
fn bounding_right(&self, amount: usize) -> PixelStrictPosition<H, W> ⓘ
Returns a PixelStrictPosition at the right side of this one as far as possible.
Sourcefn bounding_direction(
&self,
dir: Direction,
amount: usize,
) -> PixelStrictPosition<H, W> ⓘ
fn bounding_direction( &self, dir: Direction, amount: usize, ) -> PixelStrictPosition<H, W> ⓘ
Returns a PixelStrictPosition at the Direction side of this one as far as possible.