FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    PixelPoint

    struct · ferroui-base · v0.5.0

    struct PixelPoint
    

    Represents a point in device pixels.

    Integer arithmetic wraps on overflow. Conversions from floating point truncate toward zero and saturate at the i32 range (NaN becomes 0).

    View source

    Members

    x

    x: i32
    

    The X co-ordinate.

    Source

    y

    y: i32
    

    The Y co-ordinate.

    Source

    ORIGIN

    const ORIGIN: PixelPoint
    

    A point representing 0,0.

    Source

    new

    const fn new(x: i32, y: i32) -> Self
    

    Initializes a new instance of the PixelPoint structure.

    Source

    parse

    fn parse(s: &str) -> Result<Self, FormatError>
    

    Parses a PixelPoint string ("x, y").

    Source

    equals

    const fn equals(self: &Self, other: PixelPoint) -> bool
    

    Returns a boolean indicating whether the point is equal to the other given point.

    Source

    with_x

    const fn with_x(self: &Self, x: i32) -> PixelPoint
    

    Returns a new PixelPoint with the same Y co-ordinate and the specified X co-ordinate.

    Source

    with_y

    const fn with_y(self: &Self, y: i32) -> PixelPoint
    

    Returns a new PixelPoint with the same X co-ordinate and the specified Y co-ordinate.

    Source

    to_point

    fn to_point(self: &Self, scale: f64) -> Point
    

    Converts the PixelPoint to a device-independent Point using the specified scaling factor.

    Source

    to_point_vector

    fn to_point_vector(self: &Self, scale: Vector) -> Point
    

    Converts the PixelPoint to a device-independent Point using the specified per-axis scaling factor.

    Source

    to_point_with_dpi

    fn to_point_with_dpi(self: &Self, dpi: f64) -> Point
    

    Converts the PixelPoint to a device-independent Point using the specified dots per inch (DPI).

    Source

    to_point_with_dpi_vector

    fn to_point_with_dpi_vector(self: &Self, dpi: Vector) -> Point
    

    Converts the PixelPoint to a device-independent Point using the specified per-axis dots per inch (DPI).

    Source

    from_point

    fn from_point(point: Point, scale: f64) -> PixelPoint
    

    Converts a Point to device pixels using the specified scaling factor.

    Source

    from_point_vector

    fn from_point_vector(point: Point, scale: Vector) -> PixelPoint
    

    Converts a Point to device pixels using the specified per-axis scaling factor.

    Source

    from_point_with_dpi

    fn from_point_with_dpi(point: Point, dpi: f64) -> PixelPoint
    

    Converts a Point to device pixels using the specified dots per inch (DPI).

    Source

    from_point_with_dpi_vector

    fn from_point_with_dpi_vector(point: Point, dpi: Vector) -> PixelPoint
    

    Converts a Point to device pixels using the specified per-axis dots per inch (DPI).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • MarkupTyped
    • ValueTypeRegistration
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Hash
    • Default
    • From<PixelPoint>
    • Add
    • Add<PixelVector>
    • Sub
    • Sub<PixelVector>
    • AddAssign
    • AddAssign<PixelVector>
    • SubAssign
    • SubAssign<PixelVector>
    • FromStr
    • Display
    • From<PixelVector>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.