441 {
443 uint16_t i = 0;
444
445 assert(NULL != raster);
446
447 RASTER_DEBUGF(3,
"rt_raster_wkb_size: computing size for %d bands",
449
450 for (i = 0; i <
raster->numBands; ++i) {
454
455 RASTER_DEBUGF(3,
"rt_raster_wkb_size: adding size of band %d", i);
456
457 if (pixbytes < 1) {
458 rterror(
"rt_raster_wkb_size: Corrupted band: unknown pixtype");
459 return 0;
460 }
461
462
463 size += 1;
464
465
466 size += pixbytes;
467
468 if (!outasin &&
band->offline) {
469
470 size += 1;
471
472
473 size += strlen(
band->data.offline.path) + 1;
474 }
475 else {
476
478 }
479 }
480
481 return size;
482}
void rterror(const char *fmt,...)
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): ...