svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / io / raster / RemoveBandsShortFilter.java @ 2669
History | View | Annotate | Download (2.55 KB)
1 |
/*
|
---|---|
2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications.
|
3 |
*
|
4 |
* Copyright (C) 2004-5.
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
19 |
*
|
20 |
* For more information, contact:
|
21 |
*
|
22 |
* cresques@gmail.com
|
23 |
*/
|
24 |
package org.cresques.io.raster; |
25 |
|
26 |
|
27 |
/**
|
28 |
* Proceso del filtro de recorte de colas aplicado a im?genes 16 bits
|
29 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
30 |
*
|
31 |
*/
|
32 |
public class RemoveBandsShortFilter extends RemoveBandsFilter { |
33 |
public RemoveBandsShortFilter() {
|
34 |
} |
35 |
|
36 |
/* (non-Javadoc)
|
37 |
* @see org.cresques.io.raster.IRasterFilter#pre()
|
38 |
*/
|
39 |
public void pre() { |
40 |
//Obtenci?n de par?metros
|
41 |
this.raster = (RasterBuf) params.get("raster"); |
42 |
height = raster.getHeight(); |
43 |
width = raster.getWidth(); |
44 |
super.pre();
|
45 |
} |
46 |
|
47 |
/* (non-Javadoc)
|
48 |
* @see org.cresques.io.raster.IRasterFilter#process(int, int)
|
49 |
*/
|
50 |
public void process(int x, int y) { |
51 |
raster.getElemInt(x, y, px); |
52 |
px[0] = px[0] & m1; |
53 |
px[1] = px[1] & m2; |
54 |
px[2] = px[2] & m3; |
55 |
raster.setElemInt(x, y, px); |
56 |
} |
57 |
|
58 |
/* (non-Javadoc)
|
59 |
* @see org.cresques.io.raster.IRasterFilter#getInRasterDataType()
|
60 |
*/
|
61 |
public int getInRasterDataType() { |
62 |
return RasterBuf.TYPE_SHORT;
|
63 |
} |
64 |
|
65 |
/* (non-Javadoc)
|
66 |
* @see org.cresques.io.raster.IRasterFilter#getOutRasterDataType()
|
67 |
*/
|
68 |
public int getOutRasterDataType() { |
69 |
return RasterBuf.TYPE_SHORT;
|
70 |
} |
71 |
|
72 |
/* (non-Javadoc)
|
73 |
* @see org.cresques.io.raster.RasterFilter#processLine(int)
|
74 |
*/
|
75 |
public void processLine(int y) { |
76 |
} |
77 |
|
78 |
/* (non-Javadoc)
|
79 |
* @see org.cresques.io.raster.IRasterFilter#getResult(java.lang.String)
|
80 |
*/
|
81 |
public Object getResult(String name) { |
82 |
if (name.equals("raster")) { |
83 |
return (Object) this.image; |
84 |
} else {
|
85 |
return null; |
86 |
} |
87 |
} |
88 |
|
89 |
public void post() { |
90 |
super.post();
|
91 |
} |
92 |
} |