예제 #1
0
 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);
     });
 }
예제 #2
0
 public ScaleTransform(VisualLayer layer) : base(layer)
 {
 }
예제 #3
0
 public RotateTransform(VisualLayer layer) : base(layer)
 {
 }
예제 #4
0
 public PerspectiveTransform(VisualLayer layer) : base(layer)
 {
 }
예제 #5
0
 public DistortTransform(VisualLayer layer) : base(layer)
 {
 }
예제 #6
0
 public Transform(VisualLayer visualLayer)
 {
     VisualLayer = visualLayer;
 }