1 /* 2 * Copyright 2010 ZXing authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.zxing.aztec; 18 19 import com.google.zxing.ResultPoint; 20 import com.google.zxing.common.BitMatrix; 21 import com.google.zxing.common.DetectorResult; 22 23 /** 24 * <p>Extends {@link DetectorResult} with more information specific to the Aztec format, 25 * like the number of layers and whether it's compact.</p> 26 * 27 * @author Sean Owen 28 */ 29 public final class AztecDetectorResult extends DetectorResult { 30 31 private final boolean compact; 32 private final int nbDatablocks; 33 private final int nbLayers; 34 private final int errorsCorrected; 35 AztecDetectorResult(BitMatrix bits, ResultPoint[] points, boolean compact, int nbDatablocks, int nbLayers)36 public AztecDetectorResult(BitMatrix bits, 37 ResultPoint[] points, 38 boolean compact, 39 int nbDatablocks, 40 int nbLayers) { 41 this(bits, points, compact, nbDatablocks, nbLayers, 0); 42 } 43 AztecDetectorResult(BitMatrix bits, ResultPoint[] points, boolean compact, int nbDatablocks, int nbLayers, int errorsCorrected)44 public AztecDetectorResult(BitMatrix bits, 45 ResultPoint[] points, 46 boolean compact, 47 int nbDatablocks, 48 int nbLayers, 49 int errorsCorrected) { 50 super(bits, points); 51 this.compact = compact; 52 this.nbDatablocks = nbDatablocks; 53 this.nbLayers = nbLayers; 54 this.errorsCorrected = errorsCorrected; 55 } 56 getNbLayers()57 public int getNbLayers() { 58 return nbLayers; 59 } 60 getNbDatablocks()61 public int getNbDatablocks() { 62 return nbDatablocks; 63 } 64 isCompact()65 public boolean isCompact() { 66 return compact; 67 } 68 getErrorsCorrected()69 public int getErrorsCorrected() { 70 return errorsCorrected; 71 } 72 } 73