Search band for pixel(s) with search values.
1964 {
1967 int i;
1969 int err;
1971 int isnodata = 0;
1972 int isequal = 0;
1973
1975
1976 assert(NULL != band);
1977 assert(NULL != pixels);
1978 assert(NULL != searchset && searchcount > 0);
1979
1980 if (!
band->hasnodata)
1981 exclude_nodata_value =
FALSE;
1982
1983 else if (exclude_nodata_value &&
band->isnodata) {
1984 RASTER_DEBUG(4,
"Pixels cannot be searched as band is NODATA and excluding NODATA values");
1985 return 0;
1986 }
1987
1988 for (x = 0;
x <
band->width;
x++) {
1989 for (y = 0;
y <
band->height;
y++) {
1992 rterror(
"rt_band_get_pixel_of_value: Cannot get band pixel");
1993 return -1;
1994 }
1995 else if (exclude_nodata_value && isnodata)
1996 continue;
1997
1998 for (i = 0; i < searchcount; i++) {
2000 continue;
2001 }
2002
2004 continue;
2005
2006
2008 if (*pixels == NULL)
2010 else
2012 if (*pixels == NULL) {
2013 rterror(
"rt_band_get_pixel_of_value: Could not allocate memory for pixel(s)");
2014 return -1;
2015 }
2016
2022 }
2023 }
2024 }
2025
2027}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
#define RASTER_DEBUG(level, msg)
struct rt_pixel_t * rt_pixel
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.
void * rtrealloc(void *mem, size_t size)
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.