[−][src]Struct valora::canvas::Canvas
A painting surface.
Methods
impl Canvas
[src]
pub fn paint(&mut self, element: impl Paint)
[src]
Paints an element.
pub fn set_color(&mut self, color: impl IntoColor)
[src]
Sets the current color.
pub fn set_color_alpha(&mut self, color: impl IntoColor, alpha: f32)
[src]
Sets the current color.
pub fn move_to(&mut self, dest: P2)
[src]
Stats a new path at the given point.
pub fn line_to(&mut self, dest: P2)
[src]
Adds a line to the current path which ends at the given point.
pub fn quadratic_to(&mut self, ctrl: P2, end: P2)
[src]
Adds a quadratic bezier curve to the current path with the given control and end points.
pub fn cubic_to(&mut self, ctrl0: P2, ctrl1: P2, end: P2)
[src]
Adds a cubic bezier curve to the current path with the given control and end points.
pub fn arc(&mut self, center: P2, radii: V2, sweep: Angle, phase: Angle)
[src]
Adds an arc segment to the path.
pub fn close_path(&mut self)
[src]
Closes the current path.
pub fn set_stroke_width(&mut self, stroke_width: f32)
[src]
Sets the width of lines drawn with the stroke()
.
pub fn fill(&mut self)
[src]
Paints the current path by filling the region inside the path.
pub fn stroke(&mut self)
[src]
Paints the current path by stroking the path.
pub fn set_shader(&mut self, shader: Shader)
[src]
Sets the current shader used to shade rastered paths.
Changing shaders requires making a new draw call to the GPU and tearing down some state. Changing shaders 0-10 times per frame is likely to be fast enough. Changing shaders 500 times per frame will be slow.
Trait Implementations
impl IntoIterator for Canvas
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Canvas
impl !Send for Canvas
impl !Sync for Canvas
impl Unpin for Canvas
impl !UnwindSafe for Canvas
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
fn convert_into(self) -> U
[src]
fn convert_unclamped_into(self) -> U
[src]
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,