[GRASS-SVN] r38109 - in grass/trunk: display/d.colors display/d.legend display/d.rast.num display/d.vect include lib/display lib/ogsf lib/raster ps/ps.map raster/r.colors.out raster/r.le/r.le.patch raster/r.out.gdal raster/r.out.tiff raster/r.patch raster/r.profile raster/r.resample raster/r.watershed/ram raster/r.watershed/seg raster/r.what raster/r.what.color

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 28 15:00:33 EDT 2009


Author: martinl
Date: 2009-06-28 15:00:33 -0400 (Sun, 28 Jun 2009)
New Revision: 38109

Modified:
   grass/trunk/display/d.colors/interact.c
   grass/trunk/display/d.colors/tbl_toggle.c
   grass/trunk/display/d.legend/main.c
   grass/trunk/display/d.rast.num/main.c
   grass/trunk/display/d.vect/area.c
   grass/trunk/display/d.vect/plot1.c
   grass/trunk/include/raster.h
   grass/trunk/lib/display/raster2.c
   grass/trunk/lib/ogsf/Gp3.c
   grass/trunk/lib/ogsf/Gs3.c
   grass/trunk/lib/ogsf/Gvl3.c
   grass/trunk/lib/ogsf/gsd_legend.c
   grass/trunk/lib/raster/color_get.c
   grass/trunk/lib/raster/color_range.c
   grass/trunk/lib/raster/color_read.c
   grass/trunk/lib/raster/color_rule.c
   grass/trunk/lib/raster/color_write.c
   grass/trunk/lib/raster/color_xform.c
   grass/trunk/ps/ps.map/ps_clrtbl.c
   grass/trunk/ps/ps.map/ps_fclrtbl.c
   grass/trunk/ps/ps.map/ps_raster.c
   grass/trunk/ps/ps.map/r_cell.c
   grass/trunk/raster/r.colors.out/main.c
   grass/trunk/raster/r.le/r.le.patch/trace.c
   grass/trunk/raster/r.out.gdal/export_band.c
   grass/trunk/raster/r.out.tiff/main.c
   grass/trunk/raster/r.patch/support.c
   grass/trunk/raster/r.profile/read_rast.c
   grass/trunk/raster/r.resample/main.c
   grass/trunk/raster/r.watershed/ram/close_maps2.c
   grass/trunk/raster/r.watershed/seg/close_maps2.c
   grass/trunk/raster/r.what.color/main.c
   grass/trunk/raster/r.what/main.c
Log:
rasterlib: fns from color_get.c renamed, see
http://trac.osgeo.org/grass/wiki/Grass7/RasterLib


Modified: grass/trunk/display/d.colors/interact.c
===================================================================
--- grass/trunk/display/d.colors/interact.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/display/d.colors/interact.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -43,7 +43,7 @@
 
     colors_changed = 0;
     Rast_set_c_null_value(&at_cat, 1);
-    Rast_get_color(at_cat, &cur_red, &cur_grn, &cur_blu, colors);
+    Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
     shift_incr = 10;
 
     Initialize_curses();
@@ -88,7 +88,7 @@
 	case 'd':
 	case 'u':
 	    if (hi_mode && !hi_save_mode) {
-		Rast_get_color(at_cat, &cur_red, &cur_grn, &cur_blu, colors);
+		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
 	    }
 	    /*              tmark_category(at_cat, 0) ; */
 	    if (Rast_is_c_null_value(&at_cat))
@@ -128,7 +128,7 @@
 		}
 	    }
 	    else {
-		Rast_get_color(at_cat, &cur_red, &cur_grn, &cur_blu, colors);
+		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
 	    }
 
 	    WRITE_CATS;
@@ -171,7 +171,7 @@
 		}
 	    }
 	    else {
-		Rast_get_color(at_cat, &cur_red, &cur_grn, &cur_blu, colors);
+		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
 		switch (cur_char) {
 		case 'r':
 		    cur_red = shift_color(cur_red, -shift_incr);
@@ -251,7 +251,7 @@
 	case 'h':
 	case 'H':
 	    if (hi_mode) {
-		Rast_get_color(at_cat, &cur_red, &cur_grn, &cur_blu, colors);
+		Rast_get_c_color(&at_cat, &cur_red, &cur_grn, &cur_blu, colors);
 		hi_mode = 0;
 		hi_save_mode = 0;
 	    }

Modified: grass/trunk/display/d.colors/tbl_toggle.c
===================================================================
--- grass/trunk/display/d.colors/tbl_toggle.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/display/d.colors/tbl_toggle.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -9,7 +9,7 @@
     char *msg = '\0';
     char info[100];
 
-    Rast_get_color_range(&min, &max, colors);
+    Rast_get_c_color_range(&min, &max, colors);
     Rast_free_colors(colors);
     sprintf(info, "Color range: %d to %d\n", min, max);
 

Modified: grass/trunk/display/d.legend/main.c
===================================================================
--- grass/trunk/display/d.legend/main.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/display/d.legend/main.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -327,7 +327,7 @@
 	if (Rast_is_c_null_value(&min_ind))
 	    G_fatal_error(_("Input map contains no data"));
 
-	Rast_get_color_range(&min_colr, &max_colr, &colors);
+	Rast_get_c_color_range(&min_colr, &max_colr, &colors);
 
 	if (UserRange) {
 	    if (min_ind < UserRangeMin)

Modified: grass/trunk/display/d.rast.num/main.c
===================================================================
--- grass/trunk/display/d.rast.num/main.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/display/d.rast.num/main.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -233,7 +233,7 @@
 	for (col = 0; col < ncols; col++) {
 
 	    if (fixed_color == 0) {
-		Rast_get_raster_color(&cell[col], &R, &G, &B, &colors, map_type);
+		Rast_get_color(&cell[col], &R, &G, &B, &colors, map_type);
 		D_RGB_color(R, G, B);
 	    }
 

Modified: grass/trunk/display/d.vect/area.c
===================================================================
--- grass/trunk/display/d.vect/area.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/display/d.vect/area.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -243,7 +243,7 @@
 		    Points->z[0]);
 	    rgb = 1;
 	    Rast_make_fp_colors(&colors, style, box.B, box.T);
-	    Rast_get_raster_color(&zval, &red, &grn, &blu, &colors, DCELL_TYPE);
+	    Rast_get_color(&zval, &red, &grn, &blu, &colors, DCELL_TYPE);
 	    G_debug(3, "b %d, g: %d, r %d", blu, grn, red);
 	}
 

Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/display/d.vect/plot1.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -258,7 +258,7 @@
 		    cat, Points->x[0], Points->y[0], Points->z[0]);
 	    custom_rgb = TRUE;
 	    Rast_make_fp_colors(&colors, style, box.B, box.T);
-	    Rast_get_raster_color(&zval, &red, &grn, &blu, &colors, DCELL_TYPE);
+	    Rast_get_color(&zval, &red, &grn, &blu, &colors, DCELL_TYPE);
 	    G_debug(3, "b %d, g: %d, r %d", blu, grn, red);
 	}
 

Modified: grass/trunk/include/raster.h
===================================================================
--- grass/trunk/include/raster.h	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/include/raster.h	2009-06-28 19:00:33 UTC (rev 38109)
@@ -114,12 +114,11 @@
 void Rast__color_reset(struct Colors *);
 
 /* color_get.c */
-int Rast_get_color(CELL, int *, int *, int *, struct Colors *);
-int Rast_get_raster_color(const void *, int *, int *, int *, struct Colors *,
-		       RASTER_MAP_TYPE);
-int Rast_get_c_raster_color(const CELL *, int *, int *, int *, struct Colors *);
-int Rast_get_f_raster_color(const FCELL *, int *, int *, int *, struct Colors *);
-int Rast_get_d_raster_color(const DCELL *, int *, int *, int *, struct Colors *);
+int Rast_get_color(const void *, int *, int *, int *, struct Colors *,
+		   RASTER_MAP_TYPE);
+int Rast_get_c_color(const CELL *, int *, int *, int *, struct Colors *);
+int Rast_get_f_color(const FCELL *, int *, int *, int *, struct Colors *);
+int Rast_get_d_color(const DCELL *, int *, int *, int *, struct Colors *);
 void Rast_get_null_value_color(int *, int *, int *, const struct Colors *);
 void Rast_get_default_color(int *, int *, int *, const struct Colors *);
 
@@ -166,7 +165,7 @@
 /* color_range.c */
 void Rast_set_color_range(CELL, CELL, struct Colors *);
 void Rast_set_d_color_range(DCELL, DCELL, struct Colors *);
