Class Decoder


  • public final class Decoder
    extends java.lang.Object

    The main class which implements Data Matrix Code decoding -- as opposed to locating and extracting the Data Matrix Code from an image.

    • Constructor Summary

      Constructors 
      Constructor Description
      Decoder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DecoderResult decode​(boolean[][] image)
      Convenience method that can decode a Data Matrix Code represented as a 2D array of booleans.
      DecoderResult decode​(BitMatrix bits)
      Decodes a Data Matrix Code represented as a BitMatrix.
      • Methods inherited from class java.lang.Object

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

      • Decoder

        public Decoder()
    • Method Detail

      • decode

        public DecoderResult decode​(boolean[][] image)
                             throws FormatException,
                                    ChecksumException

        Convenience method that can decode a Data Matrix Code represented as a 2D array of booleans. "true" is taken to mean a black module.

        Parameters:
        image - booleans representing white/black Data Matrix Code modules
        Returns:
        text and bytes encoded within the Data Matrix Code
        Throws:
        FormatException - if the Data Matrix Code cannot be decoded
        ChecksumException - if error correction fails