pub fn morton_decode_generic<Coor, Key, Coors>(
key: Key,
siz_rat: NonZeroUsize,
) -> Coors
Expand description
Receives a Key
value and returns an iterator of Coor
values that were decoded from it.
Returns an empty iterator if the Key
value is too small for so many Coor
values.
ยงExamples
assert_eq!(morton_decode_generic::<_, _, Vec<u8>>(3u16, nz(2)), vec!(1, 1));
assert_eq!(morton_decode_generic::<u16, u32, Vec<u16>>(0, nz(4)), vec!());
let input = vec!(1u8, 2);
let encoded_input: u16 = morton_encode_generic(input.clone());
let reassembled_input: Vec<u8> = morton_decode_generic(encoded_input, nz(2));
assert_eq!(input, reassembled_input);