[][src]Struct orbtk_shell::render::concurrent::RenderContext2D

pub struct RenderContext2D { /* fields omitted */ }

The RenderContext2D provides a concurrent render ctx.

Implementations

impl RenderContext2D[src]

pub fn new(width: f64, height: f64) -> RenderContext2D[src]

Creates a new render ctx 2d.

pub fn finish_receiver(&self) -> &Receiver<bool>[src]

pub fn set_background(&mut self, background: Color)[src]

pub fn start(&mut self)[src]

Starts a new render pipeline.

pub fn finish(&mut self)[src]

Finishes the current render pipeline.

pub fn resize(&mut self, width: f64, height: f64)[src]

Resizes the render ctx.

pub fn register_font(&mut self, family: &str, font_file: &'static [u8])[src]

Registers a new font file.

pub fn fill_rect(&mut self, x: f64, y: f64, width: f64, height: f64)[src]

Draws a filled rectangle whose starting point is at the coordinates {x, y} with the specified width and height and whose style is determined by the fillStyle attribute.

pub fn stroke_rect(&mut self, x: f64, y: f64, width: f64, height: f64)[src]

Draws a rectangle that is stroked (outlined) according to the current strokeStyle and other ctx settings.

pub fn fill_text(&mut self, text: &str, x: f64, y: f64)[src]

Draws (fills) a given text at the given (x, y) position.

pub fn measure(
    &mut self,
    text: &str,
    font_size: f64,
    family: impl Into<String>
) -> TextMetrics
[src]

pub fn measure_text(&mut self, text: &str) -> TextMetrics[src]

Returns a TextMetrics object.

pub fn fill(&mut self)[src]

Fills the current or given path with the current file style.

pub fn stroke(&mut self)[src]

Strokes {outlines} the current or given path with the current stroke style.

pub fn begin_path(&mut self)[src]

Starts a new path by emptying the list of sub-paths. Call this when you want to create a new path.

pub fn close_path(&mut self)[src]

Attempts to add a straight line from the current point to the start of the current sub-path. If the shape has already been closed or has only one point, this function does nothing.

pub fn rect(&mut self, x: f64, y: f64, width: f64, height: f64)[src]

Adds a rectangle to the current path.

pub fn arc(
    &mut self,
    x: f64,
    y: f64,
    radius: f64,
    start_angle: f64,
    end_angle: f64
)
[src]

Creates a circular arc centered at (x, y) with a radius of radius. The path starts at startAngle and ends at endAngle.

pub fn move_to(&mut self, x: f64, y: f64)[src]

Begins a new sub-path at the point specified by the given {x, y} coordinates.

pub fn line_to(&mut self, x: f64, y: f64)[src]

Adds a straight line to the current sub-path by connecting the sub-path's last point to the specified {x, y} coordinates.

pub fn quadratic_curve_to(&mut self, cpx: f64, cpy: f64, x: f64, y: f64)[src]

Adds a quadratic Bézier curve to the current sub-path.

pub fn bezier_curve_to(
    &mut self,
    cp1x: f64,
    cp1y: f64,
    cp2x: f64,
    cp2y: f64,
    x: f64,
    y: f64
)
[src]

Adds a cubic Bézier curve to the current sub-path. It requires three points: the first two are control points and the third one is the end point. The starting point is the latest point in the current path, which can be changed using MoveTo{} before creating the Bézier curve.

pub fn draw_render_target(
    &mut self,
    render_target: &RenderTarget,
    x: f64,
    y: f64
)
[src]

pub fn draw_image(&mut self, image: &mut Image, x: f64, y: f64)[src]

Draws the image.

pub fn draw_image_with_clip(
    &mut self,
    image: &mut Image,
    clip: Rectangle,
    x: f64,
    y: f64
)
[src]

Draws the given part of the image.

pub fn draw_pipeline(
    &mut self,
    x: f64,
    y: f64,
    width: f64,
    height: f64,
    pipeline: Box<dyn PipelineTrait + 'static>
)
[src]

pub fn clip(&mut self)[src]

Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the clipping path only.

pub fn set_line_width(&mut self, line_width: f64)[src]

Sets the thickness of lines.

pub fn set_alpha(&mut self, alpha: f32)[src]

Sets the alpha value,

pub fn set_font_family(&mut self, family: impl Into<String>)[src]

Specifies the font family.

pub fn set_font_size(&mut self, size: f64)[src]

Specifies the font size.

pub fn set_fill_style(&mut self, fill_style: Brush)[src]

Specifies the fill color to use inside shapes.

pub fn set_stroke_style(&mut self, stroke_style: Brush)[src]

Specifies the fill stroke to use inside shapes.

pub fn set_transform(
    &mut self,
    h_scaling: f64,
    h_skewing: f64,
    v_skewing: f64,
    v_scaling: f64,
    h_moving: f64,
    v_moving: f64
)
[src]

Sets the transformation.

pub fn save(&mut self)[src]

Saves the entire state of the canvas by pushing the current state onto a stack.

pub fn restore(&mut self)[src]

Restores the most recently saved canvas state by popping the top entry in the drawing state stack. If there is no saved state, this method does nothing.

pub fn clear(&mut self, brush: &Brush)[src]

pub fn data(&mut self) -> Option<&[u32]>[src]

pub fn data_mut(&mut self) -> &mut [u32][src]

pub fn data_u8_mut(&mut self) -> &mut [u8][src]

Trait Implementations

impl Drop for RenderContext2D[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,