Statistics
| Revision:

root / trunk / libraries / libCq_CMS_praster / src / org / cresques / filter / IRaster.java @ 8026

History | View | Annotate | Download (3 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.filter;
25

    
26
import java.awt.image.DataBuffer;
27
import es.gva.cit.jgdal.Gdal;
28

    
29

    
30
/**
31
 * Raster con acceso a los elementos individuales (pixeles o datos de celda).
32
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
33
 */
34
public interface IRaster {
35
    public final static int TYPE_UNDEFINED = DataBuffer.TYPE_UNDEFINED;
36
    public final static int TYPE_BYTE = DataBuffer.TYPE_BYTE;
37
    public final static int TYPE_SHORT = DataBuffer.TYPE_SHORT;
38
    public final static int TYPE_USHORT = DataBuffer.TYPE_USHORT;
39
    public final static int TYPE_INT = DataBuffer.TYPE_INT;
40
    public final static int TYPE_FLOAT = DataBuffer.TYPE_FLOAT;
41
    public final static int TYPE_DOUBLE = DataBuffer.TYPE_DOUBLE;
42
    public final static int TYPE_IMAGE = -1;
43

    
44
    /**
45
     * Ancho del raster
46
     * @return Entero con el ancho del raster
47
     */
48
    public int getWidth();
49

    
50
    /**
51
     * Alto del raster
52
     * @return Entero con el alto del raster
53
     */
54
    public int getHeight();
55

    
56
    /**
57
     * N?mero de bandas
58
     * @return Entero con el n?mero de bandas
59
     */
60
    public int getBandCount();
61

    
62
    /**
63
     * Devuelve el tipo de datos del raster
64
     * @see java.awt.image.DataBuffer
65
     */
66
    public int getDataType();
67

    
68
    /**
69
     * Obtiene sobre un array de bandas el valor del raster en la
70
     * coordenada que se le pasa. Los elementos son de 16 bits.
71
     * @param x        coordenada X
72
     * @param y coordenada Y
73
     * @param px Array de 4 elementos para las bandas de la imagen ARGB
74
     */
75
    public void getElemShort(int x, int y, short[] px);
76

    
77
    /**
78
     * Obtiene sobre un array de bandas el valor del raster en la
79
     * coordenada que se le pasa. Los elementos son de 32 bits.
80
     * @param x        coordenada X
81
     * @param y coordenada Y
82
     * @param px Array de 4 elementos para las bandas de la imagen ARGB
83
     */
84
    public void getElemInt(int x, int y, int[] px);
85

    
86
    /**
87
     * Obtiene el valor del raster en la coordenada que se le pasa.
88
     * Devuelve un int.
89
     * @param x        coordenada X
90
     * @param y coordenada Y
91
     * @param band banda
92
     * @return Entero
93
     */
94
    public int getElemInt(int x, int y, int band);
95
}