refactor/ThoughtWorks.QRCode/Codec/Reader/Pattern/FinderPattern.cs

(开头部分) 23KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace ThoughtWorks.QRCode.Codec.Reader.Pattern
{
    using System;
    using System.Collections;
    using ThoughtWorks.QRCode.Codec.Reader;
    using ThoughtWorks.QRCode.Codec.Util;
    using ThoughtWorks.QRCode.ExceptionHandler;
    using ThoughtWorks.QRCode.Geom;

    public class FinderPattern
    {
        public const int UL = 0;
        public const int UR = 1;
        public const int DL = 2;
        internal static readonly int[] VersionInfoBit = new int[] { 
            0x7c94, 0x85bc, 0x9a99, 0xa4d3, 0xbbf6, 0xc762, 0xd847, 0xe60d, 0xf928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9,
            0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64,
            0x27541, 0x28c69
        };
        internal static DebugCanvas canvas = QRCodeDecoder.Canvas;
        internal Point[] center;
        internal int version;
        internal int[] sincos;
        internal int[] width;
        internal int[] moduleSize;

        internal FinderPattern(Point[] center, int version, int[] sincos, int[] width, int[] moduleSize)
        {
            this.center = center;
            this.version = version;
            this.sincos = sincos;
            this.width = width;
            this.moduleSize = moduleSize;
        }

        internal static int calcExactVersion(Point[] centers, int[] angle, int[] moduleSize, bool[][] image)
        {
            Point point;
            int num2;
            bool[] target = new bool[0x12];
            Point[] points = new Point[0x12];
            Axis axis = new Axis(angle, moduleSize[1]) {
                Origin = centers[1]
            };
            int num = 0;
            while (num < 6)
            {
                for (num2 = 0; num2 < 3; num2++)
                {
                    point = axis.translate((int) (num2 - 7), (int) (num - 3));
                    target[num2 + (num * 3)] = image[point.X][point.Y];
                    points[num2 + (num * 3)] = point;
                }
                num++;
            }
            canvas.drawPoints(points, Color_Fields.RED);
            int num3 = 0;
            try
            {
                num3 = checkVersionInfo(target);
后面还有 640 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。