290 {
294 int rtn;
295 uint32_t maxX = 10;
296 uint32_t maxY = 10;
298
299 double search0[1] = {0};
300 double search1[1] = {1};
301 double search2[2] = {3, 5};
302
304 CU_ASSERT(rast != NULL);
305
307 CU_ASSERT(band != NULL);
308
309 for (x = 0;
x < maxX;
x++) {
310 for (y = 0;
y < maxY;
y++) {
312 }
313 }
314
332
333 pixels = NULL;
336 search1, 1,
337 &pixels
338 );
339 CU_ASSERT_EQUAL(rtn, 83);
340 if (rtn)
342
343 pixels = NULL;
346 search0, 1,
347 &pixels
348 );
349 CU_ASSERT_EQUAL(rtn, 17);
350 if (rtn)
352
356
357 pixels = NULL;
360 search2, 2,
361 &pixels
362 );
363 CU_ASSERT_EQUAL(rtn, 3);
364 if (rtn)
366
368}
int rt_band_get_pixel_of_value(rt_band band, int exclude_nodata_value, double *searchset, int searchcount, rt_pixel *pixels)
Search band for pixel(s) with search values.
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
rt_errorstate rt_band_set_pixel(rt_band band, int x, int y, double val, int *converted)
Set single pixel's value.
void rtdealloc(void *mem)
rt_band cu_add_band(rt_raster raster, rt_pixtype pixtype, int hasnodata, double nodataval)
void cu_free_raster(rt_raster raster)