Class Visualization.InterpConvert

java.lang.Object
org.apache.sis.image.Interpolation
org.apache.sis.image.Visualization.InterpConvert
Direct Known Subclasses:
Visualization.InterpConvertOneBand
Enclosing class:
Visualization

static class Visualization.InterpConvert extends Interpolation
Interpolation followed by conversion from floating point values to the values to store as integers in the destination image. This class is used for combining ResampledImage and BandedSampleConverter in a single operation.
  • Field Details

    • interpolation

      final Interpolation interpolation
      The object to use for performing interpolations.
      See Also:
    • converter

      final org.opengis.referencing.operation.MathTransform converter
      Conversion from floating point values resulting from interpolations to values to store as integers in the destination image. This transform shall operate on all bands in one transform(…) call.
  • Constructor Details

    • InterpConvert

      InterpConvert(Interpolation interpolation, org.opengis.referencing.operation.MathTransform converter)
      Creates a new object combining the given interpolation with the given conversion of sample values.
  • Method Details

    • getSupportSize

      public final Dimension getSupportSize()
      Specified by:
      getSupportSize in class Interpolation
      Returns:
      number of sample values required for interpolations.
    • interpolate

      public void interpolate(DoubleBuffer source, int numBands, double xfrac, double yfrac, double[] writeTo, int writeToOffset)
      Delegates to interpolation, then convert sample values in all bands.
      Specified by:
      interpolate in class Interpolation
      Parameters:
      source - pixel values from the source image to use for interpolation.
      numBands - number of bands. This is the number of values to put in the writeTo array.
      xfrac - the X subsample position, usually (but not always) in the range [0 … 1).
      yfrac - the Y subsample position, usually (but not always) in the range [0 … 1).
      writeTo - the array where this method shall write interpolated values.
      writeToOffset - index of the first value to put in the writeTo array.
      Throws:
      BackingStoreException - if an error occurred while converting sample values. This exception should be unwrapped by Visualization.computeTile(int, int, WritableRaster).
    • toCompatible

      Interpolation toCompatible(RenderedImage source)
      This interpolation never need to be disabled.
      Overrides:
      toCompatible in class Interpolation
      Returns:
      Interpolation.NEAREST if interpolations should be restricted to nearest-neighbor, or this otherwise.