*
* @param band: the band to query for minimum and maximum pixel values
* @param exclude_nodata_value: if non-zero, ignore nodata values
- * @param search_values: array of values to count
- * @param search_values_count: the number of search values
+ * @param searchset: array of values to count
+ * @param searchcount: the number of search values
+ * @param pixels: pixels with the search value
*
* @return -1 on error, otherwise number of pixels
*/
}
for (i = 0; i < searchcount; i++) {
- if (FLT_NEQ(pixval, searchset[i]))
+ if (
+ FLT_NEQ(pixval, searchset[i]) ||
+ (rt_pixtype_compare_clamped_values(band->pixtype, searchset[i], pixval) != 1)
+ ) {
continue;
+ }
/* match found */
count++;
*
* @param band: the band to query for minimum and maximum pixel values
* @param exclude_nodata_value: if non-zero, ignore nodata values
- * @param search_values: array of values to count
- * @param search_values_count: the number of search values
+ * @param searchset: array of values to count
+ * @param searchcount: the number of search values
+ * @param pixels: pixels with the search value
*
* @return -1 on error, otherwise number of pixels
*/