|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.coverage.raster.data.nio.ByteBufferRasterData org.deegree.coverage.raster.data.nio.PixelInterleavedRasterData
public class PixelInterleavedRasterData
This class implements a pixel-interleaved, ByteBuffer-based RasterData.
Field Summary |
---|
Fields inherited from class org.deegree.coverage.raster.data.nio.ByteBufferRasterData |
---|
dataAccess, dataInfo, info, rasterHeight, rasterWidth |
Fields inherited from interface org.deegree.coverage.raster.data.RasterData |
---|
TYPE_BYTE_RGB, TYPE_BYTE_RGBA |
Constructor Summary | |
---|---|
protected |
PixelInterleavedRasterData(DataView view,
int rasterWidth,
int rasterHeight,
RasterReader reader,
RasterDataInfo dataInfo,
boolean init)
|
|
PixelInterleavedRasterData(RasterRect sampleDomain,
int rasterWidth,
int rasterHeight,
RasterDataInfo dataInfo)
Creates a new PixelInterleavedRasterData with given size, number of bands and data type, backed with no data. |
|
PixelInterleavedRasterData(RasterRect sampleDomain,
int rasterWidth,
int rasterHeight,
RasterReader reader,
RasterDataInfo dataInfo)
Creates a new PixelInterleavedRasterData with given size, number of bands and data type |
Method Summary | |
---|---|
protected ByteBufferRasterData |
createCompatibleEmptyRasterData()
|
PixelInterleavedRasterData |
createCompatibleRasterData(DataView view)
Implementation should create a view of this raster data. |
RasterData |
createCompatibleWritableRasterData(RasterRect sampleDomain,
BandType[] bands)
Create a writable compatible raster with the height and width of the given sample domain. |
int |
getBandStride()
Returns the byte offset to the next sample of the same pixel. |
Pair<ByteBuffer,RasterRect> |
getDataRect()
|
int |
getLineStride()
Returns the byte offset to the next row (same column, same sample) |
byte[] |
getPixel(int x,
int y,
byte[] result)
Returns a pixel as byte array, regardless of the DataType. i.e. a FLOAT DataType results in a four byte array. |
int |
getPixelStride()
Retruns the byte offset to the next pixel. |
boolean |
isOutside()
|
boolean |
isWithinDataArea()
|
void |
setPixel(int x,
int y,
byte[] result)
Sets a pixel with data from a byte array, regardless of the DataType. i.e. a float sample must be packed as a four byte array. |
void |
setSubset(int dstX,
int dstY,
int width,
int height,
RasterData srcRaster,
int srcX,
int srcY)
Sets the raster with values from sourceRaster. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PixelInterleavedRasterData(RasterRect sampleDomain, int rasterWidth, int rasterHeight, RasterDataInfo dataInfo)
sampleDomain
- the raster rectangle defining the sample domain of this raster data.rasterWidth
- width of the underlying raster data.rasterHeight
- height of the underlying raster data.dataInfo
- containing information about the underlying raster.public PixelInterleavedRasterData(RasterRect sampleDomain, int rasterWidth, int rasterHeight, RasterReader reader, RasterDataInfo dataInfo)
sampleDomain
- the raster rectangle defining the sample domain of this raster data.rasterWidth
- width of the underlying raster data.rasterHeight
- height of the underlying raster data.reader
- to be used for reading the data, may be nulldataInfo
- containing information about the underlying raster.
protected PixelInterleavedRasterData(DataView view, int rasterWidth, int rasterHeight, RasterReader reader, RasterDataInfo dataInfo, boolean init)
view
- the raster rectangle defining the sample domain of this raster data as well as the data info of the
view.rasterWidth
- width of the underlying raster data.rasterHeight
- height of the underlying raster data.reader
- to be used for reading the data, may be nulldataInfo
- containing information about the underlying raster.init
- true if a new buffer should be initialized
Method Detail |
---|
public PixelInterleavedRasterData createCompatibleRasterData(DataView view)
ByteBufferRasterData
createCompatibleRasterData
in class ByteBufferRasterData
view
- the new view on this data
ByteBuffer
public RasterData createCompatibleWritableRasterData(RasterRect sampleDomain, BandType[] bands)
RasterData
sampleDomain
- the raster rectangle defining the sample domain of this raster data.bands
- indices to the requested bands if null
all bands will be available.
protected ByteBufferRasterData createCompatibleEmptyRasterData()
createCompatibleEmptyRasterData
in class ByteBufferRasterData
public final int getBandStride()
ByteBufferRasterData
getBandStride
in class ByteBufferRasterData
public final int getLineStride()
ByteBufferRasterData
getLineStride
in class ByteBufferRasterData
public final int getPixelStride()
ByteBufferRasterData
getPixelStride
in class ByteBufferRasterData
public byte[] getPixel(int x, int y, byte[] result)
RasterData
getPixel
in interface RasterData
getPixel
in class ByteBufferRasterData
result
- a byte array to put the values into or null
result
array or a new array, if the result
array is null
public void setPixel(int x, int y, byte[] result)
RasterData
setPixel
in interface RasterData
setPixel
in class ByteBufferRasterData
public void setSubset(int dstX, int dstY, int width, int height, RasterData srcRaster, int srcX, int srcY)
RasterData
setSubset
in interface RasterData
setSubset
in class ByteBufferRasterData
dstX
- insert positiondstY
- insert positionwidth
- width of the subsetheight
- height of the subsetsrcRaster
- data source to copysrcX
- x offset in the source rastersrcY
- y offset in the source rasterpublic boolean isWithinDataArea()
public boolean isOutside()
public Pair<ByteBuffer,RasterRect> getDataRect()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |