5 unstable releases

0.3.2 Jul 30, 2021
0.3.1 Sep 6, 2019
0.3.0 Jul 12, 2019
0.2.0 Jun 28, 2019
0.1.0 Apr 10, 2019

#275 in Graphics APIs

Download history 46/week @ 2023-10-26 39/week @ 2023-11-02 36/week @ 2023-11-09 42/week @ 2023-11-16 45/week @ 2023-11-23 40/week @ 2023-11-30 29/week @ 2023-12-07 40/week @ 2023-12-14 42/week @ 2023-12-21 19/week @ 2023-12-28 38/week @ 2024-01-04 36/week @ 2024-01-11 40/week @ 2024-01-18 30/week @ 2024-01-25 25/week @ 2024-02-01 49/week @ 2024-02-08

150 downloads per month
Used in 6 crates (2 directly)

Apache-2.0

22KB
320 lines

ktx crates.io Documentation

KTX v1 texture storage format parsing.

Parses byte data according to https://www.khronos.org/registry/KTX/specs/1.0/ktxspec_v1.html.

// Include & use static ktx data
use ktx::{Ktx, include_ktx, KtxInfo};

let image: Ktx<_> = include_ktx!("../tests/babg-bc3.ktx");
assert_eq!(image.pixel_width(), 260);
// Read ktx data at runtime
use ktx::KtxInfo;

let decoder = ktx::Decoder::new(buf_reader)?;
assert_eq!(decoder.pixel_width(), 260);

Minimum supported rust compiler

This crate is maintained with latest stable rust.


lib.rs:

KTX v1 texture storage format parsing.

Parses byte data according to https://www.khronos.org/registry/KTX/specs/1.0/ktxspec_v1.html.

Example: Include at compile time

use ktx::{Ktx, include_ktx, KtxInfo};

// Include & use static ktx data
let image: Ktx<_> = include_ktx!("../tests/babg-bc3.ktx");
assert_eq!(image.pixel_width(), 260);

Example: Read at runtime

use ktx::KtxInfo;

let decoder = ktx::Decoder::new(buf_reader)?;
assert_eq!(decoder.pixel_width(), 260);

Dependencies

~120KB