Constant freya_elements::attributes::sampling::sampling
source ยท pub const sampling: (&'static str, Option<&'static str>, bool);
Expand description
sampling
controls how an image
element is resized when scaling from its original size to smaller or larger sizes.
Accepted values:
nearest
ornone
(default): The image will be resized using nearest-neighbor interpolation.bilinear
: The image will be resized using bilinear interpolation.trilinear
: The image will be resized using trilinear interpolation.mitchell
: The image will be resized using Mitchell-Netravali interpolation, also known as Bicubic.catmull-rom
: The image will be resized using Catmull-Rom interpolation.
static RUST_LOGO: &[u8] = include_bytes!("../_docs/rust_logo.png");
fn app() -> Element {
let image_data = static_bytes(RUST_LOGO);
rsx!(
image {
image_data: image_data,
width: "96",
height: "96",
sampling: "trilinear",
}
)
}