Class Barcode

java.lang.Object
com.codename1.ai.vision.Barcode

public final class Barcode extends Object
Portable barcode observation with normalized geometry. Format names are backend-neutral constants such as QR_CODE, DATA_MATRIX, CODE_128, and EAN_13; unknown symbologies use UNKNOWN. Corner points are ordered around the code when supplied by the backend and may be empty when geometry is unavailable.
  • Constructor Details

    • Barcode

      public Barcode(String value, String format, byte[] rawBytes, VisionRect bounds, VisionPoint[] corners)
      Creates a barcode without backend metadata.
      Parameters:
      value - decoded display value, or null
      format - normalized symbology name
      rawBytes - original payload bytes when available
      bounds - normalized top-left-origin bounds
      corners - normalized corner points
    • Barcode

      public Barcode(String value, String format, byte[] rawBytes, VisionRect bounds, VisionPoint[] corners, VisionMetadata metadata)
      Creates a complete barcode observation.
      Parameters:
      value - decoded display value, or null
      format - normalized symbology name
      rawBytes - original payload bytes when available
      bounds - normalized top-left-origin bounds
      corners - normalized corner points
      metadata - backend identity and optional diagnostic values
  • Method Details

    • getValue

      public String getValue()
      Returns:
      decoded display value, or null when decoding failed
    • getFormat

      public String getFormat()
      Returns:
      normalized symbology name, never a vendor numeric identifier
    • getRawBytes

      public byte[] getRawBytes()
      Returns:
      a defensive copy of payload bytes, or null if unavailable
    • getBounds

      public VisionRect getBounds()
      Returns:
      normalized top-left-origin bounds
    • getCorners

      public VisionPoint[] getCorners()
      Returns:
      defensive copy of normalized corners; possibly empty
    • getMetadata

      public VisionMetadata getMetadata()
      Returns:
      backend metadata, or null for manually created results