pub struct GpuBlendEffect {
pub transition: GpuTransition,
pub progress: f32,
}Expand description
GPU混合特效描述
封装了GPU过渡特效的完整参数,便于传递和复用。 提供便捷的工厂方法创建各种过渡效果。
§Example
ⓘ
// 方式1: 使用new
let effect = GpuBlendEffect::new(GpuTransition::Ripple, 0.5);
// 方式2: 使用工厂方法
let effect = GpuBlendEffect::ripple(0.5);
let effect = GpuBlendEffect::dispersion(0.3);
// 调用blend_rts
ctx.adapter.blend_rts(0, 1, 2, effect.effect_type(), effect.progress);Fields§
§transition: GpuTransition过渡特效类型
progress: f32过渡进度 (0.0 = 完全显示src1, 1.0 = 完全显示src2)
Implementations§
Source§impl GpuBlendEffect
impl GpuBlendEffect
Sourcepub fn new(transition: GpuTransition, progress: f32) -> Self
pub fn new(transition: GpuTransition, progress: f32) -> Self
Sourcepub fn effect_type(&self) -> usize
pub fn effect_type(&self) -> usize
获取特效类型索引 (用于 Adapter::blend_rts)
Sourcepub fn with_progress(self, progress: f32) -> Self
pub fn with_progress(self, progress: f32) -> Self
设置进度值
Sourcepub fn set_progress(&mut self, progress: f32)
pub fn set_progress(&mut self, progress: f32)
更新进度值 (可变引用版本)
Sourcepub fn rotate_zoom(progress: f32) -> Self
pub fn rotate_zoom(progress: f32) -> Self
创建旋转缩放过渡特效
Sourcepub fn dispersion(progress: f32) -> Self
pub fn dispersion(progress: f32) -> Self
创建色散过渡特效
Sourcepub fn from_index(index: usize, progress: f32) -> Self
pub fn from_index(index: usize, progress: f32) -> Self
从索引创建特效 (循环)
Trait Implementations§
Source§impl Clone for GpuBlendEffect
impl Clone for GpuBlendEffect
Source§fn clone(&self) -> GpuBlendEffect
fn clone(&self) -> GpuBlendEffect
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 GpuBlendEffect
impl Debug for GpuBlendEffect
Auto Trait Implementations§
impl Freeze for GpuBlendEffect
impl RefUnwindSafe for GpuBlendEffect
impl Send for GpuBlendEffect
impl Sync for GpuBlendEffect
impl Unpin for GpuBlendEffect
impl UnsafeUnpin for GpuBlendEffect
impl UnwindSafe for GpuBlendEffect
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().