Skip to content

Commit

Permalink
rasterlib: fns from put_row.c renamed, see
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed Jun 30, 2009
1 parent 5ddb9ed commit 4dade3f
Show file tree
Hide file tree
Showing 124 changed files with 595 additions and 619 deletions.
2 changes: 1 addition & 1 deletion doc/raster/r.example/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int main(int argc, char *argv[])
}

/* write raster row to output raster map */
if (Rast_put_raster_row(outfd, outrast, data_type) < 0)
if (Rast_put_row(outfd, outrast, data_type) < 0)
G_fatal_error(_("Failed writing raster map <%s>"), result);
}

Expand Down
2 changes: 1 addition & 1 deletion imagery/i.albedo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ int main(int argc, char *argv[])
}
((DCELL *) outrast)[col] = de;
}
if (Rast_put_raster_row(outfd, outrast, out_data_type) < 0)
if (Rast_put_row(outfd, outrast, out_data_type) < 0)
G_fatal_error(_("Failed writing raster map <%s> row %d"),
result, row);
}
Expand Down
4 changes: 2 additions & 2 deletions imagery/i.atcorr/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,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]);
Rast_put_raster_row(ofd, cbuf, CELL_TYPE);
Rast_put_row(ofd, cbuf, CELL_TYPE);
}


Expand Down Expand Up @@ -405,7 +405,7 @@ static void process_raster (int ifd, InputMask imask, ScaleRange iscale,
}

/* write output */
if(oflt) Rast_put_raster_row(ofd, buf, FCELL_TYPE);
if(oflt) Rast_put_row(ofd, buf, FCELL_TYPE);
else write_fp_to_cell(ofd, buf);
}

Expand Down
2 changes: 1 addition & 1 deletion imagery/i.biomass/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int main(int argc, char *argv[])
outrast1[col] = d;
}
}
if (Rast_put_d_raster_row(outfd1, outrast1) < 0)
if (Rast_put_d_row(outfd1, outrast1) < 0)
G_fatal_error(_("Failed writing raster map <%s>"), result1);
}

Expand Down
2 changes: 1 addition & 1 deletion imagery/i.cca/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ transform(int datafds[MX], int outfds[MX], int rows, int cols,

/* output the row of data */
for (j = 1; j <= bands; j++)
if (Rast_put_raster_row(outfds[j], rowbufs[j], CELL_TYPE) < 0)
if (Rast_put_row(outfds[j], rowbufs[j], CELL_TYPE) < 0)
G_fatal_error(_("Error writing cell map during transform."));
}
for (i = 1; i <= bands; i++)
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.class/signature.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ int display_signature(void)
buffer[col] = (CELL) 1;
past:;
}
Rast_put_raster_row(fd, buffer, CELL_TYPE);
Rast_put_row(fd, buffer, CELL_TYPE);
}

Rast_close(fd);
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.eb.eta/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int main(int argc, char *argv[])
outrast1[col] = d;
}
}
if (Rast_put_d_raster_row(outfd1,outrast1) < 0)
if (Rast_put_d_row(outfd1,outrast1) < 0)
G_fatal_error(_("Failed writing raster map <%s>"), result1);
}
G_free(inrast_rnetday);
Expand Down
4 changes: 2 additions & 2 deletions imagery/i.eb.evapfr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ int main(int argc, char *argv[])
}
}
}
if (Rast_put_d_raster_row(outfd1, outrast1) < 0)
if (Rast_put_d_row(outfd1, outrast1) < 0)
G_fatal_error(_("Failed writing raster map <%s>"), result1);
if (makin)
{
if (Rast_put_d_raster_row(outfd2, outrast2) < 0)
if (Rast_put_d_row(outfd2, outrast2) < 0)
G_fatal_error(_("Failed writing raster map <%s>"), result2);
}
}
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.eb.h_SEBAL01/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ int main(int argc, char *argv[])
outrast[col] = d_h3;
}
}
if (Rast_put_d_raster_row(outfd, outrast) < 0)
if (Rast_put_d_row(outfd, outrast) < 0)
G_fatal_error("Failed writing raster map <%s>", h0);
}

Expand Down
2 changes: 1 addition & 1 deletion imagery/i.eb.soilheatflux/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ int main(int argc, char *argv[])
outrast[col] = d;
}
}
if (Rast_put_d_raster_row(outfd, outrast) < 0)
if (Rast_put_d_row(outfd, outrast) < 0)
G_fatal_error(_("Failed writing raster map <%s>"), result);
}
G_free(inrast_albedo);
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.emissivity/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int main(int argc, char *argv[])
outr[col] = d;
}
}
if (Rast_put_raster_row(outfd, outr, DCELL_TYPE) < 0)
if (Rast_put_row(outfd, outr, DCELL_TYPE) < 0)
G_fatal_error(_("Cannot write to output raster file"));
}
G_free(inr);
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.evapo.time_integration/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ int main(int argc, char *argv[])
}
}
}
if (Rast_put_raster_row(outfd, outrast, out_data_type) < 0)
if (Rast_put_row(outfd, outrast, out_data_type) < 0)
G_fatal_error(_("Unable to write to raster map<%s>"), result);
}

