#[repr(u32)]
#[non_exhaustive]
pub enum NcScale {
    None,
    Scale,
    NoneHiRes,
    ScaleHiRes,
    Stretch,
}
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.

Variants (Non-exhaustive)

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.

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

Returns a copy of the value. Read more

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.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. 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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.