Struct pax_runtime::engine::Renderer

source ·
pub struct Renderer<R: RenderContext> { /* private fields */ }

Implementations§

source§

impl<R: RenderContext> Renderer<R>

source

pub fn new() -> Self

source

pub fn add_context(&mut self, id: &str, context: R)

source

pub fn remove_context(&mut self, id: &str)

source

pub fn image_loaded(&self, path: &str) -> bool

Trait Implementations§

source§

impl<R: RenderContext> RenderContext for Renderer<R>

source§

fn fill(&mut self, layer: &str, path: BezPath, brush: &PaintBrush)

source§

fn stroke(&mut self, layer: &str, path: BezPath, brush: &PaintBrush, width: f64)

source§

fn save(&mut self, layer: &str)

source§

fn transform(&mut self, layer: &str, affine: Affine)

source§

fn clip(&mut self, layer: &str, path: BezPath)

source§

fn restore(&mut self, layer: &str)

source§

fn load_image(&mut self, path: &str, buf: &[u8], width: usize, height: usize)

source§

fn get_image_size(&mut self, image_path: &str) -> Option<(usize, usize)>

source§

fn draw_image(&mut self, layer: &str, image_path: &str, rect: Rect)

source§

fn layers(&self) -> Vec<&str>

Auto Trait Implementations§

§

impl<R> Freeze for Renderer<R>

§

impl<R> RefUnwindSafe for Renderer<R>

§

impl<R> Send for Renderer<R>
where R: Send, <R as RenderContext>::Image: Send,

§

impl<R> Sync for Renderer<R>
where R: Sync, <R as RenderContext>::Image: Sync,

§

impl<R> Unpin for Renderer<R>
where R: Unpin, <R as RenderContext>::Image: Unpin,

§

impl<R> UnwindSafe for Renderer<R>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> RoundFrom<T> for T

source§

fn round_from(x: T) -> T

Performs the conversion.
source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

source§

fn round_into(self) -> U

Performs the conversion.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.