Class Matrices.ResizingMethod.Averaging

java.lang.Object
net.algart.arrays.Matrices.ResizingMethod
net.algart.arrays.Matrices.ResizingMethod.Averaging
Enclosing class:
Matrices.ResizingMethod

public static class Matrices.ResizingMethod.Averaging extends Matrices.ResizingMethod
Resizing method with averaging (while compression). Can be extended to customize the averaging function: to do this, please override getAveragingFunc(long[]) method.

This class is immutable and thread-safe: there are no ways to modify settings of the created instance. Any possible inheritors of this class also must be immutable and thread-safe.

  • Constructor Details

    • Averaging

      protected Averaging(Matrices.InterpolationMethod interpolationMethod)
      Creates new instance of this class.
      Parameters:
      interpolationMethod - interpolation that should be used while resizing.
      Throws:
      NullPointerException - if the argument is null.
  • Method Details

    • averaging

      public final boolean averaging()
      Description copied from class: Matrices.ResizingMethod
      Returns true for any instances of Matrices.ResizingMethod.Averaging class, in particular, for Matrices.ResizingMethod.AVERAGING and Matrices.ResizingMethod.POLYLINEAR_AVERAGING cases, false for other cases.
      Overrides:
      averaging in class Matrices.ResizingMethod
      Returns:
      whether this mode performs averaging of several elements.
    • getAveragingFunc

      protected Func getAveragingFunc(long[] apertureDim)
      Returns the function that should be used for "averaging" several elements while compression. May return null, than the default behavior (usual averaging the source elements). This implementation returns null.
      Parameters:
      apertureDim - the sizes of averaged aperture in the source matrix.
      Returns:
      the function that will be used for averaging; may be null (default behavior).