Interface BufferManager


public interface BufferManager
Author:
fdiaz
  • Field Details

  • Method Details

    • createNoData

      NoData createNoData(Number value, Number defaultValue)
      Creates a NoData object.
      Parameters:
      value -
      defaultValue -
      Returns:
      NoData
    • createBandInfo

      BandInfo createBandInfo(int band, String name, String description, int dataType, List<Map.Entry<Object,Object>> values)
      Creates BandInfo with information about one band.
      Parameters:
      band - Band of this BandInfo
      name - Band name
      description - Description of band
      dataType - Data type of band. See BufferManager to check types.
      values - A key-value map with information properties about band
      Returns:
      BandInfo
    • createBand

      Band createBand(int dataType, int rows, int columns, NoData noData, PageManager pageManager) throws BandException
      Creates a Band. If PageManager is null, the band will be in memory, otherwise, the band will be paginated using page manager.
      Parameters:
      dataType - Type of band. Check BufferManager to see what types are available
      rows - Band rows
      columns - Band columns
      noData - 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.
      Returns:
      Band A empty band.
      Throws:
      BandException - If there are problems creating the band.
      See Also:
    • createBuffer

      Buffer createBuffer(int rows, int columns, int[] bandDataTypes, org.gvsig.crs.projection.lib.Projection projection) throws BufferException
      Creates a memory buffer.
      Parameters:
      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.
      Returns:
      Buffer
      Throws:
      BufferException - If there is any problem creating buffer.
    • createBuffer

      Buffer createBuffer(int rows, int columns, int[] bandDataTypes, NoData[] bandNodata, org.gvsig.crs.projection.lib.Projection projection) throws BufferException
      Creates a memory buffer.
      Parameters:
      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.
      Returns:
      Buffer
      Throws:
      BufferException - If there is any problem creating buffer.
    • createBuffer

      Buffer createBuffer(int rows, int columns, int[] bandDataTypes, NoData[] bandNodata, org.gvsig.crs.projection.lib.Projection projection, org.gvsig.fmap.geom.primitive.Envelope envelope) throws BufferException
      Creates a memory buffer.
      Parameters:
      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.
      Returns:
      Buffer
      Throws:
      BufferException - If there is any problem creating buffer.
    • createBuffer

      Buffer createBuffer(int rows, int columns, int[] bandDataTypes, NoData[] bandNoData, org.gvsig.crs.projection.lib.Projection projection, org.gvsig.fmap.geom.primitive.Envelope envelope, List<PageManager> pageManagers) throws BufferException
      Creates a buffer. Buffer bands will be paginated using BandPageManager.
      Parameters:
      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.
      Returns:
      Buffer
      Throws:
      BufferException - If there is any problem creating buffer.
    • createBuffer

      Buffer createBuffer(Buffer buffer, boolean paginated) throws BufferException
      Creates a buffer from another buffer. If paginated parameter is false the buffer bands will be in memory. If paginated parameter is true the buffer bands will be paginated using a simple band page manager.
      Parameters:
      buffer -
      paginated -
      Returns:
      Buffer
      Throws:
      BufferException
    • createConvertedTypeBuffer

      Buffer createConvertedTypeBuffer(Buffer buffer, int type) throws BufferException
      Create one buffer from another by changing the type. The returned buffer will be like a view of the original buffer. It not reserve additional memory.
      Parameters:
      buffer -
      type -
      Returns:
      a converted type buffer
      Throws:
      BufferException
    • createClippedBuffer

      Buffer createClippedBuffer(Buffer buffer, org.gvsig.fmap.geom.primitive.Envelope envelope) throws BufferException
      Creates a buffer from clipping of a buffer. The returned clipping will be like a view of the original buffer. It not reserve additional memory. It will only be a walkway to access an area of the buffer.
      Parameters:
      buffer -
      envelope -
      Returns:
      a clip buffer
      Throws:
      BufferException
    • createSimpleBandPageManager

      PageManager createSimpleBandPageManager(File file, int rows, int columns, int dataType) throws IOException
      Parameters:
      file -
      rows -
      columns -
      dataType -
      Returns:
      BandPageManager
      Throws:
      IOException
    • createSimpleBandPageManagerList

      List<PageManager> createSimpleBandPageManagerList(File[] files, int rows, int columns, int[] dataType) throws IOException
      Parameters:
      files -
      rows -
      columns -
      dataType -
      Returns:
      A list of page managers
      Throws:
      IOException
    • getDataTypeSize

      int getDataTypeSize(int dataType)
      Parameters:
      dataType - Data tpye
      Returns:
      Data type size in bytes
    • createClippedBand

      Band createClippedBand(Buffer buffer, Band band) throws BandException
      Creates a clipping of a band. The returned clipping will be like a view of the original band. It not reserve additional memory. It will only be a walkway to access an area of the band.
      Parameters:
      buffer -
      band -
      Returns:
      Band
      Throws:
      BandException
    • createConvertedTypeBand

      Band createConvertedTypeBand(Buffer buffer, Band band, int type) throws BandException
      Create one band from another by changing the type. The returned clipping will be like a view of the original band. It not reserve additional memory.
      Parameters:
      buffer -
      band -
      type -
      Returns:
      Band
      Throws:
      BandException
    • createRGBABuffer

      Buffer createRGBABuffer(BufferedImage img, org.gvsig.crs.projection.lib.Projection projection, org.gvsig.fmap.geom.primitive.Envelope envelope) throws BufferException
      Creates a forced RGBA Buffer from a BufferedImage
      Parameters:
      img -
      projection -
      envelope -
      Returns:
      Buffer
      Throws:
      BufferException
    • createRGBBuffer

      Buffer createRGBBuffer(BufferedImage img, org.gvsig.crs.projection.lib.Projection projection, org.gvsig.fmap.geom.primitive.Envelope envelope) throws BufferException
      Creates a forced RGB Buffer from a BufferedImage
      Parameters:
      img -
      projection -
      envelope -
      Returns:
      Buffer
      Throws:
      BufferException
    • getTypeName

      String getTypeName(int type)
      Return type's name
      Parameters:
      type -
      Returns:
    • getBufferTypeName

      String getBufferTypeName(int dataType)
      Parameters:
      dataType -
      Returns:
    • coerce

      Object coerce(int dataType, Object value) throws org.gvsig.tools.dataTypes.CoercionException
      Throws:
      org.gvsig.tools.dataTypes.CoercionException
    • createOneBufferPerBand

      List<Buffer> createOneBufferPerBand(Buffer buffer, boolean paginated) throws BufferException
      Throws:
      BufferException
    • createBufferDimensions

      BufferDimensions createBufferDimensions(int rows, int columns, org.gvsig.fmap.geom.primitive.Envelope envelope)
      Parameters:
      rows -
      columns -
      envelope -
      Returns:
    • setLastFolderUsedToSaveRaster

      void setLastFolderUsedToSaveRaster(File folder)
      Parameters:
      folder -
    • getLastFolderUsedToSaveRaster

      File getLastFolderUsedToSaveRaster()
      Returns:
    • createKernel

      Kernel createKernel(double[][] k)
    • createKernel

      Kernel createKernel(double[][] k, double divisor)
    • createAwtRasterBandPageManagerList

      List<PageManager> createAwtRasterBandPageManagerList(Raster img) throws IOException
      Parameters:
      img -
      Returns:
      Throws:
      IOException
    • createAwtRasterBandPageManager

      BandPageManager createAwtRasterBandPageManager(Raster img, int band)
      Parameters:
      img -
      band -
      Returns:
    • getBufferTypeFromAwtRaster

      int getBufferTypeFromAwtRaster(Raster raster)
      Parameters:
      raster -
      Returns:
    • createBufferFromAwtRaster

      Buffer createBufferFromAwtRaster(Raster raster, org.gvsig.crs.projection.lib.Projection projection, org.gvsig.fmap.geom.primitive.Envelope envelope) throws IOException, BufferException
      Parameters:
      raster -
      projection -
      envelope -
      Returns:
      Throws:
      IOException
      BufferException