3 writes to _image
Microsoft.ML.ImageAnalytics (3)
44 references to _image
Microsoft.ML.ImageAnalytics (44)
MLImage.cs (44)
126Debug.Assert(_image is not null);
141var pixelData = _image.Pixels;
163Debug.Assert(_image.Info.BytesPerPixel == 4);
165return _image.GetPixelSpan();
195return _image.Width;
207return _image.Height;
219Debug.Assert(_image.Info.BitsPerPixel == 32);
220return _image.Info.BitsPerPixel;
239using SKData data = _image.Encode(encodingFormat, 100);
254if (_image != null)
256_image.Dispose();
265PixelFormat = _image.Info.ColorType switch
275Debug.Assert(_image.Info.ColorType != SKColorType.Bgra8888 && _image.Info.ColorType != SKColorType.Rgba8888);
277if (!_image.CanCopyTo(SKColorType.Bgra8888))
282SKBitmap image1 = _image.Copy(SKColorType.Bgra8888);
283_image.Dispose();
308private SKBitmap ResizeFull(int width, int height) => _image.Resize(new SKSizeI(width, height), SKFilterQuality.None);
312float widthAspect = (float)width / _image.Width;
313float heightAspect = (float)height / _image.Height;
321destX = (int)((width - (_image.Width * aspect)) / 2);
326destY = (int)((height - (_image.Height * aspect)) / 2);
329int destWidth = (int)(_image.Width * aspect);
330int destHeight = (int)(_image.Height * aspect);
333SKRect srcRect = new SKRect(0, 0, _image.Width, _image.Height);
339canvas.DrawBitmap(_image, srcRect, destRect, paint);
346float widthAspect = (float)width / _image.Width;
347float heightAspect = (float)height / _image.Height;
361destY = (int)(height - (_image.Height * aspect));
364destY = (int)((height - (_image.Height * aspect)) / 2);
377destX = (int)(width - (_image.Width * aspect));
380destX = (int)((width - (_image.Width * aspect)) / 2);
385int destWidth = (int)(_image.Width * aspect);
386int destHeight = (int)(_image.Height * aspect);
390SKRect srcRect = new SKRect(0, 0, _image.Width, _image.Height);
396canvas.DrawBitmap(_image, srcRect, destRect, paint);
414SKBitmap dst = new SKBitmap(_image.Width, _image.Height, isOpaque: true);
421SKBitmap destBitmap = new SKBitmap(_image.Width, _image.Height, isOpaque: true);
423canvas.DrawBitmap(_image, 0f, 0f, paint: paint);
447if (_image is null)