Esempio n. 1
0
		public override void pie(int xc, int yc, int x1, int y1, int x2, int y2)
		{
			int r = ((subpixel_width() + LineAABasics.line_subpixel_mask) >> LineAABasics.line_subpixel_shift);
			if (r < 1) r = 1;
			ellipse_bresenham_interpolator ei = new ellipse_bresenham_interpolator(r, r);
			int dx = 0;
			int dy = -r;
			int dy0 = dy;
			int dx0 = dx;
			int x = xc >> LineAABasics.line_subpixel_shift;
			int y = yc >> LineAABasics.line_subpixel_shift;

			do
			{
				dx += ei.dx();
				dy += ei.dy();

				if (dy != dy0)
				{
					pie_hline(xc, yc, x1, y1, x2, y2, x - dx0, y + dy0, x + dx0);
					pie_hline(xc, yc, x1, y1, x2, y2, x - dx0, y - dy0, x + dx0);
				}
				dx0 = dx;
				dy0 = dy;
				ei.Next();
			}
			while (dy < 0);
			pie_hline(xc, yc, x1, y1, x2, y2, x - dx0, y + dy0, x + dx0);
		}
Esempio n. 2
0
		public override void semidot(CompareFunction cmp, int xc1, int yc1, int xc2, int yc2)
		{
			if (doClipping && ClipLiangBarsky.clipping_flags(xc1, yc1, clippingRectangle) != 0) return;

			int r = ((subpixel_width() + LineAABasics.line_subpixel_mask) >> LineAABasics.line_subpixel_shift);
			if (r < 1) r = 1;
			ellipse_bresenham_interpolator ei = new ellipse_bresenham_interpolator(r, r);
			int dx = 0;
			int dy = -r;
			int dy0 = dy;
			int dx0 = dx;
			int x = xc1 >> LineAABasics.line_subpixel_shift;
			int y = yc1 >> LineAABasics.line_subpixel_shift;

			do
			{
				dx += ei.dx();
				dy += ei.dy();

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