Class ParseTiffDSP
java.lang.Object
net.buildtheearth.terraminusminus.config.scalarparse.d.ParseTiffDSP
- All Implemented Interfaces:
DoubleScalarParser
- Direct Known Subclasses:
ParseTiffAutoDSP,ParseTiffFloatingPointDSP
Parses integer or floating-point scalar data from single-channel TIFF images, to double arrays.
This API has diverged from Terraplusplus, which has implementation specific to integers and floating-point images as a workaround for Apache commons imaging not initially supporting integer images.
This API has diverged from Terraplusplus, which has implementation specific to integers and floating-point images as a workaround for Apache commons imaging not initially supporting integer images.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.buildtheearth.terraminusminus.config.scalarparse.d.DoubleScalarParser
DoubleScalarParser.Deserializer, DoubleScalarParser.Serializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisSupportedFormat(org.apache.commons.imaging.formats.tiff.TiffDirectory directory) Verify whether this is a supported format (single-channel grayscale, encoded as IEEE 754, integers, or signed integers).double[]parse(int resolution, @NonNull io.netty.buffer.ByteBuf buffer) protected org.apache.commons.imaging.formats.tiff.TiffDirectoryparse(int resolution, @NonNull org.apache.commons.imaging.formats.tiff.TiffContents contents, double @NonNull [] dst) protected booleanparse(int resolution, @NonNull org.apache.commons.imaging.formats.tiff.TiffDirectory directory, double @NonNull [] dst) protected voidpostProcess(int resolution, @NonNull org.apache.commons.imaging.formats.tiff.TiffDirectory directory, double @NonNull [] dst)
-
Constructor Details
-
ParseTiffDSP
public ParseTiffDSP()
-
-
Method Details
-
parse
public double[] parse(int resolution, @NonNull @NonNull io.netty.buffer.ByteBuf buffer) throws IOException - Specified by:
parsein interfaceDoubleScalarParser- Throws:
IOException
-
postProcess
protected void postProcess(int resolution, @NonNull @NonNull org.apache.commons.imaging.formats.tiff.TiffDirectory directory, double @NonNull [] dst) throws IOException - Throws:
IOException
-
parse
protected org.apache.commons.imaging.formats.tiff.TiffDirectory parse(int resolution, @NonNull @NonNull org.apache.commons.imaging.formats.tiff.TiffContents contents, double @NonNull [] dst) throws IOException - Throws:
IOException
-
parse
protected boolean parse(int resolution, @NonNull @NonNull org.apache.commons.imaging.formats.tiff.TiffDirectory directory, double @NonNull [] dst) throws IOException - Throws:
IOException
-
isSupportedFormat
protected boolean isSupportedFormat(org.apache.commons.imaging.formats.tiff.TiffDirectory directory) throws org.apache.commons.imaging.ImagingException Verify whether this is a supported format (single-channel grayscale, encoded as IEEE 754, integers, or signed integers).- Parameters:
directory- the TIFF directory to check- Returns:
- true if the directory can be safely processed, false otherwise
- Throws:
org.apache.commons.imaging.ImagingException- if the directory is missing required fields
-