- ByteMatrix output = new ByteMatrix(outputHeight, outputWidth);
- byte[][] outputArray = output.getArray();
-
- // We could be tricky and use the first row in each set of multiple as the temporary storage,
- // instead of allocating this separate array.
- byte[] row = new byte[outputWidth];
-
- // 1. Write the white lines at the top
- for (int y = 0; y < topPadding; y++) {
- setRowColor(outputArray[y], (byte) 255);
- }
-
- // 2. Expand the QR image to the multiple
- byte[][] inputArray = input.getArray();
- for (int y = 0; y < inputHeight; y++) {
- // a. Write the white pixels at the left of each row
- for (int x = 0; x < leftPadding; x++) {
- row[x] = (byte) 255;
- }