Enum flo_canvas::Draw
[−]
[src]
pub enum Draw { NewPath, Move(f32, f32), Line(f32, f32), BezierCurve((f32, f32), (f32, f32), (f32, f32)), ClosePath, Fill, Stroke, LineWidth(f32), LineWidthPixels(f32), LineJoin(LineJoin), LineCap(LineCap), NewDashPattern, DashLength(f32), DashOffset(f32), FillColor(Color), StrokeColor(Color), BlendMode(BlendMode), IdentityTransform, CanvasHeight(f32), CenterRegion((f32, f32), (f32, f32)), MultiplyTransform(Transform2D), Unclip, Clip, Store, Restore, FreeStoredBuffer, PushState, PopState, ClearCanvas, Layer(u32), LayerBlend(u32, BlendMode), ClearLayer, }
Instructions for drawing to a canvas
Variants
NewPath
Begins a new path
Move(f32, f32)
Move to a new point
Line(f32, f32)
Line to point
BezierCurve((f32, f32), (f32, f32), (f32, f32))
Bezier curve to point
ClosePath
Closes the current path
Fill
Fill the current path
Stroke
Draw a line around the current path
LineWidth(f32)
Set the line width
LineWidthPixels(f32)
Set the line width in pixels
LineJoin(LineJoin)
Line join
LineCap(LineCap)
The cap to use on lines
NewDashPattern
Resets the dash pattern to empty (which is a solid line)
DashLength(f32)
Adds a dash to the current dash pattern
DashOffset(f32)
Sets the offset for the dash pattern
FillColor(Color)
Set the fill color
StrokeColor(Color)
Set the line color
BlendMode(BlendMode)
Set how future renderings are blended with one another
IdentityTransform
Reset the transformation to the identity transformation
CanvasHeight(f32)
Sets a transformation such that: (0,0) is the center point of the canvas (0,height/2) is the top of the canvas Pixels are square
CenterRegion((f32, f32), (f32, f32))
Moves a particular region to the center of the canvas (coordinates are minx, miny, maxx, maxy)
MultiplyTransform(Transform2D)
Multiply a 2D transform into the canvas
Unclip
Unset the clipping path
Clip
Clip to the currently set path
Store
Stores the content of the clipping path from the current layer in a background buffer
Restore
Restores what was stored in the background buffer. This should be done on the same layer that the Store operation was called upon.
The buffer is left intact by this operation so it can be restored again in the future.
(If the clipping path has changed since then, the restored image is clipped against the new path)
FreeStoredBuffer
Releases the buffer created by the last 'Store' operation
Restore will no longer be valid for the current layer
PushState
Push the current state of the canvas (line settings, stored image, current path - all state)
PopState
Restore a state previously pushed
ClearCanvas
Clears the canvas entirely
Layer(u32)
Selects a particular layer for drawing Layer 0 is selected initially. Layers are drawn in order starting from 0. Layer IDs don't have to be sequential.
LayerBlend(u32, BlendMode)
Sets how a particular layer is blended with the underlying layer
ClearLayer
Clears the current layer
Trait Implementations
impl<'a, Coord: Coordinate2D + Coordinate, Curve: BezierCurve<Point = Coord>> From<&'a Curve> for Draw
[src]
impl Clone for Draw
[src]
fn clone(&self) -> Draw
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Draw
[src]
impl PartialEq for Draw
[src]
fn eq(&self, __arg_0: &Draw) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Draw) -> bool
[src]
This method tests for !=
.
impl Debug for Draw
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl CanvasEncoding<String> for Draw
[src]
fn encode_canvas(&self, append_to: &mut String)
[src]
Encodes this item by appending it to the specified string Read more