"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/main/java/com/google/zxing/qrcode/encoder/MaskUtil.java" between
zxing-zxing-3.4.1.tar.gz and zxing-zxing-3.5.0.tar.gz

About: ZXing ("zebra crossing") is a multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages. Info: Project is in maintenance mode (no active development).

MaskUtil.java  (zxing-zxing-3.4.1):MaskUtil.java  (zxing-zxing-3.5.0)
skipping to change at line 107 skipping to change at line 107
array[y + 6][x] == 1 && array[y + 6][x] == 1 &&
(isWhiteVertical(array, x, y - 4, y) || isWhiteVertical(array, x, y + 7, y + 11))) { (isWhiteVertical(array, x, y - 4, y) || isWhiteVertical(array, x, y + 7, y + 11))) {
numPenalties++; numPenalties++;
} }
} }
} }
return numPenalties * N3; return numPenalties * N3;
} }
private static boolean isWhiteHorizontal(byte[] rowArray, int from, int to) { private static boolean isWhiteHorizontal(byte[] rowArray, int from, int to) {
from = Math.max(from, 0); if (from < 0 || rowArray.length < to) {
to = Math.min(to, rowArray.length); return false;
}
for (int i = from; i < to; i++) { for (int i = from; i < to; i++) {
if (rowArray[i] == 1) { if (rowArray[i] == 1) {
return false; return false;
} }
} }
return true; return true;
} }
private static boolean isWhiteVertical(byte[][] array, int col, int from, int to) { private static boolean isWhiteVertical(byte[][] array, int col, int from, int to) {
from = Math.max(from, 0); if (from < 0 || array.length < to) {
to = Math.min(to, array.length); return false;
}
for (int i = from; i < to; i++) { for (int i = from; i < to; i++) {
if (array[i][col] == 1) { if (array[i][col] == 1) {
return false; return false;
} }
} }
return true; return true;
} }
/** /**
* Apply mask penalty rule 4 and return the penalty. Calculate the ratio of da rk cells and give * Apply mask penalty rule 4 and return the penalty. Calculate the ratio of da rk cells and give
 End of changes. 2 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)