NatCorder
Search…
CropTextureInput
class NatSuite.Recorders.Inputs.CropTextureInput : ITextureInput
The CropTextureInput class provides a simple primitive for recording video frames from Texture objects while cropping the frame so that only a region of interest is encoded to the output recording.

Creating the Recorder Input

1
/// <summary>
2
/// Create a crop texture input.
3
/// </summary>
4
/// <param name="input">Backing texture input to receive cropped frames.</param>
5
CropTextureInput (ITextureInput input);
Copied!
The texture input is always created with a backing input which receives cropped frame textures. The backing input will then forward these frames to the recorder.

Specifying the Crop Rectangle

1
/// <summary>
2
/// Crop rect in pixel coordinates of the recorder.
3
/// </summary>
4
RectInt cropRect { get; set; }
Copied!
The crop rectangle is specified by the cropRect field. The rect is always initialized to the frame size of the recorder, thereby corresponding to no cropping.

Specifying the Aspect Mode

1
/// <summary>
2
/// Crop aspect mode.
3
/// </summary>
4
AspectMode aspectMode { get; set; }
Copied!
When cropping, the aspectMode determines how aspect ratio mismatches should be handled. This allows you to stretch the cropped frame, letter- or pillar-box, or fill the frame.

Committing Video Frames

1
/// <summary>
2
/// Commit a video frame from a texture.
3
/// </summary>
4
/// <param name="texture">Source texture.</param>
5
/// <param name="timestamp">Frame timestamp in nanoseconds.</param>
6
void CommitFrame (Texture texture, long timestamp);
Copied!
Refer to the Committing Video Frames section of the ITextureInput interface for more information.

Disposing the Recorder Input

1
/// <summary>
2
/// Stop recorder input and release resources.
3
/// </summary>
4
void Dispose ();
Copied!
Refer to the Disposing the Recorder Input section of the ITextureInput interface for more information.