System.Drawing.Bitmap.Convert_BGRA_8888_To_P_RGBA_8888 C# (CSharp) Method

Convert_BGRA_8888_To_P_RGBA_8888() private method

private Convert_BGRA_8888_To_P_RGBA_8888 ( IntPtr source, IntPtr destination, int scanLength ) : void
source IntPtr
destination IntPtr
scanLength int
return void
        void Convert_BGRA_8888_To_P_RGBA_8888(IntPtr source, IntPtr destination, int scanLength)
        {
            unsafe
            {
                byte* src = (byte*)source;
                byte* dest = (byte*)destination;

                byte temp = 0;
                byte alpha = 0;

                for (int sd = 0; sd < scanLength; sd+=4)
                {
                    alpha = src [sd + 3];
                    temp = src [sd];  // save off blue
                    dest [sd] = ConversionHelpers.PremultiplyValue(alpha, src [sd + 2]);  // move red back
                    dest [sd + 1] = ConversionHelpers.PremultiplyValue(alpha, src [sd + 1]);
                    dest [sd + 2] = ConversionHelpers.PremultiplyValue(alpha, temp);
                    dest [sd + 3] = alpha;

                }
            }
        }