[−][src]Struct ktx::slice::Ktx
KTX texture storage format data stored in a complete slice.
Provides KtxInfo
.
See the specification.
Example
let image: Ktx<_> = include_ktx!("../tests/babg-bc3.ktx"); let texture_levels: Vec<&[u8]> = image.textures().collect();
Methods
impl<D> Ktx<D> where
D: Deref<Target = [u8]>,
[src]
D: Deref<Target = [u8]>,
pub fn new(ktx_data: D) -> Self
[src]
Parses a complete KTX data slice and returns a Ktx
instance.
pub fn texture_level(&self, level: u32) -> &[u8]
[src]
Returns texture data at the input level, starting at 0
.
Panics
Input level is >= the mipmap_levels
value.
ⓘImportant traits for Textures<'a, D>pub fn textures(&self) -> Textures<D>
[src]
ⓘImportant traits for Textures<'a, D>
Returns an iterator over the texture levels starting at level 0.
Trait Implementations
impl<D: Copy> Copy for Ktx<D>
[src]
impl<D> AsRef<KtxHeader> for Ktx<D>
[src]
impl<D> From<D> for Ktx<D> where
D: Deref<Target = [u8]>,
[src]
D: Deref<Target = [u8]>,
impl<D: Clone> Clone for Ktx<D>
[src]
fn clone(&self) -> Ktx<D>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<D> Debug for Ktx<D>
[src]
Auto Trait Implementations
impl<D> Send for Ktx<D> where
D: Send,
D: Send,
impl<D> Unpin for Ktx<D> where
D: Unpin,
D: Unpin,
impl<D> Sync for Ktx<D> where
D: Sync,
D: Sync,
impl<D> UnwindSafe for Ktx<D> where
D: UnwindSafe,
D: UnwindSafe,
impl<D> RefUnwindSafe for Ktx<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
Blanket Implementations
impl<T> KtxInfo for T where
T: AsRef<KtxHeader>,
[src]
T: AsRef<KtxHeader>,
fn big_endian(&Self) -> bool
[src]
fn gl_type(&Self) -> u32
[src]
fn gl_type_size(&Self) -> u32
[src]
fn gl_format(&Self) -> u32
[src]
fn gl_internal_format(&Self) -> u32
[src]
fn gl_base_internal_format(&Self) -> u32
[src]
fn pixel_width(&Self) -> u32
[src]
fn pixel_height(&Self) -> u32
[src]
fn pixel_depth(&Self) -> u32
[src]
fn array_elements(&Self) -> u32
[src]
fn faces(&Self) -> u32
[src]
fn mipmap_levels(&Self) -> u32
[src]
fn bytes_of_key_value_data(&Self) -> u32
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,