zOrder function
Implementation
zOrder(num x0, num y0, num minX, num minY, num invSize) {
// coords are transformed into non-negative 15-bit integer range
int x = (32767 * (x0 - minX) * invSize).floor().toInt();
int y = (32767 * (y0 - minY) * invSize).floor().toInt();
x = (x | (x << 8)) & 0x00FF00FF;
x = (x | (x << 4)) & 0x0F0F0F0F;
x = (x | (x << 2)) & 0x33333333;
x = (x | (x << 1)) & 0x55555555;
y = (y | (y << 8)) & 0x00FF00FF;
y = (y | (y << 4)) & 0x0F0F0F0F;
y = (y | (y << 2)) & 0x33333333;
y = (y | (y << 1)) & 0x55555555;
return x | (y << 1);
}