private void WriteSourceAndFill(SourceAndMatch match) { FastBitmap.FastBitmap fillImage = new FastBitmap.FastBitmap(match.ReplacementImage); fillImage.Lock(); ImageManipulationInfo hole = match.SourceSegment; for (int xOffset = 0; xOffset < hole.Width; xOffset++) { for (int yOffset = 0; yOffset < hole.Height; yOffset++) { Color holeColor = _target.GetPixel(hole.StartX + xOffset, hole.StartY + yOffset); Color fillColor = fillImage.GetPixel(xOffset, yOffset); _newImage.SetPixel(hole.StartX + xOffset, hole.StartY + yOffset, GetNewColor(holeColor, fillColor)); } } fillImage.Unlock(); }
public int this[int x, int y] => _colorToIntFunc(_source.GetPixel(x, y));