NatCorder
Search…
WatermarkTextureInput
class NatSuite.Recorders.Inputs.WatermarkTextureInput : ITextureInput
The WatermarkTextureInput class provides a simple primitive for recording video frames from Texture objects while applying a watermark image to the recording.

Creating the Recorder Input

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

Specifying the Watermark

1
/// <summary>
2
/// Watermark image.
3
/// If `null`, no watermark will be rendered.
4
/// </summary>
5
Texture watermark { get; set; }
Copied!
The watermark can be any Texture object. If it is null, then no watermark is rendered.

Specifying the Display Rectangle

1
/// <summary>
2
/// Watermark display rect in pixel coordinates of the recorder.
3
/// </summary>
4
RectInt rect { get; set; }
Copied!
The watermark position and size are specified by the rect field. The rect is always initialized to the frame size of the recorder, thereby filling the screen with the watermark.

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 watermark.

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.