Exemplo n.º 1
0
 protected BuildItemBase(ImageJob builder, object nodeData, BuildNode inputNode, BuildNode canvasNode)
 {
     Builder  = builder;
     Input    = inputNode;
     Canvas   = canvasNode;
     NodeData = nodeData;
     Uid      = NextUid();
     builder.AddNode(this);
 }
Exemplo n.º 2
0
 public BuildNode CopyRectTo(BuildNode canvas, Rectangle area, Point to) => NodeWithCanvas(canvas, new
 {
     copy_rect_to_canvas = new
     {
         from_x = area.X,
         from_y = area.Y,
         width  = area.Width,
         height = area.Height,
         x      = to.X,
         y      = to.Y
     }
 });
Exemplo n.º 3
0
 /// <summary>
 /// Draws the input image to the given rectangle on the canvas, distorting if the aspect ratios differ.
 ///
 /// </summary>
 /// <param name="canvas"></param>
 /// <param name="to"></param>
 /// <param name="hints"></param>
 /// <param name="blend"></param>
 /// <returns></returns>
 public BuildNode DrawImageExactTo(BuildNode canvas, Rectangle to, ResampleHints hints, CompositingMode?blend) => NodeWithCanvas(canvas, new
 {
     draw_image_exact = new
     {
         w     = to.Width,
         h     = to.Height,
         x     = to.X,
         y     = to.Y,
         blend = blend?.ToString()?.ToLowerInvariant(),
         hints = hints?.ToImageflowDynamic()
     }
 });
 public BuildNode Decode(IBytesSource source, int ioId, DecodeCommands commands)
 {
     AddInput(ioId, source);
     if (commands == null)
     {
         return(BuildNode.StartNode(this,
                                    new
         {
             decode = new
             {
                 io_id = ioId
             }
         }));
     }
     return(BuildNode.StartNode(this,
                                new
     {
         decode = new
         {
             io_id = ioId,
             commands = commands.ToImageflowDynamic()
         }
     }));
 }
 internal BuildEndpoint(FluentBuildJob builder, object nodeData, BuildNode inputNode, BuildNode canvasNode) : base(builder, nodeData, inputNode,
                                                                                                                   canvasNode)
 {
 }
Exemplo n.º 6
0
 private BuildNode NodeWithCanvas(BuildNode canvas, object data) => new BuildNode(Builder, data, this, canvas);
Exemplo n.º 7
0
 private BuildNode(FluentBuildJob builder, object nodeData, BuildNode inputNode, BuildNode canvasNode) : base(builder, nodeData, inputNode,
                                                                                                              canvasNode)
 {
 }
Exemplo n.º 8
0
 private BuildNode CreateCanvas(uint w, uint h, AnyColor color, PixelFormat format) =>
 BuildNode.StartNode(this, new { create_canvas = new { w, h, color, format = format.ToString().ToLowerInvariant() } });