CSJ2K.Util.WriteableBitmapImageSource.GetNumberOfComponents C# (CSharp) Метод

GetNumberOfComponents() приватный статический Метод

private static GetNumberOfComponents ( System.Windows.Media.PixelFormat format ) : int
format System.Windows.Media.PixelFormat
Результат int
        private static int GetNumberOfComponents(PixelFormat format)
        {
            if (format.Equals(PixelFormats.BlackWhite) || format.Equals(PixelFormats.Gray8))
            {
                return 1;
            }

            if (format.Equals(PixelFormats.Bgra32) || format.Equals(PixelFormats.Bgr24)
                || format.Equals(PixelFormats.Bgr32) || format.Equals(PixelFormats.Pbgra32)
                || format.Equals(PixelFormats.Rgb24))
            {
                return 3;
            }

            throw new ArgumentOutOfRangeException("format");
        }