⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a.java

📁 二维QR条码项目的J2ME源代码。软件包括1.核心QR码编/解库
💻 JAVA
字号:
// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 12/6/2006 9:53:45 AM
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 

package jp.sourceforge.qrcode.reader.pattern;

import jp.sourceforge.qrcode.exception.d;
import jp.sourceforge.qrcode.geom.b;
import jp.sourceforge.qrcode.geom.c;

// Referenced classes of package jp.sourceforge.qrcode.reader.pattern:
//            b

public final class a
{

    private a(jp.sourceforge.qrcode.geom.a aa[][], int i)
    {
        a = aa;
        b = i;
    }

    public static a a(boolean aflag[][], jp.sourceforge.qrcode.reader.pattern.b b1)
        throws jp.sourceforge.qrcode.exception.a, d
    {
        jp.sourceforge.qrcode.geom.a aa[][];
        int i = (aa = a(b1))[1][0].a - aa[0][0].a;
        jp.sourceforge.qrcode.geom.a aa1[][] = null;
        aa1 = a(aflag, b1, aa);
        return new a(aa1, i);
    }

    public final jp.sourceforge.qrcode.geom.a[][] a()
    {
        return a;
    }

    public final int b()
    {
        return b;
    }

    private static jp.sourceforge.qrcode.geom.a[][] a(boolean aflag[][], jp.sourceforge.qrcode.reader.pattern.b b1, jp.sourceforge.qrcode.geom.a aa[][])
        throws jp.sourceforge.qrcode.exception.a
    {
        int i = b1.d();
        int j = b1.b()[0];
        int k = b1.b()[1];
        b b2 = new b(j, k, i);
        int l;
        jp.sourceforge.qrcode.geom.a aa1[][] = new jp.sourceforge.qrcode.geom.a[l = aa.length][l];
        b2.d = b1.a(0);
        aa1[0][0] = b2.a(3, 3);
        b2.d = b1.a(1);
        aa1[l - 1][0] = b2.a(-3, 3);
        b2.d = b1.a(2);
        aa1[0][l - 1] = b2.a(3, -3);
        for(int i1 = 0; i1 < l; i1++)
        {
            for(int j1 = 0; j1 < l; j1++)
            {
                if(j1 == 1 && i1 == 0 && l == 3)
                    aa1[j1][i1] = jp.sourceforge.qrcode.geom.a.a(aa1[0][0], aa1[l - 1][0]);
                else
                if(j1 == 0 && i1 == 1 && l == 3)
                {
                    aa1[j1][i1] = jp.sourceforge.qrcode.geom.a.a(aa1[0][0], aa1[0][l - 1]);
                } else
                {
                    if(j1 < 1 || i1 < 1)
                        continue;
                    c ac[] = {
                        new c(aa1[j1 - 1][i1 - 1], aa1[j1][i1 - 1]), new c(aa1[j1 - 1][i1 - 1], aa1[j1 - 1][i1])
                    };
                    int k1 = aa1[j1 - 1][i1].a - aa1[j1 - 1][i1 - 1].a;
                    int l1 = aa1[j1 - 1][i1].b - aa1[j1 - 1][i1 - 1].b;
                    ac[0].a += k1;
                    ac[0].b += l1;
                    ac[0].c += k1;
                    ac[0].d += l1;
                    k1 = aa1[j1][i1 - 1].a - aa1[j1 - 1][i1 - 1].a;
                    l1 = aa1[j1][i1 - 1].b - aa1[j1 - 1][i1 - 1].b;
                    ac[1].a += k1;
                    ac[1].b += l1;
                    ac[1].c += k1;
                    ac[1].d += l1;
                    aa1[j1][i1] = jp.sourceforge.qrcode.geom.a.a(ac[0].b(), ac[1].b());
                }
                aa1[j1][i1] = a(aflag, aa1[j1][i1]);
            }

        }

        return aa1;
    }

    private static jp.sourceforge.qrcode.geom.a a(boolean aflag[][], jp.sourceforge.qrcode.geom.a a1)
        throws jp.sourceforge.qrcode.exception.a
    {
        if(!aflag[a1.a][a1.b])
        {
            int i = 0;
            for(boolean flag = true; flag;)
            {
                int l = ++i;
                while(l > -i) 
                {
                    for(int j1 = i; j1 > -i; j1--)
                        if(aflag[a1.a + j1][a1.b + l])
                        {
                            a1 = new jp.sourceforge.qrcode.geom.a(a1.a + j1, a1.b + l);
                            flag = false;
                        }

                    l--;
                }
            }

        }
        int k;
        int i1;
        int j = k = i1 = a1.a;
        int k1;
        int l1;
        int i2;
        for(k1 = l1 = i2 = a1.b; k >= 1 && !a(aflag, k, k1, k - 1, k1); k--);
        for(; i1 < aflag.length - 1 && !a(aflag, i1, k1, i1 + 1, k1); i1++);
        for(; l1 >= 1 && !a(aflag, j, l1, j, l1 - 1); l1--);
        for(; i2 < aflag[0].length - 1 && !a(aflag, j, i2, j, i2 + 1); i2++);
        return new jp.sourceforge.qrcode.geom.a((k + i1 + 1) / 2, (l1 + i2 + 1) / 2);
    }

    private static boolean a(boolean aflag[][], int i, int j, int k, int l)
    {
        return !aflag[i][j] && aflag[k][l];
    }

    private static jp.sourceforge.qrcode.geom.a[][] a(jp.sourceforge.qrcode.reader.pattern.b b1)
        throws d
    {
        int i = b1.c();
        jp.sourceforge.qrcode.geom.a aa[][] = null;
        int ai[] = null;
        if(i == 1)
            return (jp.sourceforge.qrcode.geom.a[][])null;
        if(i >= 2 && i <= 6)
        {
            (ai = new int[2])[0] = 6;
            ai[1] = 10 + 4 * i;
            aa = new jp.sourceforge.qrcode.geom.a[ai.length][ai.length];
        } else
        if(i >= 7 && i <= 13)
        {
            (ai = new int[3])[0] = 6;
            ai[1] = 8 + 2 * i;
            ai[2] = 10 + 4 * i;
            aa = new jp.sourceforge.qrcode.geom.a[ai.length][ai.length];
        } else
        {
            throw new d();
        }
        for(int j = 0; j < aa.length; j++)
        {
            for(int k = 0; k < aa.length; k++)
                aa[k][j] = new jp.sourceforge.qrcode.geom.a(ai[k], ai[j]);

        }

        return aa;
    }

    jp.sourceforge.qrcode.geom.a a[][];
    int b;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -