exr::meta::attribute

Type Alias DataWindow

Source
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

Source

pub fn zero() -> Self

Create a box with no size located at (0,0).

Source

pub fn from_dimensions(size: impl Into<Vec2<usize>>) -> Self

Create a box with a size starting at zero.

Source

pub fn new(start: impl Into<Vec2<i32>>, size: impl Into<Vec2<usize>>) -> Self

Create a box with a size and an origin point.

Source

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().

Source

pub fn max(self) -> Vec2<i32>

Returns the maximum coordinate that a value in this rectangle may have.

Source

pub fn validate(&self, max_size: Option<Vec2<usize>>) -> UnitResult

Validate this instance.

Source

pub fn byte_size() -> usize

Number of bytes this would consume in an exr file.

Source

pub fn write<W: Write>(&self, write: &mut W) -> UnitResult

Without validation, write this instance to the byte stream.

Source

pub fn read<R: Read>(read: &mut R) -> Result<Self>

Read the value without validating.

Source

pub fn with_origin(self, origin: Vec2<i32>) -> Self

Create a new rectangle which is offset by the specified origin.

Source

pub fn contains(self, subset: Self) -> bool

Returns whether the specified rectangle is equal to or inside this rectangle.

Trait Implementations

Source§

impl Clone for IntegerBounds

Source§

fn clone(&self) -> IntegerBounds

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IntegerBounds

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IntegerBounds

Source§

fn default() -> IntegerBounds

Returns the “default value” for a type. Read more
Source§

impl Hash for IntegerBounds

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for IntegerBounds

Source§

fn eq(&self, other: &IntegerBounds) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for IntegerBounds

Source§

impl Eq for IntegerBounds

Source§

impl StructuralPartialEq for IntegerBounds