/// <summary> /// Combines pixel changes array with overriding values. /// </summary> /// <param name="changes">BitmapPixelChanges to combine</param> /// <returns>Combined BitmapPixelChanges</returns> public static BitmapPixelChanges CombineOverride(BitmapPixelChanges[] changes) { if (changes == null || changes.Length == 0) { throw new ArgumentException(); } BitmapPixelChanges output = Empty; for (int i = 0; i < changes.Length; i++) { output.ChangedPixels.AddRangeOverride(changes[i].ChangedPixels); } return(output); }
public LayerChange(BitmapPixelChanges pixelChanges, Layer layer) { PixelChanges = pixelChanges; // Layer implements IEquatable interface so IndexOf method cannot be used here as it // calls Equals that is very slow (compares bitmap pixel by pixel). for (var i = 0; i < ViewModelMain.Current.BitmapManager.ActiveDocument.Layers.Count; i++) { if (ViewModelMain.Current.BitmapManager.ActiveDocument.Layers[i] != layer) { continue; } LayerIndex = i; break; } }
public LayerChange(BitmapPixelChanges pixelChanges, Guid layerGuid) { PixelChanges = pixelChanges; LayerGuid = layerGuid; }
public LayerChange(BitmapPixelChanges pixelChanges, Layer layer) { PixelChanges = pixelChanges; LayerGuid = layer.LayerGuid; }
public static BitmapPixelChanges CombineOverride(BitmapPixelChanges changes1, BitmapPixelChanges changes2) { return(CombineOverride(new[] { changes1, changes2 })); }
public LayerChange(BitmapPixelChanges pixelChanges, Layer layer) { PixelChanges = pixelChanges; LayerIndex = ViewModelMain.Current.BitmapManager.ActiveDocument.Layers.IndexOf(layer); }
public LayerChange(BitmapPixelChanges pixelChanges, int layerIndex) { PixelChanges = pixelChanges; LayerIndex = layerIndex; }