pub enum Primitive {
None,
Group {
primitives: Vec<Primitive, Global>,
},
Text {
content: String,
bounds: Rectangle<f32>,
color: Color,
size: f32,
font: Font,
horizontal_alignment: Horizontal,
vertical_alignment: Vertical,
},
Quad {
bounds: Rectangle<f32>,
background: Background,
border_radius: [f32; 4],
border_width: f32,
border_color: Color,
},
Image {
handle: Handle,
bounds: Rectangle<f32>,
},
Svg {
handle: Handle,
color: Option<Color>,
bounds: Rectangle<f32>,
},
Clip {
bounds: Rectangle<f32>,
content: Box<Primitive, Global>,
},
Translate {
translation: Vector<f32>,
content: Box<Primitive, Global>,
},
SolidMesh {
buffers: Mesh2D<ColoredVertex2D>,
size: Size<f32>,
},
GradientMesh {
buffers: Mesh2D<Vertex2D>,
size: Size<f32>,
gradient: Gradient,
},
Cached {
cache: Arc<Primitive>,
},
}
Expand description
A rendering primitive.
Variants§
None
An empty primitive
Group
A group of primitives
Text
Fields
§
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
§
background: Background
The background of the quad
A quad primitive
Image
An image primitive
Svg
Fields
An SVG primitive
Clip
Fields
A clip primitive
Translate
Fields
A primitive that applies a translation
SolidMesh
Fields
§
buffers: Mesh2D<ColoredVertex2D>
The vertices and indices of the mesh.
A low-level primitive to render a mesh of triangles with a solid color.
It can be used to render many kinds of geometry freely.
GradientMesh
Fields
A low-level primitive to render a mesh of triangles with a gradient.
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§
source§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>,
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>,
source§fn 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>,
Convert the source color to the destination color using the specified
method Read more
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default Read more
source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more