-void Rast_get_color_range(CELL *, CELL *, const struct Colors *);
+void Rast_get_c_color_range(CELL *, CELL *, const struct Colors *);
 void Rast_get_d_color_range(DCELL *, DCELL *, const struct Colors *);
 
 /* color_read.c */

Modified: grass/trunk/lib/display/raster2.c
===================================================================
--- grass/trunk/lib/display/raster2.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/display/raster2.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -137,7 +137,7 @@
 {
     int r, g, b;
 
-    Rast_get_raster_color(raster, &r, &g, &b, colors, data_type);
+    Rast_get_color(raster, &r, &g, &b, colors, data_type);
     D_RGB_color((unsigned char)r, (unsigned char)g, (unsigned char)b);
 
     return 0;

Modified: grass/trunk/lib/ogsf/Gp3.c
===================================================================
--- grass/trunk/lib/ogsf/Gp3.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/ogsf/Gp3.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -62,7 +62,7 @@
 	    cat = (int)tp->fattr;
 	    color = NULL_COLOR;
 
-	    if (Rast_get_color(cat, &r, &g, &b, &sc)) {
+	    if (Rast_get_c_color(&cat, &r, &g, &b, &sc)) {
 		color = (r & 0xff) | ((g & 0xff) << 8) | ((b & 0xff) << 16);
 	    }
 

Modified: grass/trunk/lib/ogsf/Gs3.c
===================================================================
--- grass/trunk/lib/ogsf/Gs3.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/ogsf/Gs3.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -642,7 +642,7 @@
     }
 
     Rast_read_colors(filename, mapset, &colrules);
-    Rast_get_color_range(&min, &max, &colrules);
+    Rast_get_c_color_range(&min, &max, &colrules);
 
     if (min < 0 || max > 255) {
 	G_warning(_("Color table range doesn't match data (mincol=%d, maxcol=%d"),

Modified: grass/trunk/lib/ogsf/Gvl3.c
===================================================================
--- grass/trunk/lib/ogsf/Gvl3.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/ogsf/Gvl3.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -83,6 +83,6 @@
 {
     int r, g, b;
 
-    Rast_get_f_raster_color((FCELL *) value, &r, &g, &b, color_data);
+    Rast_get_f_color((FCELL *) value, &r, &g, &b, color_data);
     return ((r & 0xff) | ((g & 0xff) << 8) | ((b & 0xff) << 16));
 }

Modified: grass/trunk/lib/ogsf/gsd_legend.c
===================================================================
--- grass/trunk/lib/ogsf/gsd_legend.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/ogsf/gsd_legend.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -515,10 +515,10 @@
 	    }
 	    if (k == 0 || tdcell != pdcell) {
 		if (is_fp)
-		    Rast_get_d_raster_color(&tdcell,
+		    Rast_get_d_color(&tdcell,
 					 &red, &green, &blue, &colors);
 		else
-		    Rast_get_color((CELL) tdcell, &red, &green, &blue, &colors);
+		    Rast_get_c_color((CELL *)&tdcell, &red, &green, &blue, &colors);
 
 		RGB_TO_INT(red, green, blue, colr);
 		if (discrete) {	/* draw black-white-black separator */

Modified: grass/trunk/lib/raster/color_get.c
===================================================================
--- grass/trunk/lib/raster/color_get.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/raster/color_get.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -15,45 +15,16 @@
 #include <grass/raster.h>
 
 /*!
- * \brief Get a category color.
+ * \brief Gets color from raster map
  *
- * \todo To be removed, replaced by Rast_get_raster_color().
+ * Looks up the rgb colors for <i>rast</i> in the color table
+ * <i>colors</i>.
  *
  * The <i>red, green</i>, and <i>blue</i> intensities for the color
  * associated with category <i>n</i> are extracted from the
  * <i>colors</i> structure. The intensities will be in the range 0 ­-
  * 255. Also works for null cells.
  *
- * \param n cell to get color from
- * \param[out] red red value
- * \param[out] grn green value
- * \param[out] blu blue value
- * \param colors pointer to Colors structure which holds color info
- *
- * \return 1 if color is set
- * \return 0 if color is not set
- */
-int Rast_get_color(CELL n, int *red, int *grn, int *blu, struct Colors *colors)
-{
-    CELL cat;
-    unsigned char r, g, b, set;
-
-    cat = n;
-    Rast_lookup_colors(&cat, &r, &g, &b, &set, 1, colors);
-
-    *red = (int)r;
-    *grn = (int)g;
-    *blu = (int)b;
-
-    return (int)set;
-}
-
-/*!
- * \brief Gets color from raster map
- *
- * Looks up the rgb colors for <i>rast</i> in the color table
- * <i>colors</i>.
- *
  * \param rast raster cell value
  * \param[out] red red value
  * \param[out] grn green value
@@ -64,9 +35,9 @@
  * \return 1 if color is set
  * \return 0 if color is not set
  */
-int Rast_get_raster_color(const void *rast,
-		       int *red, int *grn, int *blu,
-		       struct Colors *colors, RASTER_MAP_TYPE map_type)
+int Rast_get_color(const void *rast,
+		   int *red, int *grn, int *blu,
+		   struct Colors *colors, RASTER_MAP_TYPE map_type)
 {
     unsigned char r, g, b, set;
 
@@ -94,10 +65,10 @@
  * \return 1 if color is set
  * \return 0 if color is not set
  */
-int Rast_get_c_raster_color(const CELL * rast,
-			 int *red, int *grn, int *blu, struct Colors *colors)
+int Rast_get_c_color(const CELL *rast,
+		     int *red, int *grn, int *blu, struct Colors *colors)
 {
-    return Rast_get_raster_color(rast, red, grn, blu, colors, CELL_TYPE);
+    return Rast_get_color(rast, red, grn, blu, colors, CELL_TYPE);
 }
 
 /*!
@@ -115,10 +86,10 @@
  * \return 1 if color is set
  * \return 0 if color is not set
  */
-int Rast_get_f_raster_color(const FCELL * rast,
-			 int *red, int *grn, int *blu, struct Colors *colors)
+int Rast_get_f_color(const FCELL *rast,
+		     int *red, int *grn, int *blu, struct Colors *colors)
 {
-    return Rast_get_raster_color(rast, red, grn, blu, colors, FCELL_TYPE);
+    return Rast_get_color(rast, red, grn, blu, colors, FCELL_TYPE);
 }
 
 /*!
@@ -136,10 +107,10 @@
  * \return 1 if color is set
  * \return 0 if color is not set
  */
-int Rast_get_d_raster_color(const DCELL * rast,
-			 int *red, int *grn, int *blu, struct Colors *colors)
+int Rast_get_d_color(const DCELL *rast,
+		     int *red, int *grn, int *blu, struct Colors *colors)
 {
-    return Rast_get_raster_color(rast, red, grn, blu, colors, DCELL_TYPE);
+    return Rast_get_color(rast, red, grn, blu, colors, DCELL_TYPE);
 }
 
 /*!
@@ -154,7 +125,7 @@
  * \param colors pointer to Colors structure which holds color info
  */
 void Rast_get_null_value_color(int *red, int *grn, int *blu,
-			   const struct Colors *colors)
+			       const struct Colors *colors)
 {
     if (colors->null_set) {
 	*red = (int)colors->null_red;
@@ -182,7 +153,7 @@
  * \param colors pointer to Colors structure which holds color info
  */
 void Rast_get_default_color(int *red, int *grn, int *blu,
-			 const struct Colors *colors)
+			    const struct Colors *colors)
 {
     if (colors->undef_set) {
 	*red = (int)colors->undef_red;

Modified: grass/trunk/lib/raster/color_range.c
===================================================================
--- grass/trunk/lib/raster/color_range.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/raster/color_range.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -64,7 +64,7 @@
   \param[out] min,max minimum and maximum value
   \param colors pointer to Colors structure which holds color info
  */
-void Rast_get_color_range(CELL * min, CELL * max, const struct Colors *colors)
+void Rast_get_c_color_range(CELL * min, CELL * max, const struct Colors *colors)
 {
     if (!colors->is_float) {
 	*min = (CELL) floor(colors->cmin);

Modified: grass/trunk/lib/raster/color_read.c
===================================================================
--- grass/trunk/lib/raster/color_read.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/raster/color_read.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -380,7 +380,7 @@
  * Sets a flag in the <i>colors</i> structure that indicates that
  * these colors should only be looked up using floating-point raster
  * data (not integer data). In particular if this flag is set, the
- * routine Rast_get_colors_min_max() should return min=-255$^3$ and
+ * routine Rast_get_c_colors_min_max() should return min=-255$^3$ and
  * max=255$^3$.
  *
  * \param colors pointer to Colors structure

Modified: grass/trunk/lib/raster/color_rule.c
===================================================================
--- grass/trunk/lib/raster/color_rule.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/raster/color_rule.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -125,7 +125,7 @@
  * <b>r1,g1,b1</b> and <b>r2,g2,b2</b> are assigned to <b>cat1</b> and
  * <b>cat2</b> respectively. Colors for data values between <b>cat1</b> and
  * <b>cat2</b> are not stored in the structure but are interpolated when
- * queried by <i>Rast_lookup_colors</i> and<i>Rast_get_color.</i> The color
+ * queried by <i>Rast_lookup_colors</i> and<i>Rast_get_c_color.</i> The color
  * components <b>r1,g1,b1</b> and <b>r2,g2,b2</b> must be in the range
  * 0 -- 255.
  * For example, to create a linear grey scale for the range 200 -- 1000:

Modified: grass/trunk/lib/raster/color_write.c
===================================================================
--- grass/trunk/lib/raster/color_write.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/raster/color_write.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -229,11 +229,12 @@
     CELL cat;
 
     fprintf(fd, "#%ld first color\n", (long)colors->cmin);
-    Rast_get_color((CELL) 0, &red, &grn, &blu, colors);
+    cat = 0;
+    Rast_get_c_color(&cat, &red, &grn, &blu, colors);
     fprintf(fd, "%d %d %d\n", red, grn, blu);
 
     for (cat = colors->cmin; cat <= colors->cmax; cat++) {
-	Rast_get_color(cat, &red, &grn, &blu, colors);
+	Rast_get_c_color(&cat, &red, &grn, &blu, colors);
 	fprintf(fd, "%d", red);
 	if (red != grn || red != blu)
 	    fprintf(fd, " %d %d", grn, blu);

Modified: grass/trunk/lib/raster/color_xform.c
===================================================================
--- grass/trunk/lib/raster/color_xform.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/lib/raster/color_xform.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -101,7 +101,7 @@
 	    continue;
 
 	x = min + (max - min) * (sum + count / 2.0) / total;
-	Rast_get_d_raster_color(&x, &red2, &grn2, &blu2, src);
+	Rast_get_d_color(&x, &red2, &grn2, &blu2, src);
 
 	if (!first)
 	    Rast_add_color_rule(prev, red, grn, blu, cat, red2, grn2, blu2, dst);
@@ -168,7 +168,7 @@
 	if (statf->flip)
 	    val2 = -val2;
 	x = min + (max - min) * sum / statf->total;
-	Rast_get_d_raster_color(&x, &red2, &grn2, &blu2, src);
+	Rast_get_d_color(&x, &red2, &grn2, &blu2, src);
 
 	if (!first)
 	    Rast_add_d_raster_color_rule(&val, red, grn, blu, &val2, red2, grn2, blu2, dst);
@@ -222,7 +222,7 @@
 	DCELL x, y;
 
 	y = min + (max - min) * i / samples;
-	Rast_get_d_raster_color(&y, &red2, &grn2, &blu2, src);
+	Rast_get_d_color(&y, &red2, &grn2, &blu2, src);
 
 	if (i == 0)
 	    x = min;
@@ -286,7 +286,7 @@
 	DCELL x, y;
 
 	y = min + (max - min) * i / samples;
-	Rast_get_d_raster_color(&y, &red2, &grn2, &blu2, src);
+	Rast_get_d_color(&y, &red2, &grn2, &blu2, src);
 
 	if (i == 0)
 	    x = 1;

Modified: grass/trunk/ps/ps.map/ps_clrtbl.c
===================================================================
--- grass/trunk/ps/ps.map/ps_clrtbl.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/ps/ps.map/ps_clrtbl.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -149,7 +149,7 @@
 		if (!i)
 		    Rast_get_null_value_color(&R, &G, &B, &colors);
 		else
-		    Rast_get_d_raster_color(&dmin, &R, &G, &B, &colors);
+		    Rast_get_d_color(&dmin, &R, &G, &B, &colors);
 
 		if (do_color)
 		    fprintf(PS.fp, "%.3f %.3f %.3f C\n",
@@ -180,7 +180,7 @@
 		    /* set box fill color */
 		    val = dmin + (double)jj *(dmax - dmin) / NSTEPS;
 
-		    Rast_get_d_raster_color(&val, &R, &G, &B, &colors);
+		    Rast_get_d_color(&val, &R, &G, &B, &colors);
 		    fprintf(PS.fp, "%.3f %.3f %.3f C\n",
 			    (double)R / 255., (double)G / 255.,
 			    (double)B / 255.);

Modified: grass/trunk/ps/ps.map/ps_fclrtbl.c
===================================================================
--- grass/trunk/ps/ps.map/ps_fclrtbl.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/ps/ps.map/ps_fclrtbl.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -133,7 +133,7 @@
     for (i = 0; i < ncols; i++) {
 	/*      val = dmin + i * step;   flip */
 	val = dmax - i * step;
-	Rast_get_d_raster_color(&val, &R, &G, &B, &colors);
+	Rast_get_d_color(&val, &R, &G, &B, &colors);
 
 	if (do_color)
 	    fprintf(PS.fp, "%.3f %.3f %.3f C\n", (double)R / 255.,

Modified: grass/trunk/ps/ps.map/ps_raster.c
===================================================================
--- grass/trunk/ps/ps.map/ps_raster.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/ps/ps.map/ps_raster.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -116,7 +116,7 @@
 	    if ((row % PS.row_delta) == 0) {
 		ptr = cellbuf;
 		for (col = 0; col < PS.w.cols; col += PS.col_delta) {
-		    Rast_get_raster_color(ptr, &r, &g, &b, &PS.colors, map_type);
+		    Rast_get_color(ptr, &r, &g, &b, &PS.colors, map_type);
 
 		    /* if color raster */
 		    if (doing_color) {
@@ -162,7 +162,7 @@
 	    if ((row % PS.row_delta) == 0) {
 		for (col = 0; col < PS.w.cols; col += PS.col_delta) {
 		    for (i = 0; i < 3; i++) {
-			Rast_get_raster_color(cptr[i], &rr, &gg, &bb,
+			Rast_get_color(cptr[i], &rr, &gg, &bb,
 					   &(grp.colors[i]), grp_map_type[i]);
 			if (i == 0)
 			    r = rr;

Modified: grass/trunk/ps/ps.map/r_cell.c
===================================================================
--- grass/trunk/ps/ps.map/r_cell.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/ps/ps.map/r_cell.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -27,7 +27,7 @@
 	error(fullname, "", "can't read color table");
 	return 0;
     }
-    Rast_get_color_range(&PS.min_color, &PS.max_color, &PS.colors);
+    Rast_get_c_color_range(&PS.min_color, &PS.max_color, &PS.colors);
 
     /* open raster map for reading */
     if ((PS.cell_fd = Rast_open_cell_old(name, mapset)) < 0) {

Modified: grass/trunk/raster/r.colors.out/main.c
===================================================================
--- grass/trunk/raster/r.colors.out/main.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.colors.out/main.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -103,7 +103,7 @@
 	/* 3.0 format */
 	CELL lo, hi;
 
-	Rast_get_color_range(&lo, &hi, &colors);
+	Rast_get_c_color_range(&lo, &hi, &colors);
 
 	for (i = lo; i <= hi; i++) {
 	    unsigned char r, g, b, set;

Modified: grass/trunk/raster/r.le/r.le.patch/trace.c
===================================================================
--- grass/trunk/raster/r.le/r.le.patch/trace.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.le/r.le.patch/trace.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -393,7 +393,7 @@
 
 		Rast_read_range("interior", mapset, &range);
 		Rast_get_range_min_max(&range, &min, &max);
-		Rast_get_color_range(&cmin, &cmax, &colr);
+		Rast_get_c_color_range(&cmin, &cmax, &colr);
 		if (min > cmin)
 		    cmin = min;
 		if (max < cmax)
@@ -406,7 +406,7 @@
 
 		Rast_read_fp_range("interior", mapset, &fprange);
 		Rast_get_fp_range_min_max(&fprange, &dmin, &dmax);
-		Rast_get_color_range(&cmin, &cmax, &colr);
+		Rast_get_c_color_range(&cmin, &cmax, &colr);
 		if (dmin > cmin)
 		    cmin = dmin;
 		if (dmax < cmax)

Modified: grass/trunk/raster/r.out.gdal/export_band.c
===================================================================
--- grass/trunk/raster/r.out.gdal/export_band.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.out.gdal/export_band.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -85,7 +85,7 @@
 	char key[200], value[200];
 	int rcount;
 
-	Rast_get_color_range(&min, &max, &sGrassColors);
+	Rast_get_c_color_range(&min, &max, &sGrassColors);
 	if (bHaveMinMax) {
 	    if (max < dfCellMax) {
 		maxcolor = max;
@@ -122,15 +122,15 @@
 		int nRed, nGreen, nBlue;
 		GDALColorEntry sColor;
 
-		if (Rast_get_color
-		    (iColor, &nRed, &nGreen, &nBlue, &sGrassColors)) {
+		if (Rast_get_c_color(&iColor, &nRed, &nGreen, &nBlue,
+				     &sGrassColors)) {
 		    sColor.c1 = nRed;
 		    sColor.c2 = nGreen;
 		    sColor.c3 = nBlue;
 		    sColor.c4 = 255;
 
 		    G_debug(3,
-			    "Rast_get_color: Y, rcount %d, nRed %d, nGreen %d, nBlue %d",
+			    "Rast_get_c_color: Y, rcount %d, nRed %d, nGreen %d, nBlue %d",
 			    rcount, nRed, nGreen, nBlue);
 		    GDALSetColorEntry(hCT, iColor, &sColor);
 		}
@@ -141,7 +141,7 @@
 		    sColor.c4 = 0;
 
 		    G_debug(3,
-			    "Rast_get_color: N, rcount %d, nRed %d, nGreen %d, nBlue %d",
+			    "Rast_get_c_color: N, rcount %d, nRed %d, nGreen %d, nBlue %d",
 			    rcount, nRed, nGreen, nBlue);
 		    GDALSetColorEntry(hCT, iColor, &sColor);
 		}

Modified: grass/trunk/raster/r.out.tiff/main.c
===================================================================
--- grass/trunk/raster/r.out.tiff/main.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.out.tiff/main.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -201,7 +201,7 @@
 #define	SCALE(x)	(((x)*((1L<<16)-1))/255)
 
 	for (i = colors.cmin; i <= colors.cmax; i++, redp++, grnp++, blup++) {
-	    Rast_get_color(i, &red, &grn, &blu, &colors);
+	    Rast_get_c_color(&i, &red, &grn, &blu, &colors);
 	    *redp = (unsigned short) (SCALE(red));
 	    *grnp = (unsigned short) (SCALE(grn));
 	    *blup = (unsigned short) (SCALE(blu));
@@ -290,8 +290,8 @@
 		    }
 		    else {
 			for (j = 0; j < width; j++) {
-			    Rast_get_color(cellptr[col + j], &red, &grn, &blu,
-					&colors);
+			    Rast_get_c_color(&(cellptr[col + j]), &red, &grn, &blu,
+					     &colors);
 			    *tptr++ = (unsigned char) red;
 			    *tptr++ = (unsigned char) grn;
 			    *tptr++ = (unsigned char) blu;
@@ -350,7 +350,7 @@
 	    }
 	    else {
 		for (col = 0; col < h.ras_width; col++) {
-		    Rast_get_color(cell[col], &red, &grn, &blu, &colors);
+		    Rast_get_c_color(&(cell[col]), &red, &grn, &blu, &colors);
 		    *tmpptr++ = (unsigned char) red;
 		    *tmpptr++ = (unsigned char) grn;
 		    *tmpptr++ = (unsigned char) blu;

Modified: grass/trunk/raster/r.patch/support.c
===================================================================
--- grass/trunk/raster/r.patch/support.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.patch/support.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -53,7 +53,7 @@
 			Rast_set_c_cat(&n, &n, Rast_get_c_cat((CELL *) &n, &pcats), cats);
 		    }
 		    if (do_colr) {
-			Rast_get_color(n, &red, &grn, &blu, &pcolr);
+			Rast_get_c_color(&n, &red, &grn, &blu, &pcolr);
 			Rast_set_color(n, red, grn, blu, colr);
 		    }
 		}

Modified: grass/trunk/raster/r.profile/read_rast.c
===================================================================
--- grass/trunk/raster/r.profile/read_rast.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.profile/read_rast.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -62,9 +62,9 @@
 	int red, green, blue;
 
 	if (outofbounds)
-	    Rast_get_color(nullcell, &red, &green, &blue, &colors);
+	    Rast_get_c_color(&nullcell, &red, &green, &blue, &colors);
 	else
-	    Rast_get_d_raster_color(&dcell[col], &red, &green, &blue,
+	    Rast_get_d_color(&dcell[col], &red, &green, &blue,
 				 &colors);
 
 	fprintf(fp, " %03d:%03d:%03d", red, green, blue);

Modified: grass/trunk/raster/r.resample/main.c
===================================================================
--- grass/trunk/raster/r.resample/main.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.resample/main.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -159,7 +159,7 @@
 	    CELL min, max, cmin, cmax;
 
 	    Rast_get_range_min_max(&range, &min, &max);
-	    Rast_get_color_range(&cmin, &cmax, &colr);
+	    Rast_get_c_color_range(&cmin, &cmax, &colr);
 	    if (min > cmin)
 		cmin = min;
 	    if (max < cmax)

Modified: grass/trunk/raster/r.watershed/ram/close_maps2.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/close_maps2.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.watershed/ram/close_maps2.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -46,7 +46,7 @@
 			for (bl = 90 + incr; bl <= 255; bl += 40) {
 			    flag = 1;
 			    while (flag) {
-				Rast_get_color(r, &red, &green, &blue, &colors);
+				Rast_get_c_color(&r, &red, &green, &blue, &colors);
 				/* if existing rule is too dark then append a new
 				   rule to override it */
 				if ((blue * .11 + red * .30 + green * .59) <

Modified: grass/trunk/raster/r.watershed/seg/close_maps2.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/close_maps2.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.watershed/seg/close_maps2.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -39,7 +39,7 @@
 			for (bl = 90 + incr; bl <= 255; bl += 40) {
 			    flag = 1;
 			    while (flag) {
-				Rast_get_color(r, &red, &green, &blue, &colors);
+				Rast_get_c_color(&r, &red, &green, &blue, &colors);
 				/* if existing rule is too dark then append a new
 				   rule to override it */
 				if ((blue * .11 + red * .30 + green * .59) <

Modified: grass/trunk/raster/r.what/main.c
===================================================================
--- grass/trunk/raster/r.what/main.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.what/main.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -356,10 +356,10 @@
 		}
 		if (flag4->answer) {
 		    if (out_type[i] == CELL_TYPE)
-			Rast_get_c_raster_color(&cell[i][cache[point].col],
+			Rast_get_c_color(&cell[i][cache[point].col],
 					     &red, &green, &blue, &ncolor[i]);
 		    else
-			Rast_get_d_raster_color(&dcell[i][cache[point].col],
+			Rast_get_d_color(&dcell[i][cache[point].col],
 					     &red, &green, &blue, &ncolor[i]);
 
 		    sprintf(cache[point].clr_buf[i], "%03d:%03d:%03d", red,

Modified: grass/trunk/raster/r.what.color/main.c
===================================================================
--- grass/trunk/raster/r.what.color/main.c	2009-06-28 17:57:26 UTC (rev 38108)
+++ grass/trunk/raster/r.what.color/main.c	2009-06-28 19:00:33 UTC (rev 38109)
@@ -38,7 +38,7 @@
 	    fprintf(stdout, "*: *\n");
 	    return 0;
 	}
-	if (!Rast_get_c_raster_color(&ival, &red, &grn, &blu, colors)) {
+	if (!Rast_get_c_color(&ival, &red, &grn, &blu, colors)) {
 	    fprintf(stdout, "%d: *\n", ival);
 	    return 0;
 	}
@@ -53,7 +53,7 @@
 	    fprintf(stdout, "*: *\n");
 	    return 0;
 	}
-	if (!Rast_get_d_raster_color(&fval, &red, &grn, &blu, colors)) {
+	if (!Rast_get_d_color(&fval, &red, &grn, &blu, colors)) {
 	    fprintf(stdout, "%f: *\n", fval);
 	    return 0;
 	}



More information about the grass-commit mailing list