org.deegree.coverage.raster.data.info
Class RasterDataInfo

java.lang.Object
  extended by org.deegree.coverage.raster.data.info.RasterDataInfo
All Implemented Interfaces:
Serializable

public class RasterDataInfo
extends Object
implements Serializable

The RasterDataInfo class encapsulates

Version:
$Revision: 31644 $, $Date: 2011-08-24 22:27:43 +0200 (Wed, 24 Aug 2011) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $
See Also:
Serialized Form

Field Summary
 BandType[] bandInfo
          The definitions of the bands
 int bands
          The number of bands of the raster data
 int dataSize
          The byte size of a single band unit
 DataType dataType
          The datatype of the data
 InterleaveType interleaveType
          Interleave information
 byte[] noDataPixel
          The values of the bands, which are used for no data.
 
Constructor Summary
RasterDataInfo(BandType[] bandInfo, DataType dataType, InterleaveType interleaveType)
          create a new RasterDataInfo and initialize the no data pixel with null.
RasterDataInfo(byte[] noDataPixel, BandType[] bandInfo, DataType dataType, InterleaveType interleaveType)
           
 
Method Summary
 int bands()
           
 boolean equals(Object other)
           
 BandType[] getBandInfo()
           
 byte getByteNoDataForBand(int band)
          Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.BYTE 0 will be returned.
 int getDataSize()
           
 DataType getDataType()
           
 double getDoubleNoDataForBand(int band)
          Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.DOUBLE 0 will be returned.
 float getFloatNoDataForBand(int band)
          Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.FLOAT 0 will be returned.
 InterleaveType getInterleaveType()
           
 int getIntNoDataForBand(int band)
          Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.INT 0 will be returned.
 byte[] getNoDataPixel(BandType[] bands)
          Returns the no data values for this raster's bands
 byte[] getNoDataPixel(byte[] result)
          Returns the no data values for this raster's bands
 byte[] getNoDataSample(int band, byte[] result)
          Returns the no data values for the given band.
 short getShortNoDataForBand(int band)
          Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.SHORT or DataType.USHORT 0 will be returned.
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 void setNoDataPixel(byte[] values)
          Sets the no data values for this raster's bands
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noDataPixel

public final byte[] noDataPixel
The values of the bands, which are used for no data.


bandInfo

public final BandType[] bandInfo
The definitions of the bands


dataType

public final DataType dataType
The datatype of the data


interleaveType

public final InterleaveType interleaveType
Interleave information


bands

public final int bands
The number of bands of the raster data


dataSize

public final int dataSize
The byte size of a single band unit

Constructor Detail

RasterDataInfo

public RasterDataInfo(byte[] noDataPixel,
                      BandType[] bandInfo,
                      DataType dataType,
                      InterleaveType interleaveType)
Parameters:
noDataPixel - to be used if no data was found in a given subset.
bandInfo - of the raster data
dataType - of the raster data
interleaveType - of the raster data.

RasterDataInfo

public RasterDataInfo(BandType[] bandInfo,
                      DataType dataType,
                      InterleaveType interleaveType)
create a new RasterDataInfo and initialize the no data pixel with null.

Parameters:
bandInfo - of the raster data
dataType - of the raster data
interleaveType - of the raster data.
Method Detail

getBandInfo

public final BandType[] getBandInfo()
Returns:
the information on the bands.

bands

public final int bands()
Returns:
number of bands, equals getBandInfo().length

getDataType

public final DataType getDataType()
Returns:
the dataType

getInterleaveType

public final InterleaveType getInterleaveType()
Returns:
the interleaveType

getNoDataPixel

public byte[] getNoDataPixel(byte[] result)
Returns the no data values for this raster's bands

Parameters:
result - an array to put the values into or null
Returns:
the result array or a new array, if the result array is null or to small

getNoDataPixel

public byte[] getNoDataPixel(BandType[] bands)
Returns the no data values for this raster's bands

Parameters:
bands - to copy the null data pixel values for.
Returns:
the result array or a new array, if the result array is null

getNoDataSample

public byte[] getNoDataSample(int band,
                              byte[] result)
Returns the no data values for the given band. If the band is outside an empty array is returned. If the result is null or is to small for the datasize, a new allocated byte array will be returned. Otherwise the no data value for the requested band is copied at position 0 of the result array.

Parameters:
band - to get the value for.
result - to put the value in.
Returns:
the result array or a new array, if the result array is null

getByteNoDataForBand

public byte getByteNoDataForBand(int band)
Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.BYTE 0 will be returned.

Parameters:
band - to get the no data value for.
Returns:
the no data value for the given band.

getShortNoDataForBand

public short getShortNoDataForBand(int band)
Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.SHORT or DataType.USHORT 0 will be returned.

Parameters:
band - to get the no data value for.
Returns:
the no data value for the given band.

getIntNoDataForBand

public int getIntNoDataForBand(int band)
Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.INT 0 will be returned.

Parameters:
band - to get the no data value for.
Returns:
the no data value for the given band.

getFloatNoDataForBand

public float getFloatNoDataForBand(int band)
Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.FLOAT 0 will be returned.

Parameters:
band - to get the no data value for.
Returns:
the no data value for the given band.

getDoubleNoDataForBand

public double getDoubleNoDataForBand(int band)
Returns the no data value for the given band, if the band is outside the number of bands or the given type is not of DataType.DOUBLE 0 will be returned.

Parameters:
band - to get the no data value for.
Returns:
the no data value for the given band.

setNoDataPixel

public void setNoDataPixel(byte[] values)
Sets the no data values for this raster's bands

Parameters:
values - an array with the null values

getDataSize

public int getDataSize()
Returns:
the byte size of one unit of a band.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast. It is created from field f as follows:

Combining the hash code(s) computed above: result = 37 * result + code;

Overrides:
hashCode in class Object
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.