浏览代码

Move raster-specific functions from lib/gis to lib/raster:
G_align_window -> Rast_align_window
G_window_rows -> Rast_window_rows
G_window_cols -> Rast_window_cols
G_northing_to_row -> Rast_northing_to_row
G_easting_to_col -> Rast_easting_to_col
G_row_to_northing -> Rast_row_to_northing
G_col_to_easting -> Rast_col_to_easting


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40771 15284696-431f-4ddb-bdfa-cd5b030d7da7

Glynn Clements 15 年之前
父节点
当前提交
df4d81abd4
共有 100 个文件被更改,包括 444 次插入437 次删除
  1. 6 6
      display/d.profile/main.c
  2. 2 2
      display/d.rast/display.c
  3. 2 2
      doc/raster/r.example/main.c
  4. 2 2
      general/g.region/main.c
  5. 2 2
      imagery/i.albedo/main.c
  6. 3 3
      imagery/i.atcorr/main.cpp
  7. 2 2
      imagery/i.biomass/main.c
  8. 1 1
      imagery/i.cca/main.c
  9. 4 4
      imagery/i.class/cellhd.c
  10. 2 2
      imagery/i.class/draw_cell.c
  11. 2 2
      imagery/i.class/outline.c
  12. 2 2
      imagery/i.class/signature.c
  13. 2 2
      imagery/i.cluster/main.c
  14. 2 2
      imagery/i.eb.eta/main.c
  15. 2 2
      imagery/i.eb.evapfr/main.c
  16. 2 2
      imagery/i.eb.h_SEBAL01/main.c
  17. 2 2
      imagery/i.eb.soilheatflux/main.c
  18. 2 2
      imagery/i.emissivity/main.c
  19. 2 2
      imagery/i.evapo.time_integration/main.c
  20. 2 2
      imagery/i.fft/main.c
  21. 2 2
      imagery/i.gensig/covariance.c
  22. 2 2
      imagery/i.gensig/get_train.c
  23. 2 2
      imagery/i.gensig/means.c
  24. 2 2
      imagery/i.gensigset/get_train.c
  25. 2 2
      imagery/i.gensigset/read_data.c
  26. 2 2
      imagery/i.his.rgb/main.c
  27. 2 2
      imagery/i.ifft/main.c
  28. 2 2
      imagery/i.latlong/main.c
  29. 2 2
      imagery/i.maxlik/main.c
  30. 2 2
      imagery/i.modis.qc/main.c
  31. 7 7
      imagery/i.pca/main.c
  32. 2 2
      imagery/i.points/drawcell.c
  33. 2 2
      imagery/i.rectify/rectify.c
  34. 2 2
      imagery/i.rgb.his/main.c
  35. 1 1
      imagery/i.smap/openfiles.c
  36. 2 2
      imagery/i.smap/segment.c
  37. 2 2
      imagery/i.sunhours/main.c
  38. 2 2
      imagery/i.vi/main.c
  39. 2 2
      imagery/i.vpoints/drawcell.c
  40. 2 2
      imagery/i.zc/main.c
  41. 0 9
      include/gisdefs.h
  42. 11 0
      include/rasterdefs.h
  43. 1 1
      lib/gis/get_window.c
  44. 0 147
      lib/gis/window_map.c
  45. 6 5
      lib/gis/align_window.c
  46. 5 5
      lib/raster/alloc_cell.c
  47. 1 1
      lib/raster/get_row_colr.c
  48. 12 12
      lib/raster/sample.c
  49. 151 0
      lib/raster/window.c
  50. 2 2
      lib/raster/zero_cell.c
  51. 4 4
      lib/rst/interp_float/output2d.c
  52. 3 3
      ps/ps.map/do_masking.c
  53. 6 6
      ps/ps.map/ps_outline.c
  54. 2 2
      raster/r.basins.fill/main.c
  55. 2 2
      raster/r.bitpattern/main.c
  56. 28 28
      raster/r.carve/enforce_ds.c
  57. 4 4
      raster/r.carve/raster.c
  58. 2 2
      raster/r.category/cats.c
  59. 2 2
      raster/r.circle/main.c
  60. 2 2
      raster/r.clump/clump.c
  61. 1 1
      raster/r.coin/main.c
  62. 4 4
      raster/r.colors/stats.c
  63. 1 1
      raster/r.compress/main.c
  64. 6 6
      raster/r.cost/main.c
  65. 2 2
      raster/r.covar/main.c
  66. 2 2
      raster/r.cross/main.c
  67. 2 2
      raster/r.describe/describe.c
  68. 10 10
      raster/r.distance/distance.c
  69. 2 2
      raster/r.distance/edges.c
  70. 6 6
      raster/r.drain/main.c
  71. 2 2
      raster/r.fill.dir/main.c
  72. 3 3
      raster/r.flow/precomp.c
  73. 4 4
      raster/r.grow.distance/main.c
  74. 2 2
      raster/r.grow/main.c
  75. 4 4
      raster/r.horizon/main.c
  76. 4 4
      raster/r.in.arc/main.c
  77. 4 4
      raster/r.in.ascii/main.c
  78. 4 4
      raster/r.in.bin/main.c
  79. 2 2
      raster/r.in.gridatb/adjcellhd.c
  80. 4 4
      raster/r.lake/main.c
  81. 2 2
      raster/r.le/r.le.patch/driver.c
  82. 2 2
      raster/r.le/r.le.patch/input.c
  83. 2 2
      raster/r.le/r.le.pixel/driver.c
  84. 1 1
      raster/r.le/r.le.setup/main.c
  85. 1 1
      raster/r.le/r.le.trace/main.c
  86. 3 3
      raster/r.li/r.li.daemon/daemon.c
  87. 2 2
      raster/r.los/main.c
  88. 2 2
      raster/r.mapcalc/map.c
  89. 2 2
      raster/r.mapcalc/xcoor.c
  90. 2 2
      raster/r.mfilter/main.c
  91. 2 2
      raster/r.neighbors/bufs.c
  92. 3 3
      raster/r.neighbors/main.c
  93. 2 2
      raster/r.out.arc/main.c
  94. 2 2
      raster/r.out.ascii/main.c
  95. 2 2
      raster/r.out.bin/main.c
  96. 2 2
      raster/r.out.gridatb/adjcellhd.c
  97. 4 4
      raster/r.out.mat/main.c
  98. 3 3
      raster/r.out.mpeg/main.c
  99. 2 2
      raster/r.out.pov/main.c
  100. 0 0
      raster/r.out.vrml/main.c

+ 6 - 6
display/d.profile/main.c

@@ -40,8 +40,8 @@ static void get_region_range(int fd)
 {
     DCELL *buf = Rast_allocate_d_buf();
 
-    int nrows = G_window_rows();
-    int ncols = G_window_cols();
+    int nrows = Rast_window_rows();
+    int ncols = Rast_window_cols();
     int row, col;
 
     min = 1e300;
@@ -133,8 +133,8 @@ static int get_cell(DCELL *result, int fd, double x, double y)
     x -= col + 0.5;
     y -= row + 0.5;
 
-    if (row < 0 || row + 1 >= G_window_rows() ||
-	col < 0 || col + 1 >= G_window_cols()) {
+    if (row < 0 || row + 1 >= Rast_window_rows() ||
+	col < 0 || col + 1 >= Rast_window_cols()) {
 	Rast_set_d_null_value(result, 1);
 	return 0;
     }
@@ -237,8 +237,8 @@ int main(int argc, char **argv)
 	G_scan_easting( profile->answers[i+0], &x, G_projection());
 	G_scan_northing(profile->answers[i+1], &y, G_projection());
 
-	p->x = G_easting_to_col (x, &window);
-	p->y = G_northing_to_row(y, &window);
+	p->x = Rast_easting_to_col (x, &window);
+	p->y = Rast_northing_to_row(y, &window);
 
 	if (num_points > 0) {
 	    const struct point *prev = &points[num_points-1];

+ 2 - 2
display/d.rast/display.c

@@ -50,8 +50,8 @@ static int cell_draw(const char *name,
     int cur_A_row;
     int ncols, nrows;
 
-    ncols = G_window_cols();
-    nrows = G_window_rows();
+    ncols = Rast_window_cols();
+    nrows = Rast_window_rows();
 
     /* Set up the screen, conversions, and graphics */
     D_setup(0);

+ 2 - 2
doc/raster/r.example/main.c

@@ -119,8 +119,8 @@ int main(int argc, char *argv[])
     inrast = Rast_allocate_buf(data_type);
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(data_type);
 
     /* controlling, if we can write the raster */

+ 2 - 2
general/g.region/main.c

@@ -549,7 +549,7 @@ int main(int argc, char *argv[])
 	    }
 
 	    if (flag.res_set->answer)
-		G_align_window(&window, &temp_window);
+		Rast_align_window(&window, &temp_window);
 
 	    Vect_close(&Map);
 	}
@@ -783,7 +783,7 @@ int main(int argc, char *argv[])
 	if (!mapset)
 	    G_fatal_error(_("Raster map <%s> not found"), name);
 	Rast_get_cellhd(name, mapset, &temp_window);
-	G_align_window(&window, &temp_window);
+	Rast_align_window(&window, &temp_window);
     }
 
     /* save= */

+ 2 - 2
imagery/i.albedo/main.c

@@ -164,8 +164,8 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("At least two raster maps are required"));
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(out_data_type);
 
     /* Create New raster files */

+ 3 - 3
imagery/i.atcorr/main.cpp

@@ -120,7 +120,7 @@ static void write_fp_to_cell (int ofd, FCELL* buf)
 
     cbuf = (CELL*)Rast_allocate_buf(CELL_TYPE);
 
-    for(col = 0; col < G_window_cols(); col++) cbuf[col] = round_c(buf[col]);
+    for(col = 0; col < Rast_window_cols(); col++) cbuf[col] = round_c(buf[col]);
     Rast_put_row(ofd, cbuf, CELL_TYPE);
 }
 
