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:
Diffstat (limited to 'PrusaSL1Viewer/ImageSharpExtensions.cs')
-rw-r--r--PrusaSL1Viewer/ImageSharpExtensions.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/PrusaSL1Viewer/ImageSharpExtensions.cs b/PrusaSL1Viewer/ImageSharpExtensions.cs
index 0c92ba5..813d5b1 100644
--- a/PrusaSL1Viewer/ImageSharpExtensions.cs
+++ b/PrusaSL1Viewer/ImageSharpExtensions.cs
@@ -6,8 +6,11 @@
* of this license document, but changing it is not allowed.
*/
using System.IO;
+using Emgu.CV;
+using Emgu.CV.Structure;
using PrusaSL1Reader;
using SixLabors.ImageSharp;
+using SixLabors.ImageSharp.PixelFormats;
namespace PrusaSL1Viewer
{
@@ -26,6 +29,15 @@ namespace PrusaSL1Viewer
}
}
+ public static Image<Gray, byte> ToEmguImage(this Image<L8> image)
+ {
+ return
+ new Image<Gray, byte>(image.Width, image.Height)
+ {
+ Bytes = Helpers.ImageL8ToBytes(image)
+ };
+ }
+
/*public static Image<TPixel> ToImageSharpImage<TPixel>(this System.Drawing.Bitmap bitmap) where TPixel : struct, IPixel<TPixel>
{
using (var memoryStream = new MemoryStream())