PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ rt_band_clamped_value_is_nodata()

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 values is NOT clamped NODATA
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 1665 of file rt_band.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().

1665  {
1666  int isequal = 0;
1667 
1668  assert(NULL != band);
1669 
1670  /* no NODATA, so never equal */
1671  if (!band->hasnodata)
1672  return 0;
1673 
1674  /* value is exactly NODATA */
1675  if (FLT_EQ(val, band->nodataval))
1676  return 2;
1677 
1678  /* ignore error from rt_pixtype_compare_clamped_values */
1680  band->pixtype,
1681  val, band->nodataval,
1682  &isequal
1683  );
1684 
1685  return isequal ? 1 : 0;
1686 }
rt_pixtype pixtype
Definition: librtcore.h:2265
#define FLT_EQ(x, y)
Definition: librtcore.h:2185
double nodataval
Definition: librtcore.h:2272
int32_t hasnodata
Definition: librtcore.h:2269
rt_errorstate rt_pixtype_compare_clamped_values(rt_pixtype pixtype, double val, double refval, int *isequal)
Test to see if two values are equal when clamped.
Definition: rt_pixel.c:200
Here is the call graph for this function:
Here is the caller graph for this function: