Class Transferer.FloatToInteger

java.lang.Object
org.apache.sis.image.Transferer
org.apache.sis.image.Transferer.FloatToInteger
Direct Known Subclasses:
Transferer.FloatToByte, Transferer.FloatToShort, Transferer.FloatToUShort
Enclosing class:
Transferer

private static class Transferer.FloatToInteger extends Transferer
Read float values from the source raster and write int values in a temporary buffer. The floating point values will be rounded and clamped to the range of the integer type. Note that we do not provide any direct version for integer types because direct access to DataBuffer array disable Java2D acceleration on video card.
Since:
1.1
Version:
1.1
  • Field Details

    • buffer

      protected float[] buffer
      Temporary buffer where to copy data and apply operation.
    • transfer

      protected int[] transfer
      Temporary buffer where to round data before transfer to target raster.
  • Constructor Details

    • FloatToInteger

      FloatToInteger(Raster source, WritableRaster target, Rectangle aoi)
      Creates a new instance for transferring data between the two specified rasters.
  • Method Details

    • prepareTransferRegion

      final int prepareTransferRegion()
      Subdivides the region to process in smaller strips, for smaller buffer.
      Overrides:
      prepareTransferRegion in class Transferer
      Returns:
      region.y + region.height.
      See Also:
    • computeStrip

      final void computeStrip(org.opengis.referencing.operation.MathTransform1D converter) throws org.opengis.referencing.operation.TransformException
      Copies source values in temporary buffer, applies conversion then copies to target.
      Specified by:
      computeStrip in class Transferer
      Parameters:
      converter - the operation to apply on sample values in current region and current band number.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred during calculation.
    • clamp

      void clamp(int length)
      Clamps data to the range of target integer type.