[GRASS-SVN] r47699 - grass/branches/develbranch_6/ps/ps.map
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Aug 17 08:45:59 EDT 2011
Author: hamish
Date: 2011-08-17 05:45:59 -0700 (Wed, 17 Aug 2011)
New Revision: 47699
Modified:
grass/branches/develbranch_6/ps/ps.map/ps_info.h
grass/branches/develbranch_6/ps/ps.map/ps_outline.c
Log:
full RGB support for raster clump outlining (#192)
Modified: grass/branches/develbranch_6/ps/ps.map/ps_info.h
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/ps_info.h 2011-08-17 12:45:12 UTC (rev 47698)
+++ grass/branches/develbranch_6/ps/ps.map/ps_info.h 2011-08-17 12:45:59 UTC (rev 47699)
@@ -50,7 +50,8 @@
int geogrid, geogrid_numbers, geogrid_fontsize;
PSCOLOR geogrid_color, geogrid_numbers_color;
double grid_width, geogrid_width;
- int do_outline, outline_color;
+ int do_outline;
+ PSCOLOR outline_color;
int cell_fd;
int row_delta, col_delta;
int cells_wide, cells_high;
Modified: grass/branches/develbranch_6/ps/ps.map/ps_outline.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/ps_outline.c 2011-08-17 12:45:12 UTC (rev 47698)
+++ grass/branches/develbranch_6/ps/ps.map/ps_outline.c 2011-08-17 12:45:59 UTC (rev 47699)
@@ -8,6 +8,7 @@
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
+#include "clr.h"
#include "local_proto.h"
static int k, col, row, top, bottom;
@@ -41,7 +42,7 @@
PS.cell_name, PS.cell_mapset);
/* set the outline color and width */
- set_rgb_color(PS.outline_color);
+ set_ps_color(&PS.outline_color);
set_line_width(PS.outline_width);
/* create temporary vector map containing outlines */
@@ -65,35 +66,43 @@
{
char buf[1024];
char ch, *key, *data;
- int color;
+ PSCOLOR color;
+ int ret, r, g, b;
PS.outline_width = 1.;
- color = BLACK;
+ set_color(&color, 0, 0, 0);
+
while (input(2, buf, help)) {
if (!key_data(buf, &key, &data))
continue;
+
if (KEY("color")) {
- color = get_color_number(data);
- if (color < 0) {
- color = BLACK;
- error(key, data, "illegal color request");
- }
+ ret = G_str_to_color(data, &r, &g, &b);
+ if (ret == 1)
+ set_color(&color, r, g, b);
+ else if (ret == 2) /* i.e. "none" */
+ /* unset_color(&color); */
+ error(key, data, _("Unsupported color request"));
+ else
+ error(key, data, _("illegal color request"));
+
continue;
}
+
if (KEY("width")) {
PS.outline_width = -1.;
ch = ' ';
if (sscanf(data, "%lf%c", &(PS.outline_width), &ch) < 1
|| PS.outline_width < 0.) {
PS.outline_width = 1.;
- error(key, data, "illegal width request");
+ error(key, data, _("illegal width request"));
}
if (ch == 'i')
PS.outline_width = PS.outline_width / 72.;
continue;
}
- error(key, data, "illegal outline sub-request");
- error(key, data, "illegal outline sub-request");
+
+ error(key, data, _("illegal outline sub-request"));
}
PS.outline_color = color;
PS.do_outline = 1;
More information about the grass-commit
mailing list