/// <summary> /// Create a crop texture input. /// </summary> /// <param name="input">Backing texture input to receive cropped frames.</param> public CropTextureInput(ITextureInput input) { this.input = input; this.material = new Material(Shader.Find(@"Hidden/NCPX/CropFilter")); this.frameSizeInv = new Vector2(1f / input.frameSize.width, 1f / input.frameSize.height); this.rect = new RectInt(0, 0, input.frameSize.width, input.frameSize.height); this.aspectMode = 0; }
/// <summary> /// Create a crop texture input. /// </summary> /// <param name="recorder">Media recorder to receive video frames.</param> /// <param name="textureInput">Backing texture input for committing frames to recorder.</param> public CropTextureInput(IMediaRecorder recorder, ITextureInput textureInput = null) { this.recorder = recorder; this.input = textureInput ?? new TextureInput(recorder); this.material = new Material(Shader.Find(@"Hidden/NCPX/CropTextureInput")); this.cropRect = new RectInt(0, 0, recorder.frameSize.width, recorder.frameSize.height); this.aspectMode = 0; }