pub struct Forma;

Implementations§

source§

impl Forma

source

pub fn new_context_without_token( size: Size2D<u32>, display_rotation: DisplayRotation ) -> FormaContext

Trait Implementations§

source§

impl Backend for Forma

§

type Image = FormaImage

Buffer-backed image that can be used for rendering or storing pixel data.
§

type Context = FormaContext

Backend’s rendering context.
§

type Path = FormaPath

Vector path.
§

type PathBuilder = FormaPathBuilder

Stateful path builder.
§

type Raster = FormaRaster

Compact rasterized form of any number of paths.
§

type RasterBuilder = FormaRasterBuilder

Stateful raster builder.
§

type Composition = FormaComposition

Composition of stylized rasters.
source§

fn new_context( token: ClientEnd<BufferCollectionTokenMarker>, size: Size2D<u32>, display_rotation: DisplayRotation ) -> FormaContext

Creates a new rendering context
source§

impl Clone for Forma

source§

fn clone(&self) -> Forma

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Composition<Forma> for FormaComposition

source§

fn new(background_color: Color) -> Self

Creates a composition of ordered layers where the layers with lower index appear on top.
source§

fn clear(&mut self)

Resets composition by removing all layers.
source§

fn insert(&mut self, order: Order, layer: Layer<Forma>)

Inserts layer into the composition.
source§

fn remove(&mut self, order: Order)

Removes layer from the composition.
source§

impl Context<Forma> for FormaContext

source§

fn pixel_format(&self) -> PixelFormat

Returns the context’s pixel format.
source§

fn path_builder(&self) -> Option<FormaPathBuilder>

Optionally returns a PathBuilder. May return None of old builder is still alive.
source§

fn raster_builder(&self) -> Option<FormaRasterBuilder>

Optionally returns a RasterBuilder. May return None of old builder is still alive.
source§

fn new_image(&mut self, size: Size2D<u32>) -> FormaImage

Creates a new image with size.
source§

fn new_image_from_png<R: Read>( &mut self, reader: &mut Reader<R> ) -> Result<FormaImage, Error>

Creates a new image from PNG reader.
source§

fn get_image(&mut self, image_index: u32) -> FormaImage

Returns the image at image_index.
source§

fn get_current_image(&mut self, context: &ViewAssistantContext) -> FormaImage

Returns the context’s current image.
source§

fn render_with_clip( &mut self, composition: &mut FormaComposition, clip: Rect<u32>, image: FormaImage, ext: &RenderExt<Forma> )

Renders the composition with a clip to the image.
source§

fn render( &mut self, composition: &mut B::Composition, clip: Option<Rect<u32>>, image: B::Image, ext: &RenderExt<B> )

Renders the composition with an optional clip to the image.
source§

impl Debug for Forma

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Forma

source§

fn default() -> Forma

Returns the “default value” for a type. Read more
source§

impl Hash for Forma

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Forma

source§

fn cmp(&self, other: &Forma) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Forma

source§

fn eq(&self, other: &Forma) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Forma

source§

fn partial_cmp(&self, other: &Forma) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PathBuilder<Forma> for FormaPathBuilder

source§

fn move_to(&mut self, point: Point) -> &mut Self

Move end-point to.
source§

fn line_to(&mut self, point: Point) -> &mut Self

Create line from end-point to point and update end-point.
source§

fn quad_to(&mut self, p1: Point, p2: Point) -> &mut Self

Create quadratic Bézier from end-point to p2 with p1 as control point.
source§

fn cubic_to(&mut self, p1: Point, p2: Point, p3: Point) -> &mut Self

Create cubic Bézier from end-point to p3 with p1 and p2 as control points.
source§

fn rat_quad_to(&mut self, p1: Point, p2: Point, w: f32) -> &mut Self

Create rational quadratic Bézier from end-point to p2 with p1 as control point and w as its weight.
source§

fn rat_cubic_to( &mut self, p1: Point, p2: Point, p3: Point, w1: f32, w2: f32 ) -> &mut Self

Create rational cubic Bézier from end-point to p3 with p1 and p2 as control points, and w1 and w2 their weights.
source§

fn build(self) -> FormaPath

Closes the path with a line if not yet closed and builds the path. Read more
source§

impl RasterBuilder<Forma> for FormaRasterBuilder

source§

fn add_with_transform( &mut self, path: &FormaPath, transform: &Transform2D<f32> ) -> &mut Self

Add a path to the raster with transform.
source§

fn build(self) -> FormaRaster

Builds the raster. Read more
source§

fn add( &mut self, path: &B::Path, transform: Option<&Transform2D<f32>> ) -> &mut Self

Add a path to the raster with optional transform.
source§

impl Copy for Forma

source§

impl Eq for Forma

source§

impl StructuralPartialEq for Forma

Auto Trait Implementations§

§

impl Freeze for Forma

§

impl RefUnwindSafe for Forma

§

impl Send for Forma

§

impl Sync for Forma

§

impl Unpin for Forma

§

impl UnwindSafe for Forma

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> Encode<Ambiguous1> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> Encode<Ambiguous2> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
§

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

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V

§

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

impl<St> WithTag for St

source§

fn tagged<T>(self, tag: T) -> Tagged<T, St>

Produce a new stream from this one which yields item tupled with a constant tag