pub struct Texture2D3D { /* private fields */ }Expand description
Mipmapped 3D texture asset decoded from embedded or external Blender/glTF images.
Implementations§
Source§impl Texture2D3D
Construction, mipmap generation, and filtered sampling for Texture2D3D.
impl Texture2D3D
Construction, mipmap generation, and filtered sampling for Texture2D3D.
Sourcepub fn from_rgba8(
name: &str,
width: u32,
height: u32,
pixels: Vec<u8>,
color_space: TextureColorSpace,
generate_mips: bool,
) -> Result<Self, String>
pub fn from_rgba8( name: &str, width: u32, height: u32, pixels: Vec<u8>, color_space: TextureColorSpace, generate_mips: bool, ) -> Result<Self, String>
Builds a Texture2D3D from raw RGBA8 pixels and optionally generates a full mipmap chain.
§Arguments
&str- Texture name.u32- Base image width in pixels.u32- Base image height in pixels.Vec<u8>- Packed RGBA8 base-level pixels.TextureColorSpace- Color-space filtering and decode mode.bool- Whether to generate mip levels down to1x1.
§Returns
Result<Self, String>- Ready mipmapped texture or size error.
Sourcepub fn from_encoded_bytes(
name: &str,
bytes: &[u8],
color_space: TextureColorSpace,
generate_mips: bool,
) -> Result<Self, String>
pub fn from_encoded_bytes( name: &str, bytes: &[u8], color_space: TextureColorSpace, generate_mips: bool, ) -> Result<Self, String>
Decodes encoded PNG, JPEG, BMP, HDR, or EXR bytes into a mipmapped Texture2D3D.
§Arguments
&str- Texture name.&[u8]- Raw encoded image bytes.TextureColorSpace- Color-space interpretation.bool- Whether to build the full mipmap chain.
§Returns
Result<Self, String>- Decoded texture or codec error.
Sourcepub fn generate_mipmaps(&mut self)
pub fn generate_mipmaps(&mut self)
Source§impl Texture2D3D
impl Texture2D3D
pub fn get_name(&self) -> &String
pub fn get_mut_name(&mut self) -> &mut String
pub fn set_name(&mut self, val: String) -> &mut Self
pub fn get_width(&self) -> u32
pub fn get_mut_width(&mut self) -> &mut u32
pub fn set_width(&mut self, val: u32) -> &mut Self
pub fn get_height(&self) -> u32
pub fn get_mut_height(&mut self) -> &mut u32
pub fn set_height(&mut self, val: u32) -> &mut Self
pub fn get_color_space(&self) -> TextureColorSpace
pub fn get_mut_color_space(&mut self) -> &mut TextureColorSpace
pub fn set_color_space(&mut self, val: TextureColorSpace) -> &mut Self
pub fn get_sampler(&self) -> TextureSampler3D
pub fn get_mut_sampler(&mut self) -> &mut TextureSampler3D
pub fn set_sampler(&mut self, val: TextureSampler3D) -> &mut Self
pub fn get_mips(&self) -> &Vec<TextureMipLevel3D>
pub fn get_mut_mips(&mut self) -> &mut Vec<TextureMipLevel3D>
pub fn set_mips(&mut self, val: Vec<TextureMipLevel3D>) -> &mut Self
Trait Implementations§
Source§impl Clone for Texture2D3D
impl Clone for Texture2D3D
Source§impl Debug for Texture2D3D
impl Debug for Texture2D3D
Source§impl Default for Texture2D3D
impl Default for Texture2D3D
impl Eq for Texture2D3D
Source§impl PartialEq for Texture2D3D
impl PartialEq for Texture2D3D
impl StructuralPartialEq for Texture2D3D
Auto Trait Implementations§
impl Forget for Texture2D3D
impl Freeze for Texture2D3D
impl Move for Texture2D3D
impl RefUnwindSafe for Texture2D3D
impl Send for Texture2D3Dwhere
RawVecInner: Send,
impl Sync for Texture2D3Dwhere
RawVecInner: Sync,
impl Unpin for Texture2D3D
impl UnsafeUnpin for Texture2D3Dwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TextureMipLevel3D>: UnsafeUnpin,
impl UnwindSafe for Texture2D3Dwhere
RawVecInner: UnwindSafe,
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