Class PanZoomBlock
- Assembly
- VisioForge.Core.dll
MediaBlock that applies pan and zoom transformations to video frames using Cairo. This block provides static and dynamic zoom and pan effects for video streams. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class PanZoomBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
PanZoomBlock()
Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.PanZoomBlock class.
public PanZoomBlock()Properties
Input
Gets the input.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the inputs.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the outputs.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the type.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Constructs and initializes the pan zoom filter and its associated GStreamer elements.
public override bool Build()Returns
- bool
-
trueif successful;falseif initialization failed.
CleanUp()
Releases all resources and performs cleanup operations.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the core BaseElement wrapper.
public BaseElement GetCore()Returns
- BaseElement
-
The BaseElement wrapper instance.
GetElement()
Gets the underlying GStreamer element.
public Element GetElement()Returns
- Element
-
The GStreamer Element instance.
IsAvailable()
Determines whether the pan zoom filter is available on the current system.
public static bool IsAvailable()Returns
- bool
-
trueif available; otherwise,false.
SetDynamicPan(VideoStreamDynamicPanSettings)
Sets the dynamic pan (translation) settings for the video stream. Dynamic pan interpolates between start and stop values based on the video timestamp.
public void SetDynamicPan(VideoStreamDynamicPanSettings settings)Parameters
settingsVideoStreamDynamicPanSettings-
The dynamic pan settings to apply, or null to disable dynamic pan.
SetDynamicZoom(VideoStreamDynamicZoomSettings)
Sets the dynamic zoom settings for the video stream. Dynamic zoom interpolates between start and stop values based on the video timestamp.
public void SetDynamicZoom(VideoStreamDynamicZoomSettings settings)Parameters
settingsVideoStreamDynamicZoomSettings-
The dynamic zoom settings to apply, or null to disable dynamic zoom.
SetPan(VideoStreamPanSettings)
Sets the static pan (translation) settings for the video stream.
public void SetPan(VideoStreamPanSettings settings)Parameters
settingsVideoStreamPanSettings-
The pan settings to apply, or null to disable pan.
SetRect(VideoStreamRectSettings)
Sets the target rectangle settings for drawing the video into a specific rectangle. The video will be resized and positioned to fit within the specified rectangle. When enabled, this takes precedence over pan and zoom settings.
public void SetRect(VideoStreamRectSettings settings)Parameters
settingsVideoStreamRectSettings-
The rect settings to apply, or null to disable rect mode.
SetZoom(VideoStreamZoomSettings)
Sets the static zoom settings for the video stream.
public void SetZoom(VideoStreamZoomSettings settings)Parameters
settingsVideoStreamZoomSettings-
The zoom settings to apply, or null to disable zoom.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this block with a pipeline and initializes its internal context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline instance that will manage this block.