public class DefaultBufferManager extends java.lang.Object implements BufferManager, OperationManager
TYPE_BYTE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_SHORT, TYPE_UNDEFINED, TYPE_USHORT
Constructor and Description |
---|
DefaultBufferManager() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
coerce(int dataType,
java.lang.Object value) |
BandPageManager |
createAwtRasterBandPageManager(java.awt.image.Raster img,
int band) |
java.util.List<PageManager> |
createAwtRasterBandPageManagerList(java.awt.image.Raster img) |
Band |
createBand(int dataType,
int rows,
int columns,
NoData noData,
PageManager pageManager)
Creates a
Band . |
BandInfo |
createBandInfo(int band,
java.lang.String name,
java.lang.String description,
int dataType,
java.util.List<java.util.Map.Entry<java.lang.Object,java.lang.Object>> values)
Creates
BandInfo with information about one band. |
Buffer |
createBuffer(Buffer buffer,
boolean paginated)
Creates a buffer from another buffer.
|
Buffer |
createBuffer(int rows,
int columns,
int[] bandDataTypes,
IProjection projection)
Creates a memory buffer.
|
Buffer |
createBuffer(int rows,
int columns,
int[] bandDataTypes,
NoData[] bandNoData,
IProjection projection)
Creates a memory buffer.
|
Buffer |
createBuffer(int rows,
int columns,
int[] bandDataTypes,
NoData[] bandNoData,
IProjection projection,
Envelope envelope)
Creates a memory buffer.
|
Buffer |
createBuffer(int rows,
int columns,
int[] bandDataTypes,
NoData[] bandNoData,
IProjection projection,
Envelope envelope,
java.util.List<PageManager> pageManagers)
Creates a buffer.
|
BufferDimensions |
createBufferDimensions(int rows,
int columns,
Envelope envelope) |
Buffer |
createBufferFromAwtRaster(java.awt.image.Raster raster,
IProjection projection,
Envelope envelope) |
Band |
createClippedBand(Buffer buffer,
Band band)
Creates a clipping of a band.
|
Buffer |
createClippedBuffer(Buffer buffer,
Envelope envelope)
Creates a buffer from clipping of a buffer.
|
Band |
createConvertedTypeBand(Buffer buffer,
Band band,
int type)
Create one band from another by changing the type.
|
Buffer |
createConvertedTypeBuffer(Buffer buffer,
int type)
Create one buffer from another by changing the type.
|
Kernel |
createKernel(double[][] k) |
Kernel |
createKernel(double[][] k,
double divisor) |
NoData |
createNoData(java.lang.Number value,
java.lang.Number defaultValue)
Creates a NoData object.
|
java.util.List<Buffer> |
createOneBufferPerBand(Buffer buffer,
boolean paginated) |
Operation |
createOperation(java.lang.String name) |
OperationList |
createOperationList()
Creates a OperationList
|
OperationListEntry |
createOperationListEntry(Operation operation,
DynObject parameters)
Creates a entry for OperationList
|
DynObject |
createOperationParameters(java.lang.String name) |
Buffer |
createRGBABuffer(java.awt.image.BufferedImage img,
IProjection projection,
Envelope envelope)
Creates a forced RGBA Buffer from a BufferedImage
|
Buffer |
createRGBBuffer(java.awt.image.BufferedImage img,
IProjection projection,
Envelope envelope)
Creates a forced RGB Buffer from a BufferedImage
|
BandPageManager |
createSimpleBandPageManager(java.io.File file,
int rows,
int columns,
int dataType) |
java.util.List<PageManager> |
createSimpleBandPageManagerList(java.io.File[] files,
int rows,
int columns,
int[] dataType) |
Buffer |
execute(SimpleTaskStatus status,
java.lang.String name,
Buffer buffer,
DynObject parameters) |
int |
getBufferTypeFromAwtRaster(java.awt.image.Raster raster) |
java.lang.String |
getBufferTypeName(int dataType) |
int |
getDataTypeSize(int dataType) |
java.io.File |
getLastFolderUsedToSaveRaster() |
java.util.List<OperationFactory> |
getOperationFactories() |
OperationFactory |
getOperationFactory(java.lang.String name) |
java.lang.String |
getTypeName(int type)
Return type's name
|
void |
registerOperationFactory(OperationFactory factory)
Register operation factory
|
void |
setLastFolderUsedToSaveRaster(java.io.File folder) |
public NoData createNoData(java.lang.Number value, java.lang.Number defaultValue)
BufferManager
createNoData
in interface BufferManager
public Band createBand(int dataType, int rows, int columns, NoData noData, PageManager pageManager) throws CreateBandTypeException
BufferManager
Band
. If PageManager
is null, the band will be
in
memory, otherwise, the band will be paginated using page manager.createBand
in interface BufferManager
dataType
- Type of band. Check BufferManager
to see what types
are availablerows
- Band rowscolumns
- Band columnsnoData
- NoData
of band. If It is null, a undefined NoData will
be set.pageManager
- Page manager to paginate band. It page manager is null, band
will be in memory.CreateBandTypeException
BufferManager.createNoData(Number, Number)
,
BufferManager#createBandInfo(String, String, List)
,
BufferManager.createSimpleBandPageManager(File, int, int, int)
public Buffer createBuffer(int rows, int columns, int[] bandDataTypes, IProjection projection) throws BufferException
BufferManager
createBuffer
in interface BufferManager
rows
- Rows of buffer. All buffer bands will have the same rows as
buffer.columns
- Columns of buffer. All buffer bands will have the same
columns as buffer.bandDataTypes
- Types of buffer bands, see BufferManager
to get types.
The length of array indicates number of buffer bands.projection
- Projection of buffer.BufferException
- If there is any problem creating buffer.public Buffer createBuffer(int rows, int columns, int[] bandDataTypes, NoData[] bandNoData, IProjection projection) throws CreateBufferException
BufferManager
createBuffer
in interface BufferManager
rows
- Rows of buffer. All buffer bands will have the same rows as
buffer.columns
- Columns of buffer. All buffer bands will have the same
columns as buffer.bandDataTypes
- Types of buffer bands, see BufferManager
to get types.
The length of array indicates number of buffer bands.bandNoData
- NoData
of each band. It can be null. If there are
bands without NoData object, a undefined NoData will be set.projection
- Projection of buffer.CreateBufferException
public Buffer createBuffer(int rows, int columns, int[] bandDataTypes, NoData[] bandNoData, IProjection projection, Envelope envelope) throws BufferException
BufferManager
createBuffer
in interface BufferManager
rows
- Rows of buffer. All buffer bands will have the same rows as
buffer.columns
- Columns of buffer. All buffer bands will have the same
columns as buffer.bandDataTypes
- Types of buffer bands, see BufferManager
to get types.
The length of array indicates number of buffer bands.bandNoData
- NoData
of each band. If there are bands without NoData
object, a undefined NoData will be set. It can be
null
.projection
- Projection of buffer.envelope
- Envelope of data. It can be null
.BufferException
- If there is any problem creating buffer.public Buffer createBuffer(int rows, int columns, int[] bandDataTypes, NoData[] bandNoData, IProjection projection, Envelope envelope, java.util.List<PageManager> pageManagers) throws BufferException
BufferManager
BandPageManager
.createBuffer
in interface BufferManager
rows
- Rows of buffer. All buffer bands will have the same rows as
buffer.columns
- Columns of buffer. All buffer bands will have the same
columns as buffer.bandDataTypes
- Types of buffer bands, see BufferManager
to get types.
The length of array indicates number of buffer bands.bandNoData
- NoData
of each band. If there are bands without NoData
object, a undefined NoData will be set. It can be
null
.projection
- Projection of buffer.envelope
- Envelope of data. It can be null
.pageManagers
- Page manager list to paginate data bands. If there are bands
without page manager,
they will be loaded at memory.BufferException
- If there is any problem creating buffer.public BandPageManager createSimpleBandPageManager(java.io.File file, int rows, int columns, int dataType) throws java.io.IOException
createSimpleBandPageManager
in interface BufferManager
java.io.IOException
public int getDataTypeSize(int dataType)
getDataTypeSize
in interface BufferManager
dataType
- Data tpyepublic java.util.List<PageManager> createSimpleBandPageManagerList(java.io.File[] files, int rows, int columns, int[] dataType) throws java.io.IOException
createSimpleBandPageManagerList
in interface BufferManager
java.io.IOException
public Buffer createClippedBuffer(Buffer buffer, Envelope envelope) throws BufferException
BufferManager
createClippedBuffer
in interface BufferManager
BufferException
public Buffer createConvertedTypeBuffer(Buffer buffer, int type) throws BufferException
BufferManager
createConvertedTypeBuffer
in interface BufferManager
BufferException
public Band createClippedBand(Buffer buffer, Band band) throws CreateBandTypeException
BufferManager
createClippedBand
in interface BufferManager
CreateBandTypeException
public Band createConvertedTypeBand(Buffer buffer, Band band, int type) throws BandException
BufferManager
createConvertedTypeBand
in interface BufferManager
BandException
public BandInfo createBandInfo(int band, java.lang.String name, java.lang.String description, int dataType, java.util.List<java.util.Map.Entry<java.lang.Object,java.lang.Object>> values)
BufferManager
BandInfo
with information about one band.createBandInfo
in interface BufferManager
band
- Band of this BandInfo
name
- Band namedescription
- Description of banddataType
- Data type of band. See BufferManager
to check types.values
- A key-value map with information properties about bandpublic Buffer createBuffer(Buffer buffer, boolean paginated) throws BufferException
BufferManager
createBuffer
in interface BufferManager
BufferException
public BandPageManager createAwtRasterBandPageManager(java.awt.image.Raster img, int band)
createAwtRasterBandPageManager
in interface BufferManager
public java.util.List<PageManager> createAwtRasterBandPageManagerList(java.awt.image.Raster img) throws java.io.IOException
createAwtRasterBandPageManagerList
in interface BufferManager
java.io.IOException
public java.util.List<Buffer> createOneBufferPerBand(Buffer buffer, boolean paginated) throws BufferException
createOneBufferPerBand
in interface BufferManager
BufferException
public int getBufferTypeFromAwtRaster(java.awt.image.Raster raster)
getBufferTypeFromAwtRaster
in interface BufferManager
raster
- public Buffer createRGBABuffer(java.awt.image.BufferedImage img, IProjection projection, Envelope envelope) throws BufferException
BufferManager
createRGBABuffer
in interface BufferManager
BufferException
public Buffer createRGBBuffer(java.awt.image.BufferedImage img, IProjection projection, Envelope envelope) throws BufferException
BufferManager
createRGBBuffer
in interface BufferManager
BufferException
public java.lang.String getTypeName(int type)
BufferManager
getTypeName
in interface BufferManager
public java.lang.String getBufferTypeName(int dataType)
getBufferTypeName
in interface BufferManager
public java.lang.Object coerce(int dataType, java.lang.Object value) throws CoercionException
coerce
in interface BufferManager
CoercionException
public BufferDimensions createBufferDimensions(int rows, int columns, Envelope envelope)
createBufferDimensions
in interface BufferManager
public java.io.File getLastFolderUsedToSaveRaster()
getLastFolderUsedToSaveRaster
in interface BufferManager
public void setLastFolderUsedToSaveRaster(java.io.File folder)
setLastFolderUsedToSaveRaster
in interface BufferManager
public Operation createOperation(java.lang.String name)
createOperation
in interface OperationManager
public DynObject createOperationParameters(java.lang.String name)
createOperationParameters
in interface OperationManager
public void registerOperationFactory(OperationFactory factory)
OperationManager
registerOperationFactory
in interface OperationManager
public java.util.List<OperationFactory> getOperationFactories()
getOperationFactories
in interface OperationManager
public OperationFactory getOperationFactory(java.lang.String name)
getOperationFactory
in interface OperationManager
public Buffer execute(SimpleTaskStatus status, java.lang.String name, Buffer buffer, DynObject parameters) throws BufferOperationException
execute
in interface OperationManager
BufferOperationException
public Kernel createKernel(double[][] k)
createKernel
in interface BufferManager
public Kernel createKernel(double[][] k, double divisor)
createKernel
in interface BufferManager
public OperationListEntry createOperationListEntry(Operation operation, DynObject parameters)
OperationManager
createOperationListEntry
in interface OperationManager
public OperationList createOperationList()
OperationManager
createOperationList
in interface OperationManager
public Buffer createBufferFromAwtRaster(java.awt.image.Raster raster, IProjection projection, Envelope envelope) throws java.io.IOException, BufferException
createBufferFromAwtRaster
in interface BufferManager
java.io.IOException
BufferException