Enum texture_synthesis::ImageSource
source · [−]pub enum ImageSource<'a> {
Memory(&'a [u8]),
Path(&'a Path),
Image(DynamicImage),
}
Expand description
Helper type used to define the source of ImageSource
’s data
Variants
Memory(&'a [u8])
A raw buffer of image data, see image::load_from_memory
for details
on what is supported
Path(&'a Path)
The path to an image to load from disk. The image format is inferred
from the file extension, see image::open
for details
Image(DynamicImage)
An already loaded image that is passed directly to the generator
Implementations
sourceimpl<'a> ImageSource<'a>
impl<'a> ImageSource<'a>
Trait Implementations
sourceimpl<'a> Clone for ImageSource<'a>
impl<'a> Clone for ImageSource<'a>
sourcefn clone(&self) -> ImageSource<'a>
fn clone(&self) -> ImageSource<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> From<DynamicImage> for ImageSource<'a>
impl<'a> From<DynamicImage> for ImageSource<'a>
sourcefn from(img: DynamicImage) -> Self
fn from(img: DynamicImage) -> Self
Performs the conversion.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ImageSource<'a>
impl<'a> Send for ImageSource<'a>
impl<'a> Sync for ImageSource<'a>
impl<'a> Unpin for ImageSource<'a>
impl<'a> UnwindSafe for ImageSource<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more