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

« back to all changes in this revision

Viewing changes to raster/r.null/mask.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:
1
1
#include <grass/gis.h>
 
2
#include <grass/raster.h>
2
3
#include "mask.h"
3
4
#include "local_proto.h"
4
5
 
29
30
    DCELL x;
30
31
 
31
32
    while (ncols-- > 0) {
32
 
        x = G_get_raster_value_d(rast, data_type);
33
 
        if (change_null && G_is_null_value(rast, data_type))
34
 
            G_set_raster_value_d(rast, new_null, data_type);
 
33
        x = Rast_get_d_value(rast, data_type);
 
34
        if (change_null && Rast_is_null_value(rast, data_type))
 
35
            Rast_set_d_value(rast, new_null, data_type);
35
36
        if (mask_d_select(&x, &d_mask))
36
 
            G_set_null_value(rast, 1, data_type);
37
 
        rast = G_incr_void_ptr(rast, G_raster_size(data_type));
 
37
            Rast_set_null_value(rast, 1, data_type);
 
38
        rast = G_incr_void_ptr(rast, Rast_cell_size(data_type));
38
39
    }
39
40
 
40
41
    return 0;
55
56
 
56
57
int mask_match_d_interval(DCELL x, d_Interval * I)
57
58
{
58
 
    if (G_is_d_null_value(&x))
 
59
    if (Rast_is_d_null_value(&x))
59
60
        return 0;
60
61
 
61
62
    if (I->inf < 0)
64
65
    if (I->inf > 0)
65
66
        return x >= I->high;
66
67
 
 
68
    if (I->low != I->low && I->high != I->high)
 
69
        return x != x;
 
70
 
67
71
    return x >= I->low && x <= I->high;
68
72
}