Skip to main content

blockworx_paint/
lib.rs

1//! What a drawing is made of, and how it reaches a host.
2//!
3//! Above the coordinates a mark is placed at ([`blockworx_geom`]) sits
4//! everything the render path and the tools need in order to *draw*: the colour
5//! a mark is filled with, the font a glyph is selected from, the palette and
6//! theme those resolve through, the [`Renderer`] every backend implements, and
7//! the [`Canvas`] a *live* backend adds on top of it — pointer, cursor, keyed
8//! easings, an in-place text editor, repaint requests.
9//!
10//! Like [`blockworx_geom`], this crate names no UI toolkit: not as a normal
11//! dependency, not optionally behind a feature, not as a dev-dependency. The
12//! conversions to a toolkit's own types live at the backend boundary, so the
13//! next backend is a set of trait impls rather than a rewrite.
14//!
15//! [`Color`] is ecolor's `Color32` reimplemented: premultiplied sRGBA in eight
16//! bits a channel, with the operations the palette and the SVG writer use
17//! copied from ecolor (© Rerun / emilk, dual-licensed MIT OR Apache-2.0) so the
18//! two agree byte for byte. Property tests beside the conversions hold them to
19//! that.
20
21pub mod canvas;
22pub mod edit;
23pub mod extent;
24pub mod ground;
25pub mod image;
26pub mod interaction;
27pub mod palette;
28pub mod record;
29pub mod text;
30pub mod theme;
31
32mod color;
33mod easing;
34mod font;
35mod progress;
36mod renderer;
37mod scheme;
38mod vantage;
39mod zoom;
40
41pub use canvas::{AnimKey, Animator, Canvas, Cursor, EditColors, EditId, EditText, PointerKind};
42pub use color::Color;
43pub use easing::{Animated, Easing, Tick};
44pub use edit::{EditField, TextEvent, TextOutcome};
45pub use extent::Extent;
46pub use font::{CANVAS_FAMILY, Font, FontFamily};
47pub use ground::{GridLine, Ground};
48pub use image::ImageImportError;
49pub use interaction::{
50    Button, Camera, Chord, Event, Input, Interaction, Key, Keys, Modifiers, Press, Raw,
51};
52pub use palette::{Base, Luminance, Palette, PaletteStroke, Saturation, Swatch};
53pub use progress::Progress;
54pub use record::{DrawList, DrawOp, Recorded, Recording};
55pub use renderer::Renderer;
56pub use scheme::{FontChoice, Mode, Scheme};
57pub use text::TextLayout;
58pub use vantage::Move;
59pub use vantage::Vantage;
60pub use zoom::{Factor, ScrollPx, Zoom, ZoomStep};