Package org.apache.sis.image
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
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 Summary
FieldsModifier and TypeFieldDescription(package private) final org.opengis.referencing.operation.MathTransform
Conversion from floating point values resulting from interpolations to values to store as integers in the destination image.(package private) final Interpolation
The object to use for performing interpolations.Fields inherited from class org.apache.sis.image.Interpolation
BILINEAR, LANCZOS, NEAREST
-
Constructor Summary
ConstructorsConstructorDescriptionInterpConvert
(Interpolation interpolation, org.opengis.referencing.operation.MathTransform converter) Creates a new object combining the given interpolation with the given conversion of sample values. -
Method Summary
Modifier and TypeMethodDescriptionfinal Dimension
Delegates toInterpolation.getSupportSize()
.void
interpolate
(DoubleBuffer source, int numBands, double xfrac, double yfrac, double[] writeTo, int writeToOffset) Delegates tointerpolation
, then convert sample values in all bands.(package private) Interpolation
toCompatible
(RenderedImage source) This interpolation never need to be disabled.
-
Field Details
-
interpolation
The object to use for performing interpolations.- See Also:
-
converter
final org.opengis.referencing.operation.MathTransform converterConversion 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 onetransform(…)
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
Delegates toInterpolation.getSupportSize()
.- Specified by:
getSupportSize
in classInterpolation
- 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 tointerpolation
, then convert sample values in all bands.- Specified by:
interpolate
in classInterpolation
- 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 thewriteTo
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 thewriteTo
array.- Throws:
BackingStoreException
- if an error occurred while converting sample values. This exception should be unwrapped byVisualization.computeTile(int, int, WritableRaster)
.
-
toCompatible
This interpolation never need to be disabled.- Overrides:
toCompatible
in classInterpolation
- Returns:
Interpolation.NEAREST
if interpolations should be restricted to nearest-neighbor, orthis
otherwise.
-