390 CU_ASSERT(
rast != NULL);
393 CU_ASSERT(
band != NULL);
395 for (
x = 0;
x < maxX;
x++) {
396 for (
y = 0;
y < maxY;
y++) {
403 CU_ASSERT_EQUAL(nod,0);
404 CU_ASSERT_DOUBLE_EQUAL(val,1,.01);
409 CU_ASSERT(mask != NULL);
413 for( i = 0; i < maskY; i++) {
418 CU_ASSERT(mask->
values != NULL);
419 CU_ASSERT(mask->
nodata != NULL);
423 for(
y = 0;
y < maskY;
y++) {
424 for(
x = 0;
x < maskX;
x++){
442 CU_ASSERT_EQUAL(rtn,8);
456 CU_ASSERT_EQUAL(dimx, 3);
457 CU_ASSERT_EQUAL(dimy, 3);
458 CU_ASSERT_EQUAL(nodata[1][1],1);
460 for (
x = 0;
x < dimx;
x++) {
470 for(
y = 0;
y < maskY;
y++) {
471 for(
x = 0;
x < maskX;
x++){
490 CU_ASSERT_EQUAL(rtn,8);
504 CU_ASSERT_EQUAL(dimx, 3);
505 CU_ASSERT_EQUAL(dimy, 3);
506 CU_ASSERT_NOT_EQUAL(nodata[0][0],1);
507 CU_ASSERT_DOUBLE_EQUAL(
value[0][0],1,.01);
509 for (
x = 0;
x < dimx;
x++) {
519 for(
y = 0;
y < maskY;
y++) {
520 for(
x = 0;
x < maskX;
x++){
538 CU_ASSERT_EQUAL(rtn,8);
552 CU_ASSERT_EQUAL(dimx, 3);
553 CU_ASSERT_EQUAL(dimy, 3);
554 CU_ASSERT_NOT_EQUAL(nodata[0][0],1);
555 CU_ASSERT_DOUBLE_EQUAL(
value[0][0],0.5,0.1);
557 for (
x = 0;
x < dimx;
x++) {
565 for( i = 0; i < maskY; i++) {
void * rtalloc(size_t size)
Wrappers used for managing memory.
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
struct rt_mask_t * rt_mask
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.
rt_errorstate rt_pixel_set_to_array(rt_pixel npixel, uint32_t count, rt_mask mask, int x, int y, uint16_t distancex, uint16_t distancey, double ***value, int ***nodata, int *dimx, int *dimy)
uint32_t rt_band_get_nearest_pixel(rt_band band, int x, int y, uint16_t distancex, uint16_t distancey, int exclude_nodata_value, rt_pixel *npixels)
Get nearest pixel(s) with value (not NODATA) to specified pixel.
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)