Class Transferer.DoubleToDouble

java.lang.Object
org.apache.sis.image.Transferer
org.apache.sis.image.Transferer.DoubleToDouble
Enclosing class:
Transferer

private static final class Transferer.DoubleToDouble extends Transferer
Read double values from the source raster and write double values in a temporary buffer. Note that reading and writing data has double does not imply that raster data type must be that type. The temporary buffer will be written in the target raster as a separated step. The use of a temporary buffer is needed when the target raster does not use the double type, or does not use a layout that allows us to write directly in the raster array.
Note: having a source raster with double data type does not remove the need to use a temporary buffer, because we cannot modify the source data. We still need to allocate a temporary array for collecting the operation results before final writing in the target array.
  • Field Details

    • buffer

      private double[] buffer
      Temporary buffer where to copy data and apply operation.
  • Constructor Details

    • DoubleToDouble

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

    • prepareTransferRegion

      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

      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.