pub struct Image { /* private fields */ }
Expand description
Image used for uploads into the Atlas
.
Implementations
sourceimpl Image
impl Image
sourcepub fn new(
ty: ImageType,
dims: ImageDims,
data: ImageData
) -> Result<Image, String>
pub fn new(
ty: ImageType,
dims: ImageDims,
data: ImageData
) -> Result<Image, String>
Create a new Image
to upload into the Atlas
.
Notes
- This method does not actually upload anything. See
Atlas::load_image
.
sourcepub fn from_imt(imt: Arc<ImtImageView>) -> Result<Image, String>
pub fn from_imt(imt: Arc<ImtImageView>) -> Result<Image, String>
Create a new Image
from an Ilmenite image.
sourcepub fn from_bst(bst: Arc<BstImageView>) -> Result<Image, String>
pub fn from_bst(bst: Arc<BstImageView>) -> Result<Image, String>
Create a new Image
from a Basalt image.
sourcepub fn load_from_bytes(bytes: &[u8]) -> Result<Self, String>
pub fn load_from_bytes(bytes: &[u8]) -> Result<Self, String>
Load an image from bytes. This uses the image
crate.
For raw data use Image::new()
.
sourcepub fn load_from_path<P: AsRef<Path>>(path: P) -> Result<Self, String>
pub fn load_from_path<P: AsRef<Path>>(path: P) -> Result<Self, String>
Load an image from a path. This reads the file and passes it to Image::load_from_bytes()
.
sourcepub fn load_from_url<U: AsRef<str>>(url: U) -> Result<Self, String>
pub fn load_from_url<U: AsRef<str>>(url: U) -> Result<Self, String>
Load an image from a url. This uses curl
to fetch the data from the url and pass it to Image::load_from_bytes()
.
sourcepub fn to_16b_srgba(self) -> Self
pub fn to_16b_srgba(self) -> Self
Converts the image into 16-bit standard rgba.
sourcepub fn to_16b_lrgba(self) -> Self
pub fn to_16b_lrgba(self) -> Self
Converts the image into 16-bit linear rgba.
sourcepub fn to_8b_srgba(self) -> Self
pub fn to_8b_srgba(self) -> Self
Converts the image into 8-bit standard rgba.
sourcepub fn to_8b_lrgba(self) -> Self
pub fn to_8b_lrgba(self) -> Self
Converts the image into 8-bit linear rgba.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl !UnwindSafe for Image
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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