Module bus.extra

Class QrDecoder

java.lang.Object
org.miaixz.bus.extra.qrcode.QrDecoder
All Implemented Interfaces:
org.miaixz.bus.core.codec.Decoder<Image,String>

public class QrDecoder extends Object implements org.miaixz.bus.core.codec.Decoder<Image,String>
二维码(条形码等)解码器
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • QrDecoder

      public QrDecoder(Map<com.google.zxing.DecodeHintType,Object> hints)
      构造
      Parameters:
      hints - 自定义扫码配置,包括算法、编码、复杂模式等
  • Method Details

    • of

      public static QrDecoder of(boolean isTryHarder, boolean isPureBarcode)
      创建二维码(条形码等)解码器,用于将二维码(条形码等)解码为所代表的内容字符串
      Parameters:
      isTryHarder - 是否优化精度
      isPureBarcode - 是否使用复杂模式,扫描带logo的二维码设为true
      Returns:
      QrDecoder
    • of

      public static QrDecoder of(Map<com.google.zxing.DecodeHintType,Object> hints)
      创建二维码(条形码等)解码器
      Parameters:
      hints - 自定义扫码配置,包括算法、编码、复杂模式等
      Returns:
      QrDecoder
    • decode

      public String decode(Image image)
      Specified by:
      decode in interface org.miaixz.bus.core.codec.Decoder<Image,String>