diff --git a/core/src/com/google/zxing/MultiFormatWriter.java b/core/src/com/google/zxing/MultiFormatWriter.java index c6ad4a007..c980eb666 100644 --- a/core/src/com/google/zxing/MultiFormatWriter.java +++ b/core/src/com/google/zxing/MultiFormatWriter.java @@ -16,7 +16,7 @@ package com.google.zxing; -import com.google.zxing.aztec.encoder.AztecWriter; +import com.google.zxing.aztec.AztecWriter; import com.google.zxing.common.BitMatrix; import com.google.zxing.datamatrix.DataMatrixWriter; import com.google.zxing.oned.CodaBarWriter; @@ -26,7 +26,7 @@ import com.google.zxing.oned.EAN13Writer; import com.google.zxing.oned.EAN8Writer; import com.google.zxing.oned.ITFWriter; import com.google.zxing.oned.UPCAWriter; -import com.google.zxing.pdf417.encoder.PDF417Writer; +import com.google.zxing.pdf417.PDF417Writer; import com.google.zxing.qrcode.QRCodeWriter; import java.util.Map; diff --git a/core/src/com/google/zxing/aztec/encoder/AztecWriter.java b/core/src/com/google/zxing/aztec/AztecWriter.java similarity index 93% rename from core/src/com/google/zxing/aztec/encoder/AztecWriter.java rename to core/src/com/google/zxing/aztec/AztecWriter.java index 4d021fe00..6105cb673 100644 --- a/core/src/com/google/zxing/aztec/encoder/AztecWriter.java +++ b/core/src/com/google/zxing/aztec/AztecWriter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.zxing.aztec.encoder; +package com.google.zxing.aztec; import java.nio.charset.Charset; import java.util.Map; @@ -22,6 +22,8 @@ import java.util.Map; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.Writer; +import com.google.zxing.aztec.encoder.AztecCode; +import com.google.zxing.aztec.encoder.Encoder; import com.google.zxing.common.BitMatrix; public final class AztecWriter implements Writer { diff --git a/core/src/com/google/zxing/pdf417/encoder/PDF417Writer.java b/core/src/com/google/zxing/pdf417/PDF417Writer.java similarity index 96% rename from core/src/com/google/zxing/pdf417/encoder/PDF417Writer.java rename to core/src/com/google/zxing/pdf417/PDF417Writer.java index bb7ca4b74..5f2853e55 100644 --- a/core/src/com/google/zxing/pdf417/encoder/PDF417Writer.java +++ b/core/src/com/google/zxing/pdf417/PDF417Writer.java @@ -14,13 +14,16 @@ * limitations under the License. */ -package com.google.zxing.pdf417.encoder; +package com.google.zxing.pdf417; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.Writer; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; +import com.google.zxing.pdf417.encoder.Compaction; +import com.google.zxing.pdf417.encoder.Dimensions; +import com.google.zxing.pdf417.encoder.PDF417; import java.util.Map; diff --git a/core/src/com/google/zxing/pdf417/encoder/BarcodeMatrix.java b/core/src/com/google/zxing/pdf417/encoder/BarcodeMatrix.java index f1ce130b4..bcc0b6961 100644 --- a/core/src/com/google/zxing/pdf417/encoder/BarcodeMatrix.java +++ b/core/src/com/google/zxing/pdf417/encoder/BarcodeMatrix.java @@ -21,7 +21,7 @@ package com.google.zxing.pdf417.encoder; * * @author Jacob Haynes */ -final class BarcodeMatrix { +public final class BarcodeMatrix { private final BarcodeRow[] matrix; private int currentRow; @@ -59,19 +59,19 @@ final class BarcodeMatrix { return matrix[currentRow]; } - byte[][] getMatrix() { + public byte[][] getMatrix() { return getScaledMatrix(1, 1); } - byte[][] getScaledMatrix(int Scale) { - return getScaledMatrix(Scale, Scale); + public byte[][] getScaledMatrix(int scale) { + return getScaledMatrix(scale, scale); } - byte[][] getScaledMatrix(int xScale, int yScale) { + public byte[][] getScaledMatrix(int xScale, int yScale) { byte[][] matrixOut = new byte[height * yScale][width * xScale]; int yMax = height * yScale; - for (int ii = 0; ii < yMax; ii++) { - matrixOut[yMax - ii - 1] = matrix[ii / yScale].getScaledRow(xScale); + for (int i = 0; i < yMax; i++) { + matrixOut[yMax - i - 1] = matrix[i / yScale].getScaledRow(xScale); } return matrixOut; } diff --git a/core/src/com/google/zxing/pdf417/encoder/PDF417.java b/core/src/com/google/zxing/pdf417/encoder/PDF417.java index 9b89b29e6..2ddf1b3c3 100644 --- a/core/src/com/google/zxing/pdf417/encoder/PDF417.java +++ b/core/src/com/google/zxing/pdf417/encoder/PDF417.java @@ -25,7 +25,7 @@ import com.google.zxing.WriterException; /** * Top-level class for the logic part of the PDF417 implementation. */ -final class PDF417 { +public final class PDF417 { /** * The start pattern (17 bits) @@ -518,11 +518,11 @@ final class PDF417 { private int maxRows; private int minRows; - PDF417() { + public PDF417() { this(false); } - PDF417(boolean compact) { + public PDF417(boolean compact) { this.compact = compact; compaction = Compaction.AUTO; minCols = 2; @@ -531,7 +531,7 @@ final class PDF417 { minRows = 2; } - BarcodeMatrix getBarcodeMatrix() { + public BarcodeMatrix getBarcodeMatrix() { return barcodeMatrix; } @@ -638,7 +638,7 @@ final class PDF417 { * * @param msg the message to encode */ - void generateBarcodeLogic(String msg, int errorCorrectionLevel) throws WriterException { + public void generateBarcodeLogic(String msg, int errorCorrectionLevel) throws WriterException { //1. step: High-level encoding int errorCorrectionCodeWords = PDF417ErrorCorrection.getErrorCorrectionCodewordCount(errorCorrectionLevel); @@ -683,7 +683,7 @@ final class PDF417 { * @param errorCorrectionCodeWords number of error correction code words * @return dimension object containing cols as width and rows as height */ - int[] determineDimensions(int sourceCodeWords, int errorCorrectionCodeWords) throws WriterException { + private int[] determineDimensions(int sourceCodeWords, int errorCorrectionCodeWords) throws WriterException { float ratio = 0.0f; int[] dimension = null; @@ -728,7 +728,7 @@ final class PDF417 { /** * Sets max/min row/col values */ - void setDimensions(int maxCols, int minCols, int maxRows, int minRows) { + public void setDimensions(int maxCols, int minCols, int maxRows, int minRows) { this.maxCols = maxCols; this.minCols = minCols; this.maxRows = maxRows; @@ -738,7 +738,7 @@ final class PDF417 { /** * Sets compaction to values stored in {@link Compaction} enum */ - void setCompaction(Compaction compaction) { + public void setCompaction(Compaction compaction) { this.compaction = compaction; } @@ -746,7 +746,7 @@ final class PDF417 { * Sets compact to be true or false * @param compact */ - void setCompact(boolean compact) { + public void setCompact(boolean compact) { this.compact = compact; } diff --git a/core/test/src/com/google/zxing/aztec/encoder/EncoderTest.java b/core/test/src/com/google/zxing/aztec/encoder/EncoderTest.java index a4e5dc6c1..b468a7075 100644 --- a/core/test/src/com/google/zxing/aztec/encoder/EncoderTest.java +++ b/core/test/src/com/google/zxing/aztec/encoder/EncoderTest.java @@ -24,6 +24,7 @@ import java.util.Random; import java.util.regex.Pattern; import com.google.zxing.FormatException; +import com.google.zxing.aztec.AztecWriter; import org.junit.Assert; import org.junit.Test;