pub struct TextureAsset {
pub name: String,
pub width: u32,
pub height: u32,
pub channels: u8,
pub data: Vec<u8>,
pub format: TextureFormat,
}Expand description
A texture asset stored inside an asset pack.
Fields§
§name: StringLogical name for this texture (e.g. "skin_albedo").
width: u32Width in pixels.
height: u32Height in pixels.
channels: u8Number of channels (1 = grey, 3 = RGB, 4 = RGBA).
data: Vec<u8>Raw pixel bytes, length must equal width * height * channels.
format: TextureFormatEncoding format of the stored data.
Implementations§
Trait Implementations§
Source§impl Clone for TextureAsset
impl Clone for TextureAsset
Source§fn clone(&self) -> TextureAsset
fn clone(&self) -> TextureAsset
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextureAsset
impl Debug for TextureAsset
Source§impl<'de> Deserialize<'de> for TextureAsset
impl<'de> Deserialize<'de> for TextureAsset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TextureAsset
impl RefUnwindSafe for TextureAsset
impl Send for TextureAsset
impl Sync for TextureAsset
impl Unpin for TextureAsset
impl UnsafeUnpin for TextureAsset
impl UnwindSafe for TextureAsset
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