Commit 9994c57c authored by 高宇's avatar 高宇

会员码接口

parent 2da87b58
...@@ -54,7 +54,6 @@ public class Qrcode { ...@@ -54,7 +54,6 @@ public class Qrcode {
public int calStructureappendParity(byte[] originaldata) { public int calStructureappendParity(byte[] originaldata) {
int i = 0; int i = 0;
int structureappendParity = false;
int originaldataLength = originaldata.length; int originaldataLength = originaldata.length;
int structureappendParity; int structureappendParity;
if (originaldataLength > 1) { if (originaldataLength > 1) {
...@@ -93,7 +92,6 @@ public class Qrcode { ...@@ -93,7 +92,6 @@ public class Qrcode {
int[] codewordNumPlus; int[] codewordNumPlus;
int codewordNumCounterValue; int codewordNumCounterValue;
int totalDataBits; int totalDataBits;
int dataCounter;
switch(this.qrcodeEncodeMode) { switch(this.qrcodeEncodeMode) {
case 'A': case 'A':
codewordNumPlus = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; codewordNumPlus = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4};
...@@ -347,21 +345,21 @@ public class Qrcode { ...@@ -347,21 +345,21 @@ public class Qrcode {
byte formatInformationValue = (byte)(ec << 3 | maskNumber); byte formatInformationValue = (byte)(ec << 3 | maskNumber);
String[] formatInformationArray = new String[]{"101010000010010", "101000100100101", "101111001111100", "101101101001011", "100010111111001", "100000011001110", "100111110010111", "100101010100000", "111011111000100", "111001011110011", "111110110101010", "111100010011101", "110011000101111", "110001100011000", "110110001000001", "110100101110110", "001011010001001", "001001110111110", "001110011100111", "001100111010000", "000011101100010", "000001001010101", "000110100001100", "000100000111011", "011010101011111", "011000001101000", "011111100110001", "011101000000110", "010010010110100", "010000110000011", "010111011011010", "010101111101101"}; String[] formatInformationArray = new String[]{"101010000010010", "101000100100101", "101111001111100", "101101101001011", "100010111111001", "100000011001110", "100111110010111", "100101010100000", "111011111000100", "111001011110011", "111110110101010", "111100010011101", "110011000101111", "110001100011000", "110110001000001", "110100101110110", "001011010001001", "001001110111110", "001110011100111", "001100111010000", "000011101100010", "000001001010101", "000110100001100", "000100000111011", "011010101011111", "011000001101000", "011111100110001", "011101000000110", "010010010110100", "010000110000011", "010111011011010", "010101111101101"};
for(int i = 0; i < 15; ++i) { for(int a = 0; a < 15; ++a) {
byte content = Byte.parseByte(formatInformationArray[formatInformationValue].substring(i, i + 1)); byte content = Byte.parseByte(formatInformationArray[formatInformationValue].substring(a, a + 1));
matrixContent[formatInformationX1[i] & 255][formatInformationY1[i] & 255] = (byte)(content * 255); matrixContent[formatInformationX1[i] & 255][formatInformationY1[a] & 255] = (byte)(content * 255);
matrixContent[formatInformationX2[i] & 255][formatInformationY2[i] & 255] = (byte)(content * 255); matrixContent[formatInformationX2[i] & 255][formatInformationY2[a] & 255] = (byte)(content * 255);
} }
boolean[][] out = new boolean[modules1Side][modules1Side]; boolean[][] out = new boolean[modules1Side][modules1Side];
int c = 0; int c = 0;
for(int i = 0; i < modules1Side; ++i) { for(int b = 0; b < modules1Side; ++b) {
for(int j = 0; j < modules1Side; ++j) { for(int j = 0; j < modules1Side; ++j) {
if ((matrixContent[j][i] & maskContent) == 0 && frameData[c] != 49) { if ((matrixContent[j][b] & maskContent) == 0 && frameData[c] != 49) {
out[j][i] = false; out[j][b] = false;
} else { } else {
out[j][i] = true; out[j][b] = true;
} }
++c; ++c;
...@@ -460,8 +458,6 @@ public class Qrcode { ...@@ -460,8 +458,6 @@ public class Qrcode {
} catch (Exception var17) { } catch (Exception var17) {
var17.printStackTrace(); var17.printStackTrace();
} }
int i = false;
int j = 0; int j = 0;
int rsBlockNumber = 0; int rsBlockNumber = 0;
byte[][] rsTemp = new byte[rsBlockOrder.length][]; byte[][] rsTemp = new byte[rsBlockOrder.length][];
...@@ -632,4 +628,4 @@ public class Qrcode { ...@@ -632,4 +628,4 @@ public class Qrcode {
return res; return res;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment