Skip to main content

MaterialDesc

Struct MaterialDesc 

Source
pub struct MaterialDesc { /* private fields */ }

Implementations§

Source§

impl MaterialDesc

Source

pub const fn clearcoat_texture(&self) -> Option<TextureHandle>

Source

pub const fn clearcoat_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn clearcoat_roughness_texture(&self) -> Option<TextureHandle>

Source

pub const fn clearcoat_roughness_texture_transform( &self, ) -> Option<TextureTransform>

Source

pub const fn clearcoat_normal_texture(&self) -> Option<TextureHandle>

Source

pub const fn clearcoat_normal_texture_transform( &self, ) -> Option<TextureTransform>

Source

pub const fn sheen_color_texture(&self) -> Option<TextureHandle>

Source

pub const fn sheen_color_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn sheen_roughness_texture(&self) -> Option<TextureHandle>

Source

pub const fn sheen_roughness_texture_transform( &self, ) -> Option<TextureTransform>

Source

pub const fn anisotropy_texture(&self) -> Option<TextureHandle>

Source

pub const fn anisotropy_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn iridescence_texture(&self) -> Option<TextureHandle>

Source

pub const fn iridescence_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn iridescence_thickness_texture(&self) -> Option<TextureHandle>

Source

pub const fn iridescence_thickness_texture_transform( &self, ) -> Option<TextureTransform>

Source

pub const fn transmission_texture(&self) -> Option<TextureHandle>

Source

pub const fn transmission_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn thickness_texture(&self) -> Option<TextureHandle>

Source

pub const fn thickness_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn clearcoat_factor(&self) -> f32

Returns the scalar KHR_materials_clearcoat.clearcoatFactor.

The renderer multiplies this value by the sampled clearcoat texture when one is present.

Source

pub const fn clearcoat_roughness_factor(&self) -> f32

Returns the untextured KHR_materials_clearcoat.clearcoatRoughnessFactor.

Source

pub const fn clearcoat_normal_scale(&self) -> f32

Source

pub const fn sheen_color_factor(&self) -> Color

Returns the scalar KHR_materials_sheen.sheenColorFactor.

Source

pub const fn sheen_roughness_factor(&self) -> f32

Returns the scalar KHR_materials_sheen.sheenRoughnessFactor.

Source

pub const fn anisotropy_strength_factor(&self) -> f32

Returns KHR_materials_anisotropy.anisotropyStrength.

Source

pub const fn anisotropy_rotation_radians(&self) -> f32

Returns KHR_materials_anisotropy.anisotropyRotation in radians.

Source

pub const fn iridescence_factor(&self) -> f32

Returns KHR_materials_iridescence.iridescenceFactor.

Source

pub const fn iridescence_ior(&self) -> f32

Returns KHR_materials_iridescence.iridescenceIor.

Source

pub const fn iridescence_thickness_minimum_nm(&self) -> f32

Returns KHR_materials_iridescence.iridescenceThicknessMinimum, in nanometers.

Source

pub const fn iridescence_thickness_maximum_nm(&self) -> f32

Returns KHR_materials_iridescence.iridescenceThicknessMaximum, in nanometers.

Source

pub const fn dispersion_factor(&self) -> f32

Returns KHR_materials_dispersion.dispersion as 20 / Abbe number.

Source

pub const fn transmission_factor(&self) -> f32

Returns KHR_materials_transmission.transmissionFactor.

Source

pub const fn ior(&self) -> f32

Returns KHR_materials_ior.ior.

Source

pub const fn thickness_factor(&self) -> f32

Returns KHR_materials_volume.thicknessFactor, in scene units.

Source

pub const fn attenuation_distance(&self) -> f32

Returns KHR_materials_volume.attenuationDistance, in scene units.

Source

pub const fn attenuation_color(&self) -> Color

Returns KHR_materials_volume.attenuationColor.

Source

pub const fn with_clearcoat_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_clearcoat_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_clearcoat_roughness_texture( self, texture: TextureHandle, ) -> Self

Source

pub const fn with_clearcoat_roughness_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_clearcoat_normal_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_clearcoat_normal_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_clearcoat_normal_scale(self, scale: f32) -> Self

Source

pub const fn with_sheen_color_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_sheen_color_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_sheen_roughness_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_sheen_roughness_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_anisotropy_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_anisotropy_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_iridescence_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_iridescence_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_iridescence_thickness_texture( self, texture: TextureHandle, ) -> Self

