pub struct Texture2D { /* private fields */ }
Expand description
2d texture
Implementations§
Source§impl Texture2D
impl Texture2D
Sourcepub fn new(format: Format, extent: Extent2d, levels: usize) -> Texture2D
pub fn new(format: Format, extent: Extent2d, levels: usize) -> Texture2D
Create a texture2d and allocate a new storage_linear.
Sourcepub fn new_with_mipmap_chain(format: Format, extent: Extent2d) -> Texture2D
pub fn new_with_mipmap_chain(format: Format, extent: Extent2d) -> Texture2D
Create a texture2d and allocate a new storage_linear with a complete mipmap chain.
Create a texture2d view with an existing storage_linear.
Create a texture2d view with an existing storage_linear.
Create a texture2d view, reference a subset of an existing texture2d instance.
Trait Implementations§
Source§impl GliTexture for Texture2D
impl GliTexture for Texture2D
const TARGET_TYPE: Target = Target::TARGET_2D
type ExtentType = Extent2d
Source§fn extent(&self, level: usize) -> Self::ExtentType
fn extent(&self, level: usize) -> Self::ExtentType
Return the corresponding extent type of the texture instance,
which represents the size of a specific mip-level of this texture(width, height and depth).
fn set_swizzles(&mut self, swizzles: Swizzles)
Source§fn base_face(&self) -> usize
fn base_face(&self) -> usize
Return the base face of the texture instance, effectively a memory offset in the actual texture storage_type
to identify where to start reading the faces.
Source§fn base_layer(&self) -> usize
fn base_layer(&self) -> usize
Return the base layer of the texture instance, effectively a memory offset in the actual texture storage_type
to identify where to start reading the layers.
Source§fn base_level(&self) -> usize
fn base_level(&self) -> usize
Return the base level of the texture instance, effectively a memory offset in the actual texture storage_type
to identify where to start reading the levels.
Source§fn copy(
&mut self,
src_texture: &Self,
src_layer: usize,
src_face: usize,
src_level: usize,
dst_layer: usize,
dst_face: usize,
dst_level: usize,
)
fn copy( &mut self, src_texture: &Self, src_layer: usize, src_face: usize, src_level: usize, dst_layer: usize, dst_face: usize, dst_level: usize, )
Copy a specific image of a texture.
Source§fn copy_subset(
&mut self,
src_texture: &Self,
src_layer: usize,
src_face: usize,
src_level: usize,
src_offset: Extent3d,
dst_layer: usize,
dst_face: usize,
dst_level: usize,
dst_offset: Extent3d,
extent: Extent3d,
)
fn copy_subset( &mut self, src_texture: &Self, src_layer: usize, src_face: usize, src_level: usize, src_offset: Extent3d, dst_layer: usize, dst_face: usize, dst_level: usize, dst_offset: Extent3d, extent: Extent3d, )
Copy a subset of a specific image of a texture.
Source§fn data(&self) -> *const c_void
fn data(&self) -> *const c_void
Return a pointer to the beginning of the texture instance data.
unsafe fn data_mut(&mut self) -> *mut c_void
Source§fn empty(&self) -> bool
fn empty(&self) -> bool
Return whether the texture instance is empty, no storage_type or description have been assigned to the instance.
Source§fn max_face(&self) -> usize
fn max_face(&self) -> usize
Return the max face of the texture instance, effectively a memory offset to the beginning of the last face
in the actual texture storage_type that the texture instance can access.
Source§fn max_layer(&self) -> usize
fn max_layer(&self) -> usize
Return the max layer of the texture instance, effectively a memory offset to the beginning of the last layer
in the actual texture storage_type that the texture instance can access.
Source§fn max_level(&self) -> usize
fn max_level(&self) -> usize
Return the max level of the texture instance, effectively a memory offset to the beginning of the last level
in the actual texture storage_type that the texture instance can access.
Source§fn size_at_level(&self, level: usize) -> usize
fn size_at_level(&self, level: usize) -> usize
Return the memory size of a specific level identified by Level.
impl Eq for Texture2D
Auto Trait Implementations§
impl Freeze for Texture2D
impl RefUnwindSafe for Texture2D
impl Send for Texture2D
impl Sync for Texture2D
impl Unpin for Texture2D
impl UnwindSafe for Texture2D
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