java.lang.Object
net.buildtheearth.terraminusminus.config.scalarparse.d.ParseTiffDSP
All Implemented Interfaces:
DoubleScalarParser
Direct Known Subclasses:
ParseTiffAutoDSP, ParseTiffFloatingPointDSP

public class ParseTiffDSP extends Object implements DoubleScalarParser
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.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.buildtheearth.terraminusminus.config.scalarparse.d.DoubleScalarParser

    DoubleScalarParser.Deserializer, DoubleScalarParser.Serializer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    isSupportedFormat(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.TiffDirectory
    parse(int resolution, @NonNull org.apache.commons.imaging.formats.tiff.TiffContents contents, double @NonNull [] dst)
     
    protected boolean
    parse(int resolution, @NonNull org.apache.commons.imaging.formats.tiff.TiffDirectory directory, double @NonNull [] dst)
     
    protected void
    postProcess(int resolution, @NonNull org.apache.commons.imaging.formats.tiff.TiffDirectory directory, double @NonNull [] dst)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParseTiffDSP

      public ParseTiffDSP()
  • Method Details

    • parse

      public double[] parse(int resolution, @NonNull @NonNull io.netty.buffer.ByteBuf buffer) throws IOException
      Specified by:
      parse in interface DoubleScalarParser
      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