Skip to main content

SceneState

Struct SceneState 

Source
pub struct SceneState {
    pub timestamp: StateTime,
    pub background_color: Color,
    pub lighting: LightingCondition,
    pub environment: EnvironmentType,
    pub complexity: BackgroundComplexity,
    pub objects: Vec<SceneObject>,
    pub background_motion: bool,
    pub blur: f32,
    pub noise: f32,
    pub detail_level: f32,
}
Expand description

Complete scene state

Fields§

§timestamp: StateTime

Timestamp

§background_color: Color

Dominant background color

§lighting: LightingCondition

Lighting condition

§environment: EnvironmentType

Environment type

§complexity: BackgroundComplexity

Background complexity

§objects: Vec<SceneObject>

Detected objects in scene

§background_motion: bool

Is there significant motion in the background?

§blur: f32

Blur level (0.0 = sharp, 1.0 = very blurred)

§noise: f32

Noise level (0.0 = clean, 1.0 = very noisy)

§detail_level: f32

Detail level (0.0 - 1.0, for degradation)

Implementations§

Source§

impl SceneState

Source

pub fn new(timestamp: StateTime) -> Self

Create a new scene state

Source

pub fn simple(timestamp: StateTime, color: Color) -> Self

Simple scene (solid color background)

Source

pub fn add_object(&mut self, object: SceneObject)

Add an object to the scene

Source

pub fn reduce_detail(&mut self, factor: f32)

Reduce detail level (for degradation)

Source

pub fn lerp(&self, other: &SceneState, t: f32) -> SceneState

Interpolate between two scene states

Trait Implementations§

Source§

impl Clone for SceneState

Source§

fn clone(&self) -> SceneState

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SceneState

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> 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> 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 = 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.