PostGIS  2.1.10dev-r@@SVN_REVISION@@
int rt_band_clamped_value_is_nodata ( rt_band  band,
double  val 
)

Compare clamped value to band's clamped NODATA value.

Parameters
band: the band whose NODATA value will be used for comparison
val: the value to compare to the NODATA value
Returns
2 if unclamped value is unclamped NODATA 1 if clamped value is clamped NODATA 0 if clamped value is NOT clamped NODATA

Definition at line 3126 of file rt_api.c.

References FLT_EQ, rt_band_t::hasnodata, rt_band_t::nodataval, rt_band_t::pixtype, and rt_pixtype_compare_clamped_values().

Referenced by RASTER_dumpValues(), rt_band_corrected_clamped_value(), rt_band_get_pixel(), and rt_band_set_pixel().

3126  {
3127  int isequal = 0;
3128 
3129  assert(NULL != band);
3130 
3131  /* no NODATA, so never equal */
3132  if (!band->hasnodata)
3133  return 0;
3134 
3135  /* value is exactly NODATA */
3136  if (FLT_EQ(val, band->nodataval))
3137  return 2;
3138 
3139  /* ignore error from rt_pixtype_compare_clamped_values */
3141  band->pixtype,
3142  val, band->nodataval,
3143  &isequal
3144  );
3145 
3146  return isequal ? 1 : 0;
3147 }
rt_pixtype pixtype
Definition: rt_api.h:2239
double nodataval
Definition: rt_api.h:2246
#define FLT_EQ(x, y)
Definition: rt_api.h:2159
int32_t hasnodata
Definition: rt_api.h:2243
rt_errorstate rt_pixtype_compare_clamped_values(rt_pixtype pixtype, double val, double refval, int *isequal)
Returns 1 if clamped values are equal, 0 if not equal, -1 if error.
Definition: rt_api.c:1258

Here is the call graph for this function:

Here is the caller graph for this function: