.class public final Lcom/google/zxing/datamatrix/DataMatrixReader; .super Ljava/lang/Object; .source "DataMatrixReader.java" # interfaces .implements Lcom/google/zxing/Reader; # static fields .field private static final NO_POINTS:[Lcom/google/zxing/ResultPoint; # instance fields .field private final decoder:Lcom/google/zxing/datamatrix/decoder/Decoder; # direct methods .method static constructor ()V .locals 1 const/4 v0, 0x0 new-array v0, v0, [Lcom/google/zxing/ResultPoint; sput-object v0, Lcom/google/zxing/datamatrix/DataMatrixReader;->NO_POINTS:[Lcom/google/zxing/ResultPoint; return-void .end method .method public constructor ()V .locals 1 .line 43 invoke-direct {p0}, Ljava/lang/Object;->()V .line 47 new-instance v0, Lcom/google/zxing/datamatrix/decoder/Decoder; invoke-direct {v0}, Lcom/google/zxing/datamatrix/decoder/Decoder;->()V iput-object v0, p0, Lcom/google/zxing/datamatrix/DataMatrixReader;->decoder:Lcom/google/zxing/datamatrix/decoder/Decoder; return-void .end method .method private static extractPureBits(Lcom/google/zxing/common/BitMatrix;)Lcom/google/zxing/common/BitMatrix; .locals 11 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException; } .end annotation .line 102 invoke-virtual {p0}, Lcom/google/zxing/common/BitMatrix;->getTopLeftOnBit()[I move-result-object v0 .line 103 invoke-virtual {p0}, Lcom/google/zxing/common/BitMatrix;->getBottomRightOnBit()[I move-result-object v1 if-eqz v0, :cond_4 if-eqz v1, :cond_4 .line 108 invoke-static {v0, p0}, Lcom/google/zxing/datamatrix/DataMatrixReader;->moduleSize([ILcom/google/zxing/common/BitMatrix;)I move-result v2 const/4 v3, 0x1 .line 110 aget v4, v0, v3 .line 111 aget v5, v1, v3 const/4 v6, 0x0 .line 112 aget v0, v0, v6 .line 113 aget v1, v1, v6 sub-int/2addr v1, v0 add-int/2addr v1, v3 .line 115 div-int/2addr v1, v2 sub-int/2addr v5, v4 add-int/2addr v5, v3 .line 116 div-int/2addr v5, v2 if-lez v1, :cond_3 if-lez v5, :cond_3 .line 124 div-int/lit8 v3, v2, 0x2 add-int/2addr v4, v3 add-int/2addr v0, v3 .line 129 new-instance v3, Lcom/google/zxing/common/BitMatrix; invoke-direct {v3, v1, v5}, Lcom/google/zxing/common/BitMatrix;->(II)V move v7, v6 :goto_0 if-ge v7, v5, :cond_2 mul-int v8, v7, v2 add-int/2addr v8, v4 move v9, v6 :goto_1 if-ge v9, v1, :cond_1 mul-int v10, v9, v2 add-int/2addr v10, v0 .line 133 invoke-virtual {p0, v10, v8}, Lcom/google/zxing/common/BitMatrix;->get(II)Z move-result v10 if-eqz v10, :cond_0 .line 134 invoke-virtual {v3, v9, v7}, Lcom/google/zxing/common/BitMatrix;->set(II)V :cond_0 add-int/lit8 v9, v9, 0x1 goto :goto_1 :cond_1 add-int/lit8 v7, v7, 0x1 goto :goto_0 :cond_2 return-object v3 .line 118 :cond_3 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .line 105 :cond_4 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .end method .method private static moduleSize([ILcom/google/zxing/common/BitMatrix;)I .locals 5 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException; } .end annotation .line 142 invoke-virtual {p1}, Lcom/google/zxing/common/BitMatrix;->getWidth()I move-result v0 const/4 v1, 0x0 .line 143 aget v2, p0, v1 const/4 v3, 0x1 .line 144 aget v3, p0, v3 :goto_0 if-ge v2, v0, :cond_0 .line 145 invoke-virtual {p1, v2, v3}, Lcom/google/zxing/common/BitMatrix;->get(II)Z move-result v4 if-eqz v4, :cond_0 add-int/lit8 v2, v2, 0x1 goto :goto_0 :cond_0 if-eq v2, v0, :cond_2 .line 152 aget p0, p0, v1 sub-int/2addr v2, p0 if-eqz v2, :cond_1 return v2 .line 154 :cond_1 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .line 149 :cond_2 invoke-static {}, Lcom/google/zxing/NotFoundException;->getNotFoundInstance()Lcom/google/zxing/NotFoundException; move-result-object p0 throw p0 .end method # virtual methods .method public decode(Lcom/google/zxing/BinaryBitmap;)Lcom/google/zxing/Result; .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException;, Lcom/google/zxing/ChecksumException;, Lcom/google/zxing/FormatException; } .end annotation const/4 v0, 0x0 .line 59 invoke-virtual {p0, p1, v0}, Lcom/google/zxing/datamatrix/DataMatrixReader;->decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result; move-result-object p0 return-object p0 .end method .method public decode(Lcom/google/zxing/BinaryBitmap;Ljava/util/Map;)Lcom/google/zxing/Result; .locals 3 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lcom/google/zxing/BinaryBitmap;", "Ljava/util/Map<", "Lcom/google/zxing/DecodeHintType;", "*>;)", "Lcom/google/zxing/Result;" } .end annotation .annotation system Ldalvik/annotation/Throws; value = { Lcom/google/zxing/NotFoundException;, Lcom/google/zxing/ChecksumException;, Lcom/google/zxing/FormatException; } .end annotation if-eqz p2, :cond_0 .line 67 sget-object v0, Lcom/google/zxing/DecodeHintType;->PURE_BARCODE:Lcom/google/zxing/DecodeHintType; invoke-interface {p2, v0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z move-result p2 if-eqz p2, :cond_0 .line 68 invoke-virtual {p1}, Lcom/google/zxing/BinaryBitmap;->getBlackMatrix()Lcom/google/zxing/common/BitMatrix; move-result-object p1 invoke-static {p1}, Lcom/google/zxing/datamatrix/DataMatrixReader;->extractPureBits(Lcom/google/zxing/common/BitMatrix;)Lcom/google/zxing/common/BitMatrix; move-result-object p1 iget-object p0, p0, Lcom/google/zxing/datamatrix/DataMatrixReader;->decoder:Lcom/google/zxing/datamatrix/decoder/Decoder; .line 69 invoke-virtual {p0, p1}, Lcom/google/zxing/datamatrix/decoder/Decoder;->decode(Lcom/google/zxing/common/BitMatrix;)Lcom/google/zxing/common/DecoderResult; move-result-object p0 sget-object p1, Lcom/google/zxing/datamatrix/DataMatrixReader;->NO_POINTS:[Lcom/google/zxing/ResultPoint; goto :goto_0 .line 72 :cond_0 new-instance p2, Lcom/google/zxing/datamatrix/detector/Detector; invoke-virtual {p1}, Lcom/google/zxing/BinaryBitmap;->getBlackMatrix()Lcom/google/zxing/common/BitMatrix; move-result-object p1 invoke-direct {p2, p1}, Lcom/google/zxing/datamatrix/detector/Detector;->(Lcom/google/zxing/common/BitMatrix;)V invoke-virtual {p2}, Lcom/google/zxing/datamatrix/detector/Detector;->detect()Lcom/google/zxing/common/DetectorResult; move-result-object p1 iget-object p0, p0, Lcom/google/zxing/datamatrix/DataMatrixReader;->decoder:Lcom/google/zxing/datamatrix/decoder/Decoder; .line 73 invoke-virtual {p1}, Lcom/google/zxing/common/DetectorResult;->getBits()Lcom/google/zxing/common/BitMatrix; move-result-object p2 invoke-virtual {p0, p2}, Lcom/google/zxing/datamatrix/decoder/Decoder;->decode(Lcom/google/zxing/common/BitMatrix;)Lcom/google/zxing/common/DecoderResult; move-result-object p0 .line 74 invoke-virtual {p1}, Lcom/google/zxing/common/DetectorResult;->getPoints()[Lcom/google/zxing/ResultPoint; move-result-object p1 .line 76 :goto_0 new-instance p2, Lcom/google/zxing/Result; invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getText()Ljava/lang/String; move-result-object v0 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getRawBytes()[B move-result-object v1 sget-object v2, Lcom/google/zxing/BarcodeFormat;->DATA_MATRIX:Lcom/google/zxing/BarcodeFormat; invoke-direct {p2, v0, v1, p1, v2}, Lcom/google/zxing/Result;->(Ljava/lang/String;[B[Lcom/google/zxing/ResultPoint;Lcom/google/zxing/BarcodeFormat;)V .line 78 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getByteSegments()Ljava/util/List; move-result-object p1 if-eqz p1, :cond_1 .line 80 sget-object v0, Lcom/google/zxing/ResultMetadataType;->BYTE_SEGMENTS:Lcom/google/zxing/ResultMetadataType; invoke-virtual {p2, v0, p1}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V .line 82 :cond_1 invoke-virtual {p0}, Lcom/google/zxing/common/DecoderResult;->getECLevel()Ljava/lang/String; move-result-object p0 if-eqz p0, :cond_2 .line 84 sget-object p1, Lcom/google/zxing/ResultMetadataType;->ERROR_CORRECTION_LEVEL:Lcom/google/zxing/ResultMetadataType; invoke-virtual {p2, p1, p0}, Lcom/google/zxing/Result;->putMetadata(Lcom/google/zxing/ResultMetadataType;Ljava/lang/Object;)V :cond_2 return-object p2 .end method .method public reset()V .locals 0 return-void .end method