PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ _rti_colormap_arg_destroy()

static void _rti_colormap_arg_destroy ( _rti_colormap_arg  arg)
static

Definition at line 1482 of file rt_mapalgebra.c.

References _rti_iterator_arg_t::band, _rti_colormap_arg_t::expr, _rti_colormap_arg_t::nexpr, _rti_colormap_arg_t::npos, _rti_colormap_arg_t::pos, _rti_colormap_arg_t::raster, rt_band_destroy(), rt_raster_destroy(), rt_raster_get_band(), rt_raster_get_num_bands(), and rtdealloc().

Referenced by rt_raster_colormap().

1482  {
1483  int i = 0;
1484 
1485  if (arg->raster != NULL) {
1486  rt_band band = NULL;
1487 
1488  for (i = rt_raster_get_num_bands(arg->raster) - 1; i >= 0; i--) {
1489  band = rt_raster_get_band(arg->raster, i);
1490  if (band != NULL)
1491  rt_band_destroy(band);
1492  }
1493 
1494  rt_raster_destroy(arg->raster);
1495  }
1496 
1497  if (arg->nexpr) {
1498  for (i = 0; i < arg->nexpr; i++) {
1499  if (arg->expr[i] != NULL)
1500  rtdealloc(arg->expr[i]);
1501  }
1502  rtdealloc(arg->expr);
1503  }
1504 
1505  if (arg->npos)
1506  rtdealloc(arg->pos);
1507 
1508  rtdealloc(arg);
1509  arg = NULL;
1510 }
rt_reclassexpr * expr
uint16_t rt_raster_get_num_bands(rt_raster raster)
Definition: rt_raster.c:372
band
Definition: ovdump.py:57
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_band.c:340
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition: rt_raster.c:381
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
void rtdealloc(void *mem)
Definition: rt_context.c:186
Here is the call graph for this function:
Here is the caller graph for this function: