Class SqueezebackBlock
- Assembly
- VisioForge.Core.dll
Squeezeback effect block for picture-in-picture and video transition effects. This Windows-specific block creates a squeezeback effect by combining video padding and image overlay to create sophisticated picture-in-picture layouts and transitions. Features include dynamic resizing, alpha blending, fade effects, and animated positioning. The block composites a background image with a video stream that can be dynamically positioned and scaled. Essential for broadcast production, video transitions, news tickers, and professional video layouts requiring animated picture-in-picture effects. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class SqueezebackBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
SqueezebackBlock(MediaBlocksPipeline, VideoFrameInfoX, ImageOverlaySettings, Rect)
Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.SqueezebackBlock class with specified pipeline, video information, and overlay settings.
public SqueezebackBlock(MediaBlocksPipeline pipeline, VideoFrameInfoX videoInfo, ImageOverlaySettings imageSettings, Rect videoRect)Parameters
pipelineMediaBlocksPipeline-
The media blocks pipeline that will contain this block.
videoInfoVideoFrameInfoX-
The video frame information including dimensions and format.
imageSettingsImageOverlaySettings-
The background image overlay settings.
videoRectRect-
The rectangle defining video position within the layout.
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 squeezeback effect components. This method sets up the internal padding changer and image overlay blocks but performs no additional initialization as components are pre-built.
public override bool Build()Returns
- bool
-
Always returns
trueas components are pre-configured.
CleanUp()
Resets this squeezeback block to a re-buildable state after the pipeline is stopped.
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. Returns null as this is a composite block.
public BaseElement GetCore()Returns
- BaseElement
-
Always returns null for this composite block.
GetElement()
Gets the underlying GStreamer element. Returns null as this is a composite block.
public Element GetElement()Returns
- Element
-
Always returns null for this composite block.
Input_Move(Rect, TimeSpan, double?, double?)
Animates the video position and opacity within the squeezeback layout.
public void Input_Move(Rect rect, TimeSpan duration, double? startAlpha, double? endAlpha)Parameters
rectRect-
The target rectangle for the video position and size.
durationTimeSpan-
The duration of the animation.
startAlphadouble?-
Optional starting opacity value (0.0-1.0).
endAlphadouble?-
Optional ending opacity value (0.0-1.0).
IsAvailable()
Determines whether this media block is available. Correct NuGet SDK redist should be included into your project.
public static bool IsAvailable()Returns
- bool
-
trueif this media block is available; otherwise,false.
StartFadeIn(TimeSpan)
Starts a fade-in animation on the background image overlay.
public void StartFadeIn(TimeSpan duration)Parameters
durationTimeSpan-
The duration of the fade-in effect.
StartFadeOut(TimeSpan)
Starts a fade-out animation on the background image overlay.
public void StartFadeOut(TimeSpan duration)Parameters
durationTimeSpan-
The duration of the fade-out effect.
Update()
Updates the image overlay settings and refreshes the visual composition. Call this method after modifying image settings to apply changes.
public void Update()UpdateImage(string, Rect)
Updates the background image and sets a transparent cutout region for the video area.
The source image is composited with an alpha-transparent hole punched at videoRect
so the underlying video is visible through that region.
public void UpdateImage(string filename, Rect videoRect)Parameters
filenamestring-
Path to the source image file to use as the background overlay.
videoRectRect-
Rectangle within the background image that will be made fully transparent.
UpdateImageAlpha(double)
Updates the opacity of the background image overlay.
public void UpdateImageAlpha(double alpha)Parameters
alphadouble-
The new alpha value (0.0-1.0) for the background image.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this squeezeback block with a pipeline and initializes its internal context. This method is called internally when the block is added to a pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline instance that will manage this block.