pub struct TextureCube {
pub size: u32,
pub format: TextureFormat,
pub faces: [Vec<u8>; 6],
pub mip_levels: u32,
pub label: Option<String>,
}Expand description
CPU-side cube texture bytes.
Fields§
§size: u32Face width and height in texels.
format: TextureFormatTexture format.
faces: [Vec<u8>; 6]Six faces in positive X, negative X, positive Y, negative Y, positive Z, negative Z order.
mip_levels: u32Number of mip levels per face.
label: Option<String>Optional debug label.
Implementations§
Source§impl TextureCube
impl TextureCube
Sourcepub fn new(
size: u32,
format: TextureFormat,
faces: [Vec<u8>; 6],
) -> Result<Self, ValidationError>
pub fn new( size: u32, format: TextureFormat, faces: [Vec<u8>; 6], ) -> Result<Self, ValidationError>
Creates a cube texture with six faces and validates each face.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validates dimensions and every face byte length.
Sourcepub fn mip_level_range(
&self,
level: u32,
) -> Result<Range<usize>, ValidationError>
pub fn mip_level_range( &self, level: u32, ) -> Result<Range<usize>, ValidationError>
Returns the byte range occupied by one mip level inside each face.
Trait Implementations§
Source§impl Clone for TextureCube
impl Clone for TextureCube
Source§fn clone(&self) -> TextureCube
fn clone(&self) -> TextureCube
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TextureCube
impl Debug for TextureCube
Source§impl PartialEq for TextureCube
impl PartialEq for TextureCube
Source§fn eq(&self, other: &TextureCube) -> bool
fn eq(&self, other: &TextureCube) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TextureCube
Auto Trait Implementations§
impl Freeze for TextureCube
impl RefUnwindSafe for TextureCube
impl Send for TextureCube
impl Sync for TextureCube
impl Unpin for TextureCube
impl UnsafeUnpin for TextureCube
impl UnwindSafe for TextureCube
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