freya::plot

Struct SkiaBackend

pub struct SkiaBackend<'a> { /* private fields */ }

Implementations§

§

impl<'a> SkiaBackend<'a>

pub fn new( canvas: &'a Canvas, font_collection: &'a mut RCHandle<skia_textlayout_FontCollection>, size: (i32, i32), ) -> SkiaBackend<'a>

Trait Implementations§

§

impl DrawingBackend for SkiaBackend<'_>

§

type ErrorType = SkiaBackendError

The error type reported by the backend
§

fn draw_line<S>( &mut self, from: (i32, i32), to: (i32, i32), style: &S, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
where S: BackendStyle,

Draw a line on the drawing backend Read more
§

fn draw_rect<S>( &mut self, upper_left: (i32, i32), bottom_right: (i32, i32), style: &S, fill: bool, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
where S: BackendStyle,

Draw a rectangle on the drawing backend Read more
§

fn draw_path<S, I>( &mut self, path: I, style: &S, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
where S: BackendStyle, I: IntoIterator<Item = (i32, i32)>,

Draw a path on the drawing backend Read more
§

fn draw_circle<S>( &mut self, center: (i32, i32), radius: u32, style: &S, fill: bool, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
where S: BackendStyle,

Draw a circle on the drawing backend Read more
§

fn fill_polygon<S, I>( &mut self, vert: I, style: &S, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
where S: BackendStyle, I: IntoIterator<Item = (i32, i32)>,

§

fn draw_text<TStyle>( &mut self, text: &str, style: &TStyle, pos: (i32, i32), ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
where TStyle: BackendTextStyle,

Draw a text on the drawing backend Read more
§

fn estimate_text_size<TStyle>( &self, text: &str, style: &TStyle, ) -> Result<(u32, u32), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
where TStyle: BackendTextStyle,

Estimate the size of the horizontal text if rendered on this backend. This is important because some of the backend may not have font ability. Thus this allows those backend reports proper value rather than ask the font rasterizer for that. Read more
§

fn draw_pixel( &mut self, _point: (i32, i32), _color: BackendColor, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>

Draw a pixel on the drawing backend Read more
§

fn get_size(&self) -> (u32, u32)

Get the dimension of the drawing backend in pixels
§

fn ensure_prepared( &mut self, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>

Ensure the backend is ready to draw
§

fn present( &mut self, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>

Finalize the drawing step and present all the changes. This is used as the real-time rendering support. The backend may implement in the following way, when ensure_prepared is called it checks if it needs a fresh buffer and present is called rendering all the pending changes on the screen.
§

fn blit_bitmap( &mut self, pos: (i32, i32), _: (u32, u32), src: &[u8], ) -> Result<(), DrawingErrorKind<Self::ErrorType>>

Blit a bitmap on to the backend. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for SkiaBackend<'a>

§

impl<'a> !RefUnwindSafe for SkiaBackend<'a>

§

impl<'a> !Send for SkiaBackend<'a>

§

impl<'a> !Sync for SkiaBackend<'a>

§

impl<'a> Unpin for SkiaBackend<'a>

§

impl<'a> !UnwindSafe for SkiaBackend<'a>

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> InitializeFromFunction<T> for T

§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoDrawingArea for T
where T: DrawingBackend,

§

fn into_drawing_area(self) -> DrawingArea<T, Shift>

Convert the type into a root drawing area
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

§

fn super_from(input: T) -> O

Convert from a type to another type.
§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

§

fn super_into(self) -> O

Convert from a type to another type.
Source§

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

Source§

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>,

Source§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,