public PixelProcessorNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Pixel Processor"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; function = new FunctionGraph("Pixel Processor Function"); function.ParentNode = this; function.ExpectedOutput = NodeType.Float4; function.OnGraphUpdated += Function_OnGraphUpdated; previewProcessor = new BasicImageRenderer(); processor = new PixelShaderProcessor(); internalPixelType = p; Inputs = new List <NodeInput>(); AddPlaceholderInput(); AddPlaceholderInput(); Outputs = new List <NodeOutput>(); output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Outputs.Add(output); }
public PixelProcessorNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base() { Name = "Pixel Processor"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; function = new FunctionGraph("Pixel Processor Function", w, h); function.AssignParentNode(this); function.ExpectedOutput = NodeType.Float4 | NodeType.Float; previewProcessor = new BasicImageRenderer(); processor = new PixelShaderProcessor(); internalPixelType = p; for (int i = 0; i < 4; ++i) { var input = new NodeInput(NodeType.Gray | NodeType.Color, this, "Input " + Inputs.Count); Inputs.Add(input); } output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Outputs.Add(output); }