diff --git a/UVtools.Core/Extensions/EmguExtensions.cs b/UVtools.Core/Extensions/EmguExtensions.cs
index a21ca9c..7b4577e 100644
--- a/UVtools.Core/Extensions/EmguExtensions.cs
+++ b/UVtools.Core/Extensions/EmguExtensions.cs
@@ -67,6 +67,14 @@ namespace UVtools.Core.Extensions
public static Mat NewBlank(this Mat mat)
=> InitMat(mat.Size, mat.NumberOfChannels, mat.Depth);
+ ///
+ /// Creates a new blanked (All zeros) with same size and type of the source
+ ///
+ ///
+ /// Blanked
+ public static UMat NewBlank(this UMat mat)
+ => InitUMat(mat.Size, mat.NumberOfChannels, mat.Depth);
+
///
/// Creates a with same size and type of the source and set it to a color
///
@@ -87,6 +95,21 @@ namespace UVtools.Core.Extensions
public static Mat InitMat(Size size, int channels = 1, DepthType depthType = DepthType.Cv8U)
=> size.IsEmpty ? new() : Mat.Zeros(size.Height, size.Width, depthType, channels);
+ ///
+ /// Creates a new and zero it
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static UMat InitUMat(Size size, int channels = 1, DepthType depthType = DepthType.Cv8U)
+ {
+ if (size.IsEmpty) return new();
+ var umat = new UMat(size.Height, size.Width, depthType, channels);
+ umat.SetTo(BlackColor);
+ return umat;
+ }
+
///
/// Creates a new and set it to a
///
diff --git a/UVtools.Core/Layer/LayerManager.cs b/UVtools.Core/Layer/LayerManager.cs
index b718767..1e7449c 100644
--- a/UVtools.Core/Layer/LayerManager.cs
+++ b/UVtools.Core/Layer/LayerManager.cs
@@ -775,7 +775,7 @@ namespace UVtools.Core
return true;
}
- void GenerateAirMap(Mat input, Mat output, VectorOfVectorOfPoint externals)
+ void GenerateAirMap(IInputArray input, IInputOutputArray output, VectorOfVectorOfPoint externals)
{
CvInvoke.BitwiseNot(input, output);
if (externals is null || externals.Size == 0) return;