public override void OnNodeUpdated() { Debug.Log("Reloading pixels in Texture2DLoader"); Color[] pixels; if (this.texture != null && this.texture.width > 0) { if (this.Crop) { pixels = this.texture.GetPixels(this.CropRect.x, this.CropRect.y, this.CropRect.width, this.CropRect.height); } else { pixels = this.texture.GetPixels(); } this.PreviewTexture = new Texture2D(this.GetWidth(), this.GetHeight()); this.PreviewTexture.SetPixels(pixels); this.PreviewTexture.Apply(); } else { this.texture = Texture2D.blackTexture; pixels = this.texture.GetPixels(); } this.RGBPixels = new EnumerableColors(pixels); }
public override void OnNodeUpdated() { //Converting to Pixels Debug.Log("Converting to Pixels..."); var redValues = this.GetInputValue <EnumerableFloats>("RedValues"); var blueValues = this.GetInputValue <EnumerableFloats>("BlueValues"); var greenValues = this.GetInputValue <EnumerableFloats>("GreenValues"); if (redValues != null && blueValues != null && greenValues != null) { this.RGBPixels = new EnumerableColors(this.IntensityToPixels(redValues.GetEnumerable(), greenValues.GetEnumerable(), blueValues.GetEnumerable())); } }