3 writes to _image
Microsoft.ML.ImageAnalytics (3)
46 references to _image
Microsoft.ML.ImageAnalytics (46)
MLImage.cs (46)
126Debug.Assert(_image is not null);
141var pixelData = _image.Pixels;
163Debug.Assert(_image.Info.BytesPerPixel == 4);
165var pixelsPtr = _image.GetPixels();
166if (pixelsPtr == IntPtr.Zero || _image.ByteCount <= 0)
169return new ReadOnlySpan<byte>(pixelsPtr.ToPointer(), _image.ByteCount);
199return _image.Width;
211return _image.Height;
223Debug.Assert(_image.Info.BitsPerPixel == 32);
224return _image.Info.BitsPerPixel;
243using SKData data = _image.Encode(encodingFormat, 100);
258if (_image != null)
260_image.Dispose();
269PixelFormat = _image.Info.ColorType switch
279Debug.Assert(_image.Info.ColorType != SKColorType.Bgra8888 && _image.Info.ColorType != SKColorType.Rgba8888);
281if (!_image.CanCopyTo(SKColorType.Bgra8888))
286SKBitmap image1 = _image.Copy(SKColorType.Bgra8888);
287_image.Dispose();
312private SKBitmap ResizeFull(int width, int height) => _image.Resize(new SKSizeI(width, height), new SKSamplingOptions(SKFilterMode.Nearest));
316float widthAspect = (float)width / _image.Width;
317float heightAspect = (float)height / _image.Height;
325destX = (int)((width - (_image.Width * aspect)) / 2);
330destY = (int)((height - (_image.Height * aspect)) / 2);
333int destWidth = (int)(_image.Width * aspect);
334int destHeight = (int)(_image.Height * aspect);
337SKRect srcRect = new SKRect(0, 0, _image.Width, _image.Height);
341using SKImage image = SKImage.FromBitmap(_image);
350float widthAspect = (float)width / _image.Width;
351float heightAspect = (float)height / _image.Height;
365destY = (int)(height - (_image.Height * aspect));
368destY = (int)((height - (_image.Height * aspect)) / 2);
381destX = (int)(width - (_image.Width * aspect));
384destX = (int)((width - (_image.Width * aspect)) / 2);
389int destWidth = (int)(_image.Width * aspect);
390int destHeight = (int)(_image.Height * aspect);
394SKRect srcRect = new SKRect(0, 0, _image.Width, _image.Height);
398using SKImage image = SKImage.FromBitmap(_image);
418SKBitmap dst = new SKBitmap(_image.Width, _image.Height, isOpaque: true);
424SKBitmap destBitmap = new SKBitmap(_image.Width, _image.Height, isOpaque: true);
426canvas.DrawBitmap(_image, 0f, 0f, paint: paint);
450if (_image is null)