svn-gvsig-desktop / trunk / libraries / libRaster / src / org / gvsig / raster / grid / filter / enhancement / ContrastIntegerFilter.java @ 19494
History | View | Annotate | Download (1.6 KB)
1 | 11964 | bsanchez | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2004 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.enhancement; |
||
20 | |||
21 | import org.gvsig.raster.buffer.RasterBuffer; |
||
22 | /**
|
||
23 | * Filtro de contraste para tipo de datos int.
|
||
24 | 12008 | bsanchez | *
|
25 | * @author Miguel ?ngel Querol Carratal? (miguelangel.querol@iver.es)
|
||
26 | 11964 | bsanchez | */
|
27 | public class ContrastIntegerFilter extends ContrastFilter { |
||
28 | /*
|
||
29 | * (non-Javadoc)
|
||
30 | * @see org.gvsig.raster.grid.filter.enhancement.ContrastFilter#process(int, int)
|
||
31 | */
|
||
32 | public void process(int col, int line) { |
||
33 | for (int i = 0; i < raster.getBandCount(); i++) |
||
34 | 18388 | bsanchez | rasterResult.setElem(line, col, i, (byte) calcContrast(raster.getElemInt(line, col, i) & 0xff)); |
35 | 11964 | bsanchez | } |
36 | |||
37 | /*
|
||
38 | * (non-Javadoc)
|
||
39 | * @see org.gvsig.raster.grid.filter.enhancement.ContrastFilter#getInRasterDataType()
|
||
40 | */
|
||
41 | public int getInRasterDataType() { |
||
42 | return RasterBuffer.TYPE_INT;
|
||
43 | } |
||
44 | } |