FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    EffectParameterValue

    enum · ferroui-base · v0.5.0

    enum EffectParameterValue
    

    The value of a parameter of a custom effect.

    The parameters are what parsing reads and writes (tint(color=#0F9D8E, strength=0.55)), what the default interpolation interpolates, and what a backend factory hands to its GPU program as uniforms (an image as a child).

    View source

    Members

    Bool

    Bool(bool)
    

    true or false. Steps when interpolated.

    Source

    Int

    Int(i32)
    

    An integer, also the value of an enumeration. Interpolated and rounded.

    Source

    Float

    Float(f64)
    

    A number.

    Source

    Color

    Color(crate::media::Color)
    

    A colour: #AARRGGBB, #RRGGBB or a colour name.

    Source

    Point

    Point(crate::Point)
    

    A point: x,y.

    Source

    Vector

    Vector(crate::Vector)
    

    A vector: x,y.

    Source

    Size

    Size(crate::Size)
    

    A size: width,height.

    Source

    Rect

    Rect(crate::Rect)
    

    A rectangle: x,y,width,height.

    Source

    Text

    Text(std::sync::Arc<str>)
    

    A name or other text. Steps when interpolated.

    Source

    Image

    Image(super::EffectImage)
    

    An image (#455, E6): a handle of a bitmap, compared by identity, that the program of a shader effect samples as a child (see ShaderEffectDescription). Switches at half when interpolated; an empty handle takes the image of the other side.

    An effect string cannot name an image (markup has no resource context in an effect string): parsing a value for an image parameter fails, and the effect string of a snapshot leaves its images out, so that it parses back to the effect with empty images. An image is set from code, on the value or on the snapshot of a mutable effect class.

    Source

    as_bool

    fn as_bool(self: &Self) -> Option<bool>
    

    The value as a boolean.

    Source

    as_int

    fn as_int(self: &Self) -> Option<i32>
    

    The value as an integer.

    Source

    as_float

    fn as_float(self: &Self) -> Option<f64>
    

    The value as a number; an integer converts.

    Source

    as_color

    fn as_color(self: &Self) -> Option<Color>
    

    The value as a colour.

    Source

    as_point

    fn as_point(self: &Self) -> Option<Point>
    

    The value as a point; a vector converts.

    Source

    as_vector

    fn as_vector(self: &Self) -> Option<Vector>
    

    The value as a vector; a point converts.

    Source

    as_size

    fn as_size(self: &Self) -> Option<Size>
    

    The value as a size.

    Source

    as_rect

    fn as_rect(self: &Self) -> Option<Rect>
    

    The value as a rectangle.

    Source

    as_text

    fn as_text(self: &Self) -> Option<&str>
    

    The value as text.

    Source

    as_image

    fn as_image(self: &Self) -> Option<&EffectImage>
    

    The value as an image.

    Source

    interpolate

    fn interpolate(self: &Self, to: &Self, progress: f64) -> Option<Self>
    

    The value at progress (0 to 1) of the way from self to to, or None when the two are of different kinds or the kind does not interpolate (booleans and text step). Two images switch at half; an empty image is the other image all the way (a transition from no effect keeps the images of the effect it goes to).

    Source

    parse_like

    fn parse_like(self: &Self, text: &str) -> Option<Self>
    

    Parses text as a value of the same kind as self (the kind of a parameter is that of its current value), in the invariant format Display writes. Composite values may be wrapped in parentheses and separate their numbers with commas or spaces. An image is never parsed: an effect string cannot name one.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Display
    • From<bool>
    • From<i32>
    • From<f64>
    • From<Color>
    • From<Point>
    • From<Vector>
    • From<Size>
    • From<Rect>
    • From<&str>
    • From<String>
    • From<Arc<str>>
    • From<EffectImage>
    • From<&EffectImage>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.