Struct IntegerBounds
pub struct IntegerBounds { pub position: Vec2<i32>, pub size: Vec2<usize> }
A rectangular section anywhere in 2D integer space.
Valid from minimum coordinate (including) -1,073,741,822
to maximum coordinate (including) 1,073,741,822, the value of (i32::MAX/2 -1).
Fields
position: Vec2<i32>The top left corner of this rectangle. The
Box2I32includes this pixel if the size is not zero.size: Vec2<usize>How many pixels to include in this
Box2I32. Extends to the right and downwards. Does not include the actual boundary, just likeVec::len().
Implementations
impl IntegerBounds
fn zero() -> SelfCreate a box with no size located at (0,0).
fn from_dimensions(size: impl Into<Vec2<usize>>) -> SelfCreate a box with a size starting at zero.
fn new(start: impl Into<Vec2<i32>>, size: impl Into<Vec2<usize>>) -> SelfCreate a box with a size and an origin point.
fn end(self) -> Vec2<i32>Returns the top-right coordinate of the rectangle. The row and column described by this vector are not included in the rectangle, just like
Vec::len().fn max(self) -> Vec2<i32>Returns the maximum coordinate that a value in this rectangle may have.
fn validate(&self, max_size: Option<Vec2<usize>>) -> UnitResultValidate this instance.
const fn byte_size() -> usizeNumber of bytes this would consume in an exr file.
fn write<W: Write>(&self, write: &mut W) -> UnitResultWithout validation, write this instance to the byte stream.
fn read<R: Read>(read: &mut R) -> Result<Self>Read the value without validating.
fn with_origin(self, origin: Vec2<i32>) -> SelfCreate a new rectangle which is offset by the specified origin.
fn contains(self, subset: Self) -> boolReturns whether the specified rectangle is equal to or inside this rectangle.
Trait Implementations
impl Clone for IntegerBounds
fn clone(&self) -> Self
impl Copy for IntegerBounds
impl Debug for IntegerBounds
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for IntegerBounds
fn default() -> Self
impl Eq for IntegerBounds
impl Hash for IntegerBounds
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for IntegerBounds
fn eq(&self, other: &Self) -> bool