22 #include "pybind11/pybind11.h" 34 mod.def(
"log2", (uint8_t(*)(uint64_t)) &
log2);
35 mod.def(
"mortonIndex", (uint64_t(*)(uint32_t, uint32_t)) &
mortonIndex,
37 mod.def(
"mortonIndexInverse",
42 mod.def(
"hilbertIndex",
43 (uint64_t(*)(uint32_t, uint32_t,
int)) &
hilbertIndex,
"x"_a,
"y"_a,
45 mod.def(
"hilbertIndexInverse",
uint64_t hilbertToMorton(uint64_t h, int m)
hilbertToMorton converts the 2m-bit Hilbert index h to the corresponding Morton index.
uint64_t mortonIndex(uint32_t x, uint32_t y)
mortonIndex interleaves the bits of x and y.
PYBIND11_MODULE(camera, mod)
uint64_t mortonToHilbert(uint64_t z, int m)
mortonToHilbert converts the 2m-bit Morton index z to the corresponding Hilbert index.
A base class for image defects.
This file contains functions for space-filling curves.
std::tuple< uint32_t, uint32_t > hilbertIndexInverse(uint64_t h, int m)
hilbertIndexInverse returns the point (x, y) with Hilbert index h, where x and y are m bit integers...
uint64_t hilbertIndex(uint32_t x, uint32_t y, int m)
hilbertIndex returns the index of (x, y) in a 2-D Hilbert curve.
std::tuple< uint32_t, uint32_t > mortonIndexInverse(uint64_t z)
mortonIndexInverse separates the even and odd bits of z.