Pinta.ImageManipulation.Effects.PixelateEffect.RenderLine C# (CSharp) Method

RenderLine() protected method

protected RenderLine ( ISurface src, ISurface dest, Rectangle rect ) : void
src ISurface
dest ISurface
rect Rectangle
return void
		protected unsafe override void RenderLine (ISurface src, ISurface dest, Rectangle rect)
		{
			for (int y = rect.Top; y <= rect.Bottom; ++y) {
				int yEnd = y + 1;

				for (int x = rect.Left; x <= rect.Right; ++x) {
					var cellRect = GetCellBox (x, y, cell_size);
					cellRect.Intersect (dest.Bounds);
					var color = ComputeCellColor (x, y, src, cell_size, src.Bounds);

					int xEnd = Math.Min (rect.Right, cellRect.Right);
					yEnd = Math.Min (rect.Bottom, cellRect.Bottom);

					for (int y2 = y; y2 <= yEnd; ++y2) {
						ColorBgra* ptr = dest.GetPointAddress (x, y2);

						for (int x2 = x; x2 <= xEnd; ++x2) {
							ptr->Bgra = color.Bgra;
							++ptr;
						}
					}

					x = xEnd;
				}

				y = yEnd;
			}
		}