Module unit

Module unit 

Source
Expand description

Angle, factor, length, time, byte and resolution units.

Modules§

euclid
A collection of strongly typed math tools for computer graphics with an inclination towards 2d graphics and layout.

Structs§

Align
x and y alignment.
AngleDegree
Angle in degrees.
AngleGradian
Angle in gradians.
AngleRadian
Angle in radians.
AngleTurn
Angle in turns (complete rotations).
BoolVector2D
A 2d vector of booleans, useful for component-wise logic operations.
ByteLength
A length in bytes.
CornerRadius2D
Ellipses that define the radius of the four corners of a 2D box.
Dip
Device independent pixel.
DistanceKey
Comparable key that represents the absolute distance between two pixel points.
Factor
Normalized multiplication factor.
Factor2d
Scale factor applied to x and y dimensions.
FactorPercent
Multiplication factor in percentage (0%-100%).
FactorSideOffsets
Scale factor applied to margins.
GridSpacing
Spacing in-between grid cells in Length units.
Line
2D line in Length units.
Point
2D point in Length units.
Px
Device pixel.
PxConstraints
Pixel length constraints.
PxConstraints2d
Pixel size constraints.
PxDensity
Measurement of pixels in a screen or points in print.
PxGridSpacing
Computed GridSpacing.
PxLine
Computed Line.
Rect
2D rect in Length units.
Rgba
RGB + alpha.
RgbaComponent
Color functions argument conversion helper.
SideOffsets
2D size offsets in Length units.
SideOffsets2D
A group of 2D side offsets, which correspond to top/right/bottom/left for borders, padding, and margins in CSS, optionally tagged with a unit.
Size
2D size in Length units.
Transform
A transform builder type.
Vector
2D vector in Length units.

Enums§

LayoutAxis
Represents a layout dimension.
Length
1D length units.
LengthExpr
Represents an unresolved Length expression.
Orientation2D
Orientation of two 2D items.
ParseCompositeError
An error which can be returned when parsing an type composed of integers.
ParseFloatCompositeError
An error which can be returned when parsing an type composed of integers.
ParseIntCompositeError
An error which can be returned when parsing an type composed of integers.
PxTransform
A transform in device pixels.

Constants§

EQ_GRANULARITY
Minimal bucket size for equality between values in around the 0.0..=1.0 scale.
EQ_GRANULARITY_100
Minimal bucket size for equality between values in around the 1.0..=100.0 scale.

Traits§

AngleUnits
Extension methods for initializing angle units.
ByteUnits
Extension methods for initializing ByteLength values.
DipToPx
Conversion from Dip to Px units.
FactorUnits
Extension methods for initializing factor units.
Layout1d
Represents a one-dimensional length value that can be converted to a pixel length in a LAYOUT context.
Layout2d
Represents a two-dimensional value that can be converted to a pixel value in a LAYOUT context.
LengthUnits
Extension methods for initializing Length units.
LineFromTuplesBuilder
Build a Line using the syntax (x1, y1).to(x2, y2).
PxDensityUnits
Extension methods for initializing pixel density units.
PxToDip
Conversion from Px to Dip units.
RectFromTuplesBuilder
Build a Rect using the syntax (width, height).at(x, y).
TimeUnits
Extension methods for initializing Duration values.

Functions§

about_eq
f32 equality used in floating-point units.
about_eq_hash
f32 hash compatible with about_eq equality.
about_eq_ord
f32 ordering compatible with about_eq equality.

Type Aliases§

DipBox
A rectangle box in device independent pixels.
DipCornerRadius
Corner-radius in device independent pixels.
DipPoint
A point in device independent pixels.
DipRect
A rectangle in device independent pixels.
DipSideOffsets
Side-offsets in device independent pixels.
DipSize
A size in device pixels.
DipVector
A vector in device independent pixels.
PxBox
A rectangle box in device pixels.
PxCornerRadius
Corner-radius in device pixels.
PxDensity2d
Pixel density value that can differ between dimensions.
PxPoint
A point in device pixels.
PxRect
A rectangle in device pixels.
PxSideOffsets
Side-offsets in device pixels.
PxSize
A size in device pixels.
PxVector
A vector in device pixels.