[GRASS-SVN] r33092 - in grass/trunk: display/d.his display/d.profile display/d.rast display/d.rgb include lib/display

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 26 09:34:11 EDT 2008


Author: glynn
Date: 2008-08-26 09:34:11 -0400 (Tue, 26 Aug 2008)
New Revision: 33092

Modified:
   grass/trunk/display/d.his/main.c
   grass/trunk/display/d.profile/main.c
   grass/trunk/display/d.rast/display.c
   grass/trunk/display/d.rgb/main.c
   grass/trunk/include/display.h
   grass/trunk/lib/display/raster.c
Log:
Replace D_cell_draw_setup() with D_cell_draw_begin()


Modified: grass/trunk/display/d.his/main.c
===================================================================
--- grass/trunk/display/d.his/main.c	2008-08-26 13:33:17 UTC (rev 33091)
+++ grass/trunk/display/d.his/main.c	2008-08-26 13:34:11 UTC (rev 33092)
@@ -54,7 +54,6 @@
     struct GModule *module;
     struct Option *opt_h, *opt_i, *opt_s, *brighten;
     struct Flag *nulldraw;
-    double t, b, l, r;
     double bright_mult;
 
 
@@ -117,9 +116,7 @@
 
     /* Prepare the raster cell drawing functions */
     D_setup(0);
-    D_get_dst(&t, &b, &l, &r);
     D_set_overlay_mode(nulldraw->answer ? 1 : 0);
-    D_cell_draw_setup(t, b, l, r);
 
     /* Get name of layer to be used for hue */
     name_h = opt_h->answer;
@@ -202,6 +199,8 @@
     intensity = 255;		/* default is to not change intensity */
     saturation = 255;		/* default is to not change saturation */
 
+    D_cell_draw_begin();
+
     next_row = 0;
     for (atrow = 0; atrow < window.rows;) {
 	G_percent(atrow, window.rows, 2);

Modified: grass/trunk/display/d.profile/main.c
===================================================================
--- grass/trunk/display/d.profile/main.c	2008-08-26 13:33:17 UTC (rev 33091)
+++ grass/trunk/display/d.profile/main.c	2008-08-26 13:34:11 UTC (rev 33092)
@@ -426,16 +426,12 @@
 
 void myDcell(char *name, char *mapset, int overlay)
 {
-    int fd, i, t, b, l, r, code;
+    int fd, i, code;
     CELL *cell;
     struct Colors clr;
 
     D_setup(!overlay);
-
-    D_get_screen_window(&t, &b, &l, &r);
-
     D_set_overlay_mode(overlay);
-    D_cell_draw_setup(t, b, l, r);
 
     cell = G_allocate_c_raster_buf();
 
@@ -447,6 +443,7 @@
 	G_fatal_error(_("%s: Couldn't read color table for <%s@%s>"),
 		      G_program_name(), name, mapset);
 
+    D_cell_draw_begin();
     for (i = 0; i >= 0;) {
 	code = G_get_c_raster_row(fd, cell, i);
 	if (code < 0)

Modified: grass/trunk/display/d.rast/display.c
===================================================================
--- grass/trunk/display/d.rast/display.c	2008-08-26 13:33:17 UTC (rev 33091)
+++ grass/trunk/display/d.rast/display.c	2008-08-26 13:34:11 UTC (rev 33092)
@@ -51,17 +51,14 @@
     int cellfile;
     void *xarray;
     int cur_A_row;
-    double t, b, l, r;
     int ncols, nrows;
 
     ncols = G_window_cols();
     nrows = G_window_rows();
 
     /* Set up the screen, conversions, and graphics */
-    D_get_dst(&t, &b, &l, &r);
+    D_setup(0);
     D_set_overlay_mode(overlay);
-    if (D_cell_draw_setup(t, b, l, r))
-	G_fatal_error(_("Cannot use current window"));
 
     /* Make sure map is available */
     if ((cellfile = G_open_cell_old(name, mapset)) == -1)
@@ -70,6 +67,8 @@
     /* Allocate space for cell buffer */
     xarray = G_allocate_raster_buf(data_type);
 
+    D_cell_draw_begin();
+
     /* loop for array rows */
     for (cur_A_row = 0; cur_A_row != -1;) {
 	G_percent(cur_A_row, nrows, 2);

Modified: grass/trunk/display/d.rgb/main.c
===================================================================
--- grass/trunk/display/d.rgb/main.c	2008-08-26 13:33:17 UTC (rev 33091)
+++ grass/trunk/display/d.rgb/main.c	2008-08-26 13:34:11 UTC (rev 33092)
@@ -45,7 +45,6 @@
     struct Cell_head window;
     struct GModule *module;
     struct Flag *flag_o;
-    double t, b, l, r;
     int i;
 
     G_gisinit(argv[0]);
@@ -84,9 +83,7 @@
 	G_fatal_error(_("No graphics device selected"));
 
     D_setup(0);
-    D_get_dst(&t, &b, &l, &r);
     D_set_overlay_mode(flag_o->answer);
-    D_cell_draw_setup(t, b, l, r);
 
     for (i = 0; i < 3; i++) {
 	/* Get name of layer to be used */
@@ -112,6 +109,8 @@
     /* read in current window */
     G_get_window(&window);
 
+    D_cell_draw_begin();
+
     next_row = 0;
     for (row = 0; row < window.rows;) {
 	G_percent(row, window.rows, 5);

Modified: grass/trunk/include/display.h
===================================================================
--- grass/trunk/include/display.h	2008-08-26 13:33:17 UTC (rev 33091)
+++ grass/trunk/include/display.h	2008-08-26 13:34:11 UTC (rev 33092)
@@ -124,7 +124,7 @@
 int D_draw_f_raster(int, const FCELL *, struct Colors *);
 int D_draw_c_raster(int, const CELL *, struct Colors *);
 int D_draw_cell(int, const CELL *, struct Colors *);
-int D_cell_draw_setup(double, double, double, double);
+void D_cell_draw_begin(void);
 int D_draw_raster_RGB(int, const void *, const void *, const void *,
 		      struct Colors *, struct Colors *, struct Colors *,
 		      RASTER_MAP_TYPE, RASTER_MAP_TYPE, RASTER_MAP_TYPE);

Modified: grass/trunk/lib/display/raster.c
===================================================================
--- grass/trunk/lib/display/raster.c	2008-08-26 13:33:17 UTC (rev 33091)
+++ grass/trunk/lib/display/raster.c	2008-08-26 13:34:11 UTC (rev 33092)
@@ -130,22 +130,12 @@
  *  \return int
  */
 
-int D_cell_draw_setup(double t, double b, double l, double r)
+void D_cell_draw_begin(void)
 {
-    struct Cell_head window;
-
-    if (G_get_set_window(&window) == -1)
-	G_fatal_error("Current window not available");
-
-    D_do_conversions(&window, t, b, l, r);
-
     /* Set up the screen for drawing map */
     D_get_a(src);
     D_get_d(dst);
-
     R_begin_scaled_raster(D__overlay_mode, src, dst);
-
-    return 0;
 }
 
 int D_draw_raster_RGB(int A_row,



More information about the grass-commit mailing list