Class VideoEffectLightness
- Namespace
- VisioForge.Core.Types.VideoEffects
- Assembly
- VisioForge.Core.dll
Represents a lightness adjustment effect that brightens the image by moving each color channel toward white.
public class VideoEffectLightness : VideoEffect, IVideoEffectLightness, IVideoEffectInheritance
Implements
Inherited Members
Remarks
Lightness works on each RGB channel independently: a channel keeps its own value and gains a fraction of the remaining distance to white, newChannel = channel + (255 - channel) * value / 255.
A value of 0 leaves the image unchanged, and the image approaches pure white as the value grows to 255.
This is the Classic brightness control. There is no separate Classic VideoEffectBrightness, only
the GPU-accelerated VisioForge.Core.Types.VideoEffects.GPUVideoEffectBrightness.
This effect supports animated lightness transitions through the VisioForge.Core.Types.VideoEffects.VideoEffectLightness.ValueStop property, enabling smooth fades to white.
Related effects:
- Darkness: The opposite direction, moving each channel toward black
- Contrast: Expands or compresses the tonal range around mid-gray
Constructors
VideoEffectLightness(bool, int, int, string, TimeSpan, TimeSpan)
Initializes a new instance of the VisioForge.Core.Types.VideoEffects.VideoEffectLightness class with specified parameters.
public VideoEffectLightness(bool enabled, int value, int valueStop = 0, string name = "Lightness", TimeSpan startTime = default, TimeSpan stopTime = default)Parameters
enabledbool-
trueto enable the effect immediately;falseto create the effect in a disabled state. valueint-
The initial lightness value (0-255). 0 leaves the image unchanged; larger values move each color channel toward white, and 255 produces a white image.
valueStopint-
The ending lightness value for animated transitions (0-255). Default is 0 (no animation). When non-zero and different from
value, creates a smooth transition. namestring-
An optional name identifier for this effect instance. Default is "Lightness".
startTimeTimeSpan-
The time at which the effect should start being applied. Default is zero (from beginning).
stopTimeTimeSpan-
The time at which the effect should stop being applied. Default is zero (until end). Required when using
valueStopto define the animation duration.
Remarks
For static lightness adjustment, only set the value parameter.
For animated lightness changes, set both value and valueStop
along with appropriate time values.
Lightness fills the image toward white, which makes it the natural choice for fades to white and for lifting under-exposed footage.
Properties
Value
Gets or sets the lightness adjustment value.
public int Value { get; set; }Property Value
Remarks
The lightness value controls how far the image travels toward white:
- 0: No change (original image)
- 1-127: Mild to moderate lightening
- 128: Half-way to white (already washed out)
- 200-254: Strong lightening
- 255: White image
When combined with VisioForge.Core.Types.VideoEffects.VideoEffectLightness.ValueStop, the lightness will smoothly animate from this value to the stop value over the effect's time range.
ValueStop
Gets or sets the ending lightness value for animated lightness transitions.
public int ValueStop { get; set; }Property Value
Remarks
When VisioForge.Core.Types.VideoEffects.VideoEffectLightness.ValueStop is set to a non-zero value different from VisioForge.Core.Types.VideoEffects.VideoEffectLightness.Value, the lightness will smoothly transition from VisioForge.Core.Types.VideoEffects.VideoEffectLightness.Value to this value over the time period defined by VisioForge.Core.Types.VideoEffects.VideoEffect.StartTime and VisioForge.Core.Types.VideoEffects.VideoEffect.StopTime.
If set to 0 (default), the lightness remains constant at VisioForge.Core.Types.VideoEffects.VideoEffectLightness.Value throughout the effect.
Common animated effects:
- Fade to white: Value=0, ValueStop=255
- Sunrise effect: Value=50, ValueStop=180
- Sunset effect: Value=180, ValueStop=100
Because 0 means "no animation", a transition that ends at the unchanged image cannot be expressed by a single effect instance; animate to a small non-zero value instead.
Methods
GetEffectType()
Gets the specific type of this video effect.
public VideoEffectType GetEffectType()Returns
- VideoEffectType
-
Returns VisioForge.Core.Types.VideoEffects.VideoEffectType.Lightness to identify this as a lightness adjustment effect.
Remarks
This method is used by the video processing pipeline to route the effect to the appropriate lightness adjustment processor.