Package org.apache.sis.image
Class Transferer.DoubleToDouble
java.lang.Object
org.apache.sis.image.Transferer
org.apache.sis.image.Transferer.DoubleToDouble
- Enclosing class:
Transferer
Read
double
values from the source raster and write double
values in a temporary buffer.
Note that reading and writing data has double
does not imply that raster data type must be that type.
The temporary buffer will be written in the target raster as a separated step. The use of a temporary buffer
is needed when the target raster does not use the double
type, or does not use a layout that allows
us to write directly in the raster array.
Note:
having a source raster with
double
data type does not remove the need to use a temporary buffer,
because we cannot modify the source data. We still need to allocate a temporary array for collecting the
operation results before final writing in the target array.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double[]
Temporary buffer where to copy data and apply operation.Fields inherited from class org.apache.sis.image.Transferer
band, region, source, target
-
Constructor Summary
ConstructorsConstructorDescriptionDoubleToDouble
(Raster source, WritableRaster target, Rectangle aoi) Creates a new instance for transferring data between the two specified rasters. -
Method Summary
Modifier and TypeMethodDescription(package private) void
computeStrip
(org.opengis.referencing.operation.MathTransform1D converter) Copies source values in temporary buffer, applies conversion then copies to target.(package private) int
Subdivides the region to process in smaller strips, for smaller buffer.Methods inherited from class org.apache.sis.image.Transferer
compute, create, create, length
-
Field Details
-
buffer
private double[] bufferTemporary buffer where to copy data and apply operation.
-
-
Constructor Details
-
DoubleToDouble
DoubleToDouble(Raster source, WritableRaster target, Rectangle aoi) Creates a new instance for transferring data between the two specified rasters.
-
-
Method Details
-
prepareTransferRegion
int prepareTransferRegion()Subdivides the region to process in smaller strips, for smaller buffer.- Overrides:
prepareTransferRegion
in classTransferer
- Returns:
region.y + region.height
.- See Also:
-
computeStrip
void computeStrip(org.opengis.referencing.operation.MathTransform1D converter) throws org.opengis.referencing.operation.TransformException Copies source values in temporary buffer, applies conversion then copies to target.- Specified by:
computeStrip
in classTransferer
- Parameters:
converter
- the operation to apply on sample values in current region and current band number.- Throws:
org.opengis.referencing.operation.TransformException
- if an error occurred during calculation.
-