org.cresques.io.raster
Class RasterBuf

java.lang.Object
  extended byorg.cresques.io.raster.RasterBuf
All Implemented Interfaces:
IRaster

public class RasterBuf
extends java.lang.Object
implements IRaster

Rectangulo de pixeles. parecido a java.awt.image.Raster

Author:
Luis W. Sevilla (sevilla_lui@gva.es)

Field Summary
 
Fields inherited from interface org.cresques.io.raster.IRaster
TYPE_BYTE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_IMAGE, TYPE_INT, TYPE_SHORT, TYPE_UNDEFINED, TYPE_USHORT
 
Constructor Summary
RasterBuf(int dataType, int width, int height, int bandNr, java.awt.Point orig)
          Constructor
 
Method Summary
 int getBandNr()
          Número de bandas
 int getDataSize()
          Obtiene el tipo de dato
 int getDataType()
          Devuelve el tipo de datos del raster
 int getElemInt(int x, int y, int band)
          Obtiene el valor del raster en la coordenada que se le pasa.
 void getElemInt(int x, int y, int[] px)
          Obtiene sobre un array de bandas el valor del raster en la coordenada que se le pasa.
 void getElemShort(int x, int y, int[] px)
          Obtiene sobre un array de bandas el valor del raster en la coordenada que se le pasa.
 int getHeight()
          Alto del raster
 byte[][] getLineByte(int y)
           
 int[][] getLineInt(int y)
           
 short[][] getLineShort(int y)
           
 int getWidth()
          Ancho del raster
 void setElemInt(int x, int y, int[] px)
           
 void setElemShort(int x, int y, int[] px)
           
 int sizeof()
          Obtiene el tamaño del buffer
static java.lang.String typesToString(int type)
          Convierte un tipo de dato a cadena
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RasterBuf

public RasterBuf(int dataType,
                 int width,
                 int height,
                 int bandNr,
                 java.awt.Point orig)
Constructor

Parameters:
dataType - Tipo de dato
width - Ancho
height - Alto
bandNr - Banda
orig -
Method Detail

getWidth

public int getWidth()
Description copied from interface: IRaster
Ancho del raster

Specified by:
getWidth in interface IRaster
Returns:
Entero con el ancho del raster

getHeight

public int getHeight()
Description copied from interface: IRaster
Alto del raster

Specified by:
getHeight in interface IRaster
Returns:
Entero con el alto del raster

getBandNr

public int getBandNr()
Description copied from interface: IRaster
Número de bandas

Specified by:
getBandNr in interface IRaster
Returns:
Entero con el número de bandas

getDataType

public int getDataType()
Description copied from interface: IRaster
Devuelve el tipo de datos del raster

Specified by:
getDataType in interface IRaster
See Also:
DataBuffer

getDataSize

public int getDataSize()
Obtiene el tipo de dato

Returns:
Tipo de dato

sizeof

public int sizeof()
Obtiene el tamaño del buffer

Returns:
tamaño del buffer

getLineByte

public byte[][] getLineByte(int y)

getLineShort

public short[][] getLineShort(int y)

getLineInt

public int[][] getLineInt(int y)

getElemShort

public void getElemShort(int x,
                         int y,
                         int[] px)
Description copied from interface: IRaster
Obtiene sobre un array de bandas el valor del raster en la coordenada que se le pasa. Los elementos son de 16 bits.

Specified by:
getElemShort in interface IRaster
Parameters:
x - coordenada X
y - coordenada Y
px - Array de 4 elementos para las bandas de la imagen ARGB

getElemInt

public void getElemInt(int x,
                       int y,
                       int[] px)
Description copied from interface: IRaster
Obtiene sobre un array de bandas el valor del raster en la coordenada que se le pasa. Los elementos son de 32 bits.

Specified by:
getElemInt in interface IRaster
Parameters:
x - coordenada X
y - coordenada Y
px - Array de 4 elementos para las bandas de la imagen ARGB

setElemShort

public void setElemShort(int x,
                         int y,
                         int[] px)

setElemInt

public void setElemInt(int x,
                       int y,
                       int[] px)

getElemInt

public int getElemInt(int x,
                      int y,
                      int band)
Description copied from interface: IRaster
Obtiene el valor del raster en la coordenada que se le pasa. Devuelve un int.

Specified by:
getElemInt in interface IRaster
Parameters:
x - coordenada X
y - coordenada Y
band - banda
Returns:
Entero

typesToString

public static java.lang.String typesToString(int type)
Convierte un tipo de dato a cadena

Parameters:
type - Tipo de dato
Returns:
cadena que representa el tipo de dato