[GRASS-SVN] r68586 - in grass/trunk: include lib/raster lib/raster3d

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 2 19:46:29 PDT 2016


Author: wenzeslaus
Date: 2016-06-02 19:46:29 -0700 (Thu, 02 Jun 2016)
New Revision: 68586

Modified:
   grass/trunk/include/gis.h
   grass/trunk/lib/raster/color_read.c
   grass/trunk/lib/raster3d/color.c
Log:
change default color table for 2D and 3D rasters (see #3043)

Introduces DEFAULT_COLOR_TABLE define for
an easy change and global control.

Depends on r68506 which includes the
viridis color table used as a new default.

Also removes (obsolete?) calls to the
color table specific function and
uses the general function instead.


Modified: grass/trunk/include/gis.h
===================================================================
--- grass/trunk/include/gis.h	2016-06-02 20:50:01 UTC (rev 68585)
+++ grass/trunk/include/gis.h	2016-06-03 02:46:29 UTC (rev 68586)
@@ -340,6 +340,7 @@
 /* default colors */
 #define DEFAULT_FG_COLOR "black"
 #define DEFAULT_BG_COLOR "white"
+#define DEFAULT_COLOR_TABLE "viridis"
 
 /* error codes */
 #define G_FATAL_EXIT    0

Modified: grass/trunk/lib/raster/color_read.c
===================================================================
--- grass/trunk/lib/raster/color_read.c	2016-06-02 20:50:01 UTC (rev 68585)
+++ grass/trunk/lib/raster/color_read.c	2016-06-03 02:46:29 UTC (rev 68586)
@@ -87,7 +87,7 @@
 		Rast_get_range_min_max(&range, &min, &max);
 		if (!Rast_is_c_null_value(&min) &&
 		    !Rast_is_c_null_value(&max))
-		    Rast_make_rainbow_colors(colors, min, max);
+		    Rast_make_colors(colors, DEFAULT_COLOR_TABLE, min, max);
 		return 0;
 	    }
 	}
@@ -96,7 +96,7 @@
 		Rast_get_fp_range_min_max(&drange, &dmin, &dmax);
 		if (!Rast_is_d_null_value(&dmin) &&
 		    !Rast_is_d_null_value(&dmax))
-		    Rast_make_rainbow_fp_colors(colors, dmin, dmax);
+		    Rast_make_fp_colors(colors, DEFAULT_COLOR_TABLE, dmin, dmax);
 		return 0;
 	    }
 	}

Modified: grass/trunk/lib/raster3d/color.c
===================================================================
--- grass/trunk/lib/raster3d/color.c	2016-06-02 20:50:01 UTC (rev 68585)
+++ grass/trunk/lib/raster3d/color.c	2016-06-03 02:46:29 UTC (rev 68586)
@@ -57,7 +57,7 @@
 	if (Rast3d_read_range(name, mapset, &drange) >= 0) {
 	    Rast_get_fp_range_min_max(&drange, &dmin, &dmax);
 	    if (!Rast_is_d_null_value(&dmin) && !Rast_is_d_null_value(&dmax))
-		Rast_make_rainbow_fp_colors(colors, dmin, dmax);
+		Rast_make_fp_colors(colors, DEFAULT_COLOR_TABLE, dmin, dmax);
 	    return 0;
 	}
 	err = "missing";



More information about the grass-commit mailing list