Expand description
Texture processing module
This module provides comprehensive texture processing capabilities for Unity assets, organized following UnityPy and unity-rs best practices.
§Architecture
The module is organized into several sub-modules:
formats- Texture format definitions and metadatatypes- Core data structures (Texture2D, etc.)converter- Main conversion logic from Unity objectsdecoders- Specialized decoders for different format categorieshelpers- Utility functions for export and data manipulation
§Examples
use unity_asset_decode::texture::{TextureFormat, Texture2DConverter, TextureDecoder};
use unity_asset_decode::unity_version::UnityVersion;
// Create a converter
let converter = Texture2DConverter::new(UnityVersion::default());
// Convert Unity object to Texture2D (assuming you have a UnityObject)
// let texture = converter.from_unity_object(&unity_object)?;
// Create a decoder and decode to image
let decoder = TextureDecoder::new();
// let image = decoder.decode(&texture)?;
// Export the image
// TextureExporter::export_png(&image, "output.png")?;Re-exports§
pub use converter::Texture2DConverter;pub use converter::Texture2DProcessor;pub use decoders::Decoder;pub use decoders::TextureDecoder;pub use formats::TextureFormat;pub use formats::TextureFormatInfo;pub use helpers::TextureExporter;pub use helpers::TextureSwizzler;pub use types::GLTextureSettings;pub use types::StreamingInfo;pub use types::Texture2D;pub use decoders::BasicDecoder;pub use decoders::CompressedDecoder;pub use decoders::CrunchDecoder;pub use decoders::MobileDecoder;pub use helpers::export::ExportOptions;
Modules§
- converter
- Texture2D converter and processor
- decoders
- Texture decoders module
- formats
- Texture format definitions
- helpers
- Texture helper utilities
- types
- Texture data structures
Structs§
- Texture
Processor - Main texture processing facade
Functions§
- create_
processor - Convenience functions for common operations Create a texture processor with default settings
- decode_
texture_ data - Quick function to decode texture data
- export_
image - Quick function to export image with automatic format detection
- get_
supported_ formats - Get all supported texture formats
- is_
format_ supported - Quick function to check if a format is supported