Search band for pixel(s) with search values.
1993 {
1996 int i;
1998 int err;
2000 int isnodata = 0;
2001 int isequal = 0;
2002
2004
2005 assert(NULL != band);
2006 assert(NULL != pixels);
2007 assert(NULL != searchset && searchcount > 0);
2008
2009 if (!
band->hasnodata)
2010 exclude_nodata_value =
FALSE;
2011
2012 else if (exclude_nodata_value &&
band->isnodata) {
2013 RASTER_DEBUG(4,
"Pixels cannot be searched as band is NODATA and excluding NODATA values");
2014 return 0;
2015 }
2016
2017 for (x = 0;
x <
band->width;
x++) {
2018 for (y = 0;
y <
band->height;
y++) {
2021 rterror(
"rt_band_get_pixel_of_value: Cannot get band pixel");
2022 return -1;
2023 }
2024 else if (exclude_nodata_value && isnodata)
2025 continue;
2026
2027 for (i = 0; i < searchcount; i++) {
2029 continue;
2030 }
2031
2033 continue;
2034
2035
2037 if (*pixels == NULL)
2039 else
2041 if (*pixels == NULL) {
2042 rterror(
"rt_band_get_pixel_of_value: Could not allocate memory for pixel(s)");
2043 return -1;
2044 }
2045
2051 }
2052 }
2053 }
2054
2056}
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.