public NormalNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base() { Name = "Normal"; Id = Guid.NewGuid().ToString(); directx = false; noiseReduction = 0.004f; width = w; height = h; intensity = 8; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new NormalsProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Gray, this, "Gray Input"); Output = new NodeOutput(NodeType.Color, this); Inputs.Add(input); Outputs.Add(Output); }
public UniformColorNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Uniform Color"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; color = new MVector(0, 0, 0, 1); processor = new UniformColorProcessor(); previewProcessor = new BasicImageRenderer(); internalPixelType = p; Inputs = new List <NodeInput>(); output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Outputs = new List <NodeOutput>(); Outputs.Add(output); //this is a special case for uniform color node //so it will render the node preview on drag drop TryAndProcess(); }
public GradientMapNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Gradient Map"; Id = Guid.NewGuid().ToString(); width = w; height = h; gradient = new Gradient(); tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new GradientMapProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Gray, this, "Image Input"); input2 = new NodeInput(NodeType.Gray, this, "Mask Input"); Output = new NodeOutput(NodeType.Color, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input2.OnInputAdded += Input_OnInputAdded; input2.OnInputChanged += Input_OnInputChanged; input2.OnInputRemoved += Input_OnInputRemoved; Inputs = new List <NodeInput>(); Inputs.Add(input); Inputs.Add(input2); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public DistanceNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Distance"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; distance = 0.2f; previewProcessor = new BasicImageRenderer(); processor = new DistanceProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Gray, this, "Mask"); input2 = new NodeInput(NodeType.Gray | NodeType.Color, this, "Source"); Output = new NodeOutput(NodeType.Gray, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input2.OnInputAdded += Input_OnInputAdded; input2.OnInputChanged += Input_OnInputChanged; Inputs = new List <NodeInput>(); Inputs.Add(input); Inputs.Add(input2); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public MotionBlurNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Motion Blur"; Id = Guid.NewGuid().ToString(); width = w; height = h; internalPixelType = p; previewProcessor = new BasicImageRenderer(); processor = new MotionBlurProcessor(); tileX = tileY = 1; direction = 0; magnitude = 10; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input"); Inputs = new List <NodeInput>(); Inputs.Add(input); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Outputs = new List <NodeOutput>(); Outputs.Add(output); }
public WarpNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base() { Name = "Warp"; Id = Guid.NewGuid().ToString(); width = w; height = h; intensity = 1; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new WarpProcessor(); blur = new BlurProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Gray | NodeType.Color, this, "Image Input"); input1 = new NodeInput(NodeType.Gray, this, "Grayscale Gradients"); output = new NodeOutput(NodeType.Gray | NodeType.Color, this); Inputs.Add(input); Inputs.Add(input1); Outputs.Add(output); }
public GradientDynamicNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Gradient Dynamic"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new GradientMapProcessor(); internalPixelType = p; horizontal = true; input = new NodeInput(NodeType.Gray, this, "Image Input"); input2 = new NodeInput(NodeType.Color, this, "Gradient Input"); input3 = new NodeInput(NodeType.Gray, this, "Mask"); Output = new NodeOutput(NodeType.Color, this); Inputs.Add(input); Inputs.Add(input2); Inputs.Add(input3); Outputs.Add(Output); }
public InvertNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Invert"; Id = Guid.NewGuid().ToString(); width = w; height = h; red = true; blue = true; green = true; alpha = false; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new InvertProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input"); output = new NodeOutput(NodeType.Color | NodeType.Gray, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(output); }
public HSLNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "HSL"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new HSLProcessor(); hue = 0; saturation = 0; lightness = 0; internalPixelType = p; input = new NodeInput(NodeType.Gray | NodeType.Color, this, "Image"); Output = new NodeOutput(NodeType.Color, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); 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); }
public MeshDepthNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Mesh Depth"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; scale = new MVector(1, 1, 1); position = new MVector(0, 0, 0); rotation = new MVector(0, 0, 0); cameraZoom = 3; previewProcessor = new BasicImageRenderer(); processor = new MeshDepthProcessor(); internalPixelType = p; Inputs = new List <NodeInput>(); Output = new NodeOutput(NodeType.Gray, this); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public MeshDepthNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Mesh Depth"; Id = Guid.NewGuid().ToString(); width = w; height = h; tileX = tileY = 1; scaleZ = scaleY = scaleX = 1; rotationX = RotationY = rotationZ = 0; xOffset = yOffset = zOffset = 0; cameraZoom = 3; previewProcessor = new BasicImageRenderer(); processor = new MeshDepthProcessor(); internalPixelType = p; Inputs = new List <NodeInput>(); Output = new NodeOutput(NodeType.Gray, this); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public ChannelSwitchNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base() { Name = "Channel Switch"; Id = Guid.NewGuid().ToString(); width = w; height = h; redChannel = 0; greenChannel = 1; blueChannel = 2; alphaChannel = 3; tileX = tileY = 1; processor = new ChannelSwitchProcessor(); previewProcessor = new BasicImageRenderer(); internalPixelType = p; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Input 0"); input2 = new NodeInput(NodeType.Color | NodeType.Gray, this, "Input 1"); output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Inputs.Add(input); Inputs.Add(input2); Outputs.Add(output); }
public OutputNode(GraphPixelType p = GraphPixelType.RGBA) { OutType = OutputType.basecolor; Name = "Output"; Id = Guid.NewGuid().ToString(); width = height = 16; tileX = tileY = 1; internalPixelType = p; previewProcessor = new BasicImageRenderer(); input = new NodeInput(NodeType.Color | NodeType.Gray, this); Inputs = new List <NodeInput>(); Inputs.Add(input); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; Outputs = new List <NodeOutput>(); }
public GammaNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Gamma"; Id = Guid.NewGuid().ToString(); width = w; height = h; gamma = 2.2f; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new GammaProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input"); output = new NodeOutput(NodeType.Color | NodeType.Gray, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(output); }
public NormalNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Normal"; Id = Guid.NewGuid().ToString(); width = w; height = h; intensity = 8; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new NormalsProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Gray, this, "Gray Input"); Output = new NodeOutput(NodeType.Color, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputRemoved += Input_OnInputRemoved; input.OnInputChanged += Input_OnInputChanged; Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public CircleNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Circle"; Id = Guid.NewGuid().ToString(); Inputs = new List <NodeInput>(); tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new CircleProcessor(); outline = 0; internalPixelType = p; width = w; height = h; Output = new NodeOutput(NodeType.Gray, this); radius = 1; Outputs = new List <NodeOutput>(); Outputs.Add(Output); Process(); }
public TransformNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Transform"; Id = Guid.NewGuid().ToString(); angle = xoffset = yoffset = 0; scaleX = scaleY = 1; tileX = tileY = 1; width = w; height = h; previewProcessor = new BasicImageRenderer(); processor = new TransformProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input"); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; Output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public TransformNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base() { Name = "Transform"; Id = Guid.NewGuid().ToString(); angle = 0; offset = new MVector(0, 0); scale = new MVector(1, 1); tileX = tileY = 1; width = w; height = h; previewProcessor = new BasicImageRenderer(); processor = new TransformProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input"); Output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Inputs.Add(input); Outputs.Add(Output); }
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 AONode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base() { Name = "AO"; Id = Guid.NewGuid().ToString(); tileX = tileY = 1; width = w; height = h; rays = 4; internalPixelType = p; previewProcessor = new BasicImageRenderer(); processor = new OcclusionProcessor(); blur = new BlurProcessor(); input = new NodeInput(NodeType.Gray, this, "Gray Input"); Output = new NodeOutput(NodeType.Gray, this); Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public EmbossNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Emboss"; Id = Guid.NewGuid().ToString(); width = w; height = h; elevation = 2; angle = 0; tileX = tileY = 1; processor = new EmbossProcessor(); previewProcessor = new BasicImageRenderer(); internalPixelType = p; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input"); Output = new NodeOutput(NodeType.Gray, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public GrayscaleConversionNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Grayscale Conversion"; Id = Guid.NewGuid().ToString(); width = w; height = h; r = 1; g = 1; b = 1; a = 0; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); processor = new GrayscaleConvProcessor(); internalPixelType = p; input = new NodeInput(NodeType.Color, this); Output = new NodeOutput(NodeType.Gray, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public BlendNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) : base() { Name = "Blend"; width = w; height = h; alpha = 1; alphaMode = AlphaModeType.Background; mode = BlendType.Copy; previewProcessor = new BasicImageRenderer(); processor = new BlendProcessor(); internalPixelType = p; tileX = tileY = 1; Id = Guid.NewGuid().ToString(); Output = new NodeOutput(NodeType.Color | NodeType.Gray, this); first = new NodeInput(NodeType.Color | NodeType.Gray, this, "Foreground"); second = new NodeInput(NodeType.Color | NodeType.Gray, this, "Background"); mask = new NodeInput(NodeType.Gray, this, "Mask"); Inputs.Add(first); Inputs.Add(second); Inputs.Add(mask); Outputs.Add(Output); }
public SwitchNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Switch"; Id = Guid.NewGuid().ToString(); width = w; height = h; selected = SwitchInput.Input0; tileX = tileY = 1; internalPixelType = p; previewProcessor = new BasicImageRenderer(); input = new NodeInput(NodeType.Gray | NodeType.Color, this, "Input 0"); input2 = new NodeInput(NodeType.Gray | NodeType.Color, this, "Input 1"); Output = new NodeOutput(NodeType.Color | NodeType.Gray, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputRemoved += Input_OnInputRemoved; input.OnInputChanged += Input_OnInputChanged; input2.OnInputAdded += Input_OnInputAdded; input2.OnInputRemoved += Input_OnInputRemoved; input2.OnInputChanged += Input_OnInputChanged; Inputs = new List <NodeInput>(); Inputs.Add(input); Inputs.Add(input2); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public FXNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "FX"; Id = Guid.NewGuid().ToString(); tileX = tileY = 1; width = w; height = h; internalPixelType = p; luminosity = 1.0f; luminosityRandomness = 0.0f; iterations = 1; translation = new MVector(); scale = new MVector(1, 1); rotation = 0; blending = FXBlend.Blend; previewProcessor = new BasicImageRenderer(); processor = new FXProcessor(); q1 = new NodeInput(NodeType.Color | NodeType.Gray, this, "Quadrant"); q2 = new NodeInput(NodeType.Color | NodeType.Gray, this, "Quadrant"); q3 = new NodeInput(NodeType.Color | NodeType.Gray, this, "Quadrant"); q4 = new NodeInput(NodeType.Color | NodeType.Gray, this, "Quadrant"); Output = new NodeOutput(NodeType.Color | NodeType.Gray, this); q1.OnInputAdded += Input_OnInputAdded; q1.OnInputRemoved += Input_OnInputRemoved; q1.OnInputChanged += Input_OnInputChanged; q2.OnInputAdded += Input_OnInputAdded; q2.OnInputRemoved += Input_OnInputRemoved; q2.OnInputChanged += Input_OnInputChanged; q3.OnInputAdded += Input_OnInputAdded; q3.OnInputRemoved += Input_OnInputRemoved; q3.OnInputChanged += Input_OnInputChanged; q4.OnInputAdded += Input_OnInputAdded; q4.OnInputRemoved += Input_OnInputRemoved; q4.OnInputChanged += Input_OnInputChanged; Inputs = new List <NodeInput>(); Inputs.Add(q1); Inputs.Add(q2); Inputs.Add(q3); Inputs.Add(q4); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public CurvesNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Curves"; Id = Guid.NewGuid().ToString(); width = w; height = h; minValue = 0; maxValue = 1; points = new Dictionary <int, List <Point> >(); previewProcessor = new BasicImageRenderer(); tileX = tileY = 1; lutBrush = new FloatBitmap(256, 2); internalPixelType = p; curveLUT = new GLTextuer2D(GLInterfaces.PixelInternalFormat.Rgba8); curveLUT.Bind(); curveLUT.SetFilter((int)GLInterfaces.TextureMinFilter.Nearest, (int)GLInterfaces.TextureMagFilter.Nearest); curveLUT.SetWrap((int)GLInterfaces.TextureWrapMode.Repeat); GLTextuer2D.Unbind(); processor = new CurvesProcessor(curveLUT); //set defaults List <Point> pts = new List <Point>(); pts.Add(new Point(0, 1)); pts.Add(new Point(1, 0)); points[0] = pts; points[1] = pts; points[2] = pts; points[3] = pts; input = new NodeInput(NodeType.Color | NodeType.Gray, this, "Image Input"); Output = new NodeOutput(NodeType.Color | NodeType.Gray, this); input.OnInputAdded += Input_OnInputAdded; input.OnInputChanged += Input_OnInputChanged; input.OnInputRemoved += Input_OnInputRemoved; Inputs = new List <NodeInput>(); Inputs.Add(input); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }
public virtual void Dispose() { ParentGraph = null; if (buffer != null) { buffer.Release(); buffer = null; } if (previewProcessor != null) { previewProcessor.Release(); previewProcessor = null; } }
public InputNode(GraphPixelType p = GraphPixelType.RGBA) : base() { Id = Guid.NewGuid().ToString(); Name = "Input"; internalPixelType = p; //this actually does nothing for this node width = 16; height = 16; tileX = tileY = 1; previewProcessor = new BasicImageRenderer(); //only an output is present Output = new NodeOutput(NodeType.Color | NodeType.Gray, this); Outputs.Add(Output); }
public TextNode(int w, int h, GraphPixelType p = GraphPixelType.RGBA) { Name = "Text"; Id = Guid.NewGuid().ToString(); tileX = tileY = 1; width = w; height = h; fontSize = 32; fontFamily = "Arial"; text = ""; fonts = FontManager.GetAvailableFonts(); position = new MVector(); rotation = 0; scale = new MVector(1, 1); style = FontStyle.Regular; alignment = TextAlignment.Center; spacing = 1; processor = new TextProcessor(); //establish character holder texture character = new GLTextuer2D(GLInterfaces.PixelInternalFormat.Rgba); character.Bind(); character.Linear(); character.ClampToEdge(); GLTextuer2D.Unbind(); internalPixelType = p; previewProcessor = new BasicImageRenderer(); Output = new NodeOutput(NodeType.Gray, this); Inputs = new List <NodeInput>(); Outputs = new List <NodeOutput>(); Outputs.Add(Output); }