Exemplo n.º 1
0
 protected int ShiftCrossContext(IBitmap bm, IBitmap cbm, int context, int n, int up1, int up0,
                                 int xup1, int xup0, int xdn1, int column)
 {
     return(((context << 1) & 0x636) | (bm.GetByteAt(up1 + column + 1) << 8) |
            (cbm.GetByteAt(xup1 + column) << 6) | (cbm.GetByteAt(xup0 + column + 1) << 3) |
            (cbm.GetByteAt(xdn1 + column + 1)) | (n << 7));
 }
Exemplo n.º 2
0
 protected int GetDirectContext(IBitmap bm, int up2, int up1, int up0, int column)
 {
     return((bm.GetByteAt((up2 + column) - 1) << 9) | (bm.GetByteAt(up2 + column) << 8) |
            (bm.GetByteAt(up2 + column + 1) << 7) | (bm.GetByteAt((up1 + column) - 2) << 6) |
            (bm.GetByteAt((up1 + column) - 1) << 5) | (bm.GetByteAt(up1 + column) << 4) |
            (bm.GetByteAt(up1 + column + 1) << 3) | (bm.GetByteAt(up1 + column + 2) << 2) |
            (bm.GetByteAt((up0 + column) - 2) << 1) | (bm.GetByteAt((up0 + column) - 1)));
 }
Exemplo n.º 3
0
 protected int GetCrossContext(IBitmap bm, IBitmap cbm, int up1, int up0, int xup1, int xup0, int xdn1,
                               int column)
 {
     return((bm.GetByteAt((up1 + column) - 1) << 10) | (bm.GetByteAt(up1 + column) << 9) |
            (bm.GetByteAt(up1 + column + 1) << 8) | (bm.GetByteAt((up0 + column) - 1) << 7) |
            (cbm.GetByteAt(xup1 + column) << 6) | (cbm.GetByteAt((xup0 + column) - 1) << 5) |
            (cbm.GetByteAt(xup0 + column) << 4) | (cbm.GetByteAt(xup0 + column + 1) << 3) |
            (cbm.GetByteAt((xdn1 + column) - 1) << 2) | (cbm.GetByteAt(xdn1 + column) << 1) |
            (cbm.GetByteAt(xdn1 + column + 1)));
 }
Exemplo n.º 4
0
        public static void WriteBitmap(int width, int height, IBitmap bmp)
        {
            string format = "x4";

            for (int i = (height - 1); i >= 0; i--)
            {
                Console.Write($"{(i * width).ToString(format)}  ");
                for (int k = 0; k < width; k++)
                {
                    Console.Write($"{bmp.GetByteAt(i * width + k).ToString("x2")} ");
                }

                Console.WriteLine();
            }
            Console.WriteLine();
        }
Exemplo n.º 5
0
 protected int ShiftDirectContext(IBitmap bm, int context, int next, int up2, int up1, int up0,
                                  int column)
 {
     return(((context << 1) & 0x37a) | (bm.GetByteAt(up1 + column + 2) << 2) |
            (bm.GetByteAt(up2 + column + 1) << 7) | next);
 }