Pinta.Core.BrightnessContrastEffect.RenderEffect C# (CSharp) Метод

RenderEffect() публичный Метод

public RenderEffect ( ImageSurface src, ImageSurface dest, Gdk rois ) : void
src Cairo.ImageSurface
dest Cairo.ImageSurface
rois Gdk
Результат void
        public unsafe override void RenderEffect(ImageSurface src, ImageSurface dest, Gdk.Rectangle[] rois)
        {
            Calculate ();

            foreach (Gdk.Rectangle rect in rois) {
                for (int y = rect.Top; y < rect.Bottom; y++) {
                    ColorBgra* srcRowPtr = src.GetPointAddressUnchecked (rect.Left, y);
                    ColorBgra* dstRowPtr = dest.GetPointAddressUnchecked (rect.Left, y);
                    ColorBgra* dstRowEndPtr = dstRowPtr + rect.Width;

                    if (divide == 0) {
                        while (dstRowPtr < dstRowEndPtr) {
                            ColorBgra col = *srcRowPtr;
                            int i = col.GetIntensityByte ();
                            uint c = rgbTable[i];
                            dstRowPtr->Bgra = (col.Bgra & 0xff000000) | c | (c << 8) | (c << 16);

                            ++dstRowPtr;
                            ++srcRowPtr;
                        }
                    } else {
                        while (dstRowPtr < dstRowEndPtr) {
                            ColorBgra col = *srcRowPtr;
                            int i = col.GetIntensityByte ();
                            int shiftIndex = i * 256;

                            col.R = rgbTable[shiftIndex + col.R];
                            col.G = rgbTable[shiftIndex + col.G];
                            col.B = rgbTable[shiftIndex + col.B];

                            *dstRowPtr = col;
                            ++dstRowPtr;
                            ++srcRowPtr;
                        }
                    }
                }
            }
        }