pub struct Texture {
pub image: String,
pub mapping: TextureMapping,
pub repeat: (f64, f64),
pub offset: (f64, f64),
}Expand description
A texture: an image and how it lands on the geometry.
The image itself is named, not carried. A kernel that read image files would have opinions about formats, colour spaces and decoding that belong to a renderer; what a document needs to persist and exchange is which image, laid on how, at what scale, which is what this is.
Fields§
§image: StringWhere the image is: a path or a URI, as the file said it.
mapping: TextureMappingHow it is laid on.
repeat: (f64, f64)Repeats across the mapping’s own unit span.
offset: (f64, f64)Where the mapping starts, in the same units as repeat.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Texture
Auto Trait Implementations§
impl Freeze for Texture
impl RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl UnsafeUnpin for Texture
impl UnwindSafe for Texture
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.