PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ rt_band_destroy()

void rt_band_destroy ( rt_band  band)

Destroy a raster band.

Parameters
band: the band to destroy

Definition at line 340 of file rt_band.c.

References rt_band_t::data, rt_band_t::mem, rt_band_t::offline, rt_band_t::ownsdata, RASTER_DEBUGF, and rtdealloc().

Referenced by _rti_colormap_arg_destroy(), convert_raster(), cu_free_raster(), RASTER_bandmetadata(), raster_destroy(), RASTER_getBandFileSize(), RASTER_getBandFileTimestamp(), RASTER_getBandPath(), RASTER_getPixelPolygons(), RASTER_histogram(), RASTER_histogramCoverage(), RASTER_nearestValue(), RASTER_neighborhood(), RASTER_pixelOfValue(), RASTER_quantile(), RASTER_quantileCoverage(), RASTER_reclass(), RASTER_setBandPath(), RASTER_setPixelValuesGeomval(), RASTER_summaryStats(), RASTER_summaryStats_transfn(), RASTER_summaryStatsCoverage(), RASTER_tile(), RASTER_union_transfn(), RASTER_valueCount(), RASTER_valueCountCoverage(), rt_band_from_wkb(), rt_band_new_inline(), rt_band_new_offline(), rt_band_reclass(), rt_raster_deserialize(), rt_raster_from_band(), rt_raster_from_wkb(), rt_raster_gdal_rasterize(), rt_raster_generate_new_band(), rt_raster_iterator(), rtpg_union_arg_destroy(), test_band_metadata(), test_band_new_offline_from_path(), test_band_pixtype_16BSI(), test_band_pixtype_16BUI(), test_band_pixtype_1BB(), test_band_pixtype_2BUI(), test_band_pixtype_32BF(), test_band_pixtype_32BSI(), test_band_pixtype_32BUI(), test_band_pixtype_4BUI(), test_band_pixtype_64BF(), test_band_pixtype_8BSI(), test_band_pixtype_8BUI(), test_band_reclass(), and test_raster_replace_band().

340  {
341  if (band == NULL)
342  return;
343 
344  RASTER_DEBUGF(3, "Destroying rt_band @ %p", band);
345 
346  /* offline band */
347  if (band->offline) {
348  /* memory cache */
349  if (band->data.offline.mem != NULL)
350  rtdealloc(band->data.offline.mem);
351  /* offline file path */
352  if (band->data.offline.path != NULL)
353  rtdealloc(band->data.offline.path);
354  }
355  /* inline band and band owns the data */
356  else if (band->data.mem != NULL && band->ownsdata)
357  rtdealloc(band->data.mem);
358 
359  rtdealloc(band);
360 }
int8_t ownsdata
Definition: librtcore.h:2322
#define RASTER_DEBUGF(level, msg,...)
Definition: librtcore.h:299
int32_t offline
Definition: librtcore.h:2315
void rtdealloc(void *mem)
Definition: rt_context.c:186
void * mem
Definition: librtcore.h:2327
union rt_band_t::@8 data
Here is the call graph for this function: