Statistics
| Revision:

root / trunk / libraries / libRaster / src / org / gvsig / raster / grid / filter / bands / NoDataDoubleFilter.java @ 17884

History | View | Annotate | Download (2.15 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.raster.grid.filter.bands;
20

    
21
import org.gvsig.raster.dataset.IBuffer;
22
/**
23
 * Filtro NoData para tipos de datos Double
24
 *
25
 * @version 04/12/2007
26
 * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
27
 */
28
public class NoDataDoubleFilter extends NoDataFilter {
29

    
30
        /*
31
         * (non-Javadoc)
32
         * @see org.gvsig.raster.grid.filter.bands.NoDataFilter#hasNoData(int, int)
33
         */
34
        public boolean hasNoData(int col, int line) {
35
                double data[] = new double[raster.getBandCount()];
36
                raster.getElemDouble(line, col, data);
37
                for (int band = 0; band < data.length; band++)
38
                        if (noDataValue == data[band])
39
                                return true;
40
                return false;
41
        }
42

    
43
        /*
44
         * (non-Javadoc)
45
         * @see org.gvsig.raster.grid.filter.bands.NoDataFilter#writeNoData(int, int)
46
         */
47
        public void writeNoData(int col, int line) {
48
                for (int band = 0; band < raster.getBandCount(); band++)
49
                        raster.setElem(line, col, band, (double) noDataValue);
50
        }
51

    
52
        
53
        /*
54
         * (non-Javadoc)
55
         * @see org.gvsig.raster.grid.filter.bands.ColorTableFilter#getInRasterDataType()
56
         */
57
        public int getInRasterDataType() {
58
                return IBuffer.TYPE_DOUBLE;
59
        }
60

    
61
        /*
62
         * (non-Javadoc)
63
         * @see org.gvsig.raster.grid.filter.RasterFilter#getOutRasterDataType()
64
         */
65
        public int getOutRasterDataType() {
66
                return IBuffer.TYPE_DOUBLE;
67
        }
68
}