root / trunk / libraries / libRaster / src / org / gvsig / raster / grid / filter / bands / HSLToRGBManager.java @ 17108
History | View | Annotate | Download (3.53 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 java.util.ArrayList; |
22 |
|
23 |
import org.gvsig.raster.dataset.Params; |
24 |
import org.gvsig.raster.grid.filter.FilterTypeException; |
25 |
import org.gvsig.raster.grid.filter.IRasterFilterListManager; |
26 |
import org.gvsig.raster.grid.filter.RasterFilter; |
27 |
import org.gvsig.raster.grid.filter.RasterFilterList; |
28 |
import org.gvsig.raster.grid.filter.RasterFilterListManager; |
29 |
import org.gvsig.raster.util.extensionPoints.ExtensionPoints; |
30 |
import org.gvsig.raster.util.extensionPoints.ExtensionPointsSingleton; |
31 |
/**
|
32 |
* Gestor del filtro de conversi?n de HSL a RGB.
|
33 |
*
|
34 |
* @version 06/06/2007
|
35 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
36 |
*
|
37 |
*/
|
38 |
public class HSLToRGBManager implements IRasterFilterListManager { |
39 |
|
40 |
protected RasterFilterList filterList = null; |
41 |
|
42 |
public static void register() { |
43 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
44 |
extensionPoints.add("RasterFilter", "HSLToRGB", HSLToRGBManager.class); |
45 |
} |
46 |
|
47 |
/**
|
48 |
* Constructor.
|
49 |
* Asigna la lista de filtros y el managener global.
|
50 |
*
|
51 |
* @param filterListManager
|
52 |
*/
|
53 |
public HSLToRGBManager(RasterFilterListManager filterListManager) {
|
54 |
this.filterList = filterListManager.getFilterList();
|
55 |
} |
56 |
|
57 |
/**
|
58 |
* A?ade un filtro de conversi?n de RGB a HSL a la pila de filtros.
|
59 |
* @throws FilterTypeException
|
60 |
*/
|
61 |
public void addHSLToRGBFilter() throws FilterTypeException { |
62 |
RasterFilter filter = new HSLToRGBByteFilter();
|
63 |
|
64 |
//Cuando el filtro esta creado, tomamos los valores y lo a?adimos a la pila
|
65 |
|
66 |
if (filter != null) |
67 |
filterList.add(filter); |
68 |
} |
69 |
|
70 |
/*
|
71 |
* (non-Javadoc)
|
72 |
* @see org.gvsig.raster.grid.filter.IRasterFilterListManager#getRasterFilterList()
|
73 |
*/
|
74 |
public ArrayList getRasterFilterList() { |
75 |
ArrayList filters = new ArrayList(); |
76 |
filters.add(HSLToRGBFilter.class); |
77 |
return filters;
|
78 |
} |
79 |
|
80 |
/*
|
81 |
* (non-Javadoc)
|
82 |
* @see org.gvsig.raster.grid.filter.IRasterFilterListManager#addFilter(java.lang.Class, org.gvsig.raster.dataset.Params)
|
83 |
*/
|
84 |
public void addFilter(Class classFilter, Params params) throws FilterTypeException { |
85 |
if (classFilter.equals(HSLToRGBFilter.class))
|
86 |
addHSLToRGBFilter(); |
87 |
} |
88 |
|
89 |
/*
|
90 |
* (non-Javadoc)
|
91 |
* @see org.gvsig.raster.grid.filter.IRasterFilterListManager#createFilterListFromStrings(java.util.ArrayList, java.lang.String, int)
|
92 |
*/
|
93 |
public int createFilterListFromStrings(ArrayList filters, String fil, int filteri) { |
94 |
return filteri;
|
95 |
} |
96 |
|
97 |
/*
|
98 |
* (non-Javadoc)
|
99 |
* @see org.gvsig.raster.grid.filter.IRasterFilterListManager#getStringsFromFilterList(java.util.ArrayList, org.gvsig.raster.grid.filter.RasterFilter)
|
100 |
*/
|
101 |
public ArrayList getStringsFromFilterList(ArrayList filterList, RasterFilter rf) { |
102 |
return filterList;
|
103 |
} |
104 |
} |