Expand description
Switch GOB layout and Xbox byte pairs, before crunch/decode/crop.
The table and GOB order are helpers/TextureSwizzler.py:6-10,
:73-103; padding is :106-114, deswizzle :17-41.
Converter ordering and RGB promotion: export/Texture2DConverter.py:254-320.
Structs§
- Switch
Layout - Checked dimensions and strides for Switch’s 4 by 8 GOBs of 16-byte texels.
Enums§
- Platform
Error - Platform requests with no reference, or sizes that cannot be processed safely.
Functions§
- astc_
context_ decode - Standalone ASTC context decompression with top-down output, for all legal 2D footprints.
- decode_
in - Apply platform transforms before crunch/unpacking, then decode, crop and
flip as UnityPy does. Ordinary callers keep using
crate::decode. - decode_
in_ as - Apply platform transforms while retaining a selected Crunch fork. Switch RGB24/BGR24 promotion still chooses the four-channel decoder.
- deswizzle
- Deswizzle mip zero; preserve UnityPy’s output length and zeroed tail. Short padded data is refused before allocating; Python’s resizing slice assignments on truncated data have no bounded texture interpretation.
- plan_in
- Platform-aware counterpart of
crate::plan. Scratch includes the transformed input, padded image, final crop and decoder tables while live. - plan_
in_ as - Platform-aware planning retaining the decoder chosen by
crate::select_in. In particular, Unity and legacy DXT Crunch share a numeric format value. - swap_
bytes_ for_ xbox - Swap every pair, keeping an odd last byte (
export/Texture2DConverter.py:323-328). - switch_
block - The complete 29-entry 16-byte texel table, independent of linked decoders.
- switch_
layout - Pad to whole GOB blocks using the blob’s little-endian exponent.
- swizzle
- Inverse of
deswizzle, using the same checked layout and GOB order. UnityPy’s write loop ishelpers/TextureSwizzler.py:44-69. - unpack_
crunch - Unpacks mip zero before an extension-supplied texture converter is called. The format selects the same Crunch fork as the ordinary decode path.