35 char *path =
"../regress/loader/testraster.tif";
42 CU_ASSERT(data != NULL);
43 memset(data, 0,
sizeof(
uint8_t) * width * height);
51 CU_ASSERT(band != NULL);
80 CU_ASSERT_DOUBLE_EQUAL(val, 0, DBL_EPSILON);
86 CU_ASSERT_DOUBLE_EQUAL(val, 0, DBL_EPSILON);
107 CU_ASSERT(band != NULL);
110 CU_ASSERT(rast != NULL);
122 CU_ASSERT_EQUAL(extband, 2);
128 for (x = 0; x < width; x++) {
129 for (y = 0; y < height; y++) {
131 CU_ASSERT_DOUBLE_EQUAL(val, 0, 1.);
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
void * rtalloc(size_t size)
Wrappers used for managing memory.
rt_errorstate rt_band_set_nodata(rt_band band, double val, int *converted)
Set nodata 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.
const char * rt_band_get_ext_path(rt_band band)
Return band's external path (only valid when rt_band_is_offline returns non-zero).
void cu_free_raster(rt_raster raster)
void rt_band_set_ownsdata_flag(rt_band band, int flag)
int rt_band_get_ownsdata_flag(rt_band band)
Return 0 (FALSE) or non-zero (TRUE) indicating if rt_band is responsible for managing the memory for ...
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
void rt_raster_set_offsets(rt_raster raster, double x, double y)
Set insertion points in projection units.
rt_errorstate rt_band_load_offline_data(rt_band band)
Load offline band's data.
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
uint16_t rt_band_get_width(rt_band band)
Return width of this band.
uint16_t rt_band_get_height(rt_band band)
Return height of this band.
void * rt_band_get_data(rt_band band)
Get pointer to raster band data.
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
rt_band rt_band_new_inline(uint16_t width, uint16_t height, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, uint8_t *data)
Create an in-db rt_band with no data.
rt_errorstate rt_band_get_ext_band_num(rt_band band, uint8_t *bandnum)
Return bands' external band number (only valid when rt_band_is_offline returns non-zero).
void rt_band_set_hasnodata_flag(rt_band band, int flag)
Set hasnodata flag value.
void rtdealloc(void *mem)
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
int rt_raster_add_band(rt_raster raster, rt_band band, int index)
Add band data to a raster.
int rt_band_get_isnodata_flag(rt_band band)
Get isnodata flag value.
rt_band rt_band_new_offline(uint16_t width, uint16_t height, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, uint8_t bandNum, const char *path)
Create an out-db rt_band.