PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ rt_util_clamp_to_16F()

float rt_util_clamp_to_16F ( double  value)

Definition at line 88 of file rt_util.c.

89{
90 /*
91 * GDAL exposes Float16 samples as raw 16-bit words, so we clamp to the
92 * representable range before packing them manually rather than
93 * depending on a runtime helper.
94 */
95 if (isnan(value))
96 return (float)value;
97 return (float)fmin(fmax((value), -POSTGIS_RT_16F_MAX), POSTGIS_RT_16F_MAX);
98}
#define POSTGIS_RT_16F_MAX
Definition librtcore.h:2254
int value
Definition genraster.py:62

References POSTGIS_RT_16F_MAX.

Referenced by rt_band_corrected_clamped_value(), rt_band_init_value(), rt_band_set_nodata(), rt_band_set_pixel(), and rt_pixtype_compare_clamped_values().

Here is the caller graph for this function: