예제 #1
0
        private Version(int versionNumber,
                        int[] alignmentPatternCenters,
                        ECBlocks ecBlocks1,
                        ECBlocks ecBlocks2,
                        ECBlocks ecBlocks3,
                        ECBlocks ecBlocks4)
        {
            this.versionNumber           = versionNumber;
            this.alignmentPatternCenters = alignmentPatternCenters;
            this.ecBlocks = new ECBlocks[] { ecBlocks1, ecBlocks2, ecBlocks3, ecBlocks4 };
            int total       = 0;
            int ecCodewords = ecBlocks1.GetECCodewordsPerBlock();

            ECB[] ecbArray = ecBlocks1.GetECBlocks();
            for (int i = 0; i < ecbArray.Length; i++)
            {
                ECB ecBlock = ecbArray[i];
                total += ecBlock.GetCount() * (ecBlock.GetDataCodewords() + ecCodewords);
            }
            this.totalCodewords = total;
        }