#[repr(u8)]pub enum TileMode {
Clamp = 0,
Repeat = 1,
Mirror = 2,
Decal = 3,
}Expand description
What happens outside an image’s own bounds.
Numbered as upstream numbers them: the discriminants are dart:ui’s
TileMode.index, DlTileMode and Impeller’s Entity::TileMode, so
as u8 gives an embedder the upstream number, as with
crate::BlendMode. The number a shader reads is tile, kept apart.
Variants§
Clamp = 0
Hold the edge pixel. The usual choice for drawing an image once.
Repeat = 1
Repeat the image, tiling the plane.
Mirror = 2
Repeat, reversing every other copy.
What repeating is for when the two ends do not match. A ramp tiled by
TileMode::Repeat jumps from its last color back to its first at
every period, and that discontinuity is a visible seam; reflecting each
alternate copy joins end to end and leaves none. The period is twice as
long, since a copy and its reflection make one.
Decal = 3
Draw nothing outside the image.
Distinct from clamping in the only case that matters: a shape larger than the image it is filled with. Clamping smears the border across the remainder, which reads as a rendering fault rather than as a choice.
Trait Implementations§
impl Copy for TileMode
impl Eq for TileMode
impl StructuralPartialEq for TileMode
Auto Trait Implementations§
impl Forget for TileMode
impl Freeze for TileMode
impl Move for TileMode
impl RefUnwindSafe for TileMode
impl Send for TileMode
impl Sync for TileMode
impl Unpin for TileMode
impl UnsafeUnpin for TileMode
impl UnwindSafe for TileMode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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