pub type DataWindow = IntegerBounds;
Expand description
The integer rectangle describing where an layer is placed on the infinite 2D global space.
Aliased Type§
struct DataWindow {
pub position: Vec2<i32>,
pub size: Vec2<usize>,
}
Fields§
§position: Vec2<i32>
The top left corner of this rectangle.
The Box2I32
includes 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 like Vec::len()
.
Implementations
Source§impl IntegerBounds
impl IntegerBounds
Sourcepub fn from_dimensions(size: impl Into<Vec2<usize>>) -> Self
pub fn from_dimensions(size: impl Into<Vec2<usize>>) -> Self
Create a box with a size starting at zero.
Sourcepub fn new(start: impl Into<Vec2<i32>>, size: impl Into<Vec2<usize>>) -> Self
pub fn new(start: impl Into<Vec2<i32>>, size: impl Into<Vec2<usize>>) -> Self
Create a box with a size and an origin point.
Sourcepub fn end(self) -> Vec2<i32>
pub 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()
.
Sourcepub fn max(self) -> Vec2<i32>
pub fn max(self) -> Vec2<i32>
Returns the maximum coordinate that a value in this rectangle may have.
Sourcepub fn write<W: Write>(&self, write: &mut W) -> UnitResult
pub fn write<W: Write>(&self, write: &mut W) -> UnitResult
Without validation, write this instance to the byte stream.
Sourcepub fn with_origin(self, origin: Vec2<i32>) -> Self
pub fn with_origin(self, origin: Vec2<i32>) -> Self
Create a new rectangle which is offset by the specified origin.
Trait Implementations
Source§impl Clone for IntegerBounds
impl Clone for IntegerBounds
Source§fn clone(&self) -> IntegerBounds
fn clone(&self) -> IntegerBounds
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more