#ktx #texture #image #graphics #bindings

archived libktx-rs

Reading, writing and transcoding of Khronos Textures (KTX1 and KTX2)

6 releases

0.3.3 Sep 11, 2021
0.3.2 Aug 5, 2021
0.2.4 Jun 21, 2021
0.1.0 Jun 13, 2021

#4 in #ktx

Download history 12/week @ 2023-10-19 27/week @ 2023-10-26 9/week @ 2023-11-02 17/week @ 2023-11-09 10/week @ 2023-11-16 21/week @ 2023-11-23 47/week @ 2023-11-30 9/week @ 2023-12-07 18/week @ 2023-12-14 32/week @ 2023-12-21 8/week @ 2023-12-28 7/week @ 2024-01-04 8/week @ 2024-01-11 26/week @ 2024-01-18 15/week @ 2024-01-25 14/week @ 2024-02-01

64 downloads per month
Used in hotham

Apache-2.0

8.5MB
149K SLoC

C++ 85K SLoC // 0.1% comments C 44K SLoC // 0.3% comments JavaScript 10K SLoC // 0.3% comments Rust 4.5K SLoC // 0.0% comments Python 3K SLoC // 0.4% comments Perl 769 SLoC // 0.2% comments Shell 554 SLoC // 0.3% comments SWIG 4 SLoC

libktx-rs

crates.io docs.rs license CI status

A library for reading, writing and transcoding Khronos Textures (KTX1 and KTX2) in Rust.

This repository contains both high-level Rust bindings and low-level FFI to KhronosGroup/KTX-Software.

Structure

Docs

See https://docs.rs/libktx-rs for the latest documentation of the high-level API, and https://docs.rs/libktx-rs-sys for the low-level FFI.

Building and features

Clone this root repository and all git submodule (git clone --recursive https://github.com/UberLambda/libktx-rs), then run cargo build.

Image writing

To enable KTX image writing support (which is already enabled in the default feature set), enable the libktx-rs/write feature.

Image-based tests

To enable image loading tests, clone the libktx-rs-sys/KTX-Software submodule with git LFS support, then enable the libktx-rs-sys/test-images feature.

rust-bindgen at build time

To have rust-bindgen generate bindings in the build script (instead of using the pre-generated ones), enable the libktx-rs-sys/run-bindgen feature.

Docs-only

To skip building or linking KTX-Software altogether, enable the libktx-rs-sys/docs-only feature.

License

This Rust wrapper, and the KTX-Software library itself, are both licensed under the Apache-2.0 license.

Linux and GCC

Note that the library links to libstdc++, which is licensed under LGPL with the "Runtime Library Exception".

License exception

If the ETC decoder is enabled, the build will contain a proprietary source code file by Ericsson - KTX-Software/lib/etcdec.cxx!
Building this file is optional, and it is disabled by default. Build libktx-rs-sys with the nonfree-etc-unpack to enable this feature if you agree with the terms of the license.

See the original LICENSE for more information.

Dependencies