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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected float[]
    Temporary buffer where to copy data and apply operation.
    protected int[]
    Temporary buffer where to round data before transfer to target raster.

    Fields inherited from class org.apache.sis.image.Transferer

    band, region, source, target
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance for transferring data between the two specified rasters.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    clamp(int length)
    Clamps data to the range of target integer type.
    (package private) final void
    computeStrip(org.opengis.referencing.operation.MathTransform1D converter)
    Copies source values in temporary buffer, applies conversion then copies to target.
    (package private) final int
    Subdivides the region to process in smaller strips, for smaller buffer.

    Methods inherited from class org.apache.sis.image.Transferer

    compute, create, create, length

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.