BitmapOperationTool.cs 783 B

1234567891011121314151617181920212223242526
  1. using System.Windows.Media;
  2. using PixiEditor.Models.DataHolders;
  3. using PixiEditor.Models.Layers;
  4. using PixiEditor.Models.Position;
  5. namespace PixiEditor.Models.Tools
  6. {
  7. public abstract class BitmapOperationTool : Tool
  8. {
  9. public bool RequiresPreviewLayer { get; set; }
  10. public bool UseDefaultUndoMethod { get; set; } = true;
  11. public abstract LayerChange[] Use(Layer layer, Coordinates[] mouseMove, Color color);
  12. protected LayerChange[] Only(BitmapPixelChanges changes, Layer layer)
  13. {
  14. return new[] { new LayerChange(changes, layer) };
  15. }
  16. protected LayerChange[] Only(BitmapPixelChanges changes, int layerIndex)
  17. {
  18. return new[] { new LayerChange(changes, layerIndex) };
  19. }
  20. }
  21. }