444 {
446 uint16_t i = 0;
447
448 assert(NULL != raster);
449
450 RASTER_DEBUGF(3,
"rt_raster_wkb_size: computing size for %d bands",
452
453 for (i = 0; i <
raster->numBands; ++i) {
457
458 RASTER_DEBUGF(3,
"rt_raster_wkb_size: adding size of band %d", i);
459
460 if (pixbytes < 1) {
461 rterror(
"rt_raster_wkb_size: Corrupted band: unknown pixtype");
462 return 0;
463 }
464
465
466 size += 1;
467
468
469 size += pixbytes;
470
471 if (!outasin &&
band->offline) {
472
473 size += 1;
474
475
476 size += strlen(
band->data.offline.path) + 1;
477 }
478 else {
479
481 }
482 }
483
484 return size;
485}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
#define RASTER_DEBUGF(level, msg,...)
int rt_pixtype_size(rt_pixtype pixtype)
Return size in bytes of a value in the given pixtype.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...