EffectsState class
Immutable snapshot of the active video-effect settings.
Mirrors the per-effect toggles in a native beauty-effects SDK, reduced to the feature set this package builds in-house:
- Color/beauty (no landmarks): LUT color filter, skin smoothing, whitening, skin-tone, background blur.
- Face effects (MediaPipe FaceLandmarker): eye-color recolor, makeup (lipstick / eyeshadow / blush), and PNG accessories (glasses / crown / cat-ears).
All intensities/opacities are normalized to 0.0..1.0. A nullable color hex
string being non-null is what enables the corresponding makeup/eye effect
(same convention as filterKey); the matching *Opacity is just its
strength. Accessories are plain on/off bools.
- Annotations
Constructors
- EffectsState({bool enabled = false, double smoothing = 0, double whitening = 0, String? filterKey, double filterIntensity = 1.0, double backgroundBlur = 0, NoPersonPolicy noPersonPolicy = NoPersonPolicy.blurAll, double backgroundDim = 0, String? backgroundImagePath, double glow = 0, double grain = 0, double vignette = 0, double textureDetail = 0.5, double clarity = 0, double teethWhitening = 0, double eyeBrightening = 0, double underEyeBrightening = 0, String? skinColor, double skinToneShift = 0, bool segmentationSkin = false, bool poseTracking = false, String? eyeColor, double eyeColorOpacity = 0.5, String? lipstick, double lipstickOpacity = 0.6, String lipFinish = 'satin', String lipStyle = 'full', String? eyeshadow, double eyeshadowOpacity = 0.45, String? eyeshadowColor2, double eyeshadowShimmer = 0, String? blush, double blushOpacity = 0.4, String? brows, double browOpacity = 0.6, String? eyeliner, double eyelinerOpacity = 0.7, String eyelinerStyle = 'classic', double contour = 0, double highlight = 0, bool glasses = false, bool crown = false, bool catEars = false, bool sunglasses = false, bool flowerCrown = false, bool partyHat = false, bool bunnyEars = false, bool mustache = false, bool halo = false})
-
const
-
EffectsState.fromMap(Map<
String, dynamic> map) -
Inverse of toMap: rebuilds a state from a serialized map (persisted
looks / look sharing /
VideoEffectsProcessor.apply). Missing keys fall back to the constructor defaults, so maps persisted by OLDER package versions keep loading as fields are added. Round-trips key-for-key:EffectsState.fromMap(s.toMap()) == sfor any in-range state.factory
Properties
- backgroundBlur → double
-
Background-blur strength (MediaPipe selfie segmentation + blur).
0= off.final - backgroundDim → double
-
(F.6) Background dim/desaturate strength (
0= off): the background is desaturated toward its luma and darkened (portrait-relight-lite), riding the same segmentation composite as blur. Works with or without backgroundBlur/backgroundImagePath; applies on top of both.final - backgroundImagePath → String?
-
(F.7) Absolute file path of a virtual background image, or null for none.
Replaces the blurred background sample in the composite (cover-fit,
upright in view space). On decode failure native behaves as if no image.
final
- blush → String?
-
Blush hex, or null for off.
final
- blushOpacity → double
-
Blush strength,
0.0..1.0.final - browOpacity → double
-
Brow fill strength,
0.0..1.0.final - brows → String?
-
Brow fill/darken hex, or null for off. Darkens the existing brow hairs
(Multiply, hair-gated) for fuller, more defined brows.
final
- bunnyEars → bool
-
Bunny-ears overlay on/off.
final
- catEars → bool
-
Cat-ears overlay on/off.
final
- clarity → double
-
Local-contrast (clarity/structure), signed
-1.0..1.0. Positive makes eyes/lips/texture pop; negative gives the soft, dreamy "clean girl" skin.0= off.final - contour → double
-
Contour strength
0.0..1.0— a soft, cool-gray burn under the cheekbones and along the nose sides ("snatched" sculpt).0= off.final - crown → bool
-
Crown overlay on/off.
final
- enabled → bool
-
Master switch. When false the native pipeline is a 1:1 copy (visually
identical to no processor).
final
- eyeBrightening → double
-
Eye-white (sclera) brightening
0.0..1.0(brightens + de-reddens the eye whites).0= off.final - eyeColor → String?
-
Iris recolor hex (e.g.
#3366CC), or null for off.final - eyeColorOpacity → double
-
Iris recolor strength,
0.0..1.0.final - eyeliner → String?
-
Eyeliner hex (upper lash-line stroke), or null for off.
final
- eyelinerOpacity → double
-
Eyeliner strength,
0.0..1.0.final - eyelinerStyle → String
-
Eyeliner style:
classic(lash-line stroke) orwing(adds an outer flick at the temple corner). Defaults toclassic.final - eyeshadow → String?
-
Eyeshadow hex, or null for off.
final
- eyeshadowColor2 → String?
-
Optional second eyeshadow hex for a two-tone gradient (the darker
lash-line / outer stop; eyeshadow is the lighter crease stop). Null = a
single flat tone.
final
- eyeshadowOpacity → double
-
Eyeshadow strength,
0.0..1.0.final - eyeshadowShimmer → double
-
Eyeshadow shimmer/sparkle amount,
0.0..1.0.0= matte.final - filterIntensity → double
-
Blend amount for filterKey (
0= neutral,1= full grade).final - filterKey → String?
-
Key of the active LUT (HALD CLUT) color filter, or null for none.
final
- flowerCrown → bool
-
Flower-crown overlay on/off.
final
- glasses → bool
-
Eye-enlarge strength
0.0..1.0(radial magnify centered on each iris).0= off. Face-slim strength0.0..1.0(horizontal compress toward the face centre, strongest at the jaw).0= off. Nose-narrow strength0.0..1.0(horizontal compress toward the nose centre line).0= off. Lip-plump strength0.0..1.0(radial magnify centered on the mouth).0= off. Chin-shorten strength0.0..1.0(vertical compress lifting the chin toward the mouth).0= off. Glasses overlay on/off.final - glow → double
-
Soft glow / bloom (Orton effect) strength: bright areas are blurred and
screen-blended back, giving the dreamy "beauty-filter" diffusion.
0= off.final - grain → double
-
Film-grain amount overlaid after grading (animated per frame so it shimmers
like real grain rather than fixed sensor dust).
0= off.final - halo → bool
-
Halo overlay on/off.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- highlight → double
-
Highlight strength
0.0..1.0— a soft, warm-white dodge on the high points (nose bridge, cheekbone tops, cupid's bow, chin, brow bone).0= off.final - lipFinish → String
-
Lipstick finish:
matte,satin, orgloss. Controls the specular highlight the native pass adds —matteflattens it,glossadds a wet sheen. Defaults tosatin(natural).final - lipstick → String?
-
Lipstick hex, or null for off.
final
- lipstickOpacity → double
-
Lipstick strength,
0.0..1.0.final - lipStyle → String
-
Lipstick style:
full(uniform),ombre(deeper at the outer edge), orblurred(soft diffuse "just-bitten" stain). Defaults tofull.final - mustache → bool
-
Mustache overlay on/off.
final
- noPersonPolicy → NoPersonPolicy
-
(F.5) Policy when the person mask is empty/unavailable while blur is on.
Defaults to NoPersonPolicy.blurAll (privacy fails closed).
final
- partyHat → bool
-
Party-hat overlay on/off.
final
- poseTracking → bool
-
(WS3.2) Body-pose tracking (MediaPipe PoseLandmarker, 33 landmarks). Default
false — an optional capability with no built-in pixel effect yet; consumers
poll
VideoEffectsProcessor.poseLandmarks()(e.g. the example app's debug skeleton overlay). Costs one extra CPU detector per detection cycle when on.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- segmentationSkin → bool
-
Use MediaPipe multiclass segmentation to refine the skin region (3.2): the real
face-skin mask (floored by the landmark/face box so a weak mask never gates a darker
face off) constrains where skin effects apply. Default false — needs on-device
dark-tone IoU validation before enabling, and loads a larger/slower model.
false= off.final - skinColor → String?
-
Key of the active skin-tone preset (dual-LUT skin grade), or null for none.
See
VideoEffectsSkinTones.final - skinToneShift → double
-
Skin-tone shift (3.3), signed
-1.0..1.0: warms (+) or cools (−) the skin via a hue rotation gated by the adaptive YCbCr skin mask.0= off.final - smoothing → double
-
Skin-smoothing strength (frequency-separation / bilateral).
0= off.final - sunglasses → bool
-
Sunglasses overlay on/off.
final
- teethWhitening → double
-
Teeth-whitening strength
0.0..1.0(desaturates yellow + brightens the inner-mouth region).0= off.final - textureDetail → double
-
How much pore/skin texture the frequency-separation smoothing re-adds
(
0= fully smooth/plastic,1= keep all texture). Only matters when smoothing > 0. Default0.5.final - underEyeBrightening → double
-
Under-eye brightening
0.0..1.0(lifts the tear-trough shadow).0= off.final - vignette → double
-
Vignette strength — gently darkens the frame corners to pull focus to the
face, the near-universal finish under cinematic/aesthetic looks.
0= off.final - whitening → double
-
Whitening / brightness lift folded into the smoothing composite.
0= off.final
Methods
-
copyWith(
{bool? enabled, double? smoothing, double? whitening, Object? filterKey = _unset, double? filterIntensity, double? backgroundBlur, NoPersonPolicy? noPersonPolicy, double? backgroundDim, Object? backgroundImagePath = _unset, double? glow, double? grain, double? vignette, double? textureDetail, double? clarity, double? teethWhitening, double? eyeBrightening, double? underEyeBrightening, Object? skinColor = _unset, double? skinToneShift, bool? segmentationSkin, bool? poseTracking, Object? eyeColor = _unset, double? eyeColorOpacity, Object? lipstick = _unset, double? lipstickOpacity, String? lipFinish, String? lipStyle, Object? eyeshadow = _unset, double? eyeshadowOpacity, Object? eyeshadowColor2 = _unset, double? eyeshadowShimmer, Object? blush = _unset, double? blushOpacity, Object? brows = _unset, double? browOpacity, Object? eyeliner = _unset, double? eyelinerOpacity, String? eyelinerStyle, double? contour, double? highlight, bool? glasses, bool? crown, bool? catEars, bool? sunglasses, bool? flowerCrown, bool? partyHat, bool? bunnyEars, bool? mustache, bool? halo}) → EffectsState -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
Serialized form sent to the native pipeline over the method channel.
Numeric fields are clamped to their documented ranges (
0.0..1.0, signed fields-1.0..1.0) so out-of-range values can never reach native. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override