Banshee.Widgets.HoverImageButton.ColorShiftPixbuf C# (CSharp) Method

ColorShiftPixbuf() private method

private ColorShiftPixbuf ( Gdk src, byte shift ) : Gdk.Pixbuf
src Gdk
shift byte
return Gdk.Pixbuf
        private unsafe Gdk.Pixbuf ColorShiftPixbuf(Gdk.Pixbuf src, byte shift)
        {
            Gdk.Pixbuf dest = new Gdk.Pixbuf(src.Colorspace, src.HasAlpha, src.BitsPerSample, src.Width, src.Height);

            byte *src_pixels_orig = (byte *)src.Pixels;
            byte *dest_pixels_orig = (byte *)dest.Pixels;

            for(int i = 0; i < src.Height; i++) {
                byte *src_pixels = src_pixels_orig + i * src.Rowstride;
                byte *dest_pixels = dest_pixels_orig + i * dest.Rowstride;

                for(int j = 0; j < src.Width; j++) {
                    *(dest_pixels++) = PixelClamp(*(src_pixels++) + shift);
                    *(dest_pixels++) = PixelClamp(*(src_pixels++) + shift);
                    *(dest_pixels++) = PixelClamp(*(src_pixels++) + shift);

                    if(src.HasAlpha) {
                        *(dest_pixels++) = *(src_pixels++);
                    }
                }
            }

            return dest;
        }