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
use super::vector::*;
use super::brush_definition::*;
use super::brush_properties::*;
use super::brush_drawing_style::*;
use canvas::*;
use std::time::Duration;
///
/// Represents a single frame in a layer of an animation
///
pub trait Frame : Send+Sync {
///
/// Time index of this frame relative to its keyframe
///
fn time_index(&self) -> Duration;
///
/// Renders this frame to a particular graphics context
///
fn render_to(&self, gc: &mut GraphicsPrimitives);
///
/// Attempts to retrieve the vector elements associated with this frame, if there are any
///
fn vector_elements<'a>(&'a self) -> Option<Box<'a+Iterator<Item=Vector>>>;
///
/// The brush that is active after all the elements are drawn in this frame
///
/// (If new elements are added to the layer at the time index of this frame,
/// this is the brush that will be used)
///
fn active_brush(&self) -> Option<(BrushDefinition, BrushDrawingStyle)>;
///
/// The brush properties that are active after all the elements are drawn
/// in this frame.
///
/// (If new elements are added to the layer at the time index of this frame,
/// these are the properties that will be used)
///
fn active_brush_properties(&self) -> Option<BrushProperties>;
}