Package org.eclipse.imagen.media.util
Class InterpAverage
Object
Interpolation
InterpAverage
- All Implemented Interfaces:
Serializable
An
Interpolation class which performs simple averaging of all pixels within a specified neighborhood. It
is used by the "SubsampleAverage" operation implementations.- See Also:
-
Field Summary
Fields inherited from class Interpolation
INTERP_BICUBIC, INTERP_BICUBIC_2, INTERP_BILINEAR, INTERP_NEAREST -
Constructor Summary
ConstructorsConstructorDescriptionInterpAverage(int blockX, int blockY) Creates anInterpAverageinstance having the supplied dimensions. -
Method Summary
Modifier and TypeMethodDescriptiondoubleinterpolateH(double[] samples, float xfrac) Returns the average of all elements insamples;xfracis ignored.floatinterpolateH(float[] samples, float xfrac) Returns the average of all elements insamples;xfracis ignored.intinterpolateH(int[] samples, int xfrac) Returns the average of all elements insamples;xfracis ignored.Methods inherited from class Interpolation
getBottomPadding, getHeight, getInstance, getLeftPadding, getRightPadding, getSubsampleBitsH, getSubsampleBitsV, getTopPadding, getWidth, interpolate, interpolate, interpolate, interpolate, interpolate, interpolate, interpolate, interpolate, interpolate, interpolateH, interpolateH, interpolateH, interpolateH, interpolateH, interpolateH, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, interpolateV, isSeparable
-
Constructor Details
-
InterpAverage
public InterpAverage(int blockX, int blockY) Creates anInterpAverageinstance having the supplied dimensions. The left and top padding are(blockX - 1)/2and(blockY - 1)/2, respectively. ThesubsampleBitsHandsubsampleBitsVinstance variables are set to 32.- Parameters:
blockX- The width of the interpolation block.blockY- The height of the interpolation block.- Throws:
IllegalArgumentException- if either parameter is non-positive.
-
-
Method Details
-
interpolateH
public int interpolateH(int[] samples, int xfrac) Returns the average of all elements insamples;xfracis ignored.- Specified by:
interpolateHin classInterpolation- Parameters:
samples- an array of ints.xfrac- the subsample position, multiplied by 2(subsampleBitsH).- Returns:
- the interpolated value as an int.
-
interpolateH
public float interpolateH(float[] samples, float xfrac) Returns the average of all elements insamples;xfracis ignored.- Specified by:
interpolateHin classInterpolation- Parameters:
samples- an array of floats.xfrac- the X subsample position, in the range [0.0F, 1.0F).- Returns:
- the interpolated value as a float.
-
interpolateH
public double interpolateH(double[] samples, float xfrac) Returns the average of all elements insamples;xfracis ignored.- Specified by:
interpolateHin classInterpolation- Parameters:
samples- an array of doubles.xfrac- the X subsample position, in the range [0.0F, 1.0F).- Returns:
- the interpolated value as a double.
-