Browse Source

I forgot to push

flabbet 2 years ago
parent
commit
64d6bd59f7
39 changed files with 58 additions and 203 deletions
  1. 1 3
      src/ChunkyImageLib/ChunkyImage.cs
  2. 1 2
      src/ChunkyImageLib/ChunkyImageEx.cs
  3. 0 1
      src/ChunkyImageLib/IReadOnlyChunkyImage.cs
  4. 1 3
      src/ChunkyImageLib/Operations/BresenhamLineHelper.cs
  5. 0 1
      src/ChunkyImageLib/Operations/BresenhamLineOperation.cs
  6. 1 2
      src/ChunkyImageLib/Operations/ChunkyImageOperation.cs
  7. 2 4
      src/ChunkyImageLib/Operations/ClearRegionOperation.cs
  8. 0 1
      src/ChunkyImageLib/Operations/DrawingSurfaceLineOperation.cs
  9. 0 1
      src/ChunkyImageLib/Operations/EllipseOperation.cs
  10. 0 1
      src/ChunkyImageLib/Operations/ImageOperation.cs
  11. 0 1
      src/ChunkyImageLib/Operations/OperationHelper.cs
  12. 0 1
      src/ChunkyImageLib/Operations/PathOperation.cs
  13. 0 1
      src/ChunkyImageLib/Operations/PixelOperation.cs
  14. 2 3
      src/ChunkyImageLib/Operations/PixelsOperation.cs
  15. 1 2
      src/ChunkyImageLib/Operations/RectangleOperation.cs
  16. 1 9
      src/ChunkyImageLib/Operations/ReplaceColorOperation.cs
  17. 1 3
      src/PixiEditor.ChangeableDocument/Changeables/Interfaces/IReadOnlyDocument.cs
  18. 0 1
      src/PixiEditor.ChangeableDocument/Changes/Selection/SetSelection_Change.cs
  19. 7 23
      src/PixiEditor.DrawingApi.Core/Numerics/RectD.cs
  20. 4 45
      src/PixiEditor.DrawingApi.Core/Numerics/RectI.cs
  21. 7 28
      src/PixiEditor.DrawingApi.Core/Numerics/VecI.cs
  22. 2 2
      src/PixiEditor/Helpers/Converters/PaletteItemsToWidthConverter.cs
  23. 0 1
      src/PixiEditor/Helpers/Extensions/Int32RectHelper.cs
  24. 0 12
      src/PixiEditor/Helpers/Extensions/SKRectIHelper.cs
  25. 0 2
      src/PixiEditor/Helpers/SurfaceHelpers.cs
  26. 1 3
      src/PixiEditor/Models/Colors/ExColor.cs
  27. 0 3
      src/PixiEditor/Models/Commands/Search/ColorSearchResult.cs
  28. 0 2
      src/PixiEditor/Models/DataProviders/LocalPalettesFetcher.cs
  29. 3 3
      src/PixiEditor/Models/IO/ClsFile/ClsFileParser.cs
  30. 2 4
      src/PixiEditor/Models/IO/Exporter.cs
  31. 5 5
      src/PixiEditor/Models/IO/JascPalFile/JascFileParser.cs
  32. 0 1
      src/PixiEditor/Models/IO/PaletteFileData.cs
  33. 0 2
      src/PixiEditor/Views/Dialogs/PalettesBrowser.xaml.cs
  34. 0 5
      src/PixiEditor/Views/UserControls/CommandSearch/CommandSearchControl.xaml.cs
  35. 0 5
      src/PixiEditor/Views/UserControls/CommandSearch/CommandSearchControlHelper.cs
  36. 1 1
      src/PixiEditor/Views/UserControls/Palettes/ColorReplacer.xaml.cs
  37. 5 5
      src/PixiEditor/Views/UserControls/Palettes/CompactPaletteViewer.xaml.cs
  38. 10 10
      src/PixiEditor/Views/UserControls/Palettes/PaletteViewer.xaml.cs
  39. 0 1
      src/PixiEditor/Views/UserControls/SwatchesView.xaml.cs

+ 1 - 3
src/ChunkyImageLib/ChunkyImage.cs

@@ -1,5 +1,4 @@
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
+using System.Runtime.CompilerServices;
 using ChunkyImageLib.DataHolders;
 using ChunkyImageLib.Operations;
 using OneOf;
