Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.api / src / main / java / org / gvsig / fmap / dal / coverage / datastruct / NoData.java @ 2443

History | View | Annotate | Download (3.92 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.fmap.dal.coverage.datastruct;
23

    
24
/**
25
 * This class represents the nodata value.
26
 * 
27
 * @author Nacho Brodin (nachobrodin@gmail.com)
28
 */
29
public interface NoData {
30
        
31
        /**
32
         * Gets a unique value for nodata. It doesn't take into account if the raster has
33
         * several bands. Returns the same value for all of them.
34
         * @return the noData
35
         */
36
        public Number getValue();
37

    
38
        /**
39
         * Sets a unique value for nodata. It doesn't take into account if the raster has
40
         * several bands. Assigns the same value for all of them.
41
         * @param noData the noData to set
42
         */
43
        public void setValue(Number noData);
44
        
45
        /**
46
         * Returns true if getValue is defined and false if is null
47
         * @return
48
         */
49
        public boolean isDefined();
50
        
51
        /**
52
         * NoData value persistence. Saves the nodata value in the rmf.
53
         */
54
        public void save();
55
        
56
        /**
57
         * Loads this class from the rmf.
58
         */
59
        public void load();
60
        
61
        /**
62
         * Deletes the nodata value.
63
         */
64
        public void delete();
65
        
66
        /**
67
         * Restores native value. The native is the original value
68
         * saved in the head of the file or its metadata. This value
69
         * has to be assign when NoData object is initialize. 
70
         */
71
        public void restore();
72
        
73
        /**
74
         * The native is the original value
75
         * saved in the head of the file or its metadata. This value
76
         * has to be assign when NoData object is initialize
77
         * @return the noData
78
         */
79
        public Number getNativeValue();
80
        
81
        /**
82
         * The native is the original value
83
         * saved in the head of the file or its metadata. This value
84
         * has to be assign when NoData object is initialize.
85
         * @param nativeNoDataValue
86
         */
87
        public void setNativeValue(Number nativeNoDataValue);
88
        
89
        /**
90
         * Sets the file name
91
         * @param bandCount
92
         */
93
        public void setFileName(String fileName);
94
        
95
        /**
96
         * Flag to renderize nodata values as transparent
97
         * @return
98
         */
99
        public boolean isNoDataTransparent();
100

    
101
        /**
102
         * Flag to renderize nodata values as transparent
103
         * @param noDataAsTransparent
104
         */
105
        public void setNoDataTransparent(boolean noDataAsTransparent);
106
        
107
        /**
108
         * Gets the NoData data type
109
         * @return
110
         */
111
        public int getDataType();
112
        
113
        /**
114
         * Sets the datatype
115
         */
116
        public void setDataType(int datatype);
117
        
118
        /**
119
         * Compares two NoData objects an returns true if contains the same values
120
         * @param noData
121
         * @return
122
         */
123
        public boolean compare(NoData noData);
124
        
125
        /**
126
     * Creates and returns a copy of this object.
127
         * @return
128
         */
129
        public Object clone();
130
        
131
        //***********************************************
132
        //Only for file with more than one band
133
        
134
        /**
135
         * Gets the nodata value by band
136
         * @param nBand
137
         * @return
138
         */
139
        public Number getValueByBand(int nBand);
140
        
141
        /**
142
         * Gets the number of bands
143
         * @return
144
         */
145
        public int getBandCount();
146
        
147
        /**
148
         * Sets the number of bands
149
         * @param bandCount
150
         */
151
        public void setBandCount(int bandCount);
152
        
153
        /**
154
         * Assigns one value in a band
155
         * @param noDataValue
156
         */
157
        public void setValueByBand(Number noDataValue, int nBand);
158

    
159
}