Source

pub const fn with_iridescence_thickness_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_transmission_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_transmission_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_thickness_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_thickness_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_clearcoat_factor(self, clearcoat_factor: f32) -> Self

Sets the scalar clearcoat layer strength from KHR_materials_clearcoat.

Values are clamped to [0, 1]; NaN falls back to 0.

Source

pub const fn with_clearcoat_roughness_factor( self, clearcoat_roughness_factor: f32, ) -> Self

Sets the scalar clearcoat roughness from KHR_materials_clearcoat.

Values are clamped to [0, 1]; NaN falls back to 0.

Source

pub const fn with_sheen_color_factor(self, sheen_color_factor: Color) -> Self

Sets the scalar sheen color from KHR_materials_sheen.

Source

pub const fn with_sheen_roughness_factor( self, sheen_roughness_factor: f32, ) -> Self

Sets the scalar sheen roughness from KHR_materials_sheen.

Source

pub const fn with_anisotropy_strength_factor( self, anisotropy_strength_factor: f32, ) -> Self

Sets the scalar anisotropy strength from KHR_materials_anisotropy.

Values are clamped to [0, 1]; NaN falls back to 0.

Source

pub const fn with_anisotropy_rotation_radians( self, anisotropy_rotation_radians: f32, ) -> Self

Sets the anisotropy rotation in tangent space, in radians.

Source

pub const fn with_iridescence_factor(self, iridescence_factor: f32) -> Self

Sets the scalar iridescence strength from KHR_materials_iridescence.

Values are clamped to [0, 1]; NaN falls back to 0.

Source

pub const fn with_iridescence_ior(self, iridescence_ior: f32) -> Self

Sets the thin-film index of refraction from KHR_materials_iridescence.

Source

pub const fn with_iridescence_thickness_range_nm( self, minimum_nm: f32, maximum_nm: f32, ) -> Self

Sets the thin-film thickness range in nanometers.

The glTF extension permits minimum > maximum, so values are sanitized independently rather than reordered.

Source

pub const fn with_dispersion_factor(self, dispersion_factor: f32) -> Self

Sets the scalar dispersion strength from KHR_materials_dispersion.

Values are sanitized to >= 0; NaN falls back to 0.

Source

pub const fn with_transmission_factor(self, transmission_factor: f32) -> Self

Sets the scalar transmission strength from KHR_materials_transmission.

Values are clamped to [0, 1]; NaN falls back to 0.

Source

pub const fn with_ior(self, ior: f32) -> Self

Sets the material index of refraction from KHR_materials_ior.

Source

pub const fn with_thickness_factor(self, thickness_factor: f32) -> Self

Sets KHR_materials_volume.thicknessFactor, in scene units.

Source

pub const fn with_attenuation_distance(self, attenuation_distance: f32) -> Self

Sets KHR_materials_volume.attenuationDistance, in scene units.

Source

pub const fn with_attenuation_color(self, attenuation_color: Color) -> Self

Sets KHR_materials_volume.attenuationColor.

Source§

impl MaterialDesc

Source

pub const PRESET_NAMES: &'static [&'static str]

Source

pub fn from_preset_name(name: &str, base_color: Option<Color>) -> Option<Self>

Source

pub const fn matte(base_color: Color) -> Self

Matte dielectric material preset: high roughness, non-metallic.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::matte(Color::BLUE);
assert_eq!(material.metallic_factor(), 0.0);
assert!(material.roughness_factor() > 0.9);
Source

pub const fn plastic(base_color: Color) -> Self

Smooth dielectric plastic preset.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::plastic(Color::ORANGE);
assert_eq!(material.metallic_factor(), 0.0);
assert!(material.roughness_factor() < MaterialDesc::matte(Color::ORANGE).roughness_factor());
Source

pub const fn metal(base_color: Color) -> Self

Metallic-roughness metal preset for generic polished-metal behavior.

Use MaterialDesc::chrome for a smoother mirror-like metal shortcut, or MaterialDesc::brushed_steel for a texture-free anisotropic steel shortcut. This preset stays a conservative, general bare-metal default.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::metal(Color::LIGHT_GRAY);
assert_eq!(material.metallic_factor(), 1.0);
Source

pub const fn rough_metal(base_color: Color) -> Self

Rough bare-metal preset for less mirror-like product surfaces.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::rough_metal(Color::LIGHT_GRAY);
assert_eq!(material.metallic_factor(), 1.0);
assert!(material.roughness_factor() > MaterialDesc::metal(Color::LIGHT_GRAY).roughness_factor());
Source

pub const fn chrome() -> Self

Smooth chrome preset backed by metallic roughness, environment reflection, and opt-in screen-space material reflections.

Enable Renderer::set_screen_space_reflections or recipe render.screen_space_reflections for chrome surfaces to sample visible scene colour in screen space. Screen-edge and occluded samples fall back to the environment-lit material; this is not a caustics model.

§Examples
use scena::MaterialDesc;

let material = MaterialDesc::chrome();
assert_eq!(material.metallic_factor(), 1.0);
assert!(material.roughness_factor() < 0.1);
Source

pub const fn brushed_steel() -> Self

Brushed steel preset backed by metallic roughness plus scalar anisotropy.

This is a texture-free brushed-metal shortcut. Use anisotropy textures for authored brush direction maps.

§Examples
use scena::MaterialDesc;

let material = MaterialDesc::brushed_steel();
assert_eq!(material.metallic_factor(), 1.0);
assert!(material.anisotropy_strength_factor() > 0.5);
Source

pub const fn clearcoat_plastic(base_color: Color) -> Self

Glossy coated plastic preset backed by KHR_materials_clearcoat factors.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::clearcoat_plastic(Color::BLUE);
assert_eq!(material.metallic_factor(), 0.0);
assert!(material.clearcoat_factor() > 0.0);
Source

pub const fn satin(base_color: Color) -> Self

Satin fabric-like preset backed by the sheen material lane.

This is a smooth sheen shortcut, not a procedural weave texture.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::satin(Color::MAGENTA);
assert_eq!(material.metallic_factor(), 0.0);
assert!(material.sheen_roughness_factor() > 0.0);
Source

pub const fn leather(base_color: Color) -> Self

Smooth leather-like preset backed by rough dielectric shading plus sheen.

This preset does not synthesize leather grain or normal-map detail.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::leather(Color::ORANGE);
assert_eq!(material.metallic_factor(), 0.0);
assert!(material.sheen_roughness_factor() > 0.0);
Source

pub const fn clear_glass(tint: Color) -> Self

Transparent glass preset backed by blend mode plus transmission, IOR, and volume metadata.

GPU backends sample the opaque scene color with IOR/thickness refraction and roughness-driven blur where supported. This is not a caustics model.

§Examples
use scena::{AlphaMode, Color, MaterialDesc};

let material = MaterialDesc::clear_glass(Color::CYAN);
assert_eq!(material.alpha_mode(), AlphaMode::Blend);
assert_eq!(material.transmission_factor(), 1.0);
Source

pub const fn frosted_glass(tint: Color) -> Self

Frosted glass preset backed by blend mode plus rough transmission, IOR, and volume metadata.

GPU backends use the shared scene-color transmission path with roughness-driven blur where supported. This is not a caustics model.

§Examples
use scena::{AlphaMode, Color, MaterialDesc};

let material = MaterialDesc::frosted_glass(Color::COOL_WHITE);
assert_eq!(material.alpha_mode(), AlphaMode::Blend);
assert!(material.roughness_factor() > MaterialDesc::clear_glass(Color::COOL_WHITE).roughness_factor());
Source

pub const fn rubber() -> Self

Dark rough rubber preset.

§Examples
use scena::{Color, MaterialDesc};

let material = MaterialDesc::rubber();
assert_eq!(material.base_color(), Color::CHARCOAL);
assert_eq!(material.metallic_factor(), 0.0);
Source§

impl MaterialDesc

Source

pub const fn unlit(base_color: Color) -> Self

Source

pub const fn pbr_metallic_roughness( base_color: Color, metallic_factor: f32, roughness_factor: f32, ) -> Self

Source

pub const fn line(base_color: Color, width_px: f32) -> Self

Creates a world-space stroke material for line-topology geometry and polylines.

The segment endpoints live in scene/model space; GPU backends expand them in the vertex shader to a screen-constant physical-pixel width. Strokes are depth-tested against scene geometry, clipped at the near plane, and are not pickable in v1.7.

Source

pub const fn wireframe(base_color: Color, width_px: f32) -> Self

Creates a world-space stroke material that renders triangle mesh edges.

GPU backends retain model-space edge endpoints and expand them to screen-constant width during rendering; strokes are depth-tested, near-plane clipped, and ignored by picking in v1.7.

Source

pub const fn edge(base_color: Color, width_px: f32) -> Self

Creates a world-space stroke material for extracted mesh edges.

The default edge threshold is 30 degrees. Use with_edge_angle_threshold_degrees to override it. GPU backends retain model-space edge endpoints and expand them to screen-constant width during rendering; strokes are depth-tested, near-plane clipped, and ignored by picking in v1.7.

Source

pub const fn kind(&self) -> MaterialKind

Source

pub const fn base_color(&self) -> Color

Source

pub const fn with_base_color(self, base_color: Color) -> Self

Source

pub const fn base_color_texture(&self) -> Option<TextureHandle>

Source

pub const fn base_color_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn normal_texture(&self) -> Option<TextureHandle>

Source

pub const fn normal_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn metallic_roughness_texture(&self) -> Option<TextureHandle>

Source

pub const fn metallic_roughness_texture_transform( &self, ) -> Option<TextureTransform>

Source

pub const fn occlusion_texture(&self) -> Option<TextureHandle>

Source

pub const fn occlusion_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn emissive_texture(&self) -> Option<TextureHandle>

Source

pub const fn emissive_texture_transform(&self) -> Option<TextureTransform>

Source

pub const fn alpha_mode(&self) -> AlphaMode

Source

pub const fn emissive(&self) -> Color

Source

pub const fn emissive_strength(&self) -> f32

Source

pub const fn metallic_factor(&self) -> f32

Source

pub const fn with_metallic_factor(self, metallic_factor: f32) -> Self

Source

pub const fn roughness_factor(&self) -> f32

Source

pub const fn with_roughness_factor(self, roughness_factor: f32) -> Self

Source

pub const fn double_sided(&self) -> bool

Source

pub const fn stroke_width_px(&self) -> Option<f32>

Returns the screen-constant stroke width in physical pixels for line, wireframe, and edge materials. Returns None for non-stroke materials.

Source

pub const fn edge_angle_threshold_degrees(&self) -> Option<f32>

Returns the edge dihedral-angle threshold in degrees for edge materials.

0.0 means nearly every triangle pair can become an edge; 180.0 means only explicit boundaries remain. Returns None for non-edge materials.

Source

pub const fn with_stroke_width_px(self, width_px: f32) -> Self

Updates the screen-constant stroke width for line, wireframe, and edge materials.

Invalid values fall back to DEFAULT_STROKE_WIDTH_PX. This has no effect on non-stroke materials.

Source

pub const fn with_edge_angle_threshold_degrees( self, angle_threshold_degrees: f32, ) -> Self

Updates the edge dihedral-angle threshold in degrees.

Values clamp to [0.0, 180.0]; non-finite values fall back to DEFAULT_EDGE_ANGLE_THRESHOLD_DEGREES, replacing any previous value. This has no effect on non-edge materials.

Source

pub const fn with_base_color_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_base_color_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_normal_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_normal_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_normal_scale(self, scale: f32) -> Self

Sets normalTexture.scale (glTF spec): tangent-space normal X/Y components are multiplied by this factor before TBN reconstruction. Default 1.0.

Source

pub const fn with_occlusion_strength(self, strength: f32) -> Self

Sets occlusionTexture.strength (glTF spec): the AO factor applied is lerp(1.0, occlusion_sample, strength). Default 1.0 applies the full AO; 0.0 disables it.

Source

pub const fn normal_scale(&self) -> f32

Source

pub const fn occlusion_strength(&self) -> f32

Source

pub const fn with_metallic_roughness_texture( self, texture: TextureHandle, ) -> Self

Source

pub const fn with_metallic_roughness_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_occlusion_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_occlusion_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_emissive_texture(self, texture: TextureHandle) -> Self

Source

pub const fn with_emissive_texture_transform( self, transform: TextureTransform, ) -> Self

Source

pub const fn with_alpha_mode(self, alpha_mode: AlphaMode) -> Self

Source

pub const fn with_emissive(self, emissive: Color) -> Self

Source

pub const fn with_emissive_strength(self, emissive_strength: f32) -> Self

Source

pub const fn with_double_sided(self, double_sided: bool) -> Self

Trait Implementations§

Source§

impl Clone for MaterialDesc

Source§

fn clone(&self) -> MaterialDesc

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MaterialDesc

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for MaterialDesc

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for MaterialDesc

Source§

fn eq(&self, other: &MaterialDesc) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MaterialDesc

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
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, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
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, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

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 T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
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, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

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
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,