Enum libnotcurses_sys::NcScale
source · [−]#[repr(u32)]
#[non_exhaustive]
pub enum NcScale {
None,
Scale,
NoneHiRes,
ScaleHiRes,
Stretch,
}
Expand description
Indicates how to scale an NcVisual
during rendering.
Default
Application
The scaling preferences are applied only for the context of
NcVisual.render
.
You can think of it as the following pipeline, where you still have the original frame:
NcVisual::from_file() → frame → NcVisual.render() → scaling → output_frame → blit
Whereas
NcVisual.resize
and
NcVisual.resize_noninterpolative
are changing that original frame.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
None
Maintains the original size. Will Apply no scaling.
Scale
Maintains the aspect ratio.
Scales an NcVisual
to the NcPlane
’s size without stretching.
NoneHiRes
Like None
, maintains the original size, while admitting
high-resolution blitters that don’t preserve the aspect ratio.
ScaleHiRes
Like Scale
, maintains the aspect ratio, while admitting
high-resolution blitters that don’t preserve the aspect ratio.
Stretch
Throws away aspect ratio.
Stretches and scales the NcVisual
in an attempt to fill the entirety
of the NcPlane
.
Trait Implementations
sourceimpl From<NcScale> for NcScale_u32
impl From<NcScale> for NcScale_u32
sourceimpl From<u32> for NcScale
impl From<u32> for NcScale
sourcefn from(scale: NcScale_u32) -> Self
fn from(scale: NcScale_u32) -> Self
Converts to this type from the input type.
impl Copy for NcScale
impl StructuralPartialEq for NcScale
Auto Trait Implementations
impl RefUnwindSafe for NcScale
impl Send for NcScale
impl Sync for NcScale
impl Unpin for NcScale
impl UnwindSafe for NcScale
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more