~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to imagery/i.rectify/readcell.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include <fcntl.h>
12
12
#include <unistd.h>
13
13
#include <grass/gis.h>
 
14
#include <grass/raster.h>
14
15
#include <grass/glocale.h>
15
16
#include "global.h"
16
17
 
26
27
    int nblocks;
27
28
    int i;
28
29
 
29
 
    nrows = G_window_rows();
30
 
    ncols = G_window_cols();
 
30
    G_srand48(0);
 
31
 
 
32
    nrows = Rast_input_window_rows();
 
33
    ncols = Rast_input_window_cols();
31
34
 
32
35
    ny = (nrows + BDIM - 1) / BDIM;
33
36
    nx = (ncols + BDIM - 1) / BDIM;
75
78
            if (row + y >= nrows)
76
79
                break;
77
80
 
78
 
            G_get_d_raster_row(fdi, &tmpbuf[y * nx * BDIM], row + y);
 
81
            Rast_get_d_row(fdi, &tmpbuf[y * nx * BDIM], row + y);
79
82
        }
80
83
 
81
84
        for (x = 0; x < nx; x++)
105
108
 
106
109
block *get_block(struct cache * c, int idx)
107
110
{
108
 
    int replace = rand() % c->nblocks;
 
111
    int replace = G_lrand48() % c->nblocks;
109
112
    block *p = &c->blocks[replace];
110
113
    int ref = c->refs[replace];
111
114
    off_t offset = (off_t) idx * sizeof(DCELL) << L2BSIZE;