mirror of
https://github.com/zxing/zxing.git
synced 2025-02-21 02:55:27 -08:00
Merge pull request #472 from qianchenglenger/patch-1
fix a little error
This commit is contained in:
commit
aa50b59613
|
@ -68,7 +68,9 @@ public final class BufferedImageLuminanceSource extends LuminanceSource {
|
||||||
pixel = 0xFFFFFFFF; // = white
|
pixel = 0xFFFFFFFF; // = white
|
||||||
}
|
}
|
||||||
|
|
||||||
// .229R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC)
|
// .299R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC),
|
||||||
|
// (306*R) >> 10 is approximately equal to R*0.299, and so on.
|
||||||
|
// 0x200 >> 10 is 0.5, it implements rounding.
|
||||||
buffer[x] =
|
buffer[x] =
|
||||||
(306 * ((pixel >> 16) & 0xFF) +
|
(306 * ((pixel >> 16) & 0xFF) +
|
||||||
601 * ((pixel >> 8) & 0xFF) +
|
601 * ((pixel >> 8) & 0xFF) +
|
||||||
|
|
|
@ -70,7 +70,9 @@ public final class BufferedImageLuminanceSource extends LuminanceSource {
|
||||||
pixel = 0xFFFFFFFF; // = white
|
pixel = 0xFFFFFFFF; // = white
|
||||||
}
|
}
|
||||||
|
|
||||||
// .229R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC)
|
// .299R + 0.587G + 0.114B (YUV/YIQ for PAL and NTSC),
|
||||||
|
// (306*R) >> 10 is approximately equal to R*0.299, and so on.
|
||||||
|
// 0x200 >> 10 is 0.5, it implements rounding.
|
||||||
buffer[x] =
|
buffer[x] =
|
||||||
(306 * ((pixel >> 16) & 0xFF) +
|
(306 * ((pixel >> 16) & 0xFF) +
|
||||||
601 * ((pixel >> 8) & 0xFF) +
|
601 * ((pixel >> 8) & 0xFF) +
|
||||||
|
|
Loading…
Reference in a new issue