Class VideoEffectSpray
- Namespace
- VisioForge.Core.Types.VideoEffects
- Assembly
- VisioForge.Core.dll
Represents a spray effect that randomly disperses pixels within a specified radius, creating a diffused, paint-splatter appearance similar to spray painting or airbrushing.
public class VideoEffectSpray : VideoEffect, IVideoEffectSpray, IVideoEffectInheritance
Implements
Inherited Members
Remarks
The spray effect randomly redistributes pixels within a local neighborhood, creating a scattered, dispersed appearance that resembles paint being sprayed through an airbrush or stencil. Each pixel is randomly replaced with a pixel from its surrounding area, with the radius of dispersion controlled by the VisioForge.Core.Types.VideoEffects.VideoEffectSpray.Value property. This creates a diffused, artistic effect that breaks up sharp details while maintaining overall color distribution.
SDK Availability: VideoCaptureCore, MediaPlayerCore, VideoEditCore (Windows only)
Platform Support: Windows only
Technical characteristics:
- Random pixel displacement within local neighborhoods
- Preserves overall color distribution while scattering details
- Creates organic, hand-painted appearance
- Higher spray values produce more dramatic dispersion
- Effect is randomized each frame, creating subtle motion
Common use cases include:
- Artistic effects for music videos and creative content
- Simulating spray paint, watercolor, or airbrush techniques
- Creating impressionistic or abstract video styles
- Softening harsh details while maintaining character
- Privacy masking with more artistic appearance than standard blur
- Animated transitions between clear and diffused imagery
The spray intensity can be animated by specifying different VisioForge.Core.Types.VideoEffects.VideoEffectSpray.Value and VisioForge.Core.Types.VideoEffects.VideoEffectSpray.ValueStop values. The effect will automatically interpolate between these values, enabling smooth transitions from subtle dispersion to heavy spray effects.
Performance: This is a CPU-based effect with moderate computational requirements. The random nature of the effect means processing time is consistent regardless of image content. Higher spray values may slightly increase processing time due to larger neighborhood sampling.
Constructors
VideoEffectSpray(int, int, string, TimeSpan, TimeSpan, bool)
Initializes a new instance of the VisioForge.Core.Types.VideoEffects.VideoEffectSpray class with specified parameters.
public VideoEffectSpray(int value = 50, int valueStop = 0, string name = "spray", TimeSpan startTime = default, TimeSpan stopTime = default, bool enabled = true)Parameters
valueint-
The spray radius/intensity in pixels. Higher values create more dramatic pixel dispersion and diffusion effects. Lower values produce subtle scattering. Default is 50 (moderate spray). Valid range is 1 to 255.
valueStopint-
The ending spray radius for animated transitions. Set to 0 to disable animation and maintain constant intensity at
value. When non-zero, the spray radius will interpolate betweenvalueand this value over the effect's time range. Default is 0 (no animation). Valid range is 0 to 255. namestring-
An optional name identifier for this effect instance. Default is "spray". Used to retrieve specific effect instances from a collection via the name property. Multiple effects with the same type can coexist with different names.
startTimeTimeSpan-
The time at which the effect should start being applied. Default is Zero, which applies the effect from the beginning. Use a specific time value to delay the effect start.
stopTimeTimeSpan-
The time at which the effect should stop being applied. Default is Zero, which applies the effect until the end. Set to a specific time to limit the effect duration. When using animated transitions with
valueStop, this defines the end point of the animation. enabledbool-
trueto enable the effect immediately;falseto create the effect in a disabled state. The effect can be enabled/disabled later using the VisioForge.Core.Types.VideoEffects.VideoEffect.Enabled property. Default istrue.
Remarks
If both startTime and stopTime are zero (default),
the effect will be applied for the entire video duration.
The spray effect uses randomization, which means the exact pixel dispersion pattern will vary between frames, creating subtle motion and organic appearance.
Properties
Value
Gets or sets the spray radius/intensity (starting value for animations).
public int Value { get; set; }Property Value
Remarks
Controls the maximum distance that pixels can be dispersed from their original positions. Higher values create more dramatic spray effects with wider pixel scattering. Lower values produce subtle dispersion with tighter pixel distribution.
Typical value ranges and their effects:
- 1-10: Subtle spray, slight pixel scattering, maintains detail
- 11-30: Moderate spray, visible dispersion, soft-focus appearance
- 31-60: Strong spray, heavy diffusion, airbrush effect
- 61-100: Extreme spray, very diffused, heavily abstracted
- 100+: Maximum spray, almost completely scattered pixels
When VisioForge.Core.Types.VideoEffects.VideoEffectSpray.ValueStop is set to a different non-zero value, this property serves as the starting value for an animated transition.
ValueStop
Gets or sets the ending spray radius/intensity for animated transitions (optional).
public int ValueStop { get; set; }Property Value
Remarks
When set to a non-zero value different from VisioForge.Core.Types.VideoEffects.VideoEffectSpray.Value, the spray radius will automatically interpolate between VisioForge.Core.Types.VideoEffects.VideoEffectSpray.Value and VisioForge.Core.Types.VideoEffects.VideoEffectSpray.ValueStop over the effect's duration (from VisioForge.Core.Types.VideoEffects.VideoEffect.StartTime to VisioForge.Core.Types.VideoEffects.VideoEffect.StopTime).
Animation examples:
- Value=5, ValueStop=80: Gradually increase spray (clear to diffused)
- Value=80, ValueStop=5: Gradually decrease spray (diffused to clear)
- ValueStop=0: No animation, constant spray at Value
Set to 0 to disable animation and maintain constant spray intensity at VisioForge.Core.Types.VideoEffects.VideoEffectSpray.Value.
Methods
GetEffectType()
Gets the specific type of this video effect.
public VideoEffectType GetEffectType()Returns
- VideoEffectType
-
Returns VisioForge.Core.Types.VideoEffects.VideoEffectType.Spray to identify this as a spray/pixel dispersion effect.
Remarks
This method overrides the base class implementation to provide the concrete effect type. The effect type is used by the video processing pipeline to route the effect to the appropriate spray processing module.