[][src]Crate piet

A 2D graphics abstraction.

Re-exports

pub use kurbo;

Modules

util

utilities shared by various backends Code useful for multiple backends

Structs

FixedLinearGradient

Specification of a linear gradient.

FixedRadialGradient

Specification of a radial gradient in image-space.

FontFamily

A reference to a font family.

FontWeight

A font weight, represented as a value in the range 1..=1000.

GradientStop

Specification of a gradient stop.

HitTestPoint

Result of hit testing a point in a TextLayout.

HitTestPosition

Result of hit testing a text position in a TextLayout.

LineMetric

Metadata about each line in a text layout.

LinearGradient

A description of a linear gradient in the unit rect, which can be resolved to a fixed gradient.

RadialGradient

A description of a radial gradient in the unit rect, which can be resolved to a fixed gradient.

StrokeStyle

Options for drawing stroked lines. Most of these are self explanatory, but some aren't.

UnitPoint

A representation of a point relative to a unit rectangle.

Enums

Color

A datatype representing color.

Error

An error that can occur while rendering 2D graphics.

FixedGradient

Any fixed gradient.

FontStyle

A font style, which may be italic or regular.

ImageFormat

The pixel format for bitmap images.

InterpolationMode

A requested interpolation mode for drawing images.

LineCap

Options for the cap of stroked lines.

LineJoin

Options for angled joins in strokes.

PaintBrush

A color or a gradient.

ScaleMode

Mappings from the unit square into a non-square rectangle.

TextAlignment

The alignment of text in a TextLayout.

TextAttribute

Attributes that can be applied to text.

Traits

GradientStops

A flexible, ergonomic way to describe gradient stops.

IntoBrush

A trait for various types that can be used as brushes. These include backend-independent types such Color and LinearGradient, as well as the types used to represent these on a specific backend.

RenderContext

The main trait for rendering graphics.

RoundFrom

This is our own implementation of a "lossy From" trait, representing a conversion that can have precision loss. It is essentially adapted from https://github.com/rust-lang/rfcs/pull/2484.

RoundInto

The companion to RoundFrom. As with From and Into, a blanket implementation is provided; for the most part, implement RoundFrom.

Text

The Piet text API.

TextLayout

A drawable text object.

TextLayoutBuilder

A trait for laying out text.

TextStorage

A type that stores text.