pub enum TileMode {
Clamp,
Repeat,
Decal,
Mirror,
}Expand description
What happens outside an image’s own bounds.
Variants§
Clamp
Hold the edge pixel. The usual choice for drawing an image once.
Repeat
Repeat the image, tiling the plane.
Decal
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.
Mirror
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.
Trait Implementations§
impl Copy for TileMode
impl Eq for TileMode
impl StructuralPartialEq for TileMode
Auto Trait Implementations§
impl Freeze 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
Mutably borrows from an owned value. Read more