internal void ApplyPattern(ByteMatrix matrix, int pattern) { for (int i = 0; i < matrix.Width; i++) { for (int j = 0; j < matrix.Height; j++) { int bit = matrix[i, j]; if (MaskUtil.getDataMaskBit(pattern, j, i)) { bit ^= 0x1; } matrix[i, j] = (sbyte)bit; } } }
private static bool TestGetDataMaskBitInternal(int maskPattern, int[][] expected) { for (int x = 0; x < 6; ++x) { for (int y = 0; y < 6; ++y) { if ((expected[y][x] == 1) != MaskUtil.getDataMaskBit(maskPattern, x, y)) { return(false); } } } return(true); }
private void ApplyPattern(ByteMatrix matrix, int pattern) { for (int i = 0; i < matrix.Width; i++) { for (int j = 0; j < matrix.Height; j++) { int bit = matrix[i, j]; if (MaskUtil.getDataMaskBit(pattern, j, i)) { bit ^= 0x1; } matrix[i, j] = (sbyte)bit; } } MatrixUtil.embedTypeInfo(ErrorCorrectionLevelInternal.H, pattern, matrix); }