private void UISelectedValues_ColorSelected(Engine.UISelectedValuesEventArgs e) { if (t_colorVariance != null) { t_colorVariance.SetColor(e.Color); } }
private void ThreadedProcess() { t_workflow.AllowInvalidate = true; Engine.Color.Cell c = Engine.Application.UISelectedValues.SelectedColor; t_colorVariance.SetColor(c); for (int x = 0; x < t_imageProcessed.Width; x++) { t_colorVariance.Step(); for (int y = 0; y < t_imageProcessed.Height; y++) { int offset = t_imageProcessed.GetOffset(x, y); if (y < t_imageProcessed.Height * t_percent / 100) { Engine.Color.Cell variance = t_colorVariance.ColorVariation; variance.WriteBytes(t_imageProcessed.Array, offset); } else { c.WriteBytes(t_imageProcessed.Array, offset); } } } base.PostProcess(); }
internal override void Draw(MousePoint p) { if (!t_skipper.Skip()) { return; } if (t_imageSource.IsOutOfBounds(p.X, p.Y)) { return; } Engine.Color.Cell col; t_colorVariance.Step(); if (t_useColorFromImage) { col = t_imageSource.GetPixel(p.X, p.Y, PixelRetrievalOptions.ReturnEdgePixel); t_colorVariance.SetColor(col); col = t_colorVariance.ColorVariation; col.Alpha = t_alpha; } else { col = t_colorVariance.ColorVariation; col.Alpha = t_alpha; } // particles must follow the pen between each call to draw int[] delta = MousePoint.Delta(t_previousPoint, p); Engine.Calc.Vector d = new Engine.Calc.Vector(delta[0], delta[1]); foreach (Engine.Effects.Particles.Obsolete.PixelParticle_O px in t_particles) { px.Move(d); px.Draw(t_imageSource, col); } t_previousPoint = p; }