1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! `dinamika-core` — a declarative library for building animations on top of
//! the raster renderer [`dinamika_cpu`].
//!
//! It consists of three parts:
//!
//! 1. **Shapes** ([`Shape`]) — scene nodes with flex layout (direction, justify,
//! align, gap, padding, children) and signal-backed properties (background,
//! sizes, corner radius, opacity, rotation). Rectangle, circle, layout
//! container and text ([`Shape::text`]) are supported, with CSS-like
//! properties (font, font size, color, alignment, line height, letter spacing).
//! 2. **Signals** ([`Signal`], [`Computed`]) — reactive values in the spirit of
//! Motion Canvas: read, written and animated.
//! 3. **Timeline** ([`Timeline`]) — composition of animations over time: pause
//! ([`Timeline::pause`]), parallel ([`Timeline::parallel`]) and sequence
//! ([`Timeline::sequence`] / [`Timeline::cascade`]). Shapes are registered
//! on the timeline via [`Shape::on`], and properties are animated with the
//! same shape setter methods (`x`, `background`, `rotation`, …) — by
//! appending `.over(duration, easing)`.
//!
//! # Example
//!
//! ```
//! use dinamika_core::*;
//!
//! // The timeline is created first (interior mutability — no `mut`).
//! let tl = Timeline::new(320, 160, Color::from_rgba8(20, 20, 24, 255), 30.0);
//!
//! // Scene: a row container with two squares, registered on the timeline.
//! let a = Shape::rect().background(Color::from_rgba8(229, 192, 123, 255)).size(60.0, 60.0);
//! let b = Shape::rect().background(Color::from_rgba8(152, 195, 121, 255)).size(60.0, 60.0);
//! let _row = Shape::rect()
//! .at(20.0, 20.0)
//! .background(Color::from_rgba8(40, 44, 52, 255))
//! .radius(12.0)
//! .direction(Direction::Row)
//! .gap(20.0)
//! .padding(20.0)
//! .align(Align::Center)
//! .child(a.clone())
//! .child(b.clone())
//! .on(&tl);
//!
//! // Move and recolor in parallel, wait, then a sequence of opacities.
//! tl.parallel(vec![
//! a.rotation(180.0).over(1.0, Easing::CubicInOut),
//! b.background(Color::from_rgba8(97, 175, 239, 255)).over(1.0, Easing::Linear),
//! ]);
//! tl.pause(0.25);
//! tl.sequence(vec![
//! a.opacity(0.2).over(0.5, Easing::QuadOut),
//! b.opacity(0.2).over(0.5, Easing::QuadOut),
//! ]);
//!
//! // A single frame (RGBA, premultiplied alpha).
//! let frame = tl.frame(0.5);
//! assert_eq!(frame.width(), 320);
//! ```
/// Access to the underlying renderer.
pub use dinamika_cpu as cpu;
// Frequently used renderer types — for convenience.
pub use ;
pub use Easing;
pub use scene_output_dir;
pub use render_scene;
pub use ;
pub use ;
pub use ;