pub struct Texture3d { /* private fields */ }Expand description
Cheap immutable snapshot of an independently filtered sRGB RGBA8 mip chain.
Clones share CPU recovery pixels and the GPU allocation. U/V has a top-left origin; material addressing defaults to clamp. Mipmap generation is opt-in. Region updates preserve old aliases through copy-on-write. Crop snapshots are independent of later parent-atlas updates. Legacy creation accepts alpha 255 only; explicit alpha creation preserves it. Restoring returns a new device-owned handle and replays the alpha policy; existing clones remain stale until explicitly rebound or scene-restored.
Implementations§
Source§impl Texture3d
impl Texture3d
Sourcepub fn pixels(&self) -> &[u8] ⓘ
pub fn pixels(&self) -> &[u8] ⓘ
Returns immutable retained row-major, top-to-bottom sRGB RGBA8 texels.
Sourcepub fn mip_level_count(&self) -> u32
pub fn mip_level_count(&self) -> u32
Returns complete committed mip count, including the source level.
Sourcepub fn mip_level_pixels(&self, level: u32) -> Option<&[u8]>
pub fn mip_level_pixels(&self, level: u32) -> Option<&[u8]>
Returns exact source/generated bytes of one committed level, or None.
Sourcepub fn mip_level_size(&self, level: u32) -> Option<(u32, u32)>
pub fn mip_level_size(&self, level: u32) -> Option<(u32, u32)>
Returns dimensions of one committed level, or None.
Sourcepub fn mipmaps(&self) -> TextureMipmaps3d
pub fn mipmaps(&self) -> TextureMipmaps3d
Returns mip policy, which survives restoration and region updates.
Sourcepub fn options(&self) -> Texture3dOptions
pub fn options(&self) -> Texture3dOptions
Returns the alpha/mip policy retained with this immutable snapshot.
Sourcepub fn preserves_alpha(&self) -> bool
pub fn preserves_alpha(&self) -> bool
Whether creation explicitly preserved arbitrary source alpha for mask/blend use.
Sourcepub fn budget(&self) -> ImageBudget
pub fn budget(&self) -> ImageBudget
Returns creation limits retained for restoration.
Sourcepub fn recovery_memory_bytes(&self) -> usize
pub fn recovery_memory_bytes(&self) -> usize
Returns shared CPU recovery-pixel capacity, excluding fixed handle metadata.
Sourcepub fn gpu_allocation_bytes(&self) -> usize
pub fn gpu_allocation_bytes(&self) -> usize
Returns nominal complete-chain GPU texel bytes, excluding driver metadata.
Sourcepub fn region_coordinates(
&self,
region: ImageTexelRect,
) -> Result<[TextureCoordinate2d; 4], Texture3dError>
pub fn region_coordinates( &self, region: ImageTexelRect, ) -> Result<[TextureCoordinate2d; 4], Texture3dError>
Maps top-left, top-right, bottom-right and bottom-left corners of an atlas region to its outer texel centers. Nearest sampling avoids adjacent cells under this mip-zero policy. For strict linear-filter isolation, provide host-owned extruded gutters around atlas cells: interpolation rounding can extend the filtering footprint slightly beyond a center. A one-texel extent maps both edges to its center. Generated multi-level textures reject this operation: crop an independent tile instead of filtering or repeating a packed whole-atlas mip chain.