Struct Ktx2Document
pub struct Ktx2Document<'a> {
pub vk_format: u32,
pub type_size: u32,
pub pixel_width: u32,
pub pixel_height: u32,
pub pixel_depth: u32,
pub layer_count_field: u32,
pub face_count: u32,
pub level_count_field: u32,
pub supercompression_scheme: u32,
/* private fields */
}Expand description
A borrowed KTX2 container. Every exposed section has passed checked bounds and overlap tests.
Fields§
§vk_format: u32§type_size: u32§pixel_width: u32§pixel_height: u32Zero means a 1D texture, per KTX2.
pixel_depth: u32Zero means a 1D/2D texture, per KTX2.
layer_count_field: u32Zero in the header means a non-array texture; layer_count() reports its effective count.
face_count: u32§level_count_field: u32Zero in the header means one level with no mip chain; level_count() is the effective count.
supercompression_scheme: u32Implementations§
§impl<'a> Ktx2Document<'a>
impl<'a> Ktx2Document<'a>
pub fn parse(bytes: &'a [u8]) -> Result<Ktx2Document<'a>, Ktx2Error>
pub fn parse(bytes: &'a [u8]) -> Result<Ktx2Document<'a>, Ktx2Error>
Validate a KTX2 header, metadata ranges, and level index without allocating.
pub const fn layer_count(&self) -> u32
pub const fn layer_count(&self) -> u32
Effective array layer count; non-array textures have one layer.
pub const fn level_count(&self) -> usize
pub const fn level_count(&self) -> usize
Effective number of indexed levels; a zero header field represents a single base level.
pub const fn supercompression(&self) -> Ktx2Supercompression
pub const fn supercompression(&self) -> Ktx2Supercompression
Ktx2Document::supercompression.
pub const fn transcode_source(&self) -> Option<Ktx2TranscodeSource>
pub const fn transcode_source(&self) -> Option<Ktx2TranscodeSource>
Return a typed transcode requirement for Basis or known GPU block formats.
The parser deliberately does not infer a target GPU format. HMC/device policy must choose that target and keep the encoded resource available while refinement is pending.
pub const fn color_space(&self) -> Ktx2ColorSpace
pub const fn color_space(&self) -> Ktx2ColorSpace
Ktx2Document::color_space.
pub fn data_format_descriptor(&self) -> &'a [u8] ⓘ
pub fn data_format_descriptor(&self) -> &'a [u8] ⓘ
Borrow the Data Format Descriptor bytes. The descriptor’s internal contents are opaque.
pub fn key_value_data(&self) -> &'a [u8] ⓘ
pub fn key_value_data(&self) -> &'a [u8] ⓘ
Borrow the Key/Value Data bytes. Entries are intentionally not decoded here.
pub fn supercompression_global_data(&self) -> &'a [u8] ⓘ
pub fn supercompression_global_data(&self) -> &'a [u8] ⓘ
Borrow the Supercompression Global Data bytes, if present.
Trait Implementations§
§impl<'a> Clone for Ktx2Document<'a>
impl<'a> Clone for Ktx2Document<'a>
§fn clone(&self) -> Ktx2Document<'a>
fn clone(&self) -> Ktx2Document<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for Ktx2Document<'a>
§impl<'a> Debug for Ktx2Document<'a>
impl<'a> Debug for Ktx2Document<'a>
impl<'a> Eq for Ktx2Document<'a>
§impl<'a> PartialEq for Ktx2Document<'a>
impl<'a> PartialEq for Ktx2Document<'a>
impl<'a> StructuralPartialEq for Ktx2Document<'a>
Auto Trait Implementations§
impl<'a> Freeze for Ktx2Document<'a>
impl<'a> RefUnwindSafe for Ktx2Document<'a>
impl<'a> Send for Ktx2Document<'a>
impl<'a> Sync for Ktx2Document<'a>
impl<'a> Unpin for Ktx2Document<'a>
impl<'a> UnsafeUnpin for Ktx2Document<'a>
impl<'a> UnwindSafe for Ktx2Document<'a>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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