Expand Down
4 changes: 2 additions & 2 deletions imagery/i.fft/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ int main(int argc, char *argv[])
cell_real[j] = data[C(i, j)][0];
cell_imag[j] = data[C(i, j)][1];
}
Rast_put_d_raster_row(realfd, cell_real);
Rast_put_d_raster_row(imagfd, cell_imag);
Rast_put_d_row(realfd, cell_real);
Rast_put_d_row(imagfd, cell_imag);

G_percent(i+1, rows, 2);
}
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.his.rgb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int main(int argc, char **argv)

/* write out the new row for each cell map */
for (band = 0; band < 3; band++)
if (Rast_put_raster_row(fd_output[band], rowbuffer[band], CELL_TYPE)
if (Rast_put_row(fd_output[band], rowbuffer[band], CELL_TYPE)
< 0)
G_fatal_error(_("Failed writing raster map row %d"), i);
}
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.ifft/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int main(int argc, char *argv[])
for (i = 0; i < rows; i++) {
for (j = 0; j < cols; j++)
cell_real[j] = data[C(i, j)][0];
Rast_put_d_raster_row(outputfd, cell_real);
Rast_put_d_row(outputfd, cell_real);

G_percent(i+1, rows, 2);
}
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.latlong/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int main(int argc, char *argv[])
d = latitude;
outrast1[col] = d;
}
if (Rast_put_d_raster_row(outfd1, outrast1) < 0)
if (Rast_put_d_row(outfd1, outrast1) < 0)
G_fatal_error(_("Cannot write to output raster file"));
}
G_free(inrast);
Expand Down
4 changes: 2 additions & 2 deletions imagery/i.maxlik/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ int main(int argc, char *argv[])
row);

classify(class_cell, reject_cell, ncols);
Rast_put_raster_row(class_fd, class_cell, CELL_TYPE);
Rast_put_row(class_fd, class_cell, CELL_TYPE);
if (reject_fd > 0)
Rast_put_raster_row(reject_fd, reject_cell, CELL_TYPE);
Rast_put_row(reject_fd, reject_cell, CELL_TYPE);
}
G_percent(nrows, nrows, 2);

Expand Down
2 changes: 1 addition & 1 deletion imagery/i.modis.qc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ int main(int argc, char *argv[])
outrast[col] = c;
}

if (Rast_put_c_raster_row(outfd, outrast) < 0)
if (Rast_put_c_row(outfd, outrast) < 0)
G_fatal_error(_("Failed writing raster map <%s> row %d"),
output->answer, row);
}
Expand Down
4 changes: 2 additions & 2 deletions imagery/i.pca/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,

if (pass == PASSES) {
if (scale)
Rast_put_raster_row(out_fd, outbuf, CELL_TYPE);
Rast_put_row(out_fd, outbuf, CELL_TYPE);
else
Rast_put_raster_row(out_fd, outbuf, DCELL_TYPE);
Rast_put_row(out_fd, outbuf, DCELL_TYPE);
}
}

Expand Down
4 changes: 2 additions & 2 deletions imagery/i.rectify/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int write_matrix(int row, int col)
unlink(temp_name);
G_fatal_error(_("Error while writing to temp file"));
}
/*Rast_put_map_row_random (outfd, cell_buf[n], row++, col, matrix_cols); */
/*Rast_put_c_row_random (outfd, cell_buf[n], row++, col, matrix_cols); */
}
select_current_env();

