tilepack 0.1.0

Header-first single-file container for tiled multi-band image pyramids, read over HTTP range requests. Pure Rust, wasm-compatible.
Documentation
  • Coverage
  • 63.58%
    103 out of 162 items documented1 out of 81 items with examples
  • Size
  • Source code size: 88.7 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.61 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • 360-geo/tilepack
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • georgeboot

tilepack

Reader and writer for the tilepack container format: a single-file, header-first container for tiled multi-band image pyramids, designed to be read over HTTP range requests from immutable object storage. One file holds one photographic asset (a planar raster or a cubemap panorama) as one or more band groups — RGB, near-infrared, thermal, depth — each a pyramid of independently fetchable tiles.

This crate is the format core: header, descriptor, and index parsing, the pyramid and canonical-order math ([Layout]), a [Writer], and the [split16] helpers. It is pure Rust and compiles for wasm32-unknown-unknown — image decoding and tile encoding live in the caller (the browser, or the native tiler crate). It performs no I/O of its own beyond the optional [TilepackReader] convenience over a Read + Seek source.

Reading over range requests

use tilepack::{FrontMatter, required_len};
# fn fetch(_range: std::ops::Range<usize>) -> Vec<u8> { unimplemented!() }

// Fetch a generous opening prefix, then let the format tell you exactly
// how much front matter it needs.
let mut prefix = fetch(0..65_536);
loop {
    match FrontMatter::parse(&prefix) {
        Ok(fm) => {
            // fm.tile_range(loc) / fm.level_range(g, level) now plan every fetch.
            let _ = fm;
            break;
        }
        Err(tilepack::ParseError::Truncated { needed }) => {
            prefix = fetch(0..needed);
        }
        Err(e) => panic!("bad tilepack: {e}"),
    }
}
# let _ = required_len(&[]);