Skip to main content

Crate impeller_core

Crate impeller_core 

Source
Expand description

The public API: what an application draws with.

Everything below this — tessellation, batching, backends, presentation — is reachable but not usually reached for. A caller describes a frame on a Canvas and hands the resulting Recording to a target.

Recording is deliberately separate from submitting. Describing a whole frame before any of it reaches the GPU is what lets draws share a single pass, and it keeps the API free of the question of when work is flushed.

Color is linear throughout, converted at this boundary. Blending, filtering, and antialiasing all average colors, and averaging sRGB-encoded values is visibly wrong — see Color.

Re-exports§

pub use canvas::Canvas;
pub use canvas::Layer;
pub use canvas::Morphology;
pub use canvas::Pass;
pub use canvas::PointMode;
pub use canvas::Recording;
pub use canvas::Rect;
pub use canvas::RoundingRadii;
pub use canvas::TextureSource;
pub use color::Color;
pub use color::ColorSpace;
pub use execute::execute;
pub use execute::execute_deferred;
pub use execute::execute_layers;
pub use execute::render_offscreen;
pub use execute::render_offscreen_into;
pub use execute::resolve_sources;
pub use paint::GradientStop;
pub use paint::ImageFilter;
pub use paint::MaskBlurStyle;
pub use paint::Paint;
pub use paint::Shader;
pub use paint::Style;
pub use vertices::SourceRect;
pub use vertices::Sprite;
pub use vertices::VertexMode;
pub use vertices::Vertices;

Modules§

canvas
The recording surface.
color
Color.
execute
Rendering a recording, pass by pass.
paint
How a shape is drawn.
ramp
Baking a gradient’s stops into a texture the shader can sample.
vertices
A triangle mesh a caller supplies directly.

Structs§

Affine2
Two-dimensional vector and affine types, from glam. A 2D affine transform, which can represent translation, rotation, scaling and shear.
Atlas
A square atlas of glyph coverage, and where each glyph landed.
AtlasRect
Where a glyph sits in the atlas, in texels.
Coverage
A rasterized glyph, as a caller supplies it.
Dash
A dash pattern: alternating drawn and skipped lengths, and where to start.
Extent2D
A 2D extent in pixels.
GlyphKey
What identifies a glyph in the atlas.
Path
A path: a verb stream plus the points those verbs consume.
PathBuilder
Accumulates verbs and points into a Path.
PositionedGlyph
One glyph, placed.
StrokeStyle
A stroke’s geometric parameters.
Transform2D
A transform of the plane that may carry perspective.
Vec2
Two-dimensional vector and affine types, from glam. A 2-dimensional vector.

Enums§

AtlasError
Why a glyph could not be added.
BlendMode
How a draw combines with what a target already holds.
ColorFilter
A function applied to a material’s color, after the material and before the blend.
ColorForm
What space a color filter’s matrix expects its input in.
FillRule
How overlapping subpaths combine when filling.
Gamma
Which way through the sRGB transfer function a ColorFilter::Gamma goes.
LineCap
How a stroke terminates at an open end.
LineJoin
How a stroke turns a corner.
PixelFormat
Pixel formats the renderer can target.
Sampling
How a texture is read between its texels.
TileMode
What happens outside an image’s own bounds.

Constants§

MAX_STOPS
The most stops a gradient carries in the material itself.