212 {
214
218 uint32_t xmax = 100;
220 uint32_t ymax = 100;
221 uint32_t rtn = 0;
222
223 double count[] = {3, 4, 5};
224
226 CU_ASSERT(raster != NULL);
228 CU_ASSERT(band != NULL);
230
231 for (x = 0;
x < xmax;
x++) {
232 for (y = 0;
y < ymax;
y++) {
233 rt_band_set_pixel(band, x, y, (((
double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
234 }
235 }
237 CU_ASSERT(vcnts != NULL);
238 CU_ASSERT_NOT_EQUAL(rtn, 0);
240
242 CU_ASSERT(vcnts != NULL);
243 CU_ASSERT_NOT_EQUAL(rtn, 0);
245
247 CU_ASSERT(vcnts != NULL);
248 CU_ASSERT_NOT_EQUAL(rtn, 0);
250
252 CU_ASSERT(vcnts != NULL);
253 CU_ASSERT_NOT_EQUAL(rtn, 0);
255
257 CU_ASSERT(vcnts != NULL);
258 CU_ASSERT_NOT_EQUAL(rtn, 0);
260
262 CU_ASSERT(vcnts != NULL);
263 CU_ASSERT_NOT_EQUAL(rtn, 0);
265
267}
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
rt_errorstate rt_band_set_nodata(rt_band band, double val, int *converted)
Set nodata value.
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_valuecount rt_band_get_value_count(rt_band band, int exclude_nodata_value, double *search_values, uint32_t search_values_count, double roundto, uint32_t *rtn_total, uint32_t *rtn_count)
Count the number of times provided value(s) occur in the band.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
rt_band cu_add_band(rt_raster raster, rt_pixtype pixtype, int hasnodata, double nodataval)
void cu_free_raster(rt_raster raster)