Search band for pixel(s) with search values.
1656 {
1659 int i;
1661 int err;
1663 int isnodata = 0;
1664 int isequal = 0;
1665
1667
1668 assert(NULL != band);
1669 assert(NULL != pixels);
1670 assert(NULL != searchset && searchcount > 0);
1671
1672 if (!
band->hasnodata)
1673 exclude_nodata_value =
FALSE;
1674
1675 else if (exclude_nodata_value &&
band->isnodata) {
1676 RASTER_DEBUG(4,
"Pixels cannot be searched as band is NODATA and excluding NODATA values");
1677 return 0;
1678 }
1679
1680 for (x = 0;
x <
band->width;
x++) {
1681 for (y = 0;
y <
band->height;
y++) {
1684 rterror(
"rt_band_get_pixel_of_value: Cannot get band pixel");
1685 return -1;
1686 }
1687 else if (exclude_nodata_value && isnodata)
1688 continue;
1689
1690 for (i = 0; i < searchcount; i++) {
1692 continue;
1693 }
1694
1696 continue;
1697
1698
1700 if (*pixels == NULL)
1702 else
1704 if (*pixels == NULL) {
1705 rterror(
"rt_band_get_pixel_of_value: Could not allocate memory for pixel(s)");
1706 return -1;
1707 }
1708
1714 }
1715 }
1716 }
1717
1719}
void rterror(const char *fmt,...)
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.