Skip to main content

impeller_core/
lib.rs

1//! The public API: what an application draws with.
2//!
3//! Everything below this — tessellation, batching, backends, presentation — is
4//! reachable but not usually reached for. A caller describes a frame on a
5//! [`Canvas`] and hands the resulting [`Recording`] to a target.
6//!
7//! Recording is deliberately separate from submitting. Describing a whole frame
8//! before any of it reaches the GPU is what lets draws share a single pass, and
9//! it keeps the API free of the question of when work is flushed.
10//!
11//! Color is linear throughout, converted at this boundary. Blending,
12//! filtering, and antialiasing all average colors, and averaging sRGB-encoded
13//! values is visibly wrong — see [`Color`].
14
15pub mod canvas;
16pub mod color;
17pub mod execute;
18pub mod paint;
19pub mod ramp;
20pub mod vertices;
21
22pub use canvas::{
23    Canvas, Layer, Morphology, Pass, PointMode, Recording, Rect, RoundingRadii, TextureSource,
24};
25pub use color::{Color, ColorSpace};
26pub use execute::{
27    execute, execute_deferred, execute_layers, render_offscreen, render_offscreen_into,
28    resolve_sources,
29};
30pub use impeller_text::{Atlas, AtlasError, AtlasRect, Coverage, GlyphKey, PositionedGlyph};
31pub use paint::{GradientStop, ImageFilter, MaskBlurStyle, Paint, Shader, Style};
32pub use vertices::{SourceRect, Sprite, VertexMode, Vertices};
33
34// Geometry a caller builds paths with, re-exported so an application needs one
35// dependency rather than three.
36pub use impeller_geometry::dash::Dash;
37pub use impeller_geometry::stroke::{LineCap, LineJoin, StrokeStyle};
38pub use impeller_geometry::transform::Transform2D;
39pub use impeller_geometry::{FillRule, Path, PathBuilder};
40pub use impeller_hal::{
41    BlendMode, ColorFilter, ColorForm, Extent2D, Gamma, PixelFormat, Sampling, TileMode, MAX_STOPS,
42};
43
44/// Two-dimensional vector and affine types, from `glam`.
45pub use glam::{Affine2, Vec2};