pub struct ImageTextureData { /* private fields */ }Expand description
Full mip chain with a validated storage, color and alpha contract. This is an upload description, not a device resource. Backends retain normal scene ordering and coverage when sampling it at a different display size.
Implementations§
Source§impl ImageTextureData
impl ImageTextureData
Sourcepub fn new(width: u32, height: u32, levels: Vec<Vec<u8>>) -> Result<Self>
pub fn new(width: u32, height: u32, levels: Vec<Vec<u8>>) -> Result<Self>
Validate a complete mip chain, including odd and one-dimensional sizes. Every level halves each dimension, rounding down and clamping to one.
Sourcepub fn new_linear_p3_rgba16f(
width: u32,
height: u32,
levels: Vec<Vec<u8>>,
) -> Result<Self>
pub fn new_linear_p3_rgba16f( width: u32, height: u32, levels: Vec<Vec<u8>>, ) -> Result<Self>
Validate a complete bounded premultiplied linear-P3 RGBA16F mip chain. Rejects non-finite, negative, out-of-range and invalid associated pixels.
Sourcepub fn page(
width: u32,
height: u32,
bytes: Vec<u8>,
format: ImageTextureFormat,
) -> Result<Self>
pub fn page( width: u32, height: u32, bytes: Vec<u8>, format: ImageTextureFormat, ) -> Result<Self>
A single immutable mip page; the canvas selects the pyramid level.
Sourcepub fn format(&self) -> ImageTextureFormat
pub fn format(&self) -> ImageTextureFormat
Validated source storage/color contract.
Sourcepub fn bytes_per_pixel(&self) -> usize
pub fn bytes_per_pixel(&self) -> usize
Unpadded bytes per source pixel.
Sourcepub fn staging_byte_len(&self) -> usize
pub fn staging_byte_len(&self) -> usize
Bytes in a 256-byte-row-aligned staging buffer for the complete chain.
Trait Implementations§
Source§impl Clone for ImageTextureData
impl Clone for ImageTextureData
Auto Trait Implementations§
impl Freeze for ImageTextureData
impl RefUnwindSafe for ImageTextureData
impl Send for ImageTextureData
impl Sync for ImageTextureData
impl Unpin for ImageTextureData
impl UnsafeUnpin for ImageTextureData
impl UnwindSafe for ImageTextureData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more