[][src]Struct kas::geom::Coord

pub struct Coord(pub i32, pub i32);

An (x, y) coordinate.

Implementations

impl Coord[src]

pub const ZERO: Coord[src]

A coord of (0, 0)

pub fn uniform(n: i32) -> Self[src]

A Coord with uniform value n on both axes

pub fn min(self, other: Self) -> Self[src]

Return the minimum, componentwise

pub fn max(self, other: Self) -> Self[src]

Return the maximum, componentwise

pub fn clamp(self, min: Self, max: Self) -> Self[src]

Return the value clamped to the given min and max

In the case that min > max, the min value is returned.

pub fn transpose(self) -> Self[src]

Return the transpose (swap width and height)

pub fn from_logical<X: Pixel>(
    logical: LogicalPosition<X>,
    dpi_factor: f64
) -> Self
[src]

Convert from a logical position

Trait Implementations

impl Add<Coord> for Coord[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Coord> for Rect[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Size> for Coord[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Coord> for Coord[src]

impl AddAssign<Size> for Coord[src]

impl Clone for Coord[src]

impl Copy for Coord[src]

impl Debug for Coord[src]

impl Default for Coord[src]

impl Eq for Coord[src]

impl From<(i32, i32)> for Coord[src]

impl From<Coord> for Vec2[src]

impl From<Coord> for DVec2[src]

impl From<Coord> for Vec2[src]

impl<X: Pixel> From<Coord> for PhysicalPosition<X>[src]

impl From<Coord> for Size[src]

impl From<DVec2> for Coord[src]

impl<X: Pixel> From<PhysicalPosition<X>> for Coord[src]

impl From<Size> for Coord[src]

impl From<Vec2> for Coord[src]

impl PartialEq<Coord> for Coord[src]

impl StructuralEq for Coord[src]

impl StructuralPartialEq for Coord[src]

impl Sub<Coord> for Coord[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Coord> for Rect[src]

type Output = Self

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Coord

impl Send for Coord

impl Sync for Coord

impl Unpin for Coord

impl UnwindSafe for Coord

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.