コード例 #1
0
ファイル: PdfLiteral.cs プロジェクト: zymemail/itext7-dotnet
 public PdfLiteral(int size)
     : this(new byte[size])
 {
     JavaUtil.Fill(content, (byte)32);
 }
コード例 #2
0
        /* "ECC200" fills an nrow x ncol array with appropriate values for ECC200 */
        private void Ecc200()
        {
            int row;
            int col;
            int chr;

            /* First, fill the array[] with invalid entries */
            JavaUtil.Fill(array, (short)0);
            /* Starting in the correct location for character #1, bit 8,... */
            chr = 1;
            row = 4;
            col = 0;
            do
            {
                /* repeatedly first check for one of the special corner cases, then... */
                if (row == nrow && col == 0)
                {
                    Corner1(chr++);
                }
                if (row == nrow - 2 && col == 0 && ncol % 4 != 0)
                {
                    Corner2(chr++);
                }
                if (row == nrow - 2 && col == 0 && ncol % 8 == 4)
                {
                    Corner3(chr++);
                }
                if (row == nrow + 4 && col == 2 && ncol % 8 == 0)
                {
                    Corner4(chr++);
                }
                do
                {
                    /* sweep upward diagonally, inserting successive characters,... */
                    if (row < nrow && col >= 0 && array[row * ncol + col] == 0)
                    {
                        Utah(row, col, chr++);
                    }
                    row -= 2;
                    col += 2;
                }while (row >= 0 && col < ncol);
                row += 1;
                col += 3;
                do
                {
                    /* & then sweep downward diagonally, inserting successive characters,... */
                    if (row >= 0 && col < ncol && array[row * ncol + col] == 0)
                    {
                        Utah(row, col, chr++);
                    }
                    row += 2;
                    col -= 2;
                }while (row < nrow && col >= 0);
                row += 3;
                col += 1;
            }while (row < nrow || col < ncol);
            /* ... until the entire array is scanned */
            /* Lastly, if the lower righthand corner is untouched, fill in fixed pattern */
            if (array[nrow * ncol - 1] == 0)
            {
                array[nrow * ncol - 1] = array[nrow * ncol - ncol - 2] = 1;
            }
        }
コード例 #3
0
ファイル: DeviceN.cs プロジェクト: wjzhwht/itext7-dotnet
 private static float[] GetDefaultColorants(int numOfColorants)
 {
     float[] colorants = new float[numOfColorants];
     JavaUtil.Fill(colorants, 1f);
     return(colorants);
 }