74 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
75 pgraster = (
rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
78 bandindex = PG_GETARG_INT32(1);
79 if ( bandindex < 1 ) {
80 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
81 PG_FREE_IF_COPY(pgraster, 0);
87 PG_FREE_IF_COPY(pgraster, 0);
88 elog(ERROR,
"RASTER_getBandPixelType: Could not deserialize raster");
95 elog(NOTICE,
"Could not find raster band of index %d when getting pixel type. Returning NULL", bandindex);
97 PG_FREE_IF_COPY(pgraster, 0);
104 PG_FREE_IF_COPY(pgraster, 0);
106 PG_RETURN_INT32(pixtype);
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
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.