ZXing.QrCode.Internal.Version.getECBlocksForLevel C# (CSharp) 메소드

getECBlocksForLevel() 공개 메소드

public getECBlocksForLevel ( ErrorCorrectionLevel ecLevel ) : ECBlocks
ecLevel ErrorCorrectionLevel
리턴 ECBlocks
        public ECBlocks getECBlocksForLevel(ErrorCorrectionLevel ecLevel)
        {
            return ecBlocks[ecLevel.ordinal()];
        }

Usage Example

예제 #1
0
        /// <summary></summary>
        /// <returns>true if the number of input bits will fit in a code with the specified version and error correction level.</returns>
        private static bool willFit(int numInputBits, Version version, ErrorCorrectionLevel ecLevel)
        {
            // In the following comments, we use numbers of Version 7-H.
            // numBytes = 196
            var numBytes = version.TotalCodewords;
            // getNumECBytes = 130
            var ecBlocks   = version.getECBlocksForLevel(ecLevel);
            var numEcBytes = ecBlocks.TotalECCodewords;
            // getNumDataBytes = 196 - 130 = 66
            var numDataBytes    = numBytes - numEcBytes;
            var totalInputBytes = (numInputBits + 7) / 8;

            return(numDataBytes >= totalInputBytes);
        }
All Usage Examples Of ZXing.QrCode.Internal.Version::getECBlocksForLevel