Expand All @@ -55,7 +55,7 @@ int write_map(char *name)
if (read(temp_fd, rast, target_window.cols * Rast_cell_size(map_type))
!= target_window.cols * Rast_cell_size(map_type))
G_fatal_error(_("Error writing row %d"), row);
if (Rast_put_raster_row(fd, rast, map_type) < 0) {
if (Rast_put_row(fd, rast, map_type) < 0) {
G_fatal_error(_("Failed writing raster map <%s> row %d"),
name, row);
unlink(temp_name);
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.rgb.his/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int main(int argc, char **argv)

/* write out the new row for each cell map */
for (band = 0; band < 3; band++)
if (Rast_put_raster_row(fd_output[band], rowbuffer[band], CELL_TYPE)
if (Rast_put_row(fd_output[band], rowbuffer[band], CELL_TYPE)
< 0)
G_fatal_error(_("Failed writing raster map row %d"), i);
}
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.smap/write_img.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int write_img(unsigned char **img, int ncols, int nrows, struct SigSet *S, /* cl
G_debug(3, "class: [%d] row/col: [%d][%d]", class, row, col);
files->outbuf[col] = (CELL) S->ClassSig[class].classnum;
}
Rast_put_raster_row(files->output_fd, files->outbuf, CELL_TYPE);
Rast_put_row(files->output_fd, files->outbuf, CELL_TYPE);
}
G_percent(nrows, nrows, 2);

Expand Down
2 changes: 1 addition & 1 deletion imagery/i.sunhours/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main(int argc, char *argv[])
d_N = (360.0 / (15.0 * PI)) * d_Ws;
((DCELL *) outrast1)[col] = d_N;
}
if (Rast_put_raster_row(outfd1, outrast1, DCELL_TYPE) < 0)
if (Rast_put_row(outfd1, outrast1, DCELL_TYPE) < 0)
G_fatal_error(_("Cannot write to output raster file"));
}
G_free(inrast_lat);
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.vi/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ int main(int argc, char *argv[])
outrast[col] = va_ri(d_redchan, d_greenchan, d_bluechan);
}
}
if (Rast_put_d_raster_row(outfd, outrast) < 0)
if (Rast_put_d_row(outfd, outrast) < 0)
G_fatal_error(_("Failed writing raster map <%s> row %d"),
result, row);
}
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.zc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ int main(int argc, char *argv[])
for (j = 0; j < oc; j++) {
*(cell_row + j) = (CELL) (*(data[1] + i * cols + j));
}
Rast_put_raster_row(zcfd, cell_row, CELL_TYPE);
Rast_put_row(zcfd, cell_row, CELL_TYPE);
}
Rast_close(zcfd);

Expand Down
9 changes: 4 additions & 5 deletions include/raster.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,10 @@ int Rast_set_quant_rules(int, struct Quant *);
int Rast_put_cellhd(const char *, struct Cell_head *);

/* put_row.c */
int Rast_put_map_row(int, const CELL *);
int Rast_put_raster_row(int, const void *, RASTER_MAP_TYPE);
int Rast_put_c_raster_row(int, const CELL *);
int Rast_put_f_raster_row(int, const FCELL *);
int Rast_put_d_raster_row(int, const DCELL *);
int Rast_put_row(int, const void *, RASTER_MAP_TYPE);
int Rast_put_c_row(int, const CELL *);
int Rast_put_f_row(int, const FCELL *);
int Rast_put_d_row(int, const DCELL *);
int Rast__open_null_write(int);
int Rast__write_null_bits(int, const unsigned char *, int, int, int);

Expand Down
6 changes: 3 additions & 3 deletions lib/gpde/N_arrays_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,17 @@ void N_write_array_2d_to_rast(N_array_2d * array, char *name)
drast[x] = N_get_array_2d_d_value(array, x, y);
}
if (type == CELL_TYPE)
if (!Rast_put_c_raster_row(map, rast)) {
if (!Rast_put_c_row(map, rast)) {
Rast_unopen(map); /*unopen the new raster map */
G_fatal_error(_("Unable to write raster row %i"), y);
}
if (type == FCELL_TYPE)
if (!Rast_put_f_raster_row(map, frast)) {
if (!Rast_put_f_row(map, frast)) {
Rast_unopen(map); /*unopen the new raster map */
G_fatal_error(_("Unable to write raster row %i"), y);
}
if (type == DCELL_TYPE)
if (!Rast_put_d_raster_row(map, drast)) {
if (!Rast_put_d_row(map, drast)) {
Rast_unopen(map); /*unopen the new raster map */
G_fatal_error(_("Unable to write raster row %i"), y);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/raster/closecell.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static int close_new_gdal(int fd, int ok)

Rast_zero_raster_buf(fcb->data, fcb->map_type);
for (row = fcb->cur_row; row < fcb->cellhd.rows; row++)
Rast_put_raster_row(fd, fcb->data, fcb->map_type);
Rast_put_row(fd, fcb->data, fcb->map_type);
G_free(fcb->data);
fcb->data = NULL;
}
Expand Down Expand Up @@ -334,7 +334,7 @@ static int close_new(int fd, int ok)
if (fcb->cur_row < fcb->cellhd.rows) {
Rast_zero_raster_buf(fcb->data, fcb->map_type);
for (row = fcb->cur_row; row < fcb->cellhd.rows; row++)
Rast_put_raster_row(fd, fcb->data, fcb->map_type);
Rast_put_row(fd, fcb->data, fcb->map_type);
G_free(fcb->data);
fcb->data = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/raster/opencell.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ int Rast__open_old(const char *name, const char *mapset)
\brief Opens a new cell file in a database (compressed)
Opens a new cell file <i>name</i> in the current mapset for writing
by Rast_put_raster_row().
by Rast_put_row().
The file is created and filled with no data it is assumed that the
new cell file is to conform to the current window.
Expand Down
Loading

0 comments on commit 4dade3f

Please sign in to comment.