Example #1
0
        public override void Pie(int xc, int yc, int x1, int y1, int x2, int y2)
        {
            int r = ((SubPixelWidth + LineAA.SUBPIXEL_MARK) >> LineAA.SUBPIXEL_SHIFT);

            if (r < 1)
            {
                r = 1;
            }
            EllipseBresenhamInterpolator ei = new EllipseBresenhamInterpolator(r, r);
            int dx  = 0;
            int dy  = -r;
            int dy0 = dy;
            int dx0 = dx;
            int x   = xc >> LineAA.SUBPIXEL_SHIFT;
            int y   = yc >> LineAA.SUBPIXEL_SHIFT;

            do
            {
                dx += ei.Dx;
                dy += ei.Dy;
                if (dy != dy0)
                {
                    PineHLine(xc, yc, x1, y1, x2, y2, x - dx0, y + dy0, x + dx0);
                    PineHLine(xc, yc, x1, y1, x2, y2, x - dx0, y - dy0, x + dx0);
                }
                dx0 = dx;
                dy0 = dy;
                ei.Next();
            }while (dy < 0);
            PineHLine(xc, yc, x1, y1, x2, y2, x - dx0, y + dy0, x + dx0);
        }
Example #2
0
        public override void SemiDot(CompareFunction cmp, int xc1, int yc1, int xc2, int yc2)
        {
            if (doClipping && ClipLiangBarsky.Flags(xc1, yc1, clippingRectangle) != 0)
            {
                return;
            }
            int r = ((SubPixelWidth + LineAA.SUBPIXEL_MARK) >> LineAA.SUBPIXEL_SHIFT);

            if (r < 1)
            {
                r = 1;
            }
            EllipseBresenhamInterpolator ei = new EllipseBresenhamInterpolator(r, r);
            int dx  = 0;
            int dy  = -r;
            int dy0 = dy;
            int dx0 = dx;
            int x   = xc1 >> LineAA.SUBPIXEL_SHIFT;
            int y   = yc1 >> LineAA.SUBPIXEL_SHIFT;

            do
            {
                dx += ei.Dx;
                dy += ei.Dy;
                if (dy != dy0)
                {
                    SemiDotHLine(cmp, xc1, yc1, xc2, yc2, x - dx0, y + dy0, x + dx0);
                    SemiDotHLine(cmp, xc1, yc1, xc2, yc2, x - dx0, y - dy0, x + dx0);
                }
                dx0 = dx;
                dy0 = dy;
                ei.Next();
            }while (dy < 0);
            SemiDotHLine(cmp, xc1, yc1, xc2, yc2, x - dx0, y + dy0, x + dx0);
        }