28 {
32 uint32_t rtn;
33 const int maxX = 10;
34 const int maxY = 10;
36
38 int **nodata;
39 int dimx;
40 int dimy;
41
43 CU_ASSERT(rast != NULL);
44
46 CU_ASSERT(band != NULL);
47
48 for (x = 0;
x < maxX;
x++) {
49 for (y = 0;
y < maxY;
y++) {
51 }
52 }
53
71
72
74 band,
75 0, 0,
76 0, 0,
77 1,
78 &npixels
79 );
80 CU_ASSERT_EQUAL(rtn, 3);
81 if (rtn)
83
84
86 band,
87 1, 1,
88 0, 0,
89 1,
90 &npixels
91 );
92 CU_ASSERT_EQUAL(rtn, 6);
93 if (rtn)
95
96
98 band,
99 4, 4,
100 0, 0,
101 1,
102 &npixels
103 );
104 CU_ASSERT_EQUAL(rtn, 7);
105 if (rtn)
107
108
110 band,
111 4, 4,
112 2, 2,
113 1,
114 &npixels
115 );
116 CU_ASSERT_EQUAL(rtn, 19);
117 if (rtn)
119
120
122 band,
123 10, 10,
124 0, 0,
125 1,
126 &npixels
127 );
128 CU_ASSERT_EQUAL(rtn, 1);
129 if (rtn)
131
132
134 band,
135 11, 11,
136 1, 1,
137 1,
138 &npixels
139 );
140 CU_ASSERT_EQUAL(rtn, 0);
141 if (rtn)
143
144
146 band,
147 -1, -1,
148 0, 0,
149 1,
150 &npixels
151 );
152 CU_ASSERT_EQUAL(rtn, 3);
153 if (rtn)
155
156
158 band,
159 -1, -1,
160 1, 1,
161 1,
162 &npixels
163 );
164 CU_ASSERT_EQUAL(rtn, 0);
165 if (rtn)
167
168
170 band,
171 -1, 1,
172 1, 1,
173 1,
174 &npixels
175 );
176 CU_ASSERT_EQUAL(rtn, 2);
177
179 npixels, rtn, NULL,
180 -1, 1,
181 1, 1,
182 &value,
183 &nodata,
184 &dimx, &dimy
185 );
188 CU_ASSERT_EQUAL(dimx, 3);
189 CU_ASSERT_EQUAL(dimy, 3);
190
191 for (x = 0;
x < dimx;
x++) {
194 }
195
198
199
201 band,
202 -2, 2,
203 1, 1,
204 1,
205 &npixels
206 );
207 CU_ASSERT_EQUAL(rtn, 0);
208 if (rtn)
210
211
213 band,
214 -10, 2,
215 3, 3,
216 1,
217 &npixels
218 );
219 CU_ASSERT_EQUAL(rtn, 0);
220 if (rtn)
222
223
225 band,
226 -10, 2,
227 3, 3,
228 0,
229 &npixels
230 );
231 CU_ASSERT_EQUAL(rtn, 48);
232 if (rtn)
234
235
237 band,
238 4, 4,
239 3, 2,
240 1,
241 &npixels
242 );
243 CU_ASSERT_EQUAL(rtn, 27);
244 if (rtn)
246
247
249 band,
250 2, 7,
251 3, 1,
252 1,
253 &npixels
254 );
255 CU_ASSERT_EQUAL(rtn, 13);
256 if (rtn)
258
259
261 band,
262 10,10,
263 1, 3,
264 1,
265 &npixels
266 );
267 CU_ASSERT_EQUAL(rtn, 3);
268 if (rtn)
270
271
273 CU_ASSERT(band != NULL);
274
275
277 band,
278 0, 0,
279 0, 0,
280 1,
281 &npixels
282 );
283 CU_ASSERT_EQUAL(rtn, 8);
284 if (rtn)
286
288}
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)