} // Default constructor public CListLines(int max1, int max2, int maxB, int cnx, int cny, int nbits3) // constructor { this.MaxLine1 = max1; this.MaxLine2 = max2; this.MaxByte = maxB; this.CNX = cnx; this.CNY = cny; this.nBits3 = nbits3; this.pQ = new CQue(1000); // necessary to find connected components this.nLine1 = 0; this.nLine2 = 0; this.nByte = 0; this.Line1 = new CCrack[MaxLine1]; for (int i = 0; i < MaxLine1; i++) { Line1[i] = new CCrack(); } this.Line = new CLine[MaxLine2]; for (int i = 0; i < MaxLine2; i++) { Line[i] = new CLine(); } this.Step = new iVect2[4]; for (int i = 0; i < 4; i++) { Step[i] = new iVect2(); } this.Norm = new iVect2[4]; for (int i = 0; i < 4; i++) { Norm[i] = new iVect2(); } Step[0].X = 1; Step[0].Y = 0; Step[1].X = 0; Step[1].Y = 1; Step[2].X = -1; Step[2].Y = 0; Step[3].X = 0; Step[3].Y = -1; Norm[0].X = 0; Norm[0].Y = 1; Norm[1].X = -1; Norm[1].Y = 0; Norm[2].X = 0; Norm[2].Y = -1; Norm[3].X = 1; Norm[3].Y = 0; this.Line[0].EndByte = 0; this.Byte = new byte[MaxByte]; this.IndPos = new byte[MaxByte]; this.IndNeg = new byte[MaxByte]; } //*************** end constructor *********************/
public CListCode(int nx, int ny, int nbits, CListLines L) // Constructor { this.width = nx; //nLine1, nLine2, nByte; this.height = ny; this.nBits = nbits; this.nLine1 = L.nLine1; this.Line1 = new CCrack[nLine1]; for (int i = 0; i < nLine1; i++) { Line1[i] = new CCrack(); } this.nLine2 = L.nLine2; this.Line = new CLine[nLine2]; for (int i = 0; i < nLine2; i++) { Line[i] = new CLine(); } this.nByte = L.nByte; this.Byte = new byte[nByte]; this.Corner = new byte[4]; this.Param = new int[6]; this.Param[0] = nx; this.Param[1] = ny; this.Param[2] = nbits; this.Param[3] = L.nLine1; this.Param[4] = L.nLine2; this.Param[5] = L.nByte; this.Step = new iVect2[4]; for (int i = 0; i < 4; i++) { Step[i] = new iVect2(); } this.Step[0].X = 1; this.Step[0].Y = 0; this.Step[1].X = 0; this.Step[1].Y = 1; this.Step[2].X = -1; this.Step[2].Y = 0; this.Step[3].X = 0; this.Step[3].Y = -1; }