Пример #1
0
 internal void CopyTo(TriStateMatrix target, MatrixRectangle sourceArea, MatrixPoint targetPoint, MatrixStatus mstatus)
 {
     for (int j = 0; j < sourceArea.Size.Height; j++)
     {
         for (int i = 0; i < sourceArea.Size.Width; i++)
         {
             bool value = this[sourceArea.Location.X + i, sourceArea.Location.Y + j];
             target[targetPoint.X + i, targetPoint.Y + j, mstatus] = value;
         }
     }
 }
Пример #2
0
 internal void CopyTo(TriStateMatrix target, MatrixRectangle sourceArea, MatrixPoint targetPoint, MatrixStatus mstatus)
 {
     for (int j = 0; j < sourceArea.Size.Height; j++)
     {
         for (int i = 0; i < sourceArea.Size.Width; i++)
         {
             bool value = this[sourceArea.Location.X + i, sourceArea.Location.Y + j];
             target[targetPoint.X + i, targetPoint.Y + j, mstatus] = value;
         }
     }
 }
Пример #3
0
        public static bool CreateTriStateMatrix(bool[,] internalArray, out TriStateMatrix triStateMatrix)
        {
            triStateMatrix = null;
            if (CanCreate(internalArray))
            {
                triStateMatrix = new TriStateMatrix(internalArray);
                return(true);
            }

            return(false);
        }
Пример #4
0
        private static BitMatrix ProcessEncodationResult(EncodationStruct encodeStruct, ErrorCorrectionLevel errorLevel)
        {
            BitList codewords = ECGenerator.FillECCodewords(encodeStruct.DataCodewords, encodeStruct.VersionDetail);

            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);

            return triMatrix.GetLowestPenaltyMatrix(errorLevel);
        }
Пример #5
0
        private static BitMatrix ProcessEncodationResult(EncodationStruct encodeStruct, ErrorCorrectionLevel errorLevel)
        {
            BitList codewords = ECGenerator.FillECCodewords(encodeStruct.DataCodewords, encodeStruct.VersionDetail);

            TriStateMatrix triMatrix = new TriStateMatrix(encodeStruct.VersionDetail.MatrixWidth);

            PositioningPatternBuilder.EmbedBasicPatterns(encodeStruct.VersionDetail.Version, triMatrix);

            triMatrix.EmbedVersionInformation(encodeStruct.VersionDetail.Version);
            triMatrix.EmbedFormatInformation(errorLevel, new Pattern0());
            triMatrix.TryEmbedCodewords(codewords);

            return(triMatrix.GetLowestPenaltyMatrix(errorLevel));
        }
Пример #6
0
        public static bool CreateTriStateMatrix(bool[,] internalArray, out TriStateMatrix triStateMatrix)
        {
            triStateMatrix = null;
            if (internalArray == null)
            {
                return(false);
            }

            if (internalArray.GetLength(0) == internalArray.GetLength(1))
            {
                triStateMatrix = new TriStateMatrix(internalArray);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #7
0
 internal void CopyTo(TriStateMatrix target, MatrixPoint targetPoint, MatrixStatus mstatus)
 {
     CopyTo(target, new MatrixRectangle(new MatrixPoint(0, 0), new MatrixSize(Width, Height)), targetPoint, mstatus);
 }
Пример #8
0
 internal void CopyTo(TriStateMatrix target, MatrixPoint targetPoint, MatrixStatus mstatus)
 {
     CopyTo(target, new MatrixRectangle(new MatrixPoint(0,0), new MatrixSize(Width, Height)), targetPoint, mstatus);
 }
Пример #9
0
        public static bool CreateTriStateMatrix(bool[,] internalArray, out TriStateMatrix triStateMatrix)
        {
            triStateMatrix = null;
            if (internalArray == null)
                return false;

            if (internalArray.GetLength(0) == internalArray.GetLength(1))
            {
                triStateMatrix = new TriStateMatrix(internalArray);
                return true;
            }
            else
            {
                return false;
            }
        }