示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        public override void Dispose()
        {
            base.Dispose();

            if (processor != null)
            {
                processor.Release();
                processor = null;
            }
        }
示例#4
0
        public override void Dispose()
        {
            base.Dispose();

            if (processor != null)
            {
                processor.Release();
                processor = null;
            }

            if (colorLUT != null)
            {
                colorLUT.Release();
                colorLUT = null;
            }

            LUT = null;
        }