81 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
82 pgraster = (
rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
85 bandindex = PG_GETARG_INT32(1);
86 if ( bandindex < 1 ) {
87 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
88 PG_FREE_IF_COPY(pgraster, 0);
94 PG_FREE_IF_COPY(pgraster, 0);
95 elog(ERROR,
"RASTER_getBandPixelType: Could not deserialize raster");
102 elog(NOTICE,
"Could not find raster band of index %d when getting pixel type. Returning NULL", bandindex);
104 PG_FREE_IF_COPY(pgraster, 0);
111 PG_FREE_IF_COPY(pgraster, 0);
113 PG_RETURN_INT32(pixtype);
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...