public void Submit(D2dDistanceField baseField, D2dSplitGroup splitGroup, D2dRect baseRect, D2dRect rect) { distanceField.Transform(rect, this); for (var y = rect.MinY; y < rect.MaxY; y++) { for (var x = rect.MinX; x < rect.MaxX; x++) { var cell = distanceField.Cells[x - rect.MinX + (y - rect.MinY) * rect.SizeX]; var baseCell = baseField.Cells[x - baseRect.MinX + (y - baseRect.MinY) * baseRect.SizeX]; if (cell.D == baseCell.D) { splitGroup.AddPixel(x, y); } } } }
public void Fill(D2dDistanceField baseField, D2dRect baseRect, D2dRect rect) { distanceField.Transform(rect, this); for (var y = rect.MinY; y < rect.MaxY; y++) { var o = (y - rect.MinY) * rect.SizeX - rect.MinX; var z = y * alphaWidth; for (var x = rect.MinX; x < rect.MaxX; x++) { var cell = distanceField.Cells[x - rect.MinX + (y - rect.MinY) * rect.SizeX]; var baseCell = baseField.Cells[x - baseRect.MinX + (y - baseRect.MinY) * baseRect.SizeX]; if (cell.d == baseCell.d) { D2dHelper.tempAlphaData[o + x] = alphaData[z + x]; } } } }