using OpenCvSharp;

namespace VisionBuilder.UI.RaspberryAcquisition.Services;

public static class ImageConverter
{
    public static Avalonia.Media.Imaging.Bitmap MatToAvaloniaBitmap(Mat mat)
    {
        var encoded = mat.ImEncode(".bmp");
        using var ms = new MemoryStream(encoded);
        return new Avalonia.Media.Imaging.Bitmap(ms);
    }
}
