DecodeBox2DAscending decodes a box2D object in ascending order.
(b []byte)
| 1295 | |
| 1296 | // DecodeBox2DAscending decodes a box2D object in ascending order. |
| 1297 | func DecodeBox2DAscending(b []byte) ([]byte, geopb.BoundingBox, error) { |
| 1298 | box := geopb.BoundingBox{} |
| 1299 | if PeekType(b) != Box2D { |
| 1300 | return nil, box, errors.Errorf("did not find Box2D marker") |
| 1301 | } |
| 1302 | |
| 1303 | b = b[1:] |
| 1304 | var err error |
| 1305 | b, box.LoX, err = DecodeFloatAscending(b) |
| 1306 | if err != nil { |
| 1307 | return nil, box, err |
| 1308 | } |
| 1309 | b, box.HiX, err = DecodeFloatAscending(b) |
| 1310 | if err != nil { |
| 1311 | return nil, box, err |
| 1312 | } |
| 1313 | b, box.LoY, err = DecodeFloatAscending(b) |
| 1314 | if err != nil { |
| 1315 | return nil, box, err |
| 1316 | } |
| 1317 | b, box.HiY, err = DecodeFloatAscending(b) |
| 1318 | if err != nil { |
| 1319 | return nil, box, err |
| 1320 | } |
| 1321 | return b, box, nil |
| 1322 | } |
| 1323 | |
| 1324 | // DecodeBox2DDescending decodes a box2D object in descending order. |
| 1325 | func DecodeBox2DDescending(b []byte) ([]byte, geopb.BoundingBox, error) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…