CNTK.CntkBitmapExtensions.GetPixelMapper C# (CSharp) Метод

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

Returns a function for extracting the R-G-B values properly from an image based on its pixel format
private static GetPixelMapper ( PixelFormat pixelFormat, int heightStride ) : Func
pixelFormat PixelFormat The image's pixel format
heightStride int The stride (row byte count)
Результат Func
        private static Func<int, int, int, int> GetPixelMapper(PixelFormat pixelFormat, int heightStride)
        {
            switch (pixelFormat)
            {
                case PixelFormat.Format32bppArgb:
                    return (h, w, c) => h * heightStride + w * 4 + c;  // bytes are B-G-R-A
                case PixelFormat.Format24bppRgb:
                default:
                    return (h, w, c) => h * heightStride + w * 3 + c;  // bytes are B-G-R
            }
        }