PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ read_float64()

double read_float64 ( const uint8_t **  from,
uint8_t  littleEndian 
)

Definition at line 390 of file rt_serialize.c.

390 {
391
392 union {
393 double d;
394 uint64_t i;
395 } ret;
396
397 assert(NULL != from);
398
399 if (littleEndian) {
400 ret.i = (uint64_t) ((*from)[0] & 0xff) |
401 (uint64_t) ((*from)[1] & 0xff) << 8 |
402 (uint64_t) ((*from)[2] & 0xff) << 16 |
403 (uint64_t) ((*from)[3] & 0xff) << 24 |
404 (uint64_t) ((*from)[4] & 0xff) << 32 |
405 (uint64_t) ((*from)[5] & 0xff) << 40 |
406 (uint64_t) ((*from)[6] & 0xff) << 48 |
407 (uint64_t) ((*from)[7] & 0xff) << 56;
408 } else {
409 /* big endian */
410 ret.i = (uint64_t) ((*from)[7] & 0xff) |
411 (uint64_t) ((*from)[6] & 0xff) << 8 |
412 (uint64_t) ((*from)[5] & 0xff) << 16 |
413 (uint64_t) ((*from)[4] & 0xff) << 24 |
414 (uint64_t) ((*from)[3] & 0xff) << 32 |
415 (uint64_t) ((*from)[2] & 0xff) << 40 |
416 (uint64_t) ((*from)[1] & 0xff) << 48 |
417 (uint64_t) ((*from)[0] & 0xff) << 56;
418 }
419
420 *from += 8;
421 return ret.d;
422}

Referenced by rt_band_from_wkb(), rt_raster_deserialize(), and rt_raster_from_wkb().

Here is the caller graph for this function: