|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
/****************************************************************************
|
|
|
*
|
|
|
* MODULE: d.rgb
|
|
@@ -8,9 +7,10 @@
|
|
|
* Hamish Bowman <hamish_b yahoo.com>,
|
|
|
* Markus Neteler <neteler itc.it>,
|
|
|
* Radim Blazek <radim.blazek gmail.com>
|
|
|
- * PURPOSE: combine three rasters to form a colour image using red, green,
|
|
|
+ * Martin Landa <landa.martin gmail.com> (nulls opaque)
|
|
|
+ * PURPOSE: Combine three rasters to form a colour image using red, green,
|
|
|
* and blue display channels
|
|
|
- * COPYRIGHT: (C) 2001-2007 by the GRASS Development Team
|
|
|
+ * COPYRIGHT: (C) 2001-2007, 2010 by the GRASS Development Team
|
|
|
*
|
|
|
* This program is free software under the GNU General Public
|
|
|
* License (>=v2). Read the file COPYING that comes with GRASS
|
|
@@ -41,37 +41,35 @@ int main(int argc, char **argv)
|
|
|
struct band B[3];
|
|
|
int row;
|
|
|
int next_row;
|
|
|
+ int overlay;
|
|
|
struct Cell_head window;
|
|
|
struct GModule *module;
|
|
|
- struct Flag *flag_o;
|
|
|
+ struct Flag *flag_n;
|
|
|
int i;
|
|
|
|
|
|
G_gisinit(argv[0]);
|
|
|
|
|
|
module = G_define_module();
|
|
|
G_add_keyword(_("display"));
|
|
|
+ G_add_keyword(_("raster"));
|
|
|
+ G_add_keyword(_("RGB"));
|
|
|
module->description =
|
|
|
- _("Displays three user-specified raster map layers "
|
|
|
+ _("Displays three user-specified raster maps "
|
|
|
"as red, green, and blue overlays in the active graphics frame.");
|
|
|
|
|
|
- flag_o = G_define_flag();
|
|
|
- flag_o->key = 'o';
|
|
|
- flag_o->description = _("Overlay (non-null values only)");
|
|
|
+ flag_n = G_define_flag();
|
|
|
+ flag_n->key = 'n';
|
|
|
+ flag_n->description = _("Make null cells opaque");
|
|
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
char buff[80];
|
|
|
|
|
|
- sprintf(buff, _("Name of raster map to be used for <%s>"),
|
|
|
+ sprintf(buff, _("Name of raster map to be used for '%s'"),
|
|
|
color_names[i]);
|
|
|
|
|
|
- B[i].opt = G_define_option();
|
|
|
+ B[i].opt = G_define_standard_option(G_OPT_R_MAP);
|
|
|
B[i].opt->key = G_store(color_names[i]);
|
|
|
- B[i].opt->type = TYPE_STRING;
|
|
|
- B[i].opt->answer = NULL;
|
|
|
- B[i].opt->required = YES;
|
|
|
- B[i].opt->gisprompt = "old,cell,raster";
|
|
|
B[i].opt->description = G_store(buff);
|
|
|
- B[i].opt->key_desc = "name";
|
|
|
}
|
|
|
|
|
|
if (G_parser(argc, argv))
|
|
@@ -81,8 +79,10 @@ int main(int argc, char **argv)
|
|
|
if (D_open_driver() != 0)
|
|
|
G_fatal_error(_("No graphics device selected"));
|
|
|
|
|
|
+ overlay = !flag_n->answer;
|
|
|
+
|
|
|
D_setup(0);
|
|
|
- D_set_overlay_mode(flag_o->answer);
|
|
|
+ D_set_overlay_mode(overlay);
|
|
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
/* Get name of layer to be used */
|