PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ raster_destroy()

static void raster_destroy ( rt_raster  raster)
static

Definition at line 88 of file raster2pgsql.c.

88 {
89 uint16_t i;
90 uint16_t nbands = rt_raster_get_num_bands(raster);
91 for (i = 0; i < nbands; i++) {
92 rt_band band = rt_raster_get_band(raster, i);
93 if (band == NULL) continue;
94
95 if (!rt_band_is_offline(band) && !rt_band_get_ownsdata_flag(band)) {
96 void* mem = rt_band_get_data(band);
97 if (mem) rtdealloc(mem);
98 }
99 rt_band_destroy(band);
100 }
101 rt_raster_destroy(raster);
102}
void * rt_band_get_data(rt_band band)
Get pointer to raster band data.
Definition rt_band.c:559
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition rt_raster.c:86
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition rt_band.c:499
uint16_t rt_raster_get_num_bands(rt_raster raster)
Definition rt_raster.c:376
void rtdealloc(void *mem)
Definition rt_context.c:206
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 ...
Definition rt_band.c:818
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
Definition rt_band.c:488
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition rt_raster.c:385

References rt_band_destroy(), rt_band_get_data(), rt_band_get_ownsdata_flag(), rt_band_is_offline(), rt_raster_destroy(), rt_raster_get_band(), rt_raster_get_num_bands(), and rtdealloc().

Referenced by build_overview(), and convert_raster().

Here is the call graph for this function:
Here is the caller graph for this function: