public void Render(WriteableBitmap input) { input.ForEach((x, y, color) => { System.Windows.Media.Color?result = null; //Let's assume we start with the last layer in the collection (or the bottom most layer) Each <VisualLayer>(i => { if (i is PixelLayer) { var other = (i as PixelLayer).Pixels; if (x < other.PixelWidth && y < other.PixelHeight) { var b = other.GetPixel(x, y); if (result == null) { //If no color has been recorded yet, record the first layer (or the bottom most) result = b; return; } //If a color has been recorded, let's say this is the second layer; in what order are the colors blended? result = VisualLayer.Blend(i.BlendMode, b, result.Value); } } }); return(result ?? color); }); }
public ScaleTransform(VisualLayer layer) : base(layer) { }
public RotateTransform(VisualLayer layer) : base(layer) { }
public PerspectiveTransform(VisualLayer layer) : base(layer) { }
public DistortTransform(VisualLayer layer) : base(layer) { }
public Transform(VisualLayer visualLayer) { VisualLayer = visualLayer; }