pub struct SuperResConfig {
pub denominator: u8,
pub encoded_width: u32,
pub upscaled_width: u32,
pub height: u32,
pub method: UpscaleMethod,
}Expand description
Configuration for super-resolution.
Fields§
§denominator: u8Scale denominator (9-16, 16 = no scaling).
encoded_width: u32Original (encoded) width.
upscaled_width: u32Target (output) width.
height: u32Frame height (unchanged).
method: UpscaleMethodUpscale method.
Implementations§
Source§impl SuperResConfig
impl SuperResConfig
Sourcepub fn new(encoded_width: u32, upscaled_width: u32, height: u32) -> Self
pub fn new(encoded_width: u32, upscaled_width: u32, height: u32) -> Self
Create a new super-res configuration.
Sourcepub fn from_denominator(
denominator: u8,
encoded_width: u32,
height: u32,
) -> Self
pub fn from_denominator( denominator: u8, encoded_width: u32, height: u32, ) -> Self
Create from scale denominator.
Sourcepub fn scale_factor(&self) -> f32
pub fn scale_factor(&self) -> f32
Get the scale factor.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if super-res is enabled.
Sourcepub const fn with_method(self, method: UpscaleMethod) -> Self
pub const fn with_method(self, method: UpscaleMethod) -> Self
Set upscale method.
Trait Implementations§
Source§impl Clone for SuperResConfig
impl Clone for SuperResConfig
Source§fn clone(&self) -> SuperResConfig
fn clone(&self) -> SuperResConfig
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 SuperResConfig
impl Debug for SuperResConfig
Auto Trait Implementations§
impl Freeze for SuperResConfig
impl RefUnwindSafe for SuperResConfig
impl Send for SuperResConfig
impl Sync for SuperResConfig
impl Unpin for SuperResConfig
impl UnsafeUnpin for SuperResConfig
impl UnwindSafe for SuperResConfig
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<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 more