Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Conceição <Tiago_caza@hotmail.com>2020-10-21 01:41:38 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2020-10-21 01:41:38 +0300
commit661cb1cf99eb0e8baaa49e075dfd5c20440e9fab (patch)
tree4f0210066a8b1015863d21ce7589cd01e7b7cb8d /UVtools.Core/Extensions/EmguExtensions.cs
parentd709cdda4105b76d61fe7089d41df63a7112ba74 (diff)
WPF progress
Diffstat (limited to 'UVtools.Core/Extensions/EmguExtensions.cs')
-rw-r--r--UVtools.Core/Extensions/EmguExtensions.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/UVtools.Core/Extensions/EmguExtensions.cs b/UVtools.Core/Extensions/EmguExtensions.cs
index e022816..0791ec4 100644
--- a/UVtools.Core/Extensions/EmguExtensions.cs
+++ b/UVtools.Core/Extensions/EmguExtensions.cs
@@ -18,6 +18,9 @@ namespace UVtools.Core.Extensions
public static class EmguExtensions
{
public static readonly MCvScalar BlackByte = new MCvScalar(0);
+ public static readonly MCvScalar Black3Byte = new MCvScalar(0, 0, 0);
+ public static readonly MCvScalar Transparent4Byte = new MCvScalar(0, 0, 0, 0);
+ public static readonly MCvScalar Black4Byte = new MCvScalar(0, 0, 0, 255);
public static unsafe byte* GetBytePointer(this Mat mat)
{
@@ -216,7 +219,19 @@ namespace UVtools.Core.Extensions
public static Mat InitMat(Size size, DepthType depthType = DepthType.Cv8U, int channels = 1)
{
var mat = new Mat(size, depthType, channels);
- mat.SetTo(BlackByte);
+ switch (channels)
+ {
+ case 1:
+ mat.SetTo(BlackByte);
+ break;
+ case 3:
+ mat.SetTo(Black3Byte);
+ break;
+ case 4:
+ mat.SetTo(Transparent4Byte);
+ break;
+ }
+
return mat;
}