Enum iced_graphics::Primitive
source · pub enum Primitive {
None,
Group {
primitives: Vec<Primitive>,
},
Text {
content: String,
bounds: Rectangle,
color: Color,
size: f32,
font: Font,
horizontal_alignment: Horizontal,
vertical_alignment: Vertical,
},
Quad {
bounds: Rectangle,
background: Background,
border_radius: f32,
border_width: f32,
border_color: Color,
},
Image {
handle: Handle,
bounds: Rectangle,
},
Svg {
handle: Handle,
bounds: Rectangle,
},
Clip {
bounds: Rectangle,
content: Box<Primitive>,
},
Translate {
translation: Vector,
content: Box<Primitive>,
},
Mesh2D {
buffers: Mesh2D,
size: Size,
style: Style,
},
Cached {
cache: Arc<Primitive>,
},
}
Expand description
A rendering primitive.
Variants
None
An empty primitive
Group
A group of primitives
Text
Fields
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: Horizontal
The horizontal alignment of the text
vertical_alignment: Vertical
The vertical alignment of the text
A text primitive
Quad
Fields
bounds: Rectangle
The bounds of the quad
background: Background
The background of the quad
border_radius: f32
The border radius of the quad
border_width: f32
The border width of the quad
border_color: Color
The border color of the quad
A quad primitive
Image
An image primitive
Svg
An SVG primitive
Clip
A clip primitive
Translate
A primitive that applies a translation
Mesh2D
Fields
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.
style: Style
The shader of the mesh
A low-level primitive to render a mesh of triangles.
It can be used to render many kinds of geometry freely.
Cached
A cached primitive.
This can be useful if you are implementing a widget where primitive generation is expensive.
Trait Implementations
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
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
sourceimpl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
sourcefn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
sourcefn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more