flabbet 7 ماه پیش
والد
کامیت
e967082263

BIN
src/PixiEditor.Extensions.Sdk/build/PixiEditor.Api.CGlueMSBuild.dll


+ 5 - 5
tests/ChunkyImageLibTest/ChunkyImageTests.cs

@@ -23,7 +23,7 @@ public class ChunkyImageTests
     [Fact]
     public void Dispose_ComplexImage_ReturnsAllChunks()
     {
-        ChunkyImage image = new ChunkyImage(new VecI(ChunkyImage.FullChunkSize, ChunkyImage.FullChunkSize));
+        ChunkyImage image = new ChunkyImage(new VecI(ChunkyImage.FullChunkSize, ChunkyImage.FullChunkSize), ColorSpace.CreateSrgb());
         image.EnqueueDrawRectangle(new(new(5, 5), new(80, 80), 0, 2, Colors.AliceBlue, Colors.Snow));
         using (Chunk target = Chunk.Create(ColorSpace.CreateSrgb()))
         {
@@ -51,7 +51,7 @@ public class ChunkyImageTests
     public void GetCommittedPixel_RedImage_ReturnsRedPixel()
     {
         const int chunkSize = ChunkyImage.FullChunkSize;
-        ChunkyImage image = new ChunkyImage(new VecI(chunkSize * 2));
+        ChunkyImage image = new ChunkyImage(new VecI(chunkSize * 2), ColorSpace.CreateSrgb());
         image.EnqueueDrawRectangle
             (new ShapeData(new VecD(chunkSize), new VecD(chunkSize * 2), 0, 0, Colors.Transparent, Colors.Red));
         image.CommitChanges();
@@ -64,7 +64,7 @@ public class ChunkyImageTests
     public void GetMostUpToDatePixel_BlendModeSrc_ReturnsCorrectPixel()
     {
         const int chunkSize = ChunkyImage.FullChunkSize;
-        ChunkyImage image = new ChunkyImage(new VecI(chunkSize * 2));
+        ChunkyImage image = new ChunkyImage(new VecI(chunkSize * 2), ColorSpace.CreateSrgb());
         image.EnqueueDrawRectangle
             (new ShapeData(new VecD(chunkSize), new VecD(chunkSize * 2), 0, 0, Colors.Transparent, Colors.Red));
         Assert.Equal(Colors.Red, image.GetMostUpToDatePixel(new VecI(chunkSize + chunkSize / 2)));
@@ -76,7 +76,7 @@ public class ChunkyImageTests
     public void GetMostUpToDatePixel_BlendModeSrcOver_ReturnsCorrectPixel()
     {
         const int chunkSize = ChunkyImage.FullChunkSize;
-        ChunkyImage image = new ChunkyImage(new VecI(chunkSize * 2));
+        ChunkyImage image = new ChunkyImage(new VecI(chunkSize * 2), ColorSpace.CreateSrgb());
         image.EnqueueDrawRectangle
             (new ShapeData(new VecD(chunkSize), new VecD(chunkSize * 2), 0, 0, Colors.Transparent, Colors.Red));
         image.CommitChanges();
@@ -97,7 +97,7 @@ public class ChunkyImageTests
     public void EnqueueDrawRectangle_OutsideOfImage_PartsAreNotDrawn()
     {
         const int chunkSize = ChunkyImage.FullChunkSize;
-        using ChunkyImage image = new(new VecI(chunkSize));
+        using ChunkyImage image = new(new VecI(chunkSize), ColorSpace.CreateSrgb());
         image.EnqueueDrawRectangle(new ShapeData(
                 VecD.Zero,
                 new VecD(chunkSize * 10),

+ 4 - 0
tests/PixiEditor.Backend.Tests/MockDocument.cs

@@ -75,4 +75,8 @@ public class MockDocument : IReadOnlyDocument
     public IReadOnlyReferenceLayer? ReferenceLayer { get; }
     public DocumentRenderer Renderer { get; }
     public ColorSpace ProcessingColorSpace { get; }
+    public void InitProcessingColorSpace(ColorSpace processingColorSpace)
+    {
+        throw new NotImplementedException();
+    }
 }

+ 3 - 2
tests/PixiEditor.Backend.Tests/NodeSystemTests.cs

@@ -1,5 +1,6 @@
 using System.Reflection;
 using Drawie.Backend.Core.Bridge;
+using Drawie.Backend.Core.Surfaces.ImageData;
 using Drawie.Interop.Avalonia.Core;
 using Drawie.Interop.VulkanAvalonia;
 using Drawie.Skia;
@@ -113,7 +114,7 @@ public class NodeSystemTests
 
         List<SerializationFactory> factories = new();
         QoiEncoder encoder = new QoiEncoder();
-        SerializationConfig config = new SerializationConfig(encoder);
+        SerializationConfig config = new SerializationConfig(encoder, ColorSpace.CreateSrgbLinear());
 
         foreach (var factoryType in allFoundFactories)
         {
@@ -149,7 +150,7 @@ public class NodeSystemTests
                         && x is { IsAbstract: false, IsInterface: false }).ToList();
 
         QoiEncoder encoder = new QoiEncoder();
-        SerializationConfig config = new SerializationConfig(encoder);
+        SerializationConfig config = new SerializationConfig(encoder, ColorSpace.CreateSrgbLinear());
 
         var factoryTypes = typeof(SerializationFactory).Assembly.GetTypes()
             .Where(x => x.IsAssignableTo(typeof(SerializationFactory))