private static void add(List<IntPoint> contour, int x, int y) { var p = new IntPoint(x, y); if (!contour.Contains(p)) contour.Add(p); } }