ShadingType

Enum ShadingType 

Source
pub enum ShadingType {
    FunctionBased {
        domain: [f32; 4],
        matrix: Affine,
        function: ShadingFunction,
    },
    RadialAxial {
        coords: [f32; 6],
        domain: [f32; 2],
        function: ShadingFunction,
        extend: [bool; 2],
        axial: bool,
    },
    TriangleMesh {
        triangles: Vec<Triangle>,
        function: Option<ShadingFunction>,
    },
    CoonsPatchMesh {
        patches: Vec<CoonsPatch>,
        function: Option<ShadingFunction>,
    },
    TensorProductPatchMesh {
        patches: Vec<TensorProductPatch>,
        function: Option<ShadingFunction>,
    },
    Dummy,
}
Expand description

A type of shading.

Variants§

§

FunctionBased

A function-based shading.

Fields

§domain: [f32; 4]

The domain of the function.

§matrix: Affine

A transform to apply to the shading.

§function: ShadingFunction

The function that should be used to evaluate the shading.

§

RadialAxial

A radial-axial shading.

Fields

§coords: [f32; 6]

The coordinates of the shading.

For axial shadings, only the first 4 entries are relevant, representing the x/y coordinates of the first point and the coordinates for the second point.

For radial shadings, the coordinates contain the x/y coordinates as well as the radius for both circles.

§domain: [f32; 2]

The domain of the shading.

§function: ShadingFunction

The function forming the basis of the shading.

§extend: [bool; 2]

The extends in the left/right direction of the shading.

§axial: bool

Whether the shading is axial or radial.

§

TriangleMesh

A triangle-mesh shading.

Fields

§triangles: Vec<Triangle>

The triangles making up the shading.

§function: Option<ShadingFunction>

An optional function used for calculating the sampled color values.

§

CoonsPatchMesh

A coons-patch-mesh shading.

Fields

§patches: Vec<CoonsPatch>

The patches that make up the shading.

§function: Option<ShadingFunction>

An optional function used for calculating the sampled color values.

§

TensorProductPatchMesh

A tensor-product-patch-mesh shading.

Fields

§patches: Vec<TensorProductPatch>

The patches that make up the shading.

§function: Option<ShadingFunction>

An optional function used for calculating the sampled color values.

§

Dummy

A dummy shading that should just be drawn transparent.

Trait Implementations§

Source§

impl Debug for ShadingType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,