pub struct Texture3d { /* private fields */ }Expand description
Cheap shared handle for immutable opaque, single-level sRGB RGBA8 texels.
Clones share CPU recovery pixels and the GPU allocation. U/V has a top-left origin; addressing clamps to the image boundary, with no mipmap generation. Only alpha 255 is accepted. Restoring returns a new device-owned handle; 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 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 single-level 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.