PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void _rti_colormap_arg_destroy ( _rti_colormap_arg  arg)
static

Definition at line 14896 of file rt_api.c.

References ovdump::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().

14896  {
14897  int i = 0;
14898 
14899  if (arg->raster != NULL) {
14900  rt_band band = NULL;
14901 
14902  for (i = rt_raster_get_num_bands(arg->raster) - 1; i >= 0; i--) {
14903  band = rt_raster_get_band(arg->raster, i);
14904  if (band != NULL)
14905  rt_band_destroy(band);
14906  }
14907 
14908  rt_raster_destroy(arg->raster);
14909  }
14910 
14911  if (arg->nexpr) {
14912  for (i = 0; i < arg->nexpr; i++) {
14913  if (arg->expr[i] != NULL)
14914  rtdealloc(arg->expr[i]);
14915  }
14916  rtdealloc(arg->expr);
14917  }
14918 
14919  if (arg->npos)
14920  rtdealloc(arg->pos);
14921 
14922  rtdealloc(arg);
14923  arg = NULL;
14924 }
int rt_raster_get_num_bands(rt_raster raster)
Definition: rt_api.c:5677
rt_reclassexpr * expr
Definition: rt_api.c:14853
void rtdealloc(void *mem)
Definition: rt_api.c:882
uint16_t * pos
Definition: rt_api.c:14856
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_api.c:5387
tuple band
Definition: ovdump.py:57
rt_raster raster
Definition: rt_api.c:14845
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_api.c:1650
rt_band rt_raster_get_band(rt_raster raster, int n)
Return Nth band, or NULL if unavailable.
Definition: rt_api.c:5686

Here is the call graph for this function:

Here is the caller graph for this function: