From 0d06e63fcd521d24b7e9f4ad6789ba39f3c602e6 Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Fri, 27 Jul 2012 22:49:13 +0000 Subject: [PATCH] Expanded on comments about things to keep in mind when using rt_band_set_pixel_line() git-svn-id: http://svn.osgeo.org/postgis/trunk@10132 b70326c6-7e19-0410-871a-916f4a2858ee --- raster/rt_core/rt_api.c | 6 ++++++ raster/rt_core/rt_api.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/raster/rt_core/rt_api.c b/raster/rt_core/rt_api.c index 3b31d2de1..f3f8baf56 100644 --- a/raster/rt_core/rt_api.c +++ b/raster/rt_core/rt_api.c @@ -1914,6 +1914,12 @@ rt_band_set_nodata(rt_band band, double val) { * values in vals are expected to be of the band's pixel type * as this function uses memcpy. * + * It is important to be careful when using this function as + * the number of values being set may exceed a pixel "row". + * Remember that the band values are stored in a stream (1-D array) + * regardless of what the raster's width and height might be. + * So, setting a number of values may cross multiple pixel "rows". + * * @param band : the band to set value to * @param x : X coordinate (0-based) * @param y : Y coordinate (0-based) diff --git a/raster/rt_core/rt_api.h b/raster/rt_core/rt_api.h index 144d8ec07..26e72a3f8 100644 --- a/raster/rt_core/rt_api.h +++ b/raster/rt_core/rt_api.h @@ -541,6 +541,12 @@ double rt_band_get_nodata(rt_band band); * values in vals are expected to be of the band's pixel type * as this function uses memcpy. * + * It is important to be careful when using this function as + * the number of values being set may exceed a pixel "row". + * Remember that the band values are stored in a stream (1-D array) + * regardless of what the raster's width and height might be. + * So, setting a number of values may cross multiple pixel "rows". + * * @param band : the band to set value to * @param x : X coordinate (0-based) * @param y : Y coordinate (0-based) -- 2.50.1