From: Bborie Park Date: Tue, 25 Sep 2012 17:20:17 +0000 (+0000) Subject: Additional documentation regarding memory ownership X-Git-Tag: 2.1.0beta2~622 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26852b6e48f7177bd4a2f468266a53d212114abe;p=postgis Additional documentation regarding memory ownership git-svn-id: http://svn.osgeo.org/postgis/trunk@10328 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_core/rt_api.c b/raster/rt_core/rt_api.c index 26c3b398e..0e3c4469d 100644 --- a/raster/rt_core/rt_api.c +++ b/raster/rt_core/rt_api.c @@ -7681,6 +7681,12 @@ rt_raster_serialized_size(rt_raster raster) { return size; } +/** + * Return this raster in serialized form. + * Memory (band data included) is copied from rt_raster. + * + * Serialized form is documented in doc/RFC1-SerializedFormat. + */ void* rt_raster_serialize(rt_raster raster) { uint32_t size = rt_raster_serialized_size(raster); @@ -7874,6 +7880,14 @@ rt_raster_serialize(rt_raster raster) { return ret; } +/** + * Return a raster from a serialized form. + * + * Serialized form is documented in doc/RFC1-SerializedFormat. + * + * NOTE: the raster will contain pointer to the serialized + * form (including band data), which must be kept alive. + */ rt_raster rt_raster_deserialize(void* serialized, int header_only) { rt_raster rast = NULL; diff --git a/raster/rt_core/rt_api.h b/raster/rt_core/rt_api.h index 656b49f01..b92962771 100644 --- a/raster/rt_core/rt_api.h +++ b/raster/rt_core/rt_api.h @@ -1264,9 +1264,9 @@ rt_raster_gdal_polygonize( /** * Return this raster in serialized form. + * Memory (band data included) is copied from rt_raster. * * Serialized form is documented in doc/RFC1-SerializedFormat. - * */ void* rt_raster_serialize(rt_raster raster); @@ -1276,11 +1276,10 @@ void* rt_raster_serialize(rt_raster raster); * Serialized form is documented in doc/RFC1-SerializedFormat. * * NOTE: the raster will contain pointer to the serialized - * form, which must be kept alive. + * form (including band data), which must be kept alive. */ rt_raster rt_raster_deserialize(void* serialized, int header_only); - /** * Return TRUE if the raster is empty. i.e. is NULL, width = 0 or height = 0 *