"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/main/java/com/google/zxing/maxicode/MaxiCodeReader.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).

MaxiCodeReader.java  (zxing-zxing-3.4.1):MaxiCodeReader.java  (zxing-zxing-3.5.0)
skipping to change at line 101 skipping to change at line 101
} }
int left = enclosingRectangle[0]; int left = enclosingRectangle[0];
int top = enclosingRectangle[1]; int top = enclosingRectangle[1];
int width = enclosingRectangle[2]; int width = enclosingRectangle[2];
int height = enclosingRectangle[3]; int height = enclosingRectangle[3];
// Now just read off the bits // Now just read off the bits
BitMatrix bits = new BitMatrix(MATRIX_WIDTH, MATRIX_HEIGHT); BitMatrix bits = new BitMatrix(MATRIX_WIDTH, MATRIX_HEIGHT);
for (int y = 0; y < MATRIX_HEIGHT; y++) { for (int y = 0; y < MATRIX_HEIGHT; y++) {
int iy = top + (y * height + height / 2) / MATRIX_HEIGHT; int iy = Math.min(top + (y * height + height / 2) / MATRIX_HEIGHT, height - 1);
for (int x = 0; x < MATRIX_WIDTH; x++) { for (int x = 0; x < MATRIX_WIDTH; x++) {
int ix = left + (x * width + width / 2 + (y & 0x01) * width / 2) / MATR // srowen: I don't quite understand why the formula below is necessary,
IX_WIDTH; but it
// can walk off the image if left + width = the right boundary. So cap i
t.
int ix = left + Math.min(
(x * width + width / 2 + (y & 0x01) * width / 2) / MATRIX_WIDTH,
width - 1);
if (image.get(ix, iy)) { if (image.get(ix, iy)) {
bits.set(x, y); bits.set(x, y);
} }
} }
} }
return bits; return bits;
} }
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 8 lines changed or added

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