[][src]Enum iced_wgpu::Primitive

pub enum Primitive {
    None,
    Group {
        primitives: Vec<Primitive>,
    },
    Text {
        content: String,
        bounds: Rectangle,
        color: Color,
        size: f32,
        font: Font,
        horizontal_alignment: HorizontalAlignment,
        vertical_alignment: VerticalAlignment,
    },
    Quad {
        bounds: Rectangle,
        background: Background,
        border_radius: u16,
        border_width: u16,
        border_color: Color,
    },
    Image {
        handle: Handle,
        bounds: Rectangle,
    },
    Svg {
        handle: Handle,
        bounds: Rectangle,
    },
    Clip {
        bounds: Rectangle,
        offset: Vector<u32>,
        content: Box<Primitive>,
    },
    Mesh2D {
        origin: Point,
        buffers: Mesh2D,
    },
    Cached {
        origin: Point,
        cache: Arc<Primitive>,
    },
}

A rendering primitive.

Variants

None

An empty primitive

Group

A group of primitives

Fields of Group

primitives: Vec<Primitive>

The primitives of the group

Text

A text primitive

Fields of Text

content: String

The contents of the text

bounds: Rectangle

The bounds of the text

color: Color

The color of the text

size: f32

The size of the text

font: Font

The font of the text

horizontal_alignment: HorizontalAlignment

The horizontal alignment of the text

vertical_alignment: VerticalAlignment

The vertical alignment of the text

Quad

A quad primitive

Fields of Quad

bounds: Rectangle

The bounds of the quad

background: Background

The background of the quad

border_radius: u16

The border radius of the quad

border_width: u16

The border width of the quad

border_color: Color

The border color of the quad

Image

An image primitive

Fields of Image

handle: Handle

The handle of the image

bounds: Rectangle

The bounds of the image

Svg

An SVG primitive

Fields of Svg

handle: Handle

The path of the SVG file

bounds: Rectangle

The bounds of the viewport

Clip

A clip primitive

Fields of Clip

bounds: Rectangle

The bounds of the clip

offset: Vector<u32>

The offset transformation of the clip

content: Box<Primitive>

The content of the clip

Mesh2D

A low-level primitive to render a mesh of triangles.

It can be used to render many kinds of geometry freely.

Fields of Mesh2D

origin: Point

The top-left coordinate of the mesh

buffers: Mesh2D

The vertex and index buffers of the mesh

Cached

A cached primitive.

This can be useful if you are implementing a widget where primitive generation is expensive.

Fields of Cached

origin: Point

The origin of the coordinate system of the cached primitives

cache: Arc<Primitive>

The cached primitive

Trait Implementations

impl Clone for Primitive[src]

impl Debug for Primitive[src]

impl Default for Primitive[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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