Statistics
| Revision:

gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster_dataaccess_refactoring / org.gvsig.raster.lib / org.gvsig.raster.lib.impl / src / main / java / org / gvsig / raster / impl / grid / filter / band / HSLToRGBFilter.java @ 2308

History | View | Annotate | Download (2.39 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.raster.impl.grid.filter.band;
23

    
24
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
25
import org.gvsig.fmap.dal.coverage.datastruct.Params;
26
import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
27
import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
28
import org.gvsig.raster.impl.store.ParamsImpl;
29
import org.gvsig.raster.util.DefaultColorConversion;
30
/**
31
 * <P>
32
 * Clase base para los filtros de conversi?n de HSL a RGB. La entrada ser? 
33
 * siempre un raster de 3 bandas que ser?n tomadas como HSL.
34
 * </P>
35
 *
36
 * @author Nacho Brodin (nachobrodin@gmail.com)
37
 */
38
public class HSLToRGBFilter extends BaseRasterFilter {
39
        public static String[]            names            = new String[] { "hsltorgb" };
40
        protected DefaultColorConversion  colorConversion  = null;
41

    
42
        /**
43
         * Constructor
44
         */
45
        public HSLToRGBFilter() {
46
                super();
47
                setName(names[0]);
48
        }
49

    
50
        public void pre() throws FilterAddException {
51
                super.pre();
52
                checkRGBRenderBands();
53
                createARGBBufferResult();
54
                if(colorConversion == null)
55
                        colorConversion = new DefaultColorConversion();
56
        }
57

    
58
        public String getGroup() {
59
                return "colores";
60
        }
61

    
62
        public String[] getNames() {
63
                return names;
64
        }
65

    
66
        public Params getUIParams(String nameFilter) {
67
                Params params = new ParamsImpl();
68
                return params;
69
        }
70

    
71
        public void post() {
72
        
73
        }
74

    
75
        public void process(int x, int y) {
76
        }
77

    
78
        public int getOutRasterDataType() {
79
                return Buffer.TYPE_BYTE;
80
        }
81

    
82
        public boolean isVisible() {
83
                return true;
84
        }
85

    
86
        public int getInRasterDataType() {
87
                return Buffer.TYPE_BYTE;
88
        }
89
}