~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to raster/r.thin/thin_lines.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        top = bottom;           /* line above the one we're changing */
50
50
        bottom = get_a_row(row);        /* line we're working on now */
51
51
        for (col = pad_size; col < n_cols - pad_size; col++) {
52
 
            if (bottom[col]) {  /* not background pixel */
 
52
            /* skip background cells */
 
53
            if (!Rast_is_c_null_value(&(bottom[col]))) {
53
54
                if (col < box_left)     /* find bounding box which will */
54
55
                    box_left = col;     /*   cover part of raster map which */
55
56
                if (col > box_right)    /*   has lines in it */
107
108
    N_Templ[7] = /* 00000010 */ 2;
108
109
 
109
110
    new_med = (CELL *) G_malloc(sizeof(CELL) * (n_cols));
110
 
    for (i = 0; i < n_cols; i++)
111
 
        new_med[i] = 0;
 
111
    Rast_set_c_null_value(new_med, n_cols);
112
112
    row_buf = (CELL *) G_malloc(sizeof(CELL) * (n_cols));
113
 
    for (i = 0; i < n_cols; i++)
114
 
        row_buf[i] = 0;
 
113
    Rast_set_c_null_value(row_buf, n_cols);
115
114
 
116
115
    deleted = 1;
117
116
    i = 1;
137
136
                    new_med[col] = med[col];
138
137
                bottom = get_a_row(row + 1);
139
138
                for (col = box_left; col <= box_right; col++) {
140
 
                    if (med[col]) {     /* if pixel is not blank */
 
139
                    if (!Rast_is_c_null_value(&(med[col]))) {   /* if cell is not NULL */
141
140
                        W = encode_neighbours(top, med, bottom, col, 1);
142
141
                        /* current window */
143
142
                        N_W = encode_neighbours(top, med, bottom, col, -1);
150
149
                             ((N_Templ[ind3] & N_W) == N_Templ[ind3]))) {
151
150
                            /* fprintf(stdout, "col: %d,   row: %d\n", col, row); */
152
151
                            deleted++;
153
 
                            new_med[col] = 0;
 
152
                            Rast_set_c_null_value(&(new_med[col]), 1);
154
153
                        }
155
154
 
156
155
                    }           /* end blank pixel */
167
166
            }                   /* end row loop */
168
167
        }                       /* j-loop */
169
168
 
170
 
        G_message(_("Deleted %d  pixels "), deleted);
 
169
        G_message(_n("Deleted %d pixel", "Deleted %d pixels", deleted), deleted);
171
170
    }                           /* while delete >0 */
172
171
 
173
172
    if ((deleted == 0) && (i <= iterations))
188
187
 
189
188
    T = 0;
190
189
    if (neg > 0)
191
 
        T = (((middle[col + 1] != 0) << 5) | ((top[col + 1] !=
192
 
                                               0) << 6) | ((top[col] !=
193
 
                                                            0) << 7) |
194
 
             ((top[col - 1] != 0)) | ((middle[col - 1] !=
195
 
                                       0) << 1) | ((bottom[col - 1] !=
196
 
                                                    0) << 2) | ((bottom[col]
197
 
                                                                 !=
198
 
                                                                 0) << 3) |
199
 
             ((bottom[col + 1] != 0) << 4));
 
190
        T = (((!Rast_is_c_null_value(&(middle[col + 1]))) << 5) |
 
191
             ((!Rast_is_c_null_value(&(top[col + 1]))) << 6) |
 
192
             ((!Rast_is_c_null_value(&(top[col]))) << 7) |
 
193
             ((!Rast_is_c_null_value(&(top[col - 1])))) |
 
194
             ((!Rast_is_c_null_value(&(middle[col - 1]))) << 1) |
 
195
             ((!Rast_is_c_null_value(&(bottom[col - 1]))) << 2) |
 
196
             ((!Rast_is_c_null_value(&(bottom[col]))) << 3) |
 
197
             ((!Rast_is_c_null_value(&(bottom[col + 1]))) << 4));
200
198
    else
201
 
        T = (((middle[col + 1] == 0) << 5) | ((top[col + 1] ==
202
 
                                               0) << 6) | ((top[col] ==
203
 
                                                            0) << 7) |
204
 
             ((top[col - 1] == 0)) | ((middle[col - 1] ==
205
 
                                       0) << 1) | ((bottom[col - 1] ==
206
 
                                                    0) << 2) | ((bottom[col]
207
 
                                                                 ==
208
 
                                                                 0) << 3) |
209
 
             ((bottom[col + 1] == 0) << 4));
 
199
        T = (((Rast_is_c_null_value(&(middle[col + 1]))) << 5) |
 
200
             ((Rast_is_c_null_value(&(top[col + 1]))) << 6) |
 
201
             ((Rast_is_c_null_value(&(top[col]))) << 7) |
 
202
             ((Rast_is_c_null_value(&(top[col - 1])))) |
 
203
             ((Rast_is_c_null_value(&(middle[col - 1]))) << 1) |
 
204
             ((Rast_is_c_null_value(&(bottom[col - 1]))) << 2) |
 
205
             ((Rast_is_c_null_value(&(bottom[col]))) << 3) |
 
206
             ((Rast_is_c_null_value(&(bottom[col + 1]))) << 4));
210
207
 
211
208
    return (T);
212
209
}