Skip to main content

Sampled

Enum Sampled 

Source
#[non_exhaustive]
pub enum Sampled<'a> { No, Unset, Yes { samples: Vec<(f64, &'a OwnedArgument)>, last_defined: &'a OwnedArgument, }, }
Expand description

What ɴsɪ’s typing rule makes of one attribute’s samples.

Returned by Scene::sampled_attribute, and what the resolver itself reads for transformationmatrix and the instancer’s attributes.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

No

Not sampled. The static value applies and Node::effective gives it – run the same predicate over that too: the rule is about the call, not about SetAttributeAtTime. Rendered, a static "nvertices" "int64" 1 is E6007, then E6020, and the mesh does not draw.

§

Unset

Sampled, but the last call cannot be read as the attribute’s type – so the attribute is unset, at every time.

This is not “no samples”: 3Delight rejects the argument at the call and the attribute has no value at all afterwards. Rendered on a mesh’s P – good at t=0, a float at t=1 – it logs E6007 and then E6020, and draws nothing. A backend that fell back to the earlier sample here would draw a mesh the renderer does not.

§

Yes

The surviving samples.

Never empty: keep_from is one past the last unreadable definition and equals the count only in the Unset case, so at least one survivor is always left. Three call sites carried an is_empty branch for a case that cannot arise; they are gone.

The name is resolved here rather than at every consumer, which is what lets the survivors be an arbitrary subset of the timeline.

Fields

§samples: Vec<(f64, &'a OwnedArgument)>

In time order, which is what interpolation needs.

§last_defined: &'a OwnedArgument

The survivor defined last, which is what an attribute that is not motion data takes for the whole shutter – and is not the sample at the greatest time for a scene whose samples did not arrive in time order.

Trait Implementations§

Source§

impl<'a> Clone for Sampled<'a>

Source§

fn clone(&self) -> Self

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<'a> Debug for Sampled<'a>

Source§

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

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

impl<'a> PartialEq for Sampled<'a>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Sampled<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Sampled<'a>

§

impl<'a> RefUnwindSafe for Sampled<'a>

§

impl<'a> Send for Sampled<'a>

§

impl<'a> Sync for Sampled<'a>

§

impl<'a> Unpin for Sampled<'a>

§

impl<'a> UnsafeUnpin for Sampled<'a>

§

impl<'a> UnwindSafe for Sampled<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.