@@ -8,7 +7,6 @@ using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
 using PixiEditor.DrawingApi.Core.Surface.Vector;
-using SkiaSharp;
 
 [assembly: InternalsVisibleTo("ChunkyImageLibTest")]
 

+ 1 - 2
src/ChunkyImageLib/ChunkyImageEx.cs

@@ -2,7 +2,6 @@
 using ChunkyImageLib.Operations;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib;
 public static class IReadOnlyChunkyImageEx
@@ -11,7 +10,7 @@ public static class IReadOnlyChunkyImageEx
         (this IReadOnlyChunkyImage image, RectI fullResRegion, ChunkResolution resolution, DrawingSurface surface, VecI pos, Paint? paint = null)
     {
         surface.Canvas.Save();
-        surface.Canvas.ClipRect(SKRect.Create(pos, fullResRegion.Size));
+        surface.Canvas.ClipRect(RectD.Create(pos, fullResRegion.Size));
 
         VecI chunkTopLeft = OperationHelper.GetChunkPos(fullResRegion.TopLeft, ChunkyImage.FullChunkSize);
         VecI chunkBotRigth = OperationHelper.GetChunkPos(fullResRegion.BottomRight, ChunkyImage.FullChunkSize);

+ 0 - 1
src/ChunkyImageLib/IReadOnlyChunkyImage.cs

@@ -2,7 +2,6 @@
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib;
 

+ 1 - 3
src/ChunkyImageLib/Operations/BresenhamLineHelper.cs

@@ -1,7 +1,5 @@
-using ChunkyImageLib.DataHolders;
-using PixiEditor.DrawingApi.Core.Numerics;
+using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 public static class BresenhamLineHelper

+ 0 - 1
src/ChunkyImageLib/Operations/BresenhamLineOperation.cs

@@ -2,7 +2,6 @@
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 internal class BresenhamLineOperation : IDrawOperation

+ 1 - 2
src/ChunkyImageLib/Operations/ChunkyImageOperation.cs

@@ -1,6 +1,5 @@
 using ChunkyImageLib.DataHolders;
 using PixiEditor.DrawingApi.Core.Numerics;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 internal class ChunkyImageOperation : IDrawOperation
@@ -27,7 +26,7 @@ internal class ChunkyImageOperation : IDrawOperation
         {
             VecI pixelPos = chunkPos * ChunkyImage.FullChunkSize;
             VecI topLeftImageCorner = GetTopLeft();
-            SKRect clippingRect = SKRect.Create(
+            RectD clippingRect = RectD.Create(
                 OperationHelper.ConvertForResolution(topLeftImageCorner - pixelPos, chunk.Resolution),
                 OperationHelper.ConvertForResolution(imageToDraw.CommittedSize, chunk.Resolution));
             chunk.Surface.DrawingSurface.Canvas.ClipRect(clippingRect);

+ 2 - 4
src/ChunkyImageLib/Operations/ClearRegionOperation.cs

@@ -1,6 +1,4 @@
-using ChunkyImageLib.DataHolders;
-using PixiEditor.DrawingApi.Core.Numerics;
-using SkiaSharp;
+using PixiEditor.DrawingApi.Core.Numerics;
 
 namespace ChunkyImageLib.Operations;
 
@@ -21,7 +19,7 @@ internal class ClearRegionOperation : IDrawOperation
         VecI convSize = OperationHelper.ConvertForResolution(rect.Size, chunk.Resolution);
 
         chunk.Surface.DrawingSurface.Canvas.Save();
-        chunk.Surface.DrawingSurface.Canvas.ClipRect(SKRect.Create(convPos - chunkPos.Multiply(chunk.PixelSize), convSize));
+        chunk.Surface.DrawingSurface.Canvas.ClipRect(RectD.Create(convPos - chunkPos.Multiply(chunk.PixelSize), convSize));
         chunk.Surface.DrawingSurface.Canvas.Clear();
         chunk.Surface.DrawingSurface.Canvas.Restore();
     }

+ 0 - 1
src/ChunkyImageLib/Operations/DrawingSurfaceLineOperation.cs

@@ -2,7 +2,6 @@
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 internal class DrawingSurfaceLineOperation : IDrawOperation

+ 0 - 1
src/ChunkyImageLib/Operations/EllipseOperation.cs

@@ -3,7 +3,6 @@ using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
 using PixiEditor.DrawingApi.Core.Surface.Vector;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 internal class EllipseOperation : IDrawOperation

+ 0 - 1
src/ChunkyImageLib/Operations/ImageOperation.cs

@@ -1,7 +1,6 @@
 using ChunkyImageLib.DataHolders;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 

+ 0 - 1
src/ChunkyImageLib/Operations/OperationHelper.cs

@@ -1,7 +1,6 @@
 using ChunkyImageLib.DataHolders;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 

+ 0 - 1
src/ChunkyImageLib/Operations/PathOperation.cs

@@ -3,7 +3,6 @@ using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
 using PixiEditor.DrawingApi.Core.Surface.Vector;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 internal class PathOperation : IDrawOperation

+ 0 - 1
src/ChunkyImageLib/Operations/PixelOperation.cs

@@ -2,7 +2,6 @@
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 

+ 2 - 3
src/ChunkyImageLib/Operations/PixelsOperation.cs

@@ -2,7 +2,6 @@
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 
@@ -16,7 +15,7 @@ internal class PixelsOperation : IDrawOperation
 
     public PixelsOperation(IEnumerable<VecI> pixels, Color color, BlendMode blendMode)
     {
-        this.pixels = pixels.Select(pixel => (Point)pixel).ToArray();
+        this.pixels = pixels.Select(pixel => new Point(pixel.X, pixel.Y)).ToArray();
         this.color = color;
         this.blendMode = blendMode;
         paint = new Paint() { BlendMode = blendMode };
@@ -37,7 +36,7 @@ internal class PixelsOperation : IDrawOperation
 
     public HashSet<VecI> FindAffectedChunks(VecI imageSize)
     {
-        return pixels.Select(static pixel => OperationHelper.GetChunkPos((VecI)pixel, ChunkyImage.FullChunkSize)).ToHashSet();
+        return pixels.Select(static pixel => OperationHelper.GetChunkPos(pixel, ChunkyImage.FullChunkSize)).ToHashSet();
     }
 
     public IDrawOperation AsMirrored(int? verAxisX, int? horAxisY)

+ 1 - 2
src/ChunkyImageLib/Operations/RectangleOperation.cs

@@ -1,7 +1,6 @@
 using ChunkyImageLib.DataHolders;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 
@@ -36,7 +35,7 @@ internal class RectangleOperation : IDrawOperation
         if (Data.FillColor.A > 0)
         {
             skiaSurf.Canvas.Save();
-            skiaSurf.Canvas.ClipRect((SKRect)innerRect);
+            skiaSurf.Canvas.ClipRect(innerRect);
             skiaSurf.Canvas.DrawColor(Data.FillColor, Data.BlendMode);
             skiaSurf.Canvas.Restore();
         }

+ 1 - 9
src/ChunkyImageLib/Operations/ReplaceColorOperation.cs

@@ -1,16 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-using ChunkyImageLib.DataHolders;
+using ChunkyImageLib.DataHolders;
 using ChunkyImageLib.Shaders;
 using ComputeSharp;
 using PixiEditor.DrawingApi.Core.ColorsImpl;
 using PixiEditor.DrawingApi.Core.Numerics;
-using SkiaSharp;
 
 namespace ChunkyImageLib.Operations;
 internal class ReplaceColorOperation : IDrawOperation

+ 1 - 3
src/PixiEditor.ChangeableDocument/Changeables/Interfaces/IReadOnlyDocument.cs

@@ -1,7 +1,5 @@
-using System.Collections.Immutable;
-using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics.CodeAnalysis;
 using PixiEditor.DrawingApi.Core.Numerics;
-using SkiaSharp;
 
 namespace PixiEditor.ChangeableDocument.Changeables.Interfaces;
 

+ 0 - 1
src/PixiEditor.ChangeableDocument/Changes/Selection/SetSelection_Change.cs

@@ -1,6 +1,5 @@
 using PixiEditor.ChangeableDocument.Changeables.Interfaces;
 using PixiEditor.DrawingApi.Core.Surface.Vector;
-using SkiaSharp;
 
 namespace PixiEditor.ChangeableDocument.Changes.Selection;
 internal class SetSelection_Change : Change

+ 7 - 23
src/PixiEditor.DrawingApi.Core/Numerics/RectD.cs

@@ -1,5 +1,4 @@
 using System;
-using SkiaSharp;
 
 namespace PixiEditor.DrawingApi.Core.Numerics;
 public struct RectD : IEquatable<RectD>
@@ -107,6 +106,12 @@ public struct RectD : IEquatable<RectD>
         right = x + width;
         bottom = y + height;
     }
+    
+    public static RectD Create(VecI pos, VecI size)
+    {
+        return new RectD(pos.X, pos.Y, size.X, size.Y);
+    }
+    
     public static RectD FromSides(double left, double right, double top, double bottom)
     {
         return new RectD()
@@ -317,28 +322,7 @@ public struct RectD : IEquatable<RectD>
         };
     }
 
-    public static explicit operator SKRect(RectD rect)
-    {
-        return new SKRect((float)rect.left, (float)rect.top, (float)rect.right, (float)rect.bottom);
-    }
-
-    public static explicit operator SKRectI(RectD rect)
-    {
-        return new SKRectI((int)rect.left, (int)rect.top, (int)rect.right, (int)rect.bottom);
-    }
-
-    public static implicit operator RectD(SKRect rect)
-    {
-        return new RectD()
-        {
-            Left = rect.Left,
-            Right = rect.Right,
-            Top = rect.Top,
-            Bottom = rect.Bottom
-        };
-    }
-
-    public static implicit operator RectD(SKRectI rect)
+    public static explicit operator RectD(RectI rect)
     {
         return new RectD()
         {

+ 4 - 45
src/PixiEditor.DrawingApi.Core/Numerics/RectI.cs

@@ -1,5 +1,4 @@
 using System;
-using SkiaSharp;
 
 namespace PixiEditor.DrawingApi.Core.Numerics;
 public struct RectI : IEquatable<RectI>
@@ -197,7 +196,10 @@ public struct RectI : IEquatable<RectI>
     /// </summary>
     public readonly RectI AspectFit(RectI rect)
     {
-        return (RectI)((RectD)this).AspectFit(rect);
+        RectD rectD = (RectD)rect;
+        RectD thisD = (RectD)this;
+        RectD aspect = rectD.AspectFit(thisD);
+        return new RectI((int)aspect.Left, (int)aspect.Top, (int)aspect.Width, (int)aspect.Height);
     }
 
     public readonly bool ContainsInclusive(VecI point) => ContainsInclusive(point.X, point.Y);
@@ -272,49 +274,6 @@ public struct RectI : IEquatable<RectI>
         };
     }
 
-    public static implicit operator RectD(RectI rect)
-    {
-        return new RectD()
-        {
-            Left = rect.left,
-            Right = rect.right,
-            Top = rect.top,
-            Bottom = rect.bottom
-        };
-    }
-
-    public static implicit operator SKRect(RectI rect)
-    {
-        return new SKRect(rect.left, rect.top, rect.right, rect.bottom);
-    }
-
-    public static implicit operator SKRectI(RectI rect)
-    {
-        return new SKRectI(rect.left, rect.top, rect.right, rect.bottom);
-    }
-
-    public static explicit operator RectI(SKRect rect)
-    {
-        return new RectI()
-        {
-            Left = (int)rect.Left,
-            Right = (int)rect.Right,
-            Top = (int)rect.Top,
-            Bottom = (int)rect.Bottom
-        };
-    }
-
-    public static implicit operator RectI(SKRectI rect)
-    {
-        return new RectI()
-        {
-            Left = rect.Left,
-            Right = rect.Right,
-            Top = rect.Top,
-            Bottom = rect.Bottom
-        };
-    }
-
     public static bool operator ==(RectI left, RectI right)
     {
         return left.left == right.left && left.right == right.right && left.top == right.top && left.bottom == right.bottom;

+ 7 - 28
src/PixiEditor.DrawingApi.Core/Numerics/VecI.cs

@@ -1,5 +1,5 @@
 using System;
-using SkiaSharp;
+using PixiEditor.DrawingApi.Core.Surface;
 
 namespace PixiEditor.DrawingApi.Core.Numerics;
 
@@ -104,46 +104,25 @@ public struct VecI : IEquatable<VecI>
     {
         return !(a.X == b.X && a.Y == b.Y);
     }
-    public static explicit operator VecI(SKPoint point)
+    public static implicit operator VecI(Point point)
     {
         return new VecI((int)point.X, (int)point.Y);
     }
-    public static explicit operator VecI(SKSize size)
+    
+    public static implicit operator Point(VecI vec)
     {
-        return new VecI((int)size.Width, (int)size.Height);
-    }
-    public static implicit operator VecI(SKPointI point)
-    {
-        return new VecI(point.X, point.Y);
-    }
-    public static implicit operator VecI(SKSizeI size)
-    {
-        return new VecI(size.Width, size.Height);
+        return new(vec.X, vec.Y);
     }
+    
     public static implicit operator VecD(VecI vec)
     {
         return new VecD(vec.X, vec.Y);
     }
-    public static implicit operator SKPointI(VecI vec)
-    {
-        return new SKPointI(vec.X, vec.Y);
-    }
-    public static implicit operator SKPoint(VecI vec)
-    {
-        return new SKPoint(vec.X, vec.Y);
-    }
-    public static implicit operator SKSizeI(VecI vec)
-    {
-        return new SKSizeI(vec.X, vec.Y);
-    }
-    public static implicit operator SKSize(VecI vec)
-    {
-        return new SKSize(vec.X, vec.Y);
-    }
     public static implicit operator VecI((int, int) tuple)
     {
         return new VecI(tuple.Item1, tuple.Item2);
     }
+
     public void Deconstruct(out int x, out int y)
     {
         x = X;

+ 2 - 2
src/PixiEditor/Helpers/Converters/PaletteItemsToWidthConverter.cs

@@ -1,5 +1,5 @@
 using System.Globalization;
-using SkiaSharp;
+using PixiEditor.DrawingApi.Core.ColorsImpl;
 
 namespace PixiEditor.Helpers.Converters;
 
@@ -7,7 +7,7 @@ internal class PaletteItemsToWidthConverter : SingleInstanceConverter<PaletteIte
 {
     public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
     {
-        if (value is IList<SKColor> colors && colors.Count == 0)
+        if (value is IList<Color> colors && colors.Count == 0)
         {
             return 0;
         }

+ 0 - 1
src/PixiEditor/Helpers/Extensions/Int32RectHelper.cs

@@ -1,5 +1,4 @@
 using System.Windows;
-using SkiaSharp;
 
 namespace PixiEditor.Helpers.Extensions;
 

+ 0 - 12
src/PixiEditor/Helpers/Extensions/SKRectIHelper.cs

@@ -1,12 +0,0 @@
-using System.Windows;
-using SkiaSharp;
-
-namespace PixiEditor.Helpers.Extensions;
-
-internal static class SKRectIHelper
-{
-    public static Int32Rect ToInt32Rect(this SKRectI rect)
-    {
-        return new Int32Rect(rect.Left, rect.Top, rect.Width, rect.Height);
-    }
-}

+ 0 - 2
src/PixiEditor/Helpers/SurfaceHelpers.cs

@@ -2,10 +2,8 @@
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using ChunkyImageLib;
-using ChunkyImageLib.DataHolders;
 using PixiEditor.DrawingApi.Core.Numerics;
 using PixiEditor.DrawingApi.Core.Surface.ImageData;
-using SkiaSharp;
 
 namespace PixiEditor.Helpers;
 

+ 1 - 3
src/PixiEditor/Models/Colors/ExColor.cs

@@ -1,6 +1,4 @@
-using SkiaSharp;
-
-namespace PixiEditor.Models.Colors;
+namespace PixiEditor.Models.Colors;
 
 internal static class ExColor
 {

+ 0 - 3
src/PixiEditor/Models/Commands/Search/ColorSearchResult.cs

@@ -1,7 +1,4 @@
 using System.Windows.Media;
-using PixiEditor.Helpers.Extensions;
-using PixiEditor.ViewModels;
-using SkiaSharp;
 
 namespace PixiEditor.Models.Commands.Search;
 

+ 0 - 2
src/PixiEditor/Models/DataProviders/LocalPalettesFetcher.cs

@@ -1,12 +1,10 @@
 using System.IO;
 using PixiEditor.DrawingApi.Core.ColorsImpl;
-using PixiEditor.Helpers.Extensions;
 using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.DataHolders.Palettes;
 using PixiEditor.Models.IO;
 using PixiEditor.Models.IO.JascPalFile;
 using PixiEditor.Models.UserPreferences;
-using SkiaSharp;
 
 namespace PixiEditor.Models.DataProviders;
 

+ 3 - 3
src/PixiEditor/Models/IO/ClsFile/ClsFileParser.cs

@@ -1,6 +1,6 @@
 using System.IO;
 using CLSEncoderDecoder;
-using SkiaSharp;
+using PixiEditor.DrawingApi.Core.ColorsImpl;
 
 namespace PixiEditor.Models.IO.ClsFile;
 
@@ -28,7 +28,7 @@ internal class ClsFileParser : PaletteFileParser
                 set.Utf8Name,
                 set.Colors
                     .Where(static color => color.Alpha > 0)
-                    .Select(static color => new SKColor(color.Red, color.Green, color.Blue, 255))
+                    .Select(static color => new Color(color.Red, color.Green, color.Blue, 255))
                     .ToArray()
             );
             return data;
@@ -41,7 +41,7 @@ internal class ClsFileParser : PaletteFileParser
 
         string name = data.Title;
         List<ClsColor> colors = data.Colors
-            .Select(color => new ClsColor(color.Red, color.Green, color.Blue, color.Alpha)).ToList();
+            .Select(color => new ClsColor(color.R, color.G, color.B, color.A)).ToList();
         await Task.Run(() =>
         {
             if (name.Length == 0)

+ 2 - 4
src/PixiEditor/Models/IO/Exporter.cs

@@ -4,15 +4,13 @@ using System.Runtime.InteropServices;
 using System.Windows;
 using System.Windows.Media.Imaging;
 using ChunkyImageLib;
-using ChunkyImageLib.DataHolders;
 using Microsoft.Win32;
 using PixiEditor.DrawingApi.Core.Numerics;
+using PixiEditor.DrawingApi.Core.Surface.ImageData;
 using PixiEditor.Helpers;
-using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.Dialogs;
 using PixiEditor.Models.Enums;
 using PixiEditor.ViewModels.SubViewModels.Document;
-using SkiaSharp;
 
 namespace PixiEditor.Models.IO;
 
@@ -133,7 +131,7 @@ internal class Exporter
 
     public static void SaveAsGZippedBytes(string path, Surface surface, RectI rectToSave)
     {
-        var imageInfo = new SKImageInfo(rectToSave.Width, rectToSave.Height, SKColorType.RgbaF16);
+        var imageInfo = new ImageInfo(rectToSave.Width, rectToSave.Height, ColorType.RgbaF16);
         var unmanagedBuffer = Marshal.AllocHGlobal(rectToSave.Width * rectToSave.Height * 8);
         //+8 bytes for width and height
         var bytes = new byte[rectToSave.Width * rectToSave.Height * 8 + 8];

+ 5 - 5
src/PixiEditor/Models/IO/JascPalFile/JascFileParser.cs

@@ -1,5 +1,5 @@
 using System.IO;
-using SkiaSharp;
+using PixiEditor.DrawingApi.Core.ColorsImpl;
 
 namespace PixiEditor.Models.IO.JascPalFile;
 
@@ -24,11 +24,11 @@ internal class JascFileParser : PaletteFileParser
         if (ValidateFile(fileType, magicBytes))
         {
             int colorCount = int.Parse(lines[2]);
-            SKColor[] colors = new SKColor[colorCount];
+            Color[] colors = new Color[colorCount];
             for (int i = 0; i < colorCount; i++)
             {
                 string[] colorData = lines[i + 3].Split(' ');
-                colors[i] = new SKColor(byte.Parse(colorData[0]), byte.Parse(colorData[1]), byte.Parse(colorData[2]));
+                colors[i] = new Color(byte.Parse(colorData[0]), byte.Parse(colorData[1]), byte.Parse(colorData[2]));
             }
 
             return new PaletteFileData(name, colors);
@@ -44,7 +44,7 @@ internal class JascFileParser : PaletteFileParser
         string fileContent = "JASC-PAL\n0100\n" + data.Colors.Length;
         for (int i = 0; i < data.Colors.Length; i++)
         {
-            fileContent += "\n" + data.Colors[i].Red + " " + data.Colors[i].Green + " " + data.Colors[i].Blue;
+            fileContent += "\n" + data.Colors[i].R + " " + data.Colors[i].G + " " + data.Colors[i].B;
         }
 
         await File.WriteAllTextAsync(path, fileContent);
@@ -60,7 +60,7 @@ internal class JascFileParser : PaletteFileParser
         }
         catch
         {
-            return new PaletteFileData("Corrupted", Array.Empty<SKColor>()) { IsCorrupted = true };
+            return new PaletteFileData("Corrupted", Array.Empty<Color>()) { IsCorrupted = true };
         }
     }
 

+ 0 - 1
src/PixiEditor/Models/IO/PaletteFileData.cs

@@ -1,5 +1,4 @@
 using PixiEditor.DrawingApi.Core.ColorsImpl;
-using SkiaSharp;
 
 namespace PixiEditor.Models.IO;
 

+ 0 - 2
src/PixiEditor/Views/Dialogs/PalettesBrowser.xaml.cs

@@ -14,10 +14,8 @@ using PixiEditor.Models.Dialogs;
 using PixiEditor.Models.Enums;
 using PixiEditor.Models.IO;
 using PixiEditor.Models.UserPreferences;
-using PixiEditor.ViewModels;
 using PixiEditor.Views.UserControls;
 using PixiEditor.Views.UserControls.Palettes;
-using SkiaSharp;
 
 namespace PixiEditor.Views.Dialogs;
 

+ 0 - 5
src/PixiEditor/Views/UserControls/CommandSearch/CommandSearchControl.xaml.cs

@@ -5,14 +5,9 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Threading;
-using OneOf;
-using OneOf.Types;
 using PixiEditor.Helpers;
-using PixiEditor.Helpers.Extensions;
 using PixiEditor.Models.Commands;
-using PixiEditor.Models.Commands.Search;
 using PixiEditor.Models.DataHolders;
-using SkiaSharp;
 
 namespace PixiEditor.Views.UserControls.CommandSearch;
 #nullable enable

+ 0 - 5
src/PixiEditor/Views/UserControls/CommandSearch/CommandSearchControlHelper.cs

@@ -1,10 +1,5 @@
-using OneOf;
-using OneOf.Types;
 using PixiEditor.Helpers;
 using PixiEditor.Models.Commands;
-using PixiEditor.Models.Commands.Search;
-using PixiEditor.ViewModels;
-using SkiaSharp;
 using System.IO;
 using System.Text.RegularExpressions;
 using PixiEditor.DrawingApi.Core.ColorsImpl;

+ 1 - 1
src/PixiEditor/Views/UserControls/Palettes/ColorReplacer.xaml.cs

@@ -83,7 +83,7 @@ internal partial class ColorReplacer : UserControl
         BackendColor first = ColorToReplace.WithAlpha(255);
         Color rawSecond = NewColor;
 
-        SKColor second = new SKColor(rawSecond.R, rawSecond.G, rawSecond.B, 255);
+        BackendColor second = new BackendColor(rawSecond.R, rawSecond.G, rawSecond.B, 255);
 
         var pack = (first, second);
         if (ReplaceColorsCommand.CanExecute(pack))

+ 5 - 5
src/PixiEditor/Views/UserControls/Palettes/CompactPaletteViewer.xaml.cs

@@ -2,7 +2,7 @@
 using System.Windows.Controls;
 using System.Windows.Input;
 using PixiEditor.Models.DataHolders;
-using SkiaSharp;
+using BackendColor = PixiEditor.DrawingApi.Core.ColorsImpl.Color;
 
 namespace PixiEditor.Views.UserControls.Palettes;
 
@@ -11,11 +11,11 @@ namespace PixiEditor.Views.UserControls.Palettes;
 /// </summary>
 internal partial class CompactPaletteViewer : UserControl
 {
-    public static readonly DependencyProperty ColorsProperty = DependencyProperty.Register(nameof(Colors), typeof(WpfObservableRangeCollection<SKColor>), typeof(CompactPaletteViewer));
+    public static readonly DependencyProperty ColorsProperty = DependencyProperty.Register(nameof(Colors), typeof(WpfObservableRangeCollection<BackendColor>), typeof(CompactPaletteViewer));
 
-    public WpfObservableRangeCollection<SKColor> Colors
+    public WpfObservableRangeCollection<BackendColor> Colors
     {
-        get { return (WpfObservableRangeCollection<SKColor>)GetValue(ColorsProperty); }
+        get { return (WpfObservableRangeCollection<BackendColor>)GetValue(ColorsProperty); }
         set { SetValue(ColorsProperty, value); }
     }
 
@@ -37,7 +37,7 @@ internal partial class CompactPaletteViewer : UserControl
     private void RemoveColorMenuItem_OnClick(object sender, RoutedEventArgs e)
     {
         MenuItem menuItem = (MenuItem)sender;
-        SKColor color = (SKColor)menuItem.CommandParameter;
+        BackendColor color = (BackendColor)menuItem.CommandParameter;
         if (Colors.Contains(color))
         {
             Colors.Remove(color);

+ 10 - 10
src/PixiEditor/Views/UserControls/Palettes/PaletteViewer.xaml.cs

@@ -9,7 +9,7 @@ using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.DataProviders;
 using PixiEditor.Models.IO;
 using PixiEditor.Views.Dialogs;
-using SkiaSharp;
+using BackendColor = PixiEditor.DrawingApi.Core.ColorsImpl.Color;
 
 namespace PixiEditor.Views.UserControls.Palettes;
 
@@ -18,18 +18,18 @@ namespace PixiEditor.Views.UserControls.Palettes;
 /// </summary>
 internal partial class PaletteViewer : UserControl
 {
-    public static readonly DependencyProperty SwatchesProperty = DependencyProperty.Register(nameof(Swatches), typeof(WpfObservableRangeCollection<SKColor>), typeof(PaletteViewer), new PropertyMetadata(default(WpfObservableRangeCollection<SKColor>)));
+    public static readonly DependencyProperty SwatchesProperty = DependencyProperty.Register(nameof(Swatches), typeof(WpfObservableRangeCollection<BackendColor>), typeof(PaletteViewer), new PropertyMetadata(default(WpfObservableRangeCollection<BackendColor>)));
 
-    public WpfObservableRangeCollection<SKColor> Swatches
+    public WpfObservableRangeCollection<BackendColor> Swatches
     {
-        get => (WpfObservableRangeCollection<SKColor>)GetValue(SwatchesProperty);
+        get => (WpfObservableRangeCollection<BackendColor>)GetValue(SwatchesProperty);
         set => SetValue(SwatchesProperty, value);
     }
-    public static readonly DependencyProperty ColorsProperty = DependencyProperty.Register(nameof(Colors), typeof(WpfObservableRangeCollection<SKColor>), typeof(PaletteViewer));
+    public static readonly DependencyProperty ColorsProperty = DependencyProperty.Register(nameof(Colors), typeof(WpfObservableRangeCollection<BackendColor>), typeof(PaletteViewer));
 
-    public WpfObservableRangeCollection<SKColor> Colors
+    public WpfObservableRangeCollection<BackendColor> Colors
     {
-        get { return (WpfObservableRangeCollection<SKColor>)GetValue(ColorsProperty); }
+        get { return (WpfObservableRangeCollection<BackendColor>)GetValue(ColorsProperty); }
         set { SetValue(ColorsProperty, value); }
     }
 
@@ -99,7 +99,7 @@ internal partial class PaletteViewer : UserControl
     private void RemoveColorMenuItem_OnClick(object sender, RoutedEventArgs e)
     {
         MenuItem menuItem = (MenuItem)sender;
-        SKColor color = (SKColor)menuItem.CommandParameter;
+        BackendColor color = (BackendColor)menuItem.CommandParameter;
         if (Colors.Contains(color))
         {
             Colors.Remove(color);
@@ -185,7 +185,7 @@ internal partial class PaletteViewer : UserControl
         if (e.Data.GetDataPresent(PaletteColor.PaletteColorDaoFormat))
         {
             string data = (string)e.Data.GetData(PaletteColor.PaletteColorDaoFormat);
-            SKColor color = SKColor.Parse(data);
+            BackendColor color = BackendColor.Parse(data);
             if (Colors.Contains(color))
             {
                 PaletteColor paletteColor = sender as PaletteColor;
@@ -206,7 +206,7 @@ internal partial class PaletteViewer : UserControl
     private void ReplaceColor_OnClick(object sender, RoutedEventArgs e)
     {
         MenuItem menuItem = (MenuItem)sender;
-        SKColor color = (SKColor)menuItem.CommandParameter;
+        BackendColor color = (BackendColor)menuItem.CommandParameter;
         Replacer.ColorToReplace = color;
         Replacer.VisibilityCheckbox.IsChecked = false;
     }

+ 0 - 1
src/PixiEditor/Views/UserControls/SwatchesView.xaml.cs

@@ -3,7 +3,6 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
 using PixiEditor.DrawingApi.Core.ColorsImpl;
-using SkiaSharp;
 
 namespace PixiEditor.Views.UserControls;