pub struct Handle { /* private fields */ }
pure
only.Expand description
A handle of some image data.
Implementations
sourceimpl Handle
impl Handle
sourcepub fn from_path<T>(path: T) -> Handle where
T: Into<PathBuf>,
Available on crate feature image
only.
pub fn from_path<T>(path: T) -> Handle where
T: Into<PathBuf>,
image
only.Creates an image Handle
pointing to the image of the given path.
Makes an educated guess about the image format by examining the data in the file.
sourcepub fn from_pixels(width: u32, height: u32, pixels: Vec<u8, Global>) -> Handle
Available on crate feature image
only.
pub fn from_pixels(width: u32, height: u32, pixels: Vec<u8, Global>) -> Handle
image
only.Creates an image Handle
containing the image pixels directly. This
function expects the input data to be provided as a Vec<u8>
of BGRA
pixels.
This is useful if you have already decoded your image.
sourcepub fn from_memory(bytes: Vec<u8, Global>) -> Handle
Available on crate feature image
only.
pub fn from_memory(bytes: Vec<u8, Global>) -> Handle
image
only.Creates an image Handle
containing the image data directly.
Makes an educated guess about the image format by examining the given data.
This is useful if you already have your image loaded in-memory, maybe because you downloaded or generated it procedurally.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more