Struct helios_dac::Frame
source · pub struct Frame {
pub pps: u32,
pub flags: WriteFrameFlags,
pub points: Vec<Point>,
}
Fields§
§pps: u32
Rate of output in points per second
flags: WriteFrameFlags
default is 0
points: Vec<Point>
Implementations§
source§impl Frame
impl Frame
sourcepub fn new(pps: u32, points: Vec<Point>) -> Self
pub fn new(pps: u32, points: Vec<Point>) -> Self
Examples found in repository?
examples/frames.rs (line 64)
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
fn get_frames() -> Vec<Frame> {
let mut frames = vec![];
let color = Color::new(0xD0, 0xFF, 0xD0);
for i in 0..30 {
let mut points = vec![];
let mut y = (i * 0xFFF / 30) as u16;
for j in 0..1000 {
let x = if j < 500 {
j * 0xFFF / 500
}else {
0xFFF - ((j - 500) * 0xFFF / 500)
} as u16;
points.push(Point {
coordinate: (x, y).into(),
color,
intensity: 0xFF
});
}
frames.push(Frame::new(30000, points));
}
frames
}