Set nodata value.
- Parameters
-
| band | : the band to set nodata value to |
| val | : the nodata value |
| converted | : if non-zero, value was truncated/clamped/converted |
- Returns
- ES_NONE or ES_ERROR
Definition at line 884 of file rt_band.c.
884 {
886 int32_t checkvalint = 0;
887 uint32_t checkvaluint = 0;
888 float checkvalfloat = 0;
889 double checkvaldouble = 0;
890
891 assert(NULL != band);
892
893 if (converted != NULL)
894 *converted = 0;
895
896 pixtype =
band->pixtype;
897
899
900
901 switch (pixtype) {
904 checkvalint =
band->nodataval;
905 break;
906 }
909 checkvalint =
band->nodataval;
910 break;
911 }
914 checkvalint =
band->nodataval;
915 break;
916 }
919 checkvalint =
band->nodataval;
920 break;
921 }
924 checkvalint =
band->nodataval;
925 break;
926 }
929 checkvalint =
band->nodataval;
930 break;
931 }
934 checkvalint =
band->nodataval;
935 break;
936 }
939 checkvalint =
band->nodataval;
940 break;
941 }
944 checkvaluint =
band->nodataval;
945 break;
946 }
949 checkvalfloat =
band->nodataval;
950 break;
951 }
953 band->nodataval = val;
954 checkvaldouble =
band->nodataval;
955 break;
956 }
957 default: {
958 rterror(
"rt_band_set_nodata: Unknown pixeltype %d", pixtype);
961 }
962 }
963
966
968
969
971
973 val,
974 checkvalint, checkvaluint,
975 checkvalfloat, checkvaldouble,
976 pixtype
977 ) && converted != NULL) {
978 *converted = 1;
979 }
980
982}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
#define RASTER_DEBUGF(level, msg,...)
int8_t rt_util_clamp_to_8BSI(double value)
uint8_t rt_util_clamp_to_1BB(double value)
int32_t rt_util_clamp_to_32BSI(double value)
int rt_util_dbl_trunc_warning(double initialvalue, int32_t checkvalint, uint32_t checkvaluint, float checkvalfloat, double checkvaldouble, rt_pixtype pixtype)
uint8_t rt_util_clamp_to_2BUI(double value)
const char * rt_pixtype_name(rt_pixtype pixtype)
uint8_t rt_util_clamp_to_8BUI(double value)
int16_t rt_util_clamp_to_16BSI(double value)
uint8_t rt_util_clamp_to_4BUI(double value)
uint16_t rt_util_clamp_to_16BUI(double value)
uint32_t rt_util_clamp_to_32BUI(double value)
float rt_util_clamp_to_32F(double value)
References ES_ERROR, ES_NONE, PT_16BSI, PT_16BUI, PT_1BB, PT_2BUI, PT_32BF, PT_32BSI, PT_32BUI, PT_4BUI, PT_64BF, PT_8BSI, PT_8BUI, PT_END, RASTER_DEBUGF, rt_pixtype_name(), rt_util_clamp_to_16BSI(), rt_util_clamp_to_16BUI(), rt_util_clamp_to_1BB(), rt_util_clamp_to_2BUI(), rt_util_clamp_to_32BSI(), rt_util_clamp_to_32BUI(), rt_util_clamp_to_32F(), rt_util_clamp_to_4BUI(), rt_util_clamp_to_8BSI(), rt_util_clamp_to_8BUI(), rt_util_dbl_trunc_warning(), and rterror().
Referenced by RASTER_setBandNoDataValue(), rt_band_new_inline(), rt_band_new_offline(), test_band_metadata(), test_band_pixtype_16BSI(), test_band_pixtype_16BUI(), test_band_pixtype_1BB(), test_band_pixtype_2BUI(), test_band_pixtype_32BF(), test_band_pixtype_32BSI(), test_band_pixtype_32BUI(), test_band_pixtype_4BUI(), test_band_pixtype_64BF(), test_band_pixtype_8BSI(), test_band_pixtype_8BUI(), test_band_reclass(), test_band_stats(), test_band_value_count(), test_raster_colormap(), test_raster_from_band(), test_raster_fully_within_distance(), test_raster_geos_contains(), test_raster_geos_contains_properly(), test_raster_geos_covered_by(), test_raster_geos_covers(), test_raster_geos_overlaps(), test_raster_geos_touches(), test_raster_intersects(), and test_raster_within_distance().