811 CU_ASSERT(
raster != NULL);
813 CU_ASSERT(
band != NULL);
816 for (
x = 0;
x < 100;
x++) {
817 for (
y = 0;
y < 10;
y++) {
823 CU_ASSERT_DOUBLE_EQUAL(nodata, 0, DBL_EPSILON);
826 CU_ASSERT(exprset != NULL);
828 for (i = 0; i < cnt; i++) {
830 CU_ASSERT(exprset[i] != NULL);
851 exprset[i]->
src.
max = 1000;
856 exprset[i]->
dst.
max = 255;
861 CU_ASSERT(newband != NULL);
865 CU_ASSERT_DOUBLE_EQUAL(val, 0, DBL_EPSILON);
869 CU_ASSERT_DOUBLE_EQUAL(val, 77, DBL_EPSILON);
873 CU_ASSERT_DOUBLE_EQUAL(val, 255, DBL_EPSILON);
875 for (i = cnt - 1; i >= 0; i--)
rtdealloc(exprset[i]);
rt_band rt_band_reclass(rt_band srcband, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, rt_reclassexpr *exprset, int exprcount)
Returns new band with values reclassified.
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.
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 rt_band_destroy(rt_band band)
Destroy a raster band.
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
void rtdealloc(void *mem)
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)
struct rt_reclassexpr_t::rt_reclassrange src
struct rt_reclassexpr_t::rt_reclassrange dst