public MemoryBitmap GetDisplayBitmap() { var(min, max) = SpanBitmap.MinMax(_Depth); var rgb = new MemoryBitmap <Byte>(_Depth.Width, _Depth.Height, Pixel.Luminance8.Format); SpanBitmap.CopyPixels(_Depth, rgb, (-min, 255.0f / (max - min)), (0, 255)); return(rgb); }
public MemoryBitmap <Byte> GetGrayBitmap() { var minmax = SpanBitmap.MinMax(_Depth); var gray = new MemoryBitmap <Byte>(_Depth.Width, _Depth.Height, Pixel.Luminance8.Format); SpanBitmap.CopyPixels(_Depth, gray, (0, 255), (0, 255)); return(gray); }
public void Update(SpanBitmap <Vector3> newImage) { // var minmax = SpanBitmap.MinMax(newImage); if (_Image.Width != newImage.Width || _Image.Height != newImage.Height) { _Image = new MemoryBitmap(newImage.Width, newImage.Height, Pixel.BGR24.Format); } SpanBitmap.CopyPixels(newImage, _Image, (0, 255), (0, 255)); _SpriteAsset = null; }
public static void SetGrayPixels(SpanTensor2 <Single> dst, PointerBitmap src, Single offset, Single scale) { if (src.Size != dst.BitmapSize) { throw new ArgumentException(nameof(dst.BitmapSize)); } var dstSpan = dst.AsSpanBitmap(); var srcSpan = src.AsSpanBitmap(); if (srcSpan.PixelFormat.ByteCount == 1) { SpanBitmap.CopyPixels(srcSpan.OfType <Byte>(), dstSpan, (offset, scale), (0, 1)); } }