Struct flo_canvas::DrawingTarget
source · pub struct DrawingTarget { /* private fields */ }
Expand description
A drawing target sends drawing instructions to a DrawStream
flo_draw
provides two structures for sending drawing instructions to other part of the application. DrawingTarget
is used when the instructions do not need to be retained: eg, when rendering to a window or to an offscreen target.
See Canvas
for a structure that can store drawing instructions as well as send them to a target.
Implementations§
source§impl DrawingTarget
impl DrawingTarget
sourcepub fn new() -> (DrawingTarget, DrawStream)
pub fn new() -> (DrawingTarget, DrawStream)
Creates a new drawing target and a stream that can be used to read the instructions sent to it
sourcepub fn write<Drawing: Send + IntoIterator<Item = Draw>>(&self, drawing: Drawing)
pub fn write<Drawing: Send + IntoIterator<Item = Draw>>(&self, drawing: Drawing)
Sends some drawing instructions to this target
Trait Implementations§
source§impl Clone for DrawingTarget
impl Clone for DrawingTarget
A drawing context can be cloned in order to create multiple sources for a single drawing target.
This is particularly useful when combined with layers: multiple threads can draw to different layers without interfering with each other, so it’s possible to design renderers where the rendering instructions have multiple sources (see the mandelbrot example for an example of where this is used)
source§fn clone(&self) -> DrawingTarget
fn clone(&self) -> DrawingTarget
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more