Module compression

Source

Structs§

CompressedData
Wrapper for compressed, serialized data (for stuff that doesn’t use the default lz4 compression)
GridLtrPacking
A grid of the z levels, left to right, top to bottom, like English prose. Convenient for visualizing terrain for debugging or for user-inspectable file formats, but wastes space if the number of z levels isn’t a perfect square.
QuadPngEncoding
TriPngEncoding
WidePacking
A wide, short image. Shares the advantage of not wasting space with TallPacking (which is strictly worse, and was moved to benchmark code in world), but faster to compress and smaller since PNG compresses each row independently, so a wide image has fewer calls to the compressor. FLIP_X has the same spatial locality preserving behavior as with TallPacking.
WireChonk

Traits§

PackingFormula
Formula for packing voxel data into a 2d array
VoxelImageDecoding
VoxelImageEncoding

Functions§

gen_lanczos_lookup 🔒
image_from_bytes
image_terrain
image_terrain_chonk
image_terrain_volgrid
lanczos 🔒
https://en.wikipedia.org/wiki/Lanczos_resampling#Lanczos_kernel
lanczos_lookup_array_size 🔒
Needs to be a separate function since const fns can appear in the output of a const-generic function, but raw arithmetic expressions can’t be
sin 🔒
AldanTanneo’s sin approximation (since std’s sin implementation isn’t const yet)
write_image_terrain