PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ _rti_colormap_arg_init()

static _rti_colormap_arg _rti_colormap_arg_init ( rt_raster  raster)
static

Definition at line 1444 of file rt_mapalgebra.c.

References _rti_iterator_arg_t::arg, _rti_colormap_arg_t::band, _rti_colormap_arg_t::expr, _rti_colormap_arg_t::hasnodata, _rti_colormap_arg_t::nexpr, _rti_colormap_arg_t::nodataentry, _rti_colormap_arg_t::nodataval, _rti_colormap_arg_t::npos, _rti_colormap_arg_t::pos, _rti_colormap_arg_t::raster, rt_raster_clone(), rtalloc(), and rterror().

Referenced by rt_raster_colormap().

1444  {
1445  _rti_colormap_arg arg = NULL;
1446 
1447  arg = rtalloc(sizeof(struct _rti_colormap_arg_t));
1448  if (arg == NULL) {
1449  rterror("_rti_colormap_arg_init: Could not allocate memory for _rti_color_arg");
1450  return NULL;
1451  }
1452 
1453  arg->band = NULL;
1454  arg->nodataentry = NULL;
1455  arg->hasnodata = 0;
1456  arg->nodataval = 0;
1457 
1458  if (raster == NULL)
1459  arg->raster = NULL;
1460  /* raster provided */
1461  else {
1462  arg->raster = rt_raster_clone(raster, 0);
1463  if (arg->raster == NULL) {
1464  rterror("_rti_colormap_arg_init: Could not create output raster");
1465  return NULL;
1466  }
1467  }
1468 
1469  arg->nexpr = 0;
1470  arg->expr = NULL;
1471 
1472  arg->npos = 0;
1473  arg->pos = NULL;
1474 
1475  return arg;
1476 }
rt_reclassexpr * expr
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
Definition: rt_context.c:199
void * rtalloc(size_t size)
Wrappers used for managing memory.
Definition: rt_context.c:171
rt_raster rt_raster_clone(rt_raster raster, uint8_t deep)
Clone an existing raster.
Definition: rt_raster.c:1544
rt_colormap_entry nodataentry
Here is the call graph for this function:
Here is the caller graph for this function: