36 char *path =
"../regress/loader/testraster.tif";
43 CU_ASSERT(
data != NULL);
52 CU_ASSERT(
band != NULL);
84 CU_ASSERT_DOUBLE_EQUAL(val, 0, DBL_EPSILON);
90 CU_ASSERT_DOUBLE_EQUAL(val, 0, DBL_EPSILON);
111 CU_ASSERT(
band != NULL);
114 CU_ASSERT(
rast != NULL);
129 CU_ASSERT_EQUAL(extband, 2);
135 for (
x = 0;
x < width;
x++) {
136 for (
y = 0;
y < height;
y++) {
138 CU_ASSERT_DOUBLE_EQUAL(val, 0, 1.);
144 band->data.offline.mem = NULL;
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.
void rt_band_set_ownsdata_flag(rt_band band, int flag)
void * rtalloc(size_t size)
Wrappers used for managing memory.
uint16_t rt_band_get_width(rt_band band)
Return width of this band.
void rt_band_set_hasnodata_flag(rt_band band, int flag)
Set hasnodata flag 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).
rt_errorstate rt_band_load_offline_data(rt_band band)
Load offline band's data.
int rt_raster_add_band(rt_raster raster, rt_band band, int index)
Add band data to a raster.
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
int rt_band_get_isnodata_flag(rt_band band)
Get isnodata flag value.
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
uint64_t rt_band_get_file_size(rt_band band)
Return file size in bytes.
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
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_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.
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).
uint64_t rt_band_get_file_timestamp(rt_band band)
Return file timestamp.
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
void rtdealloc(void *mem)
void * rt_band_get_data(rt_band band)
Get pointer to raster band data.
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 ...
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
void rt_raster_set_offsets(rt_raster raster, double x, double y)
Set insertion points in projection units.
uint16_t rt_band_get_height(rt_band band)
Return height of this band.
void cu_free_raster(rt_raster raster)