private void Test_One_Case(int version, TriStateMatrix expected) { TriStateMatrix target = new TriStateMatrix(expected.Width); PositioninngPatternBuilder.EmbedBasicPatterns(version, target); target.EmbedVersionInformation(version); expected.AssertEquals(target); }
private void Encode(string content, int option) { ErrorCorrectionLevel errorLevel = ErrorCorrectionLevel.H; EncodationStruct encodeStruct = DataEncode.Encode(content, errorLevel); BitList codewords = ECGenerator.FillECCodewords(encodeStruct.DataCodewords, encodeStruct.VersionDetail); if (option == 3) { return; } TriStateMatrix triMatrix = new TriStateMatrix(encodeStruct.VersionDetail.MatrixWidth); PositioninngPatternBuilder.EmbedBasicPatterns(encodeStruct.VersionDetail.Version, triMatrix); triMatrix.EmbedVersionInformation(encodeStruct.VersionDetail.Version); triMatrix.EmbedFormatInformation(errorLevel, new Pattern0()); triMatrix.TryEmbedCodewords(codewords); triMatrix.GetLowestPenaltyMatrix(errorLevel); }
private void Encode(string content, int option) { ErrorCorrectionLevel errorLevel = ErrorCorrectionLevel.H; EncodationStruct encodeStruct = DataEncode.Encode(content, errorLevel); BitList codewords = ECGenerator.FillECCodewords(encodeStruct.DataCodewords, encodeStruct.VersionDetail); if(option == 3) return; TriStateMatrix triMatrix = new TriStateMatrix(encodeStruct.VersionDetail.MatrixWidth); PositioninngPatternBuilder.EmbedBasicPatterns(encodeStruct.VersionDetail.Version, triMatrix); triMatrix.EmbedVersionInformation(encodeStruct.VersionDetail.Version); triMatrix.EmbedFormatInformation(errorLevel, new Pattern0()); triMatrix.TryEmbedCodewords(codewords); triMatrix.GetLowestPenaltyMatrix(errorLevel); }