Enum NcScale Copy item path Source #[non_exhaustive]
#[repr(u32)]
pub enum NcScale {
None = 0,
Scale = 1,
NoneHiRes = 3,
ScaleHiRes = 4,
Stretch = 2,
}Expand description Indicates how to scale an NcVisual during rendering.
§ Default
NcScale::None
§ 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.
This enum is marked as non-exhaustive Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Maintains the original size. Will Apply no scaling.
Maintains the aspect ratio.
Scales an NcVisual to the NcPlane’s size without stretching.
Like None, maintains the original size, while admitting
high-resolution blitters that don’t preserve the aspect ratio.
Like Scale, maintains the aspect ratio, while admitting
high-resolution blitters that don’t preserve the aspect ratio.
Throws away aspect ratio.
Stretches and scales the NcVisual in an attempt to fill the entirety
of the NcPlane.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.