public Apply ( float r, float g, float b ) : |
||
r | float | |
g | float | |
b | float | |
Результат |
public override void RenderEffect(ImageSurface src, ImageSurface dest, Gdk.Rectangle[] rois) { HistogramRgb histogram = new HistogramRgb (); histogram.UpdateHistogram (src, new Gdk.Rectangle (0, 0, src.Width, src.Height)); op = histogram.MakeLevelsAuto (); if (op.isValid) op.Apply (dest, src, rois); }
public unsafe void Sepia() { Desaturate (); UnaryPixelOp op = new UnaryPixelOps.Level( ColorBgra.Black, ColorBgra.White, new float[] { 1.2f, 1.0f, 0.8f }, ColorBgra.Black, ColorBgra.White); ImageSurface dest = Surface.Clone (); ColorBgra* dstPtr = (ColorBgra*)dest.DataPtr; int len = Surface.Data.Length / 4; op.Apply (dstPtr, len); using (Context g = new Context (Surface)) { g.AppendPath (PintaCore.Layers.SelectionPath); g.FillRule = FillRule.EvenOdd; g.Clip (); g.SetSource (dest); g.Paint (); } (dest as IDisposable).Dispose (); }