mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Fix scanline stride issue
git-svn-id: https://zxing.googlecode.com/svn/trunk@1079 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
f4940b5782
commit
967afc8e64
|
@ -70,7 +70,7 @@ public final class BufferedImageLuminanceSource extends LuminanceSource {
|
|||
if (rgbData == null || rgbData.length < width) {
|
||||
rgbData = new int[width];
|
||||
}
|
||||
image.getRGB(left, top + y, width, 1, rgbData, 0, image.getWidth());
|
||||
image.getRGB(left, top + y, width, 1, rgbData, 0, width);
|
||||
for (int x = 0; x < width; x++) {
|
||||
int pixel = rgbData[x];
|
||||
int luminance = (306 * ((pixel >> 16) & 0xFF) +
|
||||
|
@ -89,7 +89,7 @@ public final class BufferedImageLuminanceSource extends LuminanceSource {
|
|||
byte[] matrix = new byte[area];
|
||||
|
||||
int[] rgb = new int[area];
|
||||
image.getRGB(left, top, width, height, rgb, 0, image.getWidth());
|
||||
image.getRGB(left, top, width, height, rgb, 0, width);
|
||||
for (int y = 0; y < height; y++) {
|
||||
int offset = y * width;
|
||||
for (int x = 0; x < width; x++) {
|
||||
|
|
Loading…
Reference in a new issue