#compression #texture #tools #nvidia #image

nvtt_rs

High-level bindings to the nvtt library

4 releases (2 breaking)

✓ Uses Rust 2018 edition

0.3.0 Nov 23, 2019
0.2.1 Nov 19, 2019
0.2.0 Nov 19, 2019
0.1.0 Nov 17, 2019

#51 in Compression

MIT/Apache

8.5MB
64K SLoC

C++ 58K SLoC // 0.2% comments Visual Studio Project 4K SLoC // 0.0% comments Rust 1K SLoC // 0.2% comments C 794 SLoC // 0.3% comments C# 396 SLoC // 0.1% comments Visual Studio Solution 380 SLoC

nvtt_rs

nvtt is a library for converting textures into common compressed formats for use with graphics APIs. See the wiki for more info.

Example

use nvtt_rs::{Compressor, CompressionOptions, Format, InputOptions, OutputOptions};

let input_options = InputOptions::new()?;

let mut output_options = OutputOptions::new()?;
output_options.set_output_location("output.dds");

let mut compression_opts = CompressionOptions::new()?;
compression_opts.set_format(Format::Dxt1);

let mut compressor = Compressor::new()?;
compressor.compress(&compression_opts, &input_options, &output_options)?;

Features

nvtt_image_integration

This feature provides the convenience method InputOptions::set_image, which can be used to configure the InputOptions directly from types provided by the image crate.

Only a limited number of image formats are supported, although this library can provide automatic conversions from a DynamicImage. See the ValidImage type for more information.

Dependencies

Linux/macOS

This crate requires a valid cmake installation and a C++ compiler to build.

Windows

This crate requires a valid installation of Visual Studio.

Notes

This crate does not currently work on Microsoft Windows due to incomplete work on the build system.

Dependencies