Crate figures[][src]

Expand description

A small math library specialized for 2d screen graphics.

Feature Flags

To enable serialization of most types, enable the serde feature flag.

Re-exports

pub use approx;
pub use num_traits;

Structs

DisplayScale

Scaling ratios for Scaled and Displayable.

ExtentsRect

A rectangle that uses two Points for representation.

Figure

A value in a specific unit.

Pixels

A unit representing physical pixels.

Point

A location represented by an x and y value.

Points

A unit representing DPI-adjusted resolution configured on the system.

Scale

Allows converting between UnitA and UnitB by multiplying or dividing by a scaling ratio.

Scaled

A unit representing virtual pixels that are scaled on top of the DPI adjustment done for the Points unit.

Size

A measurement of space using width and height.

SizedRect

A rectangle that uses a Point and a Size for representation.

Vector

A 2d measurement using x and y values.

Enums

Angle

An angle of rotation.

Rect

A 2d rectangle. This type may internally be represented with a SizedRect or an ExtentsRect. All rect types implement Rectlike.

Traits

Approx

Allows comparing floating point numbers with approximation.

Ceil

Defines the smallest integer equal or greater than the original value.

Displayable

Methods for converting between display scales.

Floor

Defines the biggest integer equal or lower than the original value.

One

Returns a one value.

Rectlike

Functionalitiy that all rectangle types implement

Round

Defines the nearest integer value to the original value.

Vectorlike

Methods that enable converting between 2d types that have two components.

Zero

Returns a zero value.