Example #1
0
        /// <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);
        }
Example #2
0
        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;
            }
        }
Example #3
0
 public LayerChange(BitmapPixelChanges pixelChanges, Guid layerGuid)
 {
     PixelChanges = pixelChanges;
     LayerGuid    = layerGuid;
 }
Example #4
0
 public LayerChange(BitmapPixelChanges pixelChanges, Layer layer)
 {
     PixelChanges = pixelChanges;
     LayerGuid    = layer.LayerGuid;
 }
Example #5
0
 public static BitmapPixelChanges CombineOverride(BitmapPixelChanges changes1, BitmapPixelChanges changes2)
 {
     return(CombineOverride(new[] { changes1, changes2 }));
 }
Example #6
0
 public LayerChange(BitmapPixelChanges pixelChanges, Layer layer)
 {
     PixelChanges = pixelChanges;
     LayerIndex   = ViewModelMain.Current.BitmapManager.ActiveDocument.Layers.IndexOf(layer);
 }
Example #7
0
 public LayerChange(BitmapPixelChanges pixelChanges, int layerIndex)
 {
     PixelChanges = pixelChanges;
     LayerIndex   = layerIndex;
 }