PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ _rti_colormap_arg_init()

static _rti_colormap_arg _rti_colormap_arg_init ( rt_raster  raster)
static

Definition at line 1447 of file rt_mapalgebra.c.

1447  {
1448  _rti_colormap_arg arg = NULL;
1449 
1450  arg = rtalloc(sizeof(struct _rti_colormap_arg_t));
1451  if (arg == NULL) {
1452  rterror("_rti_colormap_arg_init: Could not allocate memory for _rti_color_arg");
1453  return NULL;
1454  }
1455 
1456  arg->band = NULL;
1457  arg->nodataentry = NULL;
1458  arg->hasnodata = 0;
1459  arg->nodataval = 0;
1460 
1461  if (raster == NULL)
1462  arg->raster = NULL;
1463  /* raster provided */
1464  else {
1465  arg->raster = rt_raster_clone(raster, 0);
1466  if (arg->raster == NULL) {
1467  rterror("_rti_colormap_arg_init: Could not create output raster");
1468  return NULL;
1469  }
1470  }
1471 
1472  arg->nexpr = 0;
1473  arg->expr = NULL;
1474 
1475  arg->npos = 0;
1476  arg->pos = NULL;
1477 
1478  return arg;
1479 }
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:1540
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
rt_colormap_entry nodataentry
rt_reclassexpr * expr

References _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, rtrowdump::raster, rt_raster_clone(), rtalloc(), and rterror().

Referenced by rt_raster_colormap().

Here is the call graph for this function:
Here is the caller graph for this function: