pub struct DecodedImage {
pub width: u32,
pub height: u32,
pub data: Arc<Vec<u8>>,
}Expand description
Decoded raster image data (RGBA8, row-major).
The pixel buffer is wrapped in Arc<Vec<u8>> so that cloning a
DecodedImage is a cheap reference-count bump (~256 KiB per tile
is never memcpy’d between engine frames).
Fields§
§width: u32Image width in pixels.
height: u32Image height in pixels.
data: Arc<Vec<u8>>Raw RGBA8 pixel data, row-major.
Shared via Arc – immutable after decode.
Implementations§
Source§impl DecodedImage
impl DecodedImage
Sourcepub fn expected_len(&self) -> Option<usize>
pub fn expected_len(&self) -> Option<usize>
Return the expected RGBA8 byte length for this image.
Returns None if the dimensions overflow usize.
Sourcepub fn validate_rgba8(&self) -> Result<(), TileError>
pub fn validate_rgba8(&self) -> Result<(), TileError>
Validate that the payload is well-formed RGBA8 data.
Sourcepub fn build_mip_chain_rgba8(&self) -> Result<RasterMipChain, TileError>
pub fn build_mip_chain_rgba8(&self) -> Result<RasterMipChain, TileError>
Generate a full RGBA8 mip chain from this image.
RGB channels are downsampled in linear light and with premultiplied-alpha accumulation so oblique minification stays sharper and more stable than single-level sampling.
Trait Implementations§
Source§impl Clone for DecodedImage
impl Clone for DecodedImage
Source§fn clone(&self) -> DecodedImage
fn clone(&self) -> DecodedImage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DecodedImage
impl RefUnwindSafe for DecodedImage
impl Send for DecodedImage
impl Sync for DecodedImage
impl Unpin for DecodedImage
impl UnsafeUnpin for DecodedImage
impl UnwindSafe for DecodedImage
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