mirror of
https://github.com/zxing/zxing.git
synced 2025-02-21 02:55:27 -08:00
Add toString() for easy debugging
git-svn-id: https://zxing.googlecode.com/svn/trunk@939 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
6d472ea18a
commit
76eeeed99a
|
@ -161,6 +161,20 @@ public abstract class BaseMonochromeBitmapSource implements MonochromeBitmapSour
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
StringBuffer result = new StringBuffer(height * (width + 1));
|
||||||
|
BitArray row = new BitArray(width);
|
||||||
|
for (int i = 0; i < height; i++) {
|
||||||
|
row = getBlackRow(i, row, 0, width);
|
||||||
|
for (int j = 0; j < width; j++) {
|
||||||
|
result.append(row.get(j) ? "X " : " ");
|
||||||
|
}
|
||||||
|
result.append('\n');
|
||||||
|
}
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// These methods below should not need to exist because they are defined in the interface that
|
// These methods below should not need to exist because they are defined in the interface that
|
||||||
// this abstract class implements. However this seems to cause problems on some Nokias.
|
// this abstract class implements. However this seems to cause problems on some Nokias.
|
||||||
// So we write these redundant declarations.
|
// So we write these redundant declarations.
|
||||||
|
|
Loading…
Reference in a new issue