mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 11:47:26 -08:00
Optimize QR data mask recognition (#652)
This commit is contained in:
parent
7805a7551c
commit
70db62d11b
|
@ -89,8 +89,7 @@ enum DataMask {
|
|||
DATA_MASK_101() {
|
||||
@Override
|
||||
boolean isMasked(int i, int j) {
|
||||
int temp = i * j;
|
||||
return (temp & 0x01) + (temp % 3) == 0;
|
||||
return (i * j) % 6 == 0;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -101,7 +100,7 @@ enum DataMask {
|
|||
@Override
|
||||
boolean isMasked(int i, int j) {
|
||||
int temp = i * j;
|
||||
return (((temp & 0x01) + (temp % 3)) & 0x01) == 0;
|
||||
return ((temp + (temp % 3)) & 0x01) == 0;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -111,7 +110,7 @@ enum DataMask {
|
|||
DATA_MASK_111() {
|
||||
@Override
|
||||
boolean isMasked(int i, int j) {
|
||||
return ((((i + j) & 0x01) + ((i * j) % 3)) & 0x01) == 0;
|
||||
return ((i + j + ((i * j) % 3)) & 0x01) == 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue