Expand description

nutexb

Nutexb is an image texture format used in Super Smash Bros Ultimate and some other games. The extension “.nutexb” may stand for “Namco Universal Texture Binary”.

Image data is stored in a contiguous region of memory with metadata stored in the layer_mipmaps and footer. The supported image formats in NutexbFormat use standard compressed and uncompressed formats used for DDS files. The arrays and mipmaps for the image data are stored in a memory layout optimized for the Tegra X1 in a process known as swizzling. This library provides tools for reading and writing nutexb files as well as working with the swizzled image data.

Reading

Read a NutexbFile with NutexbFile::read or NutexbFile::read_from_file. The image data needs to be deswizzled first with NutexbFile::deswizzled_data to use with applications that expect a standard row-major memory layout.

use nutexb::NutexbFile;

let nutexb = NutexbFile::read_from_file("col_001.nutexb")?;
let surface_data = nutexb.deswizzled_data();

Writing

The easiest way to create a NutexbFile is by implementing the ToNutexb trait and calling NutexbFile::create. This trait is already implemented for DDS and formats supported by image-rs when compiling with the "ddsfile" and "image" features, respectively.

use nutexb::NutexbFile;

let image = image::open("col_001.png")?;

let nutexb = NutexbFile::create(&image, "col_001")?;
nutexb.write_to_file("col_001.nutexb")?;

Structs

The data stored in a nutexb file like "def_001_col.nutexb".

Information about the image data.

Enums

Supported image data formats.

Traits

A trait for creating a Nutexb from unswizzled image data. Implement this trait for an image file format to support creating a NutexbFile with NutexbFile::create.