Delta encoding for motion within features

This commit is contained in:
Eric Fischer
2015-06-17 17:48:29 -07:00
parent 725ea71e57
commit 46626e4f08
3 changed files with 24 additions and 12 deletions
+11 -5
View File
@@ -25,6 +25,8 @@ drawvec decode_geometry(char **meta, int z, unsigned tx, unsigned ty, int detail
bbox[2] = LONG_LONG_MIN;
bbox[3] = LONG_LONG_MIN;
long long wx = 0, wy = 0;
while (1) {
draw d;
@@ -34,12 +36,16 @@ drawvec decode_geometry(char **meta, int z, unsigned tx, unsigned ty, int detail
}
if (d.op == VT_MOVETO || d.op == VT_LINETO) {
unsigned wx, wy;
deserialize_uint(meta, &wx);
deserialize_uint(meta, &wy);
long long dx, dy;
long long wwx = (unsigned) wx;
long long wwy = (unsigned) wy;
deserialize_long_long(meta, &dx);
deserialize_long_long(meta, &dy);
wx += dx;
wy += dy;
long long wwx = wx;
long long wwy = wy;
if (z != 0) {
wwx -= tx << (32 - z);