Class GPUPixelBeautyBlock
- Namespace
- VisioForge.Core.MediaBlocks.GPUPixel
- Assembly
- VisioForge.Core.dll
Beauty-face block backed by GPUPixel (skin smoothing and whitening).
Requires the VisioForge.CrossPlatform.GPUPixel.* redistributable. Face slimming,
eye enlarge, lipstick and blusher are forwarded to the native element but are no-ops on
Windows until a 106-point face detector ships with that redistributable.
Implements VisioForge.Core.MediaBlocks.IVideoProcessingBlock so it can be inserted into a
VideoCaptureCoreX / MediaPlayerCoreX chain with Video_Processing_AddBlock.
public class GPUPixelBeautyBlock : MediaBlock, IMediaBlockInternals, IVideoProcessingBlock, IMediaBlock, IDisposableInheritance
Implements
Inherited Members
Extension Methods
Constructors
GPUPixelBeautyBlock(GPUPixelBeautySettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.GPUPixel.GPUPixelBeautyBlock class.
public GPUPixelBeautyBlock(GPUPixelBeautySettings settings)Parameters
settingsGPUPixelBeautySettings-
The settings. A null value is replaced with defaults.
GPUPixelBeautyBlock()
Initializes a new instance of the VisioForge.Core.MediaBlocks.GPUPixel.GPUPixelBeautyBlock class with default settings.
public GPUPixelBeautyBlock()Properties
Input
Gets the input pad.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the input pads.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the output pads.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the beauty settings.
public GPUPixelBeautySettings Settings { get; set; }Property Value
Type
Gets the media block type identifier.
public override MediaBlockType Type { get; }Property Value
Methods
ApplySettings()
Pushes the current VisioForge.Core.MediaBlocks.GPUPixel.GPUPixelBeautyBlock.Settings onto the running element. No-op until the block has been built, and after it has been disposed.
public void ApplySettings()Build()
Constructs the videoconvert + gpupixelbeauty chain.
public override bool Build()Returns
- bool
-
trueif the chain was built; otherwise,false.
CleanUp()
Releases the native element.
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.
GetCore()
Gets the core element wrapper.
public BaseElement GetCore()Returns
- BaseElement
-
The wrapper, or
nullbefore VisioForge.Core.MediaBlocks.GPUPixel.GPUPixelBeautyBlock.Build / after dispose.
GetElement()
Gets the underlying GStreamer element.
public Element GetElement()Returns
- Element
-
The native element, or
nullbefore VisioForge.Core.MediaBlocks.GPUPixel.GPUPixelBeautyBlock.Build / after dispose.
IsAvailable()
Determines whether the gpupixelbeauty element is registered.
The correct GPUPixel NuGet redistributable must be referenced.
public static bool IsAvailable()Returns
- bool
-
trueif the element is available; otherwise,false.
RemoveElementsFromPipeline()
Removes the owned elements from the pipeline. Idempotent.
public override void RemoveElementsFromPipeline()IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this block with a pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The pipeline.