@@ -295,8 +295,8 @@ static void process_raster (int ifd, InputMask imask, ScaleRange iscale,
     if(ivis_fd >= 0) vis = (FCELL*)Rast_allocate_buf(FCELL_TYPE);
 
     G_verbose_message(_("Percent complete..."));
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     for(row = 0; row < nrows; row++)
     {

+ 2 - 2
imagery/i.biomass/main.c

@@ -117,8 +117,8 @@ int main(int argc, char *argv[])
     infd_wa = Rast_open_old(wa, "");
     inrast_wa = Rast_allocate_d_buf();
     
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast1 = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

+ 1 - 1
imagery/i.cca/main.c

@@ -207,7 +207,7 @@ int main(int argc, char *argv[])
     }
 
     /* do the transform */
-    transform(datafds, outfds, G_window_rows(), G_window_cols(), q, bands,
+    transform(datafds, outfds, Rast_window_rows(), Rast_window_cols(), q, bands,
 	      outbandmin, outbandmax);
 
     /* make grey scale color table */

+ 4 - 4
imagery/i.class/cellhd.c

@@ -7,13 +7,13 @@ int Outline_cellhd(View * view, struct Cell_head *cellhd)
     int row, col;
     int top, bottom, left, right;
 
-    row = G_northing_to_row(cellhd->north, &view->cell.head) + .5;
+    row = Rast_northing_to_row(cellhd->north, &view->cell.head) + .5;
     top = row_to_view(view, row);
-    col = G_easting_to_col(cellhd->west, &view->cell.head) + .5;
+    col = Rast_easting_to_col(cellhd->west, &view->cell.head) + .5;
     left = col_to_view(view, col);
-    row = G_northing_to_row(cellhd->south, &view->cell.head) + .5;
+    row = Rast_northing_to_row(cellhd->south, &view->cell.head) + .5;
     bottom = row_to_view(view, row);
-    col = G_easting_to_col(cellhd->east, &view->cell.head) + .5;
+    col = Rast_easting_to_col(cellhd->east, &view->cell.head) + .5;
     right = col_to_view(view, col);
 
     Outline_box(top, bottom, left, right);

+ 2 - 2
imagery/i.class/draw_cell.c

@@ -24,8 +24,8 @@ int draw_cell(View * view, int overlay)
 	display_title(view);
 
     Rast_set_window(&view->cell.head);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     left = view->cell.left;
     top = view->cell.top;

+ 2 - 2
imagery/i.class/outline.c

@@ -40,8 +40,8 @@ int outline(void)
 	temp.x = view_to_col(Region.view, A[cur].x);
 	tmp_n = row_to_northing(&(Region.view->cell.head), temp.y, 0.5);
 	tmp_e = col_to_easting(&(Region.view->cell.head), temp.x, 0.5);
-	tmp[cur].y = G_northing_to_row(tmp_n, &Band_cellhd);
-	tmp[cur].x = G_easting_to_col(tmp_e, &Band_cellhd);
+	tmp[cur].y = Rast_northing_to_row(tmp_n, &Band_cellhd);
+	tmp[cur].x = Rast_easting_to_col(tmp_e, &Band_cellhd);
     }
 
     /* find first edge which is not horizontal */

+ 2 - 2
imagery/i.class/signature.c

@@ -274,8 +274,8 @@ int display_signature(void)
 
 	fd = Rast_open_c_new(MASK);
 	buffer = Rast_allocate_c_buf();
-	nrows = G_window_rows();
-	ncols = G_window_cols();
+	nrows = Rast_window_rows();
+	ncols = Rast_window_cols();
 
 	for (row = 0; row < nrows; row++) {
 	    readbands(nbands, row);

+ 2 - 2
imagery/i.cluster/main.c

@@ -160,8 +160,8 @@ int main(int argc, char *argv[])
 
 
     G_get_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     I_cluster_clear(&C);
 

+ 2 - 2
imagery/i.eb.eta/main.c

@@ -85,8 +85,8 @@ int main(int argc, char *argv[])
     infd_tempk = Rast_open_old(tempk, "");
     inrast_tempk = Rast_allocate_d_buf();
     
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast1 = Rast_allocate_d_buf();
     
     outfd1 = Rast_open_new(result1, DCELL_TYPE);

+ 2 - 2
imagery/i.eb.evapfr/main.c

@@ -107,8 +107,8 @@ int main(int argc, char *argv[])
     inrast_h0 = Rast_allocate_d_buf();
     
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast1 = Rast_allocate_d_buf();
 
     if (makin) 

+ 2 - 2
imagery/i.eb.h_SEBAL01/main.c

@@ -231,8 +231,8 @@ int main(int argc, char *argv[])
     ymin = cellhd.south;
     ymax = cellhd.north;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /***************************************************/
     /* Allocate output buffer */

+ 2 - 2
imagery/i.eb.soilheatflux/main.c

@@ -109,8 +109,8 @@ int main(int argc, char *argv[])
     infd_time = Rast_open_old(time, "");
     inrast_time = Rast_allocate_d_buf();
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

+ 2 - 2
imagery/i.emissivity/main.c

@@ -66,8 +66,8 @@ int main(int argc, char *argv[])
     inr = Rast_allocate_d_buf();
     
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outr = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

+ 2 - 2
imagery/i.evapo.time_integration/main.c

@@ -235,8 +235,8 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("The min specified input map is two"));
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(out_data_type);
 
    

+ 2 - 2
imagery/i.fft/main.c

@@ -109,8 +109,8 @@ int main(int argc, char *argv[])
     G_get_set_window(&window);	/* get the current window for later */
 
     /* get the rows and columns in the current window */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
     totsize = rows * cols;
 
     /* Allocate appropriate memory for the structure containing

+ 2 - 2
imagery/i.gensig/covariance.c

@@ -23,8 +23,8 @@ int compute_covariances(struct files *files, struct Signature *S)
 	    for (b2 = 0; b2 < S->nbands; b2++)
 		S->sig[n].var[b1][b2] = 0.0;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     class = (CELL *) G_calloc(ncols, sizeof(CELL));
 
     G_message(_("Calculating class covariance matrices..."));

+ 2 - 2
imagery/i.gensig/get_train.c

@@ -23,8 +23,8 @@ int get_training_classes(struct files *files, struct Signature *S)
     fd = files->train_fd;
     cell = files->train_cell;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* determine the categories in the map */
     I_init_signatures(S, files->nbands);

+ 2 - 2
imagery/i.gensig/means.c

@@ -19,8 +19,8 @@ int compute_means(struct files *files, struct Signature *S)
 	for (b = 0; b < S->nbands; b++)	/* for each band file */
 	    S->sig[n].mean[b] = 0.0;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     class = (CELL *) G_calloc(ncols, sizeof(CELL));
 
     G_message(_("Calculating class means..."));

+ 2 - 2
imagery/i.gensigset/get_train.c

@@ -23,8 +23,8 @@ int get_training_classes(struct parms *parms,
     fd = files->train_fd;
     cell = files->train_cell;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* determine the non-zero categories in the map */
     I_InitSigSet(S);

+ 2 - 2
imagery/i.gensigset/read_data.c

@@ -15,8 +15,8 @@ int read_data(struct files *files, struct SigSet *S)
     CELL *class;
     struct ClassData *Data;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     class = (CELL *) G_calloc(ncols, sizeof(CELL));
 
     G_message(_("Reading raster maps..."));

+ 2 - 2
imagery/i.his.rgb/main.c

@@ -80,8 +80,8 @@ int main(int argc, char **argv)
 	exit(EXIT_FAILURE);
 
     /* get dimension of the image */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     openfiles(opt_hue->answer, opt_int->answer, opt_sat->answer,
 	      opt_red->answer, opt_green->answer, opt_blue->answer,

+ 2 - 2
imagery/i.ifft/main.c

@@ -121,8 +121,8 @@ int main(int argc, char *argv[])
     Rast_set_window(&realhead);	/* set the window to the whole cell map */
 
     /* get the rows and columns in the current window */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
     totsize = rows * cols;
 
     /* Allocate appropriate memory for the structure containing

+ 2 - 2
imagery/i.latlong/main.c

@@ -89,8 +89,8 @@ int main(int argc, char *argv[])
     xmax = cellhd.east;
     ymin = cellhd.south;
     ymax = cellhd.north;
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     
     /*Stolen from r.sun */ 
     /* Set up parameters for projection to lat/long if necessary */ 

+ 2 - 2
imagery/i.maxlik/main.c

@@ -102,8 +102,8 @@ int main(int argc, char *argv[])
 
     open_files();
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);

+ 2 - 2
imagery/i.modis.qc/main.c

@@ -204,8 +204,8 @@ int main(int argc, char *argv[])
     inrast = Rast_allocate_c_buf();
 
     G_debug(3, "number of rows %d", cellhd.rows);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_c_buf();
 
     /* Create New raster files */ 

+ 7 - 7
imagery/i.pca/main.c

@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
 	for (j = 0; j < bands; j++) {
 	    covar[i][j] =
 		covar[i][j] /
-		((double)((G_window_rows() * G_window_cols()) - 1));
+		((double)((Rast_window_rows() * Rast_window_cols()) - 1));
 	    G_debug(3, "covar[%d][%d] = %f", i, j, covar[i][j]);
 	}
     }
@@ -226,8 +226,8 @@ set_output_scale(struct Option *scale_opt, int *scale, int *scale_min,
 static int calc_mu(int *fds, double *mu, int bands)
 {
     int i;
-    int rows = G_window_rows();
-    int cols = G_window_cols();
+    int rows = Rast_window_rows();
+    int cols = Rast_window_cols();
     void *rowbuf = NULL;
 
     for (i = 0; i < bands; i++) {
@@ -276,8 +276,8 @@ static int calc_mu(int *fds, double *mu, int bands)
 static int calc_covariance(int *fds, double **covar, double *mu, int bands)
 {
     int j, k;
-    int rows = G_window_rows();
-    int cols = G_window_cols();
+    int rows = Rast_window_rows();
+    int cols = Rast_window_cols();
     int row, col;
 
     for (j = 0; j < bands; j++) {
@@ -351,8 +351,8 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
     double max = 0.;
     double old_range = 0.;
     double new_range = 0.;
-    int rows = G_window_rows();
-    int cols = G_window_cols();
+    int rows = Rast_window_rows();
+    int cols = Rast_window_cols();
     int cell_mapsiz = Rast_cell_size(CELL_TYPE);
     int dcell_mapsiz = Rast_cell_size(DCELL_TYPE);
     DCELL *d_buf;

+ 2 - 2
imagery/i.points/drawcell.c

@@ -37,8 +37,8 @@ int drawcell(View * view)
     set_colors(colors);
 
     Rast_set_window(&view->cell.head);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     left = view->cell.left;
     top = view->cell.top;

+ 2 - 2
imagery/i.rectify/rectify.c

@@ -42,8 +42,8 @@ int rectify(char *name, char *mapset, char *result, int order)
     Rast_set_window(&cellhd);
     infd = Rast_open_old(name, mapset);
     map_type = Rast_get_map_type(infd);
-    rast = (void *)G_calloc(G_window_cols() + 1, Rast_cell_size(map_type));
-    Rast_set_null_value(rast, G_window_cols() + 1, map_type);
+    rast = (void *)G_calloc(Rast_window_cols() + 1, Rast_cell_size(map_type));
+    Rast_set_null_value(rast, Rast_window_cols() + 1, map_type);
 
     G_copy(&win, &target_window, sizeof(win));
 

+ 2 - 2
imagery/i.rgb.his/main.c

@@ -81,8 +81,8 @@ int main(int argc, char **argv)
 
 
     /* get dimension of the image */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     openfiles(opt_red->answer, opt_green->answer, opt_blue->answer,
 	      opt_hue->answer, opt_inten->answer, opt_sat->answer,

+ 1 - 1
imagery/i.smap/openfiles.c

@@ -26,7 +26,7 @@ int openfiles(struct parms *parms, struct files *files)
     files->cellbuf = Rast_allocate_d_buf();
     files->outbuf = Rast_allocate_c_buf();
 
-    files->isdata = G_malloc(G_window_cols());
+    files->isdata = G_malloc(Rast_window_cols());
 
     files->nbands = Ref.nfiles;
     files->band_fd = (int *)G_calloc(Ref.nfiles, sizeof(int));

+ 2 - 2
imagery/i.smap/segment.c

@@ -47,8 +47,8 @@ int segment(struct SigSet *S,	/* class parameters */
     ml = parms->ml;		/* use maxl? */
     block_size = parms->blocksize;
 
-    wd = G_window_cols();	/* get width from GRASS */
-    ht = G_window_rows();	/* get height from GRASS */
+    wd = Rast_window_cols();	/* get width from GRASS */
+    ht = Rast_window_rows();	/* get height from GRASS */
 
     /* make blocksize a power of 2 */
     if (block_size < 8)

+ 2 - 2
imagery/i.sunhours/main.c

@@ -77,8 +77,8 @@ int main(int argc, char *argv[])
     inrast_lat = Rast_allocate_d_buf();
 
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     outrast1 = Rast_allocate_d_buf();
     outfd1 = Rast_open_new(result1, DCELL_TYPE);

+ 2 - 2
imagery/i.vi/main.c

@@ -238,8 +238,8 @@ int main(int argc, char *argv[])
 	inrast_chan7chan = Rast_allocate_d_buf();
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_d_buf();
 
     /* Create New raster files */ 

+ 2 - 2
imagery/i.vpoints/drawcell.c

@@ -47,8 +47,8 @@ int drawcell(View * view, int initflag)
     }
 
     Rast_set_window(&view->cell.head);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     left = view->cell.left;
     top = view->cell.top;

+ 2 - 2
imagery/i.zc/main.c

@@ -121,8 +121,8 @@ int main(int argc, char *argv[])
     G_get_set_window(&window);
 
     /* get the rows and columns in the current window */
-    or = G_window_rows();
-    oc = G_window_cols();
+    or = Rast_window_rows();
+    oc = Rast_window_cols();
     rows = G_math_max_pow2((long)or);
     cols = G_math_max_pow2((long)oc);
     size = (rows > cols) ? rows : cols;

+ 0 - 9
include/gisdefs.h

@@ -50,9 +50,6 @@
 void G_adjust_Cell_head(struct Cell_head *, int, int);
 void G_adjust_Cell_head3(struct Cell_head *, int, int, int);
 
-/* align_window.c */
-void G_align_window(struct Cell_head *, const struct Cell_head *);
-
 /* alloc.c */
 #define G_incr_void_ptr(ptr, size) \
     ((void *)((const unsigned char *)(ptr) + (size)))
@@ -675,14 +672,8 @@ int G_scan_easting(const char *, double *, int);
 int G_scan_resolution(const char *, double *, int);
 
 /* window_map.c */
-double G_northing_to_row(double, const struct Cell_head *);
 double G_adjust_east_longitude(double, double);
 double G_adjust_easting(double, const struct Cell_head *);
-double G_easting_to_col(double, const struct Cell_head *);
-double G_row_to_northing(double, const struct Cell_head *);
-double G_col_to_easting(double, const struct Cell_head *);
-int G_window_rows(void);
-int G_window_cols(void);
 void G__init_window(void);
 
 /* worker.c */

+ 11 - 0
include/rasterdefs.h

@@ -5,6 +5,9 @@
 
 /* --- ANSI prototypes for the lib/raster functions --- */
 
+/* align_window.c */
+void Rast_align_window(struct Cell_head *, const struct Cell_head *);
+
 /* alloc_cell.c */
 size_t Rast_cell_size(RASTER_MAP_TYPE);
 void *Rast_allocate_buf(RASTER_MAP_TYPE);
@@ -517,6 +520,14 @@ DCELL Rast_get_sample(int, const struct Cell_head *, struct Categories *, double
 /* set_window.c */
 void Rast_set_window(struct Cell_head *);
 
+/* window.c */
+double Rast_northing_to_row(double, const struct Cell_head *);
+double Rast_easting_to_col(double, const struct Cell_head *);
+double Rast_row_to_northing(double, const struct Cell_head *);
+double Rast_col_to_easting(double, const struct Cell_head *);
+int Rast_window_rows(void);
+int Rast_window_cols(void);
+
 /* window_map.c */
 void Rast__create_window_mapping(int);
 int Rast_row_repeat_nomask(int, int);

+ 1 - 1
lib/gis/get_window.c

@@ -39,7 +39,7 @@ static struct state *st = &state;
  * should not use this routine since its use implies that the active
  * module region will not be used. Programs that read or write raster
  * map data (or vector data) can query the active module region using
- * G_window_rows() and G_window_cols().
+ * Rast_window_rows() and Rast_window_cols().
  *
  * \param window pointer to Cell_head
  */

+ 0 - 147
lib/gis/window_map.c

@@ -11,33 +11,11 @@
  * \author Original author CERL
  */
 
-#include <stdlib.h>
 #include <grass/gis.h>
 
 #include "G.h"
 
 
-
-/*!
- * \brief Northing to row.
- *
- * Converts a <i>north</i>ing relative to a <i>window</i> to a row.
-
- * <b>Note:</b> The result is a double. Casting it to an integer will 
- * give the row number.
- *
- * \param north northing value
- * \param window pointer to Cell_head
- *
- * \return row number
- */
-
-double G_northing_to_row(double north, const struct Cell_head *window)
-{
-    return (window->north - north) / window->ns_res;
-}
-
-
 /*!
  * \brief Adjust east longitude.
  *
@@ -91,131 +69,6 @@ double G_adjust_easting(double east, const struct Cell_head *window)
 }
 
 /*!
- * \brief Easting to column.
- *
- * Converts <i>east</i> relative to a <i>window</i> to a column.
-
- * <b>Note:</b> The result is a <i>double</i>. Casting it to an 
- * <i>int</i> will give the column number.
- *
- * \param east east coordinate
- * \param window pointer to Cell_head
- *
- * \return column number
- */
-
-double G_easting_to_col(double east, const struct Cell_head *window)
-{
-    east = G_adjust_easting(east, window);
-
-    return (east - window->west) / window->ew_res;
-}
-
-/*!
- * \brief Row to northing.
- *
- * Converts a <i>row</i> relative to a <i>window</i> to a
- * northing.
-
- * <b>Note:</b> row is a double:
- *  - row+0.0 will return the northing for the northern edge of the row.
- *  - row+0.5 will return the northing for the center of the row.
- *  - row+1.0 will return the northing for the southern edge of the row.
- *
- * <b>Note:</b> The result is a <i>double</i>. Casting it to an
- * <i>int</i> will give the column number.
- *
- * \param row row number
- * \param[in] window pointer to Cell_head
- *
- * \return north coordinate
- */
-double G_row_to_northing(double row, const struct Cell_head *window)
-{
-    return window->north - row * window->ns_res;
-}
-
-/*!
- * \brief Column to easting.
- *
- * Converts a <i>col</i> relative to a <i>window</i> to an easting.
- *
- * <b>Note:</b> <i>col</i> is a <i>double</i>:
- *  - col+0.0 will return the easting for the western edge of the column.
- *  - col+0.5 will return the easting for the center of the column.
- *  - col+1.0 will return the easting for the eastern edge of the column.
- *
- * \param col column number
- * \param[in] window pointer to Cell_head
- *
- * \return east coordinate
- */
-double G_col_to_easting(double col, const struct Cell_head *window)
-{
-    return window->west + col * window->ew_res;
-}
-
-/*!
- * \brief Number of rows in active window.
- *
- * This routine returns the number of rows in the active module window. 
- * Before raster files can be read or written, it is necessary to
- * known how many rows are in the active window. For example:
- \code  
-int nrows, cols;
-int row, col;
-
-nrows = G_window_rows();
-ncols = G_window_cols();
-for (row = 0; row < nrows; row++) {
-    // read row ...
-    for (col = 0; col < ncols; col++) {
-        // process col ...
-    }
-}
- \endcode 
- *
- * \return number of rows
- */
-int G_window_rows(void)
-{
-    G__init_window();
-
-    return G__.window.rows;
-}
-
-/*!
- * \brief Number of columns in active window.
- *
- * These routines return the number of rows and columns (respectively)
- * in the active module region. Before raster maps can be read or
- * written, it is necessary to known how many rows and columns are in
- * the active region. For example:
- *
- \code  
-int nrows, cols;
-int row, col;
-
-nrows = G_window_rows();
-ncols = G_window_cols();
-for (row = 0; row < nrows; row++) {
-    // read row ...
-    for (col = 0; col < ncols; col++) {
-        // process col ...
-    }
-}
- \endcode 
- *
- * \return number of columns
- */
-int G_window_cols(void)
-{
-    G__init_window();
-
-    return G__.window.cols;
-}
-
-/*!
  * \brief Initialize window.
  *
  */

+ 6 - 5
lib/gis/align_window.c

@@ -15,6 +15,7 @@
 #include <math.h>
 
 #include <grass/gis.h>
+#include <grass/raster.h>
 
 /*!
  * \brief Align two regions.
@@ -37,7 +38,7 @@
  * \return NULL on success
  */
 
-void G_align_window(struct Cell_head *window, const struct Cell_head *ref)
+void Rast_align_window(struct Cell_head *window, const struct Cell_head *ref)
 {
     int preserve;
 
@@ -49,13 +50,13 @@ void G_align_window(struct Cell_head *window, const struct Cell_head *ref)
     preserve = window->proj == PROJECTION_LL &&
 	window->east == (window->west + 360);
     window->south =
-	G_row_to_northing(ceil(G_northing_to_row(window->south, ref)), ref);
+	Rast_row_to_northing(ceil(Rast_northing_to_row(window->south, ref)), ref);
     window->north =
-	G_row_to_northing(floor(G_northing_to_row(window->north, ref)), ref);
+	Rast_row_to_northing(floor(Rast_northing_to_row(window->north, ref)), ref);
     window->east =
-	G_col_to_easting(ceil(G_easting_to_col(window->east, ref)), ref);
+	Rast_col_to_easting(ceil(Rast_easting_to_col(window->east, ref)), ref);
     window->west =
-	G_col_to_easting(floor(G_easting_to_col(window->west, ref)), ref);
+	Rast_col_to_easting(floor(Rast_easting_to_col(window->west, ref)), ref);
 
     if (window->proj == PROJECTION_LL) {
 	while (window->north > 90.0)

+ 5 - 5
lib/raster/alloc_cell.c

@@ -54,7 +54,7 @@ size_t Rast_cell_size(RASTER_MAP_TYPE data_type)
  */
 void *Rast_allocate_buf(RASTER_MAP_TYPE data_type)
 {
-    return (void *)G_calloc(G_window_cols() + 1, Rast_cell_size(data_type));
+    return (void *)G_calloc(Rast_window_cols() + 1, Rast_cell_size(data_type));
 }
 
 /*!
@@ -81,7 +81,7 @@ void *Rast_allocate_buf(RASTER_MAP_TYPE data_type)
  */
 CELL *Rast_allocate_c_buf(void)
 {
-    return (CELL *) G_calloc(G_window_cols() + 1, sizeof(CELL));
+    return (CELL *) G_calloc(Rast_window_cols() + 1, sizeof(CELL));
 }
 
 /*!
@@ -94,7 +94,7 @@ CELL *Rast_allocate_c_buf(void)
  */
 FCELL *Rast_allocate_f_buf(void)
 {
-    return (FCELL *) G_calloc(G_window_cols() + 1, sizeof(FCELL));
+    return (FCELL *) G_calloc(Rast_window_cols() + 1, sizeof(FCELL));
 }
 
 /*!
@@ -107,7 +107,7 @@ FCELL *Rast_allocate_f_buf(void)
  */
 DCELL *Rast_allocate_d_buf(void)
 {
-    return (DCELL *) G_calloc(G_window_cols() + 1, sizeof(DCELL));
+    return (DCELL *) G_calloc(Rast_window_cols() + 1, sizeof(DCELL));
 }
 
 /*!
@@ -120,7 +120,7 @@ DCELL *Rast_allocate_d_buf(void)
  */
 char *Rast_allocate_null_buf(void)
 {
-    return (char *)G_calloc(G_window_cols() + 1, sizeof(char));
+    return (char *)G_calloc(Rast_window_cols() + 1, sizeof(char));
 }
 
 /*!

+ 1 - 1
lib/raster/get_row_colr.c

@@ -40,7 +40,7 @@ void Rast_get_row_colors(int fd, int row, struct Colors *colors,
 			 unsigned char *red, unsigned char *grn,
 			 unsigned char *blu, unsigned char *nul)
 {
-    int cols = G_window_cols();
+    int cols = Rast_window_cols();
     int type = Rast_get_map_type(fd);
     int size = Rast_cell_size(type);
     void *array;

+ 12 - 12
lib/raster/sample.c

@@ -98,11 +98,11 @@ DCELL Rast_get_sample_nearest(int fd,
     DCELL *maprow = Rast_allocate_d_buf();
 
     /* convert northing and easting to row and col, resp */
-    row = (int)floor(G_northing_to_row(north, window));
-    col = (int)floor(G_easting_to_col(east, window));
+    row = (int)floor(Rast_northing_to_row(north, window));
+    col = (int)floor(Rast_easting_to_col(east, window));
 
-    if (row < 0 || row >= G_window_rows() ||
-	col < 0 || col >= G_window_cols()) {
+    if (row < 0 || row >= Rast_window_rows() ||
+	col < 0 || col >= Rast_window_cols()) {
 	Rast_set_d_null_value(&result, 1);
 	goto done;
     }
@@ -157,8 +157,8 @@ DCELL Rast_get_sample_bilinear(int fd,
     double frow, fcol, trow, tcol;
     DCELL result;
 
-    frow = G_northing_to_row(north, window);
-    fcol = G_easting_to_col(east, window);
+    frow = Rast_northing_to_row(north, window);
+    fcol = Rast_easting_to_col(east, window);
 
     /* convert northing and easting to row and col, resp */
     row = (int)floor(frow - 0.5);
@@ -167,8 +167,8 @@ DCELL Rast_get_sample_bilinear(int fd,
     trow = frow - row - 0.5;
     tcol = fcol - col - 0.5;
 
-    if (row < 0 || row + 1 >= G_window_rows() ||
-	col < 0 || col + 1 >= G_window_cols()) {
+    if (row < 0 || row + 1 >= Rast_window_rows() ||
+	col < 0 || col + 1 >= Rast_window_cols()) {
 	Rast_set_d_null_value(&result, 1);
 	goto done;
     }
@@ -249,8 +249,8 @@ DCELL Rast_get_sample_cubic(int fd,
     for (i = 0; i < 4; i++)
 	rows[i] = Rast_allocate_d_buf();
 
-    frow = G_northing_to_row(north, window);
-    fcol = G_easting_to_col(east, window);
+    frow = Rast_northing_to_row(north, window);
+    fcol = Rast_easting_to_col(east, window);
 
     /* convert northing and easting to row and col, resp */
     row = (int)floor(frow - 1.5);
@@ -259,8 +259,8 @@ DCELL Rast_get_sample_cubic(int fd,
     trow = frow - row - 1.5;
     tcol = fcol - col - 1.5;
 
-    if (row < 0 || row + 3 >= G_window_rows() ||
-	col < 0 || col + 3 >= G_window_cols()) {
+    if (row < 0 || row + 3 >= Rast_window_rows() ||
+	col < 0 || col + 3 >= Rast_window_cols()) {
 	Rast_set_d_null_value(&result, 1);
 	goto done;
     }

+ 151 - 0
lib/raster/window.c

@@ -0,0 +1,151 @@
+#include <grass/gis.h>
+#include <grass/raster.h>
+
+#include "../gis/G.h"
+#include "R.h"
+
+/*!
+ * \brief Number of rows in active window.
+ *
+ * This routine returns the number of rows in the active module window. 
+ * Before raster files can be read or written, it is necessary to
+ * known how many rows are in the active window. For example:
+ \code  
+int nrows, cols;
+int row, col;
+
+nrows = Rast_window_rows();
+ncols = Rast_window_cols();
+for (row = 0; row < nrows; row++) {
+    // read row ...
+    for (col = 0; col < ncols; col++) {
+        // process col ...
+    }
+}
+ \endcode 
+ *
+ * \return number of rows
+ */
+int Rast_window_rows(void)
+{
+    G__init_window();
+
+    return G__.window.rows;
+}
+
+/*!
+ * \brief Number of columns in active window.
+ *
+ * These routines return the number of rows and columns (respectively)
+ * in the active module region. Before raster maps can be read or
+ * written, it is necessary to known how many rows and columns are in
+ * the active region. For example:
+ *
+ \code  
+int nrows, cols;
+int row, col;
+
+nrows = Rast_window_rows();
+ncols = Rast_window_cols();
+for (row = 0; row < nrows; row++) {
+    // read row ...
+    for (col = 0; col < ncols; col++) {
+        // process col ...
+    }
+}
+ \endcode 
+ *
+ * \return number of columns
+ */
+int Rast_window_cols(void)
+{
+    G__init_window();
+
+    return G__.window.cols;
+}
+
+/*!
+ * \brief Northing to row.
+ *
+ * Converts a <i>north</i>ing relative to a <i>window</i> to a row.
+
+ * <b>Note:</b> The result is a double. Casting it to an integer will 
+ * give the row number.
+ *
+ * \param north northing value
+ * \param window pointer to Cell_head
+ *
+ * \return row number
+ */
+
+double Rast_northing_to_row(double north, const struct Cell_head *window)
+{
+    return (window->north - north) / window->ns_res;
+}
+
+
+/*!
+ * \brief Easting to column.
+ *
+ * Converts <i>east</i> relative to a <i>window</i> to a column.
+
+ * <b>Note:</b> The result is a <i>double</i>. Casting it to an 
+ * <i>int</i> will give the column number.
+ *
+ * \param east east coordinate
+ * \param window pointer to Cell_head
+ *
+ * \return column number
+ */
+
+double Rast_easting_to_col(double east, const struct Cell_head *window)
+{
+    east = G_adjust_easting(east, window);
+
+    return (east - window->west) / window->ew_res;
+}
+
+/*!
+ * \brief Row to northing.
+ *
+ * Converts a <i>row</i> relative to a <i>window</i> to a
+ * northing.
+
+ * <b>Note:</b> row is a double:
+ *  - row+0.0 will return the northing for the northern edge of the row.
+ *  - row+0.5 will return the northing for the center of the row.
+ *  - row+1.0 will return the northing for the southern edge of the row.
+ *
+ * <b>Note:</b> The result is a <i>double</i>. Casting it to an
+ * <i>int</i> will give the column number.
+ *
+ * \param row row number
+ * \param[in] window pointer to Cell_head
+ *
+ * \return north coordinate
+ */
+double Rast_row_to_northing(double row, const struct Cell_head *window)
+{
+    return window->north - row * window->ns_res;
+}
+
+/*!
+ * \brief Column to easting.
+ *
+ * Converts a <i>col</i> relative to a <i>window</i> to an easting.
+ *
+ * <b>Note:</b> <i>col</i> is a <i>double</i>:
+ *  - col+0.0 will return the easting for the western edge of the column.
+ *  - col+0.5 will return the easting for the center of the column.
+ *  - col+1.0 will return the easting for the eastern edge of the column.
+ *
+ * \param col column number
+ * \param[in] window pointer to Cell_head
+ *
+ * \return east coordinate
+ */
+double Rast_col_to_easting(double col, const struct Cell_head *window)
+{
+    return window->west + col * window->ew_res;
+}
+

+ 2 - 2
lib/raster/zero_cell.c

@@ -27,7 +27,7 @@
 
 void Rast_zero_c_buf(CELL * buf)
 {
-    int i = G_window_cols();
+    int i = Rast_window_cols();
 
     while (i--)
 	*buf++ = 0;
@@ -45,5 +45,5 @@ void Rast_zero_c_buf(CELL * buf)
  */
 void Rast_zero_buf(void *rast, RASTER_MAP_TYPE data_type)
 {
-    memset(rast, 0, G_window_cols() * Rast_cell_size(data_type));
+    memset(rast, 0, Rast_window_cols() * Rast_cell_size(data_type));
 }

+ 4 - 4
lib/rst/interp_float/output2d.c

@@ -95,15 +95,15 @@ int IL_output_2d(struct interp_params *params, struct Cell_head *cellhd,	/* curr
 
     Rast_set_window(cellhd);
 
-    if (nrows != G_window_rows()) {
+    if (nrows != Rast_window_rows()) {
 	G_warning(_("Rows changed from %d to %d"), nrows,
-		  G_window_rows());
+		  Rast_window_rows());
 	return -1;
     }
 
-    if (ncols != G_window_cols()) {
+    if (ncols != Rast_window_cols()) {
 	G_warning(_("Cols changed from %d to %d"), ncols,
-		  G_window_cols());
+		  Rast_window_cols());
 	return -1;
     }
 

+ 3 - 3
ps/ps.map/do_masking.c

@@ -24,11 +24,11 @@ int do_masking(void)
 
 
     /* adjust columns to multiple of 8 */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
     while (cols % 8)
 	cols++;
-    factor = (double)cols / (double)G_window_cols();
+    factor = (double)cols / (double)Rast_window_cols();
     width = factor * PS.map_pix_wide;
 
     /* write mask to PostScript file, using "no data" color */

+ 6 - 6
ps/ps.map/ps_outline.c

@@ -116,14 +116,14 @@ int draw_outline(void)
     k = 0;
     raster_size = Rast_cell_size(map_type);
     while (read_next()) {	/* read rest of file, one row at *//*   a time */
-	n1 = G_row_to_northing((double)row - 1., &(PS.w));
-	n2 = G_row_to_northing((double)row, &(PS.w));
-	n3 = G_row_to_northing((double)row + 1., &(PS.w));
+	n1 = Rast_row_to_northing((double)row - 1., &(PS.w));
+	n2 = Rast_row_to_northing((double)row, &(PS.w));
+	n3 = Rast_row_to_northing((double)row + 1., &(PS.w));
 
 	for (col = 0; col < scan_length - 1; col++) {
-	    e1 = G_col_to_easting((double)col - 1., &(PS.w));
-	    e2 = G_col_to_easting((double)col, &(PS.w));
-	    e3 = G_col_to_easting((double)col + 1., &(PS.w));
+	    e1 = Rast_col_to_easting((double)col - 1., &(PS.w));
+	    e2 = Rast_col_to_easting((double)col, &(PS.w));
+	    e3 = Rast_col_to_easting((double)col + 1., &(PS.w));
 	    tl = G_incr_void_ptr(buffer[top], col * raster_size);
 	    /* top left in window */
 	    tr = G_incr_void_ptr(buffer[top], (col + 1) * raster_size);

+ 2 - 2
raster/r.basins.fill/main.c

@@ -94,8 +94,8 @@ int main(int argc, char *argv[])
     Rast_get_cellhd(drain_name, "", &window);
     Rast_set_window(&window);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     ridge_name = ridge_opt->answer;
 

+ 2 - 2
raster/r.bitpattern/main.c

@@ -107,8 +107,8 @@ int main(int argc, char *argv[])
     inrast = Rast_allocate_buf(data_type);
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(data_type);
 
     outfd = Rast_open_new(result, data_type);

+ 28 - 28
raster/r.carve/enforce_ds.c

@@ -73,7 +73,7 @@ int enforce_downstream(int infd, int outfd,
 
     /* allocate and clear memory for entire raster */
     rbuf =
-	G_calloc(G_window_rows() * G_window_cols(),
+	G_calloc(Rast_window_rows() * Rast_window_cols(),
 		 Rast_cell_size(parm->raster_type));
 
     /* first read whole elevation file into buf */
@@ -122,7 +122,7 @@ static int process_line(struct Map_info *Map, struct Map_info *outMap,
 	return 0;
 
     if (!bm)
-	bm = BM_create(G_window_cols(), G_window_rows());
+	bm = BM_create(Rast_window_cols(), Rast_window_rows());
     clear_bitmap(bm);
 
     pg_init(&pg);
@@ -133,12 +133,12 @@ static int process_line(struct Map_info *Map, struct Map_info *outMap,
     for (i = 0; i < points->n_points; i++) {
 	Point2 pt, ptxy;
 	double elev;
-	int row = G_northing_to_row(points->y[i], &wind);
-	int col = G_easting_to_col(points->x[i], &wind);
+	int row = Rast_northing_to_row(points->y[i], &wind);
+	int col = Rast_easting_to_col(points->x[i], &wind);
 
 	/* rough clipping */
-	if (row < 0 || row > G_window_rows() - 1 ||
-	    col < 0 || col > G_window_cols() - 1) {
+	if (row < 0 || row > Rast_window_rows() - 1 ||
+	    col < 0 || col > Rast_window_cols() - 1) {
 	    if (first_in != -1)
 		in_out = 1;
 
@@ -210,8 +210,8 @@ static void clear_bitmap(struct BM *bm)
 {
     int i, j;
 
-    for (i = 0; i < G_window_rows(); i++)
-	for (j = 0; j < G_window_cols(); j++)
+    for (i = 0; i < Rast_window_rows(); i++)
+	for (j = 0; j < Rast_window_cols(); j++)
 	    BM_set(bm, i, j, 0);
 }
 
@@ -278,24 +278,24 @@ static void set_min_point(void *data, const int col, const int row,
 	{
 	    CELL *cbuf = data;
 
-	    cbuf[row * G_window_cols() + col] =
-		MIN(cbuf[row * G_window_cols() + col], elev) - (int)depth;
+	    cbuf[row * Rast_window_cols() + col] =
+		MIN(cbuf[row * Rast_window_cols() + col], elev) - (int)depth;
 	}
 	break;
     case FCELL_TYPE:
 	{
 	    FCELL *fbuf = data;
 
-	    fbuf[row * G_window_cols() + col] =
-		MIN(fbuf[row * G_window_cols() + col], elev) - depth;
+	    fbuf[row * Rast_window_cols() + col] =
+		MIN(fbuf[row * Rast_window_cols() + col], elev) - depth;
 	}
 	break;
     case DCELL_TYPE:
 	{
 	    DCELL *dbuf = data;
 
-	    dbuf[row * G_window_cols() + col] =
-		MIN(dbuf[row * G_window_cols() + col], elev) - depth;
+	    dbuf[row * Rast_window_cols() + col] =
+		MIN(dbuf[row * Rast_window_cols() + col], elev) - depth;
 	}
 	break;
     }
@@ -313,8 +313,8 @@ static double lowest_cell_near_point(void *data, const RASTER_MAP_TYPE rtype,
     struct Cell_head wind;
 
     G_get_window(&wind);
-    rastrows = G_window_rows();
-    rastcols = G_window_cols();
+    rastrows = Rast_window_rows();
+    rastcols = Rast_window_cols();
 
     Rast_set_d_null_value(&min, 1);
 
@@ -322,8 +322,8 @@ static double lowest_cell_near_point(void *data, const RASTER_MAP_TYPE rtype,
     rowoff = rad / wind.ns_res;
     coloff = rad / wind.ew_res;
 
-    row = G_northing_to_row(py, &wind);
-    col = G_easting_to_col(px, &wind);
+    row = Rast_northing_to_row(py, &wind);
+    col = Rast_easting_to_col(px, &wind);
 
     /* get bounding box of line segment */
     row1 = MAX(0, row - rowoff);
@@ -359,11 +359,11 @@ static double lowest_cell_near_point(void *data, const RASTER_MAP_TYPE rtype,
     }
 
     for (r = row1; r < row2; r++) {
-	double cy = G_row_to_northing(r + 0.5, &wind);
+	double cy = Rast_row_to_northing(r + 0.5, &wind);
 	int c;
 
 	for (c = col1; c < col2; c++) {
-	    double cx = G_col_to_easting(c + 0.5, &wind);
+	    double cx = Rast_col_to_easting(c + 0.5, &wind);
 
 	    if (G_distance(px, py, cx, cy) <= SQR(rad)) {
 		switch (rtype) {
@@ -450,26 +450,26 @@ static void process_line_segment(const int npts, void *rbuf,
     coloff = parm->swidth / wind.ew_res;
 
     /* get prevrow and prevcol for iteration 0 of following loop */
-    prevrow = G_northing_to_row(pgxypts[0][1], &wind);
-    prevcol = G_easting_to_col(pgxypts[0][0], &wind);
+    prevrow = Rast_northing_to_row(pgxypts[0][1], &wind);
+    prevcol = Rast_easting_to_col(pgxypts[0][0], &wind);
 
     for (i = 1; i < (npts - 1); i++) {
 	int c, r;
 
-	int row = G_northing_to_row(pgxypts[i][1], &wind);
-	int col = G_easting_to_col(pgxypts[i][0], &wind);
+	int row = Rast_northing_to_row(pgxypts[i][1], &wind);
+	int col = Rast_easting_to_col(pgxypts[i][0], &wind);
 
 	/* get bounding box of line segment */
 	row1 = MAX(0, MIN(row, prevrow) - rowoff);
-	row2 = MIN(G_window_rows() - 1, MAX(row, prevrow) + rowoff);
+	row2 = MIN(Rast_window_rows() - 1, MAX(row, prevrow) + rowoff);
 	col1 = MAX(0, MIN(col, prevcol) - coloff);
-	col2 = MIN(G_window_cols() - 1, MAX(col, prevcol) + coloff);
+	col2 = MIN(Rast_window_cols() - 1, MAX(col, prevcol) + coloff);
 
 	for (r = row1; r < row2; r++) {
-	    cy = G_row_to_northing(r + 0.5, &wind);
+	    cy = Rast_row_to_northing(r + 0.5, &wind);
 
 	    for (c = col1; c < col2; c++) {
-		cellx = G_col_to_easting(c + 0.5, &wind);
+		cellx = Rast_col_to_easting(c + 0.5, &wind);
 		celly = cy;	/* gets written over in distance2... */
 
 		/* Thought about not going past endpoints (use 

+ 4 - 4
raster/r.carve/raster.c

@@ -7,7 +7,7 @@
 void *read_raster(void *buf, const int fd, const RASTER_MAP_TYPE rtype)
 {
     void *tmpbuf = buf;
-    int rows = G_window_rows();
+    int rows = Rast_window_rows();
     int i;
 
     G_message(_("Reading raster map..."));
@@ -17,7 +17,7 @@ void *read_raster(void *buf, const int fd, const RASTER_MAP_TYPE rtype)
 
 	Rast_get_row(fd, tmpbuf, i, rtype);
 	tmpbuf =
-	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * G_window_cols());
+	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * Rast_window_cols());
     }
 
     return tmpbuf;
@@ -27,7 +27,7 @@ void *read_raster(void *buf, const int fd, const RASTER_MAP_TYPE rtype)
 void *write_raster(void *buf, const int fd, const RASTER_MAP_TYPE rtype)
 {
     void *tmpbuf = buf;
-    int rows = G_window_rows();
+    int rows = Rast_window_rows();
     int i;
 
     G_message(_("Writing raster map..."));
@@ -37,7 +37,7 @@ void *write_raster(void *buf, const int fd, const RASTER_MAP_TYPE rtype)
 
 	Rast_put_row(fd, tmpbuf, rtype);
 	tmpbuf =
-	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * G_window_cols());
+	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * Rast_window_cols());
     }
 
     return tmpbuf;

+ 2 - 2
raster/r.category/cats.c

@@ -38,8 +38,8 @@ int get_cats(const char *name, const char *mapset)
 
     /* open the raster map */
     fd = Rast_open_old(name, mapset);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     cell = Rast_allocate_c_buf();
     Rast_init_cell_stats(&statf);
 

+ 2 - 2
raster/r.circle/main.c

@@ -131,10 +131,10 @@ int main(int argc, char *argv[])
 
 	for (row = 0; row < w.rows; row++) {
 	    G_percent(row, w.rows, 2);
-	    cur[1] = G_row_to_northing(row + 0.5, &w);
+	    cur[1] = Rast_row_to_northing(row + 0.5, &w);
 	    for (col = 0; col < w.cols; col++) {
 		c = col;
-		cur[0] = G_col_to_easting(col + 0.5, &w);
+		cur[0] = Rast_col_to_easting(col + 0.5, &w);
 		int_buf[c] =
 		    (int)(distance(pt, cur, fmin, fmax, binary) * fmult);
 		if (int_buf[c] == 0)

+ 2 - 2
raster/r.clump/clump.c

@@ -44,8 +44,8 @@ CELL clump(int in_fd, int out_fd)
     int column;
 
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* allocate reclump index */
     nalloc = INCR;

+ 1 - 1
raster/r.coin/main.c

@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
     dumpname = G_tempfile();
     statname = G_tempfile();
 
-    window_cells = G_window_rows() * G_window_cols();
+    window_cells = Rast_window_rows() * Rast_window_cols();
 
     map1name = parm.map1->answer;
     map2name = parm.map2->answer;

+ 4 - 4
raster/r.colors/stats.c

@@ -33,8 +33,8 @@ int get_stats(const char *name, const char *mapset, struct Cell_stats *statf)
     fd = Rast_open_old(name, mapset);
 
     cell = Rast_allocate_c_buf();
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     Rast_init_cell_stats(statf);
     G_verbose_message(_("Reading raster map <%s>..."),
@@ -62,8 +62,8 @@ void get_fp_stats(const char *name, const char *mapset,
     fd = Rast_open_old(name, mapset);
 
     dcell = Rast_allocate_d_buf();
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     statf->geometric = geometric;
     statf->geom_abs = geom_abs;

+ 1 - 1
raster/r.compress/main.c

@@ -202,7 +202,7 @@ static int doit(char *name, int uncompress, RASTER_MAP_TYPE map_type)
     else
 	new = Rast_open_new(name, map_type);
 
-    nrows = G_window_rows();
+    nrows = Rast_window_rows();
     rast = Rast_allocate_buf(map_type);
 
     oldsize = lseek(old, (off_t) 0, SEEK_END);

+ 6 - 6
raster/r.cost/main.c

@@ -340,8 +340,8 @@ int main(int argc, char *argv[])
     move_dir_layer = opt11->answer;
 
     /* Find number of rows and columns in window */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* Open cost cell layer for reading */
     cost_mapset = G_find_raster2(cost_layer, "");
@@ -540,8 +540,8 @@ int main(int argc, char *argv[])
 		continue;
 	    got_one = 1;
 
-	    col = (int)G_easting_to_col(site->east, &window);
-	    row = (int)G_northing_to_row(site->north, &window);
+	    col = (int)Rast_easting_to_col(site->east, &window);
+	    row = (int)Rast_northing_to_row(site->north, &window);
 
 	    new_start_pt =
 		(struct start_pt *)(G_malloc(sizeof(struct start_pt)));
@@ -589,8 +589,8 @@ int main(int argc, char *argv[])
 		continue;
 	    have_stop_points = 1;
 
-	    col = (int)G_easting_to_col(site->east, &window);
-	    row = (int)G_northing_to_row(site->north, &window);
+	    col = (int)Rast_easting_to_col(site->east, &window);
+	    row = (int)Rast_northing_to_row(site->north, &window);
 
 	    new_start_pt =
 		(struct start_pt *)(G_malloc(sizeof(struct start_pt)));

+ 2 - 2
raster/r.covar/main.c

@@ -79,8 +79,8 @@ int main(int argc, char *argv[])
 	fd[i] = Rast_open_old(name, "");
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     G_message(_("%s: complete ... "), G_program_name());
     count = 0;

+ 2 - 2
raster/r.cross/main.c

@@ -95,8 +95,8 @@ int main(int argc, char *argv[])
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     nfiles = 0;
     non_zero = flag.z->answer;

+ 2 - 2
raster/r.describe/describe.c

@@ -88,8 +88,8 @@ int describe(const char *name, int compact, char *no_data_str,
 	Rast_set_quant_rules(fd, &q);
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     G_verbose_message(_("Reading <%s> ..."), name);
     for (row = 0; row < nrows; row++) {

+ 10 - 10
raster/r.distance/distance.c

@@ -37,8 +37,8 @@ find_minimum_distance(const struct CatEdgeList *list1, const struct CatEdgeList
     double dist;
     double e1, n1, e2, n2;
     extern double G_distance();
-    extern double G_row_to_northing();
-    extern double G_col_to_easting();
+    extern double Rast_row_to_northing();
+    extern double Rast_col_to_easting();
     int zerro_row, zerro_col;
 
     int nulldistance = 0;
@@ -48,18 +48,18 @@ find_minimum_distance(const struct CatEdgeList *list1, const struct CatEdgeList
 	nulldistance = null_distance(name1, name2, &zerro_row, &zerro_col);
 
     for (i1 = 0; i1 < list1->ncells; i1++) {
-	e1 = G_col_to_easting(list1->col[i1] + 0.5, region);
-	n1 = G_row_to_northing(list1->row[i1] + 0.5, region);
+	e1 = Rast_col_to_easting(list1->col[i1] + 0.5, region);
+	n1 = Rast_row_to_northing(list1->row[i1] + 0.5, region);
 
 	for (i2 = 0; i2 < list2->ncells; i2++) {
 	    if (!nulldistance) {
-		e2 = G_col_to_easting(list2->col[i2] + 0.5, region);
-		n2 = G_row_to_northing(list2->row[i2] + 0.5, region);
+		e2 = Rast_col_to_easting(list2->col[i2] + 0.5, region);
+		n2 = Rast_row_to_northing(list2->row[i2] + 0.5, region);
 		dist = G_distance(e1, n1, e2, n2);
 	    }
 	    else {
-		e2 = e1 = G_col_to_easting(zerro_col + 0.5, region);
-		n2 = n1 = G_row_to_northing(zerro_row + 0.5, region);
+		e2 = e1 = Rast_col_to_easting(zerro_col + 0.5, region);
+		n2 = n1 = Rast_row_to_northing(zerro_row + 0.5, region);
 		dist = 0.;
 	    }
 
@@ -101,8 +101,8 @@ int null_distance(const char *name1, const char *name2, int *zerro_row, int *zer
     G_message(_("Reading maps  <%s,%s> while finding 0 distance ..."), name1,
 	      name2);
 
-    ncols = G_window_cols();
-    nrows = G_window_rows();
+    ncols = Rast_window_cols();
+    nrows = Rast_window_rows();
 
     for (row = 0; row < nrows; row++) {
 

+ 2 - 2
raster/r.distance/edges.c

@@ -45,8 +45,8 @@ void find_edge_cells(struct Map *map)
 
     G_message(_("Reading map %s ..."), map->fullname);
 
-    ncols = G_window_cols();
-    nrows = G_window_rows();
+    ncols = Rast_window_cols();
+    nrows = Rast_window_rows();
 
     buf0 = (CELL *) G_calloc(ncols + 2, sizeof(CELL));
     buf1 = (CELL *) G_calloc(ncols + 2, sizeof(CELL));

+ 6 - 6
raster/r.drain/main.c

@@ -223,8 +223,8 @@ int main(int argc, char **argv)
 
     /* get the window information  */
     G_get_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     if (opt4->answer) {
 	Points = Vect_new_line_struct();
 	Cats = Vect_new_cats_struct();
@@ -240,8 +240,8 @@ int main(int argc, char **argv)
 	for (i = 0; coordopt->answers[i] != NULL; i += 2) {
 	    G_scan_easting(coordopt->answers[i], &east, G_projection());
 	    G_scan_northing(coordopt->answers[i + 1], &north, G_projection());
-	    start_col = (int)G_easting_to_col(east, &window);
-	    start_row = (int)G_northing_to_row(north, &window);
+	    start_col = (int)Rast_easting_to_col(east, &window);
+	    start_row = (int)Rast_northing_to_row(north, &window);
 
 	    if (start_row < 0 || start_row > nrows ||
 		start_col < 0 || start_col > ncols) {
@@ -277,8 +277,8 @@ int main(int argc, char **argv)
 		if (!G_site_in_region(site, &window))
 		    continue;
 
-		start_col = (int)G_easting_to_col(site->east, &window);
-		start_row = (int)G_northing_to_row(site->north, &window);
+		start_col = (int)Rast_easting_to_col(site->east, &window);
+		start_row = (int)Rast_northing_to_row(site->north, &window);
 
 		/* effectively just a duplicate check to G_site_in_region() ??? */
 		if (start_row < 0 || start_row > nrows || start_col < 0 ||

+ 2 - 2
raster/r.fill.dir/main.c

@@ -184,8 +184,8 @@ int main(int argc, char **argv)
 
     /* get the window information  */
     G_get_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* buffers for internal use */
     bndC.ns = ncols;

+ 3 - 3
raster/r.flow/precomp.c

@@ -80,9 +80,9 @@ static void precompute_ew_dists(void)
 
     if (G_projection() == PROJECTION_LL) {
 	for (row = 0; row < region.rows; row++) {
-	    northing = G_row_to_northing(row + 0.5, &region);
-	    ew_dist[row] = G_distance(G_col_to_easting(0., &region), northing,
-				      G_col_to_easting(1., &region),
+	    northing = Rast_row_to_northing(row + 0.5, &region);
+	    ew_dist[row] = G_distance(Rast_col_to_easting(0., &region), northing,
+				      Rast_col_to_easting(1., &region),
 				      northing);
 	}
     }

+ 4 - 4
raster/r.grow.distance/main.c

@@ -56,10 +56,10 @@ static double distance_manhattan(double dx, double dy)
 
 static double geodesic_distance(int x1, int y1, int x2, int y2)
 {
-    double lat1 = G_row_to_northing(y1 + 0.5, &window);
-    double lat2 = G_row_to_northing(y2 + 0.5, &window);
-    double lon1 = G_col_to_easting(x1 + 0.5, &window);
-    double lon2 = G_col_to_easting(x2 + 0.5, &window);
+    double lat1 = Rast_row_to_northing(y1 + 0.5, &window);
+    double lat2 = Rast_row_to_northing(y2 + 0.5, &window);
+    double lon1 = Rast_col_to_easting(x1 + 0.5, &window);
+    double lon2 = Rast_col_to_easting(x2 + 0.5, &window);
 
     return G_geodesic_distance(lon1, lat1, lon2, lat2);
 }

+ 2 - 2
raster/r.grow/main.c

@@ -170,8 +170,8 @@ int main(int argc, char **argv)
     if (opt.new->answer)
 	newval = atoi(opt.new->answer);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     if (strcmp(opt.met->answer, "euclidean") == 0)
 	setup_neighbors_euclidean(radius);

+ 4 - 4
raster/r.horizon/main.c

@@ -594,13 +594,13 @@ int OUTGR(int numrows, int numcols)
 	fd1 = Rast_open_fp_new(shad_filename);
     }
 
-    if (numrows != G_window_rows())
+    if (numrows != Rast_window_rows())
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), numrows,
-		      G_window_rows());
+		      Rast_window_rows());
 
-    if (numcols != G_window_cols())
+    if (numcols != Rast_window_cols())
 	G_fatal_error(_("OOPS: cols changed from %d to %d"), numcols,
-		      G_window_cols());
+		      Rast_window_cols());
 
     for (iarc = 0; iarc < numrows; iarc++) {
 	i = numrows - iarc - 1;

+ 4 - 4
raster/r.in.arc/main.c

@@ -131,12 +131,12 @@ int main(int argc, char *argv[])
     ncols = cellhd.cols;
     Rast_set_window(&cellhd);
 
-    if (nrows != G_window_rows())
+    if (nrows != Rast_window_rows())
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), nrows,
-		      G_window_rows());
-    if (ncols != G_window_cols())
+		      Rast_window_rows());
+    if (ncols != Rast_window_cols())
 	G_fatal_error(_("OOPS: cols changed from %d to %d"), ncols,
-		      G_window_cols());
+		      Rast_window_cols());
 
     switch (rtype) {
     case CELL_TYPE:

+ 4 - 4
raster/r.in.ascii/main.c

@@ -191,12 +191,12 @@ int main(int argc, char *argv[])
     ncols = cellhd.cols;
     Rast_set_window(&cellhd);
 
-    if (nrows != G_window_rows())
+    if (nrows != Rast_window_rows())
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), nrows,
-		      G_window_rows());
-    if (ncols != G_window_cols())
+		      Rast_window_rows());
+    if (ncols != Rast_window_cols())
 	G_fatal_error(_("OOPS: cols changed from %d to %d"), ncols,
-		      G_window_cols());
+		      Rast_window_cols());
 
 
     rast_ptr = Rast_allocate_buf(data_type);

+ 4 - 4
raster/r.in.bin/main.c

@@ -473,13 +473,13 @@ int main(int argc, char *argv[])
 
     Rast_set_window(&cellhd);
 
-    if (grass_nrows != G_window_rows())
+    if (grass_nrows != Rast_window_rows())
 	G_fatal_error("rows changed from %d to %d",
-		      grass_nrows, G_window_rows());
+		      grass_nrows, Rast_window_rows());
 
-    if (grass_ncols != G_window_cols())
+    if (grass_ncols != Rast_window_cols())
 	G_fatal_error("cols changed from %d to %d",
-		      grass_ncols, G_window_cols());
+		      grass_ncols, Rast_window_cols());
 
     expected = (off_t) ncols * nrows * bytes;
     if (flag.gmt_hd->answer)

+ 2 - 2
raster/r.in.gridatb/adjcellhd.c

@@ -12,11 +12,11 @@ int adjcellhd(struct Cell_head *cellhd)
 
     Rast_set_window(cellhd);
 
-    if (cellhd->rows != G_window_rows()) {
+    if (cellhd->rows != Rast_window_rows()) {
 	retval = 2;
     }
 
-    if (cellhd->cols != G_window_cols()) {
+    if (cellhd->cols != Rast_window_cols()) {
 	retval = 3;
     }
 

+ 4 - 4
raster/r.lake/main.c

@@ -214,8 +214,8 @@ int main(int argc, char *argv[])
     if (lakemap)
 	lake_fd = Rast_open_new(lakemap, 1);
 
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     /* If we use x,y as seed... */
     if (sdxy_opt->answer) {
@@ -225,8 +225,8 @@ int main(int argc, char *argv[])
 
 	G_scan_easting(sdxy_opt->answers[0], &east, G_projection());
 	G_scan_northing(sdxy_opt->answers[1], &north, G_projection());
-	start_col = (int)G_easting_to_col(east, &window);
-	start_row = (int)G_northing_to_row(north, &window);
+	start_col = (int)Rast_easting_to_col(east, &window);
+	start_row = (int)Rast_northing_to_row(north, &window);
 
 	if (start_row < 0 || start_row > rows ||
 	    start_col < 0 || start_col > cols)

+ 2 - 2
raster/r.le/r.le.patch/driver.c

@@ -2807,8 +2807,8 @@ void whole_reg_driver()
     REGLIST *ptrfirst, *ptrthis, *ptrnew;
     CELL *row_buf;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     n_scale = 1;
 

+ 2 - 2
raster/r.le/r.le.patch/input.c

@@ -383,8 +383,8 @@ void user_input(int argc, char **argv)
     if (edge->answer) {
 	choice->edge = atoi(edge->answer);
 	if (choice->edge < 0 ||
-	    choice->edge >= G_window_rows() ||
-	    choice->edge >= G_window_cols()) {
+	    choice->edge >= Rast_window_rows() ||
+	    choice->edge >= Rast_window_cols()) {
 	    fprintf(stderr, "\n");
 	    fprintf(stderr,
 		    "   ***********************************************\n");

+ 2 - 2
raster/r.le/r.le.pixel/driver.c

@@ -1640,8 +1640,8 @@ void whole_reg_driver()
 
     data_type = Rast_map_type(choice->fn, G_mapset());
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     g_scale = 1;
 

+ 1 - 1
raster/r.le/r.le.setup/main.c

@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
     /* setup the current window for display & clear screen */
     D_setup(1);
 
-    Rw_l = (double)G_window_cols() / G_window_rows();
+    Rw_l = (double)Rast_window_cols() / Rast_window_rows();
     /*R_open_driver(); */
     /* R_font("romant"); */
     G_get_set_window(&window);

+ 1 - 1
raster/r.le/r.le.trace/main.c

@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
     /* setup the current window for display */
     G_system(" d.colormode float");
     G_system(" d.frame -e");
-    Rw_l = (double)G_window_cols() / G_window_rows();
+    Rw_l = (double)Rast_window_cols() / Rast_window_rows();
     R_open_driver();
     R_font("romant");
     G_get_set_window(&window);

+ 3 - 3
raster/r.li/r.li.daemon/daemon.c

@@ -593,7 +593,7 @@ int write_raster(int mv_fd, int random_access, g_areas g)
     lseek(random_access, 0, SEEK_SET);
 
     cell_buf = Rast_allocate_d_buf();
-    Rast_set_d_null_value(cell_buf, G_window_cols() + 1);
+    Rast_set_d_null_value(cell_buf, Rast_window_cols() + 1);
 
     for (i = 0; i < g->sf_y + ((int)g->rl / 2); i++) {
 	Rast_put_row(mv_fd, cell_buf, DCELL_TYPE);
@@ -613,9 +613,9 @@ int write_raster(int mv_fd, int random_access, g_areas g)
 
     }
 
-    Rast_set_d_null_value(cell_buf, G_window_cols() + 1);
+    Rast_set_d_null_value(cell_buf, Rast_window_cols() + 1);
 
-    for (i = 0; i < G_window_rows() - g->sf_y - g->rows; i++)
+    for (i = 0; i < Rast_window_rows() - g->sf_y - g->rows; i++)
 	Rast_put_row(mv_fd, cell_buf, DCELL_TYPE);
 
     return 1;

+ 2 - 2
raster/r.los/main.c

@@ -194,8 +194,8 @@ int main(int argc, char *argv[])
     fcell = Rast_allocate_buf(FCELL_TYPE);
 
     /*  find number of rows and columns in elevation map    */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /*      open elevation overlay file for reading         */
     old = Rast_open_old(elev_layer, old_mapset);

+ 2 - 2
raster/r.mapcalc/map.c

@@ -27,8 +27,8 @@ void setup_region(void)
 {
     G_get_window(&current_region2);
 
-    rows = G_window_rows();
-    columns = G_window_cols();
+    rows = Rast_window_rows();
+    columns = Rast_window_cols();
     depths = 1;
 }
 

+ 2 - 2
raster/r.mapcalc/xcoor.c

@@ -24,7 +24,7 @@ int f_x(int argc, const int *argt, void **args)
     if (argt[0] != DCELL_TYPE)
 	return E_RES_TYPE;
 
-    x = G_col_to_easting(0.5, &current_region2);
+    x = Rast_col_to_easting(0.5, &current_region2);
 
     for (i = 0; i < columns; i++) {
 	res[i] = x;
@@ -46,7 +46,7 @@ int f_y(int argc, const int *argt, void **args)
     if (argt[0] != DCELL_TYPE)
 	return E_RES_TYPE;
 
-    y = G_row_to_northing(current_row + 0.5, &current_region2);
+    y = Rast_row_to_northing(current_row + 0.5, &current_region2);
 
     for (i = 0; i < columns; i++)
 	res[i] = y;

+ 2 - 2
raster/r.mfilter/main.c

@@ -108,8 +108,8 @@ int main(int argc, char **argv)
 
     in_name = opt1->answer;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     buflen = ncols * sizeof(DCELL);
 
     /* get the filter */

+ 2 - 2
raster/r.neighbors/bufs.c

@@ -15,12 +15,12 @@ int allocate_bufs(void)
     int i;
     int bufsize;
 
-    bufsize = (G_window_cols() + 2 * ncb.nsize) * sizeof(DCELL);
+    bufsize = (Rast_window_cols() + 2 * ncb.nsize) * sizeof(DCELL);
 
     ncb.buf = (DCELL **) G_malloc(ncb.nsize * sizeof(DCELL *));
     for (i = 0; i < ncb.nsize; i++) {
 	ncb.buf[i] = (DCELL *) G_malloc(bufsize);
-	Rast_set_d_null_value(ncb.buf[i], G_window_cols() + 2 * ncb.nsize);
+	Rast_set_d_null_value(ncb.buf[i], Rast_window_cols() + 2 * ncb.nsize);
     }
 
     return 0;

+ 3 - 3
raster/r.neighbors/main.c

@@ -211,12 +211,12 @@ int main(int argc, char *argv[])
     if (!flag.align->answer) {
 	Rast_get_cellhd(ncb.oldcell, "", &cellhd);
 	G_get_window(&window);
-	G_align_window(&window, &cellhd);
+	Rast_align_window(&window, &cellhd);
 	Rast_set_window(&window);
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open raster maps */
     in_fd = Rast_open_old(ncb.oldcell, "");

+ 2 - 2
raster/r.out.arc/main.c

@@ -126,8 +126,8 @@ int main(int argc, char *argv[])
      */
     raster = Rast_allocate_buf(out_type);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open arc file for writing */
     if (do_stdout)

+ 2 - 2
raster/r.out.ascii/main.c

@@ -158,8 +158,8 @@ int main(int argc, char *argv[])
 	    dp = 16;
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open ascii file for writing or use stdout */
     if (parm.output->answer && strcmp("-", parm.output->answer) != 0) {

+ 2 - 2
raster/r.out.bin/main.c

@@ -425,8 +425,8 @@ int main(int argc, char *argv[])
     if (flag.gmt_hd->answer)
 	write_gmt_header(&header, swap_flag, fp);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     in_buf = Rast_allocate_d_buf();
     out_buf = G_malloc(ncols * bytes);

+ 2 - 2
raster/r.out.gridatb/adjcellhd.c

@@ -7,10 +7,10 @@ int adjcellhd(struct Cell_head *cellhd)
 
     G_set_window(cellhd);
 
-    if (cellhd->rows != G_window_rows())
+    if (cellhd->rows != Rast_window_rows())
 	retval = 2;
 
-    if (cellhd->cols != G_window_cols())
+    if (cellhd->cols != Rast_window_cols())
 	retval = 3;
 
     return (retval);

+ 4 - 4
raster/r.out.mat/main.c

@@ -293,12 +293,12 @@ int main(int argc, char *argv[])
 
     /* data array, by increasing column */
     raster =
-	G_calloc((G_window_rows() + 1) * (G_window_cols() + 1),
+	G_calloc((Rast_window_rows() + 1) * (Rast_window_cols() + 1),
 		 Rast_cell_size(map_type));
 
     G_debug(1, "mem alloc is %d bytes\n",	/* I think _cols()+1 is unneeded? */
-	    Rast_cell_size(map_type) * (G_window_rows() +
-				       1) * (G_window_cols() + 1));
+	    Rast_cell_size(map_type) * (Rast_window_rows() +
+				       1) * (Rast_window_cols() + 1));
 
     G_verbose_message(_("Reading in map ... "));
 
@@ -306,7 +306,7 @@ int main(int argc, char *argv[])
     for (row = 0, ptr = raster; row < mrows; row++,
 	 ptr =
 	 G_incr_void_ptr(ptr,
-			 (G_window_cols() + 1) * Rast_cell_size(map_type))) {
+			 (Rast_window_cols() + 1) * Rast_cell_size(map_type))) {
 	Rast_get_row(fd, ptr, row, map_type);
 	G_percent(row, mrows, 2);
     }

+ 3 - 3
raster/r.out.mpeg/main.c

@@ -175,8 +175,8 @@ int main(int argc, char **argv)
 
     G_debug(1, "encoder = [%s]", encoder);
 
-    vrows = G_window_rows();
-    vcols = G_window_cols();
+    vrows = Rast_window_rows();
+    vcols = Rast_window_cols();
     nrows = vrows;
     ncols = vcols;
 
@@ -259,7 +259,7 @@ static int load_files(void)
     pg = G_malloc(size);
     pb = G_malloc(size);
 
-    tsiz = G_window_cols();
+    tsiz = Rast_window_cols();
 
     tr = (unsigned char *)G_malloc(tsiz);
     tg = (unsigned char *)G_malloc(tsiz);

+ 2 - 2
raster/r.out.pov/main.c

@@ -173,8 +173,8 @@ int main(int argc, char *argv[])
 
     cell = Rast_allocate_c_buf();
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     if (nrows > YMAX || ncols > XMAX)
 	G_fatal_error(_("Raster map is too big! Exceeds %d columns or %d rows"),
 		      XMAX, YMAX);

+ 0 - 0
raster/r.out.vrml/main.c


部分文件因为文件数量过多而无法显示