[][src]Enum iced_graphics::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>,
    },
    Translate {
        translation: Vector,
        content: Box<Primitive>,
    },
    Mesh2D {
        buffers: Mesh2D,
        size: Size,
    },
    Cached {
        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

Translate

A primitive that applies a translation

Fields of Translate

translation: Vector

The translation vector

content: Box<Primitive>

The primitive to translate

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

buffers: Mesh2D

The vertex and index buffers of the mesh

size: Size

The size of the drawable region of the mesh.

Any geometry that falls out of this region will be clipped.

Cached

A cached primitive.

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

Fields of Cached

cache: Arc<Primitive>

The cached primitive

Trait Implementations

impl Clone for Primitive[src]

impl Debug for Primitive[src]

impl Default for Primitive[src]

impl From<Geometry> for Primitive[src]

Auto Trait Implementations

impl RefUnwindSafe for Primitive

impl Send for Primitive

impl Sync for Primitive

impl Unpin for Primitive

impl UnwindSafe for Primitive

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

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