svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / io / raster / PercentTailTrimShortFilter.java @ 4578
History | View | Annotate | Download (2.28 KB)
1 | 2809 | nacho | /*
|
---|---|---|---|
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 PercentTailTrimShortFilter extends PercentTailTrimFilter { |
||
33 | public PercentTailTrimShortFilter() {
|
||
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 | sample[0][count] = px[0]; |
||
53 | sample[1][count] = px[1]; |
||
54 | sample[2][count] = px[2]; |
||
55 | count++; |
||
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 | public void post() { |
||
79 | super.post();
|
||
80 | } |
||
81 | } |