ThoughtWorks.QRCode/ThoughtWorks/QRCode/Geom/SamplingGrid.cs

(开头部分) 5KB

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

namespace ThoughtWorks.QRCode.Geom
{
    using System;

    public class SamplingGrid
    {
        private AreaGrid[][] grid;

        public SamplingGrid(int sqrtNumArea)
        {
            this.grid = new AreaGrid[sqrtNumArea][];
            for (int i = 0; i < sqrtNumArea; i++)
            {
                this.grid[i] = new AreaGrid[sqrtNumArea];
            }
        }

        public virtual void adjust(Point adjust)
        {
            int x = adjust.X;
            int y = adjust.Y;
            for (int i = 0; i < this.grid[0].Length; i++)
            {
                for (int j = 0; j < this.grid.Length; j++)
                {
                    for (int k = 0; k < this.grid[j][i].XLines.Length; k++)
                    {
                        this.grid[j][i].XLines[k].translate(x, y);
                    }
                    for (int m = 0; m < this.grid[j][i].YLines.Length; m++)
                    {
                        this.grid[j][i].YLines[m].translate(x, y);
                    }
                }
            }
        }

        public virtual int getHeight() => 
            this.grid.Length;

        public virtual int getHeight(int ax, int ay) => 
            this.grid[ax][ay].Height;

        public virtual int getWidth() => 
            this.grid[0].Length;

        public virtual int getWidth(int ax, int ay) => 
            this.grid[ax][ay].Width;

        public virtual int getX(int ax, int x)
        {
            int num = x;
            for (int i = 0; i < ax; i++)
            {
                num += this.grid[i][0].Width - 1;
            }
            return num;
        }

        public virtual Line getXLine(int ax, int ay, int x) => 
后面还有 122 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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