Struct exr::math::Vec2 [−][src]
pub struct Vec2<T>(pub T, pub T);
Expand description
Simple two-dimensional vector of any numerical type. Supports only few mathematical operations as this is used mainly as data struct.
Tuple Fields
0: T
1: T
Implementations
Returns the vector with the maximum of either coordinates.
Returns the vector with the minimum of either coordinates.
Try to convert all components of this vector to a new type, yielding either a vector of that new type, or an error.
Seeing this vector as a dimension or size (width and height),
this returns the area that this dimensions contains (width * height
).
Convert this two-dimensional coordinate to an index suited for one-dimensional flattened image arrays. Works for images that store the pixels row by row, one after another, in a single array. In debug mode, panics for an index out of bounds.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Vec2<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Vec2<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.