Package net.algart.arrays
Class Matrices.ResizingMethod.Averaging
java.lang.Object
net.algart.arrays.Matrices.ResizingMethod
net.algart.arrays.Matrices.ResizingMethod.Averaging
- Enclosing class:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.algart.arrays.Matrices.ResizingMethod
Matrices.ResizingMethod.Averaging
-
Field Summary
Fields inherited from class net.algart.arrays.Matrices.ResizingMethod
AVERAGING, POLYLINEAR_AVERAGING, POLYLINEAR_INTERPOLATION, SIMPLE
-
Constructor Summary
ModifierConstructorDescriptionprotected
Averaging
(Matrices.InterpolationMethod interpolationMethod) Creates new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Returns true for any instances ofMatrices.ResizingMethod.Averaging
class, in particular, forMatrices.ResizingMethod.AVERAGING
andMatrices.ResizingMethod.POLYLINEAR_AVERAGING
cases, false for other cases.protected Func
getAveragingFunc
(long[] apertureDim) Returns the function that should be used for "averaging" several elements while compression.Methods inherited from class net.algart.arrays.Matrices.ResizingMethod
interpolation, interpolationMethod
-
Constructor Details
-
Averaging
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 ofMatrices.ResizingMethod.Averaging
class, in particular, forMatrices.ResizingMethod.AVERAGING
andMatrices.ResizingMethod.POLYLINEAR_AVERAGING
cases, false for other cases.- Overrides:
averaging
in classMatrices.ResizingMethod
- Returns:
- whether this mode performs averaging of several elements.
-
getAveragingFunc
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).
-