74 references to MLPixelFormat
Microsoft.ML.ImageAnalytics (13)
ImagePixelExtractor.cs (2)
368MLPixelFormat.Bgra32 => (3, 2, 1, 0), 369MLPixelFormat.Rgba32 => (3, 0, 1, 2),
MLImage.cs (10)
23private MLPixelFormat _pixelFormat; 81public static unsafe MLImage CreateFromPixels(int width, int height, MLPixelFormat pixelFormat, ReadOnlySpan<byte> imagePixelData) 83if (pixelFormat != MLPixelFormat.Bgra32 && pixelFormat != MLPixelFormat.Rgba32) 103SKBitmap image = new SKBitmap(new SKImageInfo(width, height, pixelFormat == MLPixelFormat.Bgra32 ? SKColorType.Bgra8888 : SKColorType.Rgba8888)); 116public MLPixelFormat PixelFormat 267SKColorType.Bgra8888 => MLPixelFormat.Bgra32, 268SKColorType.Rgba8888 => MLPixelFormat.Rgba32, 273private MLPixelFormat CloneImageToSupportedFormat() 285return MLPixelFormat.Bgra32;
VectorToImageTransform.cs (1)
418dst = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData);
Microsoft.ML.OnnxTransformerTest (1)
OnnxTransformTests.cs (1)
616Image = MLImage.CreateFromPixels(Width, Height, MLPixelFormat.Bgra32, imageData);
Microsoft.ML.Samples (6)
Dynamic\Transforms\ApplyONNXModelWithInMemoryImages.cs (1)
118Image = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData);
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScaleInMemory.cs (5)
45MLPixelFormat.Bgra32 => (3, 2, 1, 0), 46MLPixelFormat.Rgba32 => (3, 0, 1, 2), 53MLPixelFormat.Bgra32 => (3, 2, 1, 0), 54MLPixelFormat.Rgba32 => (3, 0, 1, 2), 110Image = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData);
Microsoft.ML.Tests (54)
ImagesTests.cs (54)
213MLPixelFormat.Bgra32 => (3, 2, 1, 0), 214MLPixelFormat.Rgba32 => (3, 0, 1, 2), 263MLPixelFormat.Bgra32 => (3, 2, 1, 0), 264MLPixelFormat.Rgba32 => (3, 0, 1, 2), 286MLPixelFormat.Bgra32 => (3, 2, 1, 0), 287MLPixelFormat.Rgba32 => (3, 0, 1, 2), 325Image = MLImage.CreateFromPixels(width, height, MLPixelFormat.Bgra32, imageData); 378MLPixelFormat.Bgra32 => (3, 2, 1, 0), 379MLPixelFormat.Rgba32 => (3, 0, 1, 2), 386MLPixelFormat.Bgra32 => (3, 2, 1, 0), 387MLPixelFormat.Rgba32 => (3, 0, 1, 2), 453MLPixelFormat.Bgra32 => (3, 2, 1, 0), 454MLPixelFormat.Rgba32 => (3, 0, 1, 2), 461MLPixelFormat.Bgra32 => (3, 2, 1, 0), 462MLPixelFormat.Rgba32 => (3, 0, 1, 2), 529MLPixelFormat.Bgra32 => (3, 2, 1, 0), 530MLPixelFormat.Rgba32 => (3, 0, 1, 2), 537MLPixelFormat.Bgra32 => (3, 2, 1, 0), 538MLPixelFormat.Rgba32 => (3, 0, 1, 2), 604MLPixelFormat.Bgra32 => (3, 2, 1, 0), 605MLPixelFormat.Rgba32 => (3, 0, 1, 2), 612MLPixelFormat.Bgra32 => (3, 2, 1, 0), 613MLPixelFormat.Rgba32 => (3, 0, 1, 2), 679MLPixelFormat.Bgra32 => (3, 2, 1, 0), 680MLPixelFormat.Rgba32 => (3, 0, 1, 2), 687MLPixelFormat.Bgra32 => (3, 2, 1, 0), 688MLPixelFormat.Rgba32 => (3, 0, 1, 2), 755MLPixelFormat.Bgra32 => (3, 2, 1, 0), 756MLPixelFormat.Rgba32 => (3, 0, 1, 2), 763MLPixelFormat.Bgra32 => (3, 2, 1, 0), 764MLPixelFormat.Rgba32 => (3, 0, 1, 2), 830MLPixelFormat.Bgra32 => (3, 2, 1, 0), 831MLPixelFormat.Rgba32 => (3, 0, 1, 2), 838MLPixelFormat.Bgra32 => (3, 2, 1, 0), 839MLPixelFormat.Rgba32 => (3, 0, 1, 2), 906MLPixelFormat.Bgra32 => (3, 2, 1, 0), 907MLPixelFormat.Rgba32 => (3, 0, 1, 2), 914MLPixelFormat.Bgra32 => (3, 2, 1, 0), 915MLPixelFormat.Rgba32 => (3, 0, 1, 2), 980MLPixelFormat.Bgra32 => (3, 2, 1, 0), 981MLPixelFormat.Rgba32 => (3, 0, 1, 2), 988MLPixelFormat.Bgra32 => (3, 2, 1, 0), 989MLPixelFormat.Rgba32 => (3, 0, 1, 2), 1033MLPixelFormat.Bgra32 => (3, 2, 1, 0), 1034MLPixelFormat.Rgba32 => (3, 0, 1, 2), 1246Assert.True(image1.PixelFormat == MLPixelFormat.Rgba32 || image1.PixelFormat == MLPixelFormat.Bgra32); 1268Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Unknown, Array.Empty<byte>())); 1269Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Bgra32, Array.Empty<byte>())); 1270Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(0, 10, MLPixelFormat.Bgra32, new byte[10])); 1271Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 0, MLPixelFormat.Bgra32, new byte[10])); 1272Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Bgra32, new byte[401])); 1309MLImage image = MLImage.CreateFromPixels(10, 10, MLPixelFormat.Bgra32, new byte[10 * 10 * 4]); 1315Assert.Equal(MLPixelFormat.Bgra32, image.PixelFormat);