pub struct PrecisionTransition {
pub from: Precision,
pub to: Precision,
pub start_step: u32,
pub end_step: u32,
pub strategy: TransitionStrategy,
pub blend_factors: Vec<f32>,
}Expand description
A precision transition with blending information
Fields§
§from: PrecisionSource precision
to: PrecisionTarget precision
start_step: u32Step at which transition starts
end_step: u32Step at which transition completes
strategy: TransitionStrategyStrategy used
blend_factors: Vec<f32>Precomputed blend factors per step
Implementations§
Source§impl PrecisionTransition
impl PrecisionTransition
Sourcepub fn immediate(from: Precision, to: Precision, step: u32) -> Self
pub fn immediate(from: Precision, to: Precision, step: u32) -> Self
Create a new immediate transition
Sourcepub fn gradual(
from: Precision,
to: Precision,
start_step: u32,
duration: u32,
) -> Self
pub fn gradual( from: Precision, to: Precision, start_step: u32, duration: u32, ) -> Self
Create a gradual transition
Sourcepub fn contains_step(&self, step: u32) -> bool
pub fn contains_step(&self, step: u32) -> bool
Check if a step is within this transition
Sourcepub fn blend_at(&self, step: u32) -> Option<f32>
pub fn blend_at(&self, step: u32) -> Option<f32>
Get blend factor for a specific step (0.0 = from, 1.0 = to)
Sourcepub fn effective_precision(&self, step: u32) -> Precision
pub fn effective_precision(&self, step: u32) -> Precision
Get the effective precision at a step
Sourcepub fn peak_vram_ratio(&self) -> f32
pub fn peak_vram_ratio(&self) -> f32
Compute VRAM requirement during transition
Trait Implementations§
Source§impl Clone for PrecisionTransition
impl Clone for PrecisionTransition
Source§fn clone(&self) -> PrecisionTransition
fn clone(&self) -> PrecisionTransition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrecisionTransition
impl Debug for PrecisionTransition
Source§impl<'de> Deserialize<'de> for PrecisionTransition
impl<'de> Deserialize<'de> for PrecisionTransition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PrecisionTransition
impl RefUnwindSafe for PrecisionTransition
impl Send for PrecisionTransition
impl Sync for PrecisionTransition
impl Unpin for PrecisionTransition
impl UnwindSafe for PrecisionTransition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more