[GRASS-SVN] r52207 - in grass/trunk/imagery: i.his.rgb i.rgb.his
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jun 25 12:57:03 PDT 2012
Author: glynn
Date: 2012-06-25 12:57:03 -0700 (Mon, 25 Jun 2012)
New Revision: 52207
Modified:
grass/trunk/imagery/i.his.rgb/his2rgb.c
grass/trunk/imagery/i.rgb.his/rgb2his.c
Log:
Propagate nulls
Modified: grass/trunk/imagery/i.his.rgb/his2rgb.c
===================================================================
--- grass/trunk/imagery/i.his.rgb/his2rgb.c 2012-06-25 12:26:12 UTC (rev 52206)
+++ grass/trunk/imagery/i.his.rgb/his2rgb.c 2012-06-25 19:57:03 UTC (rev 52207)
@@ -37,6 +37,15 @@
for (sample = 0; sample < columns; sample++) {
+ if (Rast_is_c_null_value(&rowbuffer[0][sample]) ||
+ Rast_is_c_null_value(&rowbuffer[1][sample]) ||
+ Rast_is_c_null_value(&rowbuffer[2][sample])) {
+ Rast_set_c_null_value(&rowbuffer[0][sample], 1);
+ Rast_set_c_null_value(&rowbuffer[1][sample], 1);
+ Rast_set_c_null_value(&rowbuffer[2][sample], 1);
+ continue;
+ }
+
red = green = blue = 0.0;
scalei = (double)rowbuffer[1][sample];
scalei /= 255.;
Modified: grass/trunk/imagery/i.rgb.his/rgb2his.c
===================================================================
--- grass/trunk/imagery/i.rgb.his/rgb2his.c 2012-06-25 12:26:12 UTC (rev 52206)
+++ grass/trunk/imagery/i.rgb.his/rgb2his.c 2012-06-25 19:57:03 UTC (rev 52207)
@@ -35,6 +35,15 @@
double hue = 0.0L; /* hue */
for (sample = 0; sample < columns; sample++) {
+ if (Rast_is_c_null_value(&rowbuffer[0][sample]) ||
+ Rast_is_c_null_value(&rowbuffer[1][sample]) ||
+ Rast_is_c_null_value(&rowbuffer[2][sample])) {
+ Rast_set_c_null_value(&rowbuffer[0][sample], 1);
+ Rast_set_c_null_value(&rowbuffer[1][sample], 1);
+ Rast_set_c_null_value(&rowbuffer[2][sample], 1);
+ continue;
+ }
+
scaler = (double)rowbuffer[0][sample];
scaler /= 255.0;
scaleg = (double)rowbuffer[1][sample];
More information about the grass-commit
mailing list