コード例 #1
0
        /// <inheritdoc/>
        public bool TryWrite(Lazy <Stream> stream, CodecFormat format, SpanBitmap bmp)
        {
            var fmt = _GetFormatFromExtension(format);

            if (fmt == null)
            {
                return(false);
            }

            using var dst = bmp.Info.ToAndroidFactory().CreateCompatibleBitmap();

            bmp.CopyTo(dst);

            dst.Compress(fmt, 100, stream.Value);

            return(true);
        }
コード例 #2
0
        public static void Inference <TResult>(this IInferenceContext <PointerBitmap, TResult> context, TResult result, SpanBitmap image, RECT?imageRect = null)
            where TResult : class
        {
            if (image.PixelFormat == Pixel.BGR24.Format)
            {
                context.Inference(result, image.OfType <Pixel.BGR24>(), imageRect);
                return;
            }

            // convert image to BGR24
            MemoryBitmap tmp = default;

            image.CopyTo(ref tmp, Pixel.BGR24.Format);

            tmp.AsSpanBitmap().PinReadablePointer
            (
                ptrBmp => context.Inference(result, ptrBmp, imageRect)
            );
        }
コード例 #3
0
 public void Update(SpanBitmap <float> newDepth)
 {
     newDepth.CopyTo(ref _Depth);
     _SpriteAsset = null;
 }