Class GPUVideoEffectSaturation
- Namespace
- VisioForge.Core.Types.VideoEffects
- Assembly
- VisioForge.Core.dll
GPU-accelerated saturation adjustment effect that controls the intensity and vividness of colors in video using DirectX hardware acceleration.
public class GPUVideoEffectSaturation : GPUVideoEffect, IGPUVideoEffectSaturation, IGPUVideoEffectInheritance
Implements
Inherited Members
Remarks
Available in: VideoCaptureCore, MediaPlayerCore, VideoEditCore (Windows only)
GPU-accelerated version using DirectX. Real-time processing with hardware acceleration for efficient saturation adjustment on high-resolution video. Significantly faster than CPU-based processing, making it suitable for 4K and higher resolutions with minimal performance impact.
Saturation determines how intense or vivid colors appear in the video. Increasing saturation makes colors more vibrant and punchy, while decreasing it moves colors toward grayscale. At zero saturation, the image becomes completely monochrome. The effect uses GPU shaders to perform per-pixel color intensity calculations in real-time, applying the transformation in the YUV or HSV color space for accurate color manipulation.
The GPU implementation provides several advantages over CPU processing: parallel processing of all pixels simultaneously, optimized shader code specifically designed for color manipulation, and reduced CPU load allowing other processing tasks to run concurrently. This makes it ideal for live video processing, real-time preview during editing, and multi-effect pipelines where performance is critical.
Common applications:
- Creating vibrant, stylized looks in real-time video production
- Desaturation for muted, cinematic effects without performance penalty
- Live color grading and mood adjustment during capture or streaming
- Compensating for washed-out footage from cameras or sources
- Creative color effects in video editing with instant preview
- Real-time saturation enhancement for broadcast or live streaming
See VisioForge.Core.Types.VideoEffects.VideoEffectSaturation for CPU-based alternative with animated saturation transitions (ValueStop property). The CPU version offers more flexibility with animation but lower performance. Choose GPU version for real-time processing and high-resolution video; choose CPU version when animated saturation changes are required.
Constructors
GPUVideoEffectSaturation(bool, int, string, TimeSpan, TimeSpan)
Initializes a new instance of the VisioForge.Core.Types.VideoEffects.GPUVideoEffectSaturation class with GPU-accelerated saturation adjustment.
public GPUVideoEffectSaturation(bool enabled, int value, string name = "Saturation", TimeSpan startTime = default, TimeSpan stopTime = default)Parameters
enabledbool-
trueto enable the GPU effect immediately;falseto create the effect in a disabled state. GPU effects can be toggled on/off without performance penalty when disabled. valueint-
The saturation value (0-255). 0 produces grayscale, 255 is full original saturation. Values below 255 reduce color intensity progressively toward monochrome.
namestring-
An optional name identifier for this effect instance. Default is "Saturation". Used to retrieve and control specific effect instances from the GPU effects collection.
startTimeTimeSpan-
The time at which the effect should start being applied. Default is zero (from beginning). Useful for applying saturation changes at specific points in video playback or editing timeline.
stopTimeTimeSpan-
The time at which the effect should stop being applied. Default is zero (until end). Combined with
startTime, allows time-limited saturation adjustment.
Remarks
The GPU-accelerated implementation ensures real-time saturation adjustment with minimal CPU overhead. The effect is processed entirely on the GPU using DirectX shaders, making it suitable for high-resolution video including 4K and 8K content where CPU-based processing would be too slow.
Requires DirectX-compatible GPU. Automatically falls back to CPU processing if GPU is unavailable, though performance will be significantly reduced. Check GPU availability before using in performance-critical scenarios.
Properties
Value
Gets or sets the saturation adjustment value.
public int Value { get; set; }Property Value
Remarks
The saturation value controls color intensity using GPU hardware acceleration:
- 0: No saturation (grayscale/black-and-white)
- 1-127: Reduced saturation (muted, desaturated colors)
- 128: Half saturation (noticeably desaturated)
- 200-254: Slightly reduced saturation
- 255: Full saturation (original colors)
The GPU shader applies the saturation transformation in parallel across all pixels, ensuring consistent color adjustment throughout the frame with minimal latency. Changes to this property take effect immediately in the next rendered frame.
Methods
GetEffectType()
Gets the specific GPU effect type identifier for this saturation effect.
public GPUVideoEffectType GetEffectType()Returns
- GPUVideoEffectType
-
Returns VisioForge.Core.Types.VideoEffects.GPUVideoEffectType.Saturation to identify this as a GPU-accelerated saturation adjustment effect.
Remarks
This method is used by the GPU video processing pipeline to route the effect to the appropriate DirectX shader processor for hardware-accelerated saturation adjustment.