Esempio n. 1
0
        /// <param name="fadeInTime">
        /// Values below <see cref="MinimumFadeTime"/> will be increased to <see cref="MinimumFadeTime"/>
        /// (see	<see cref="MinimumFadeTime"/> for why).
        /// <para/>
        /// Values below zero will cause an error.
        /// </param>
        /// <param name="fadeOutTime">
        /// Values below <see cref="MinimumFadeTime"/> will be increased to <see cref="MinimumFadeTime"/>
        /// (see	<see cref="MinimumFadeTime"/> for why).
        /// <para/>
        /// Values below zero will cause an error.
        /// </param>
        public Glow(
            GlowType glowType,
            double fadeInTime  = 0.05,
            double fadeOutTime = 0.2,
            double x           = 0.5,
            double y           = 0.5,
            double scaleX      = 1,
            double scaleY      = 1,
            double rotateAngle = 0,
            FFmpegColorChannelMixer colorMixer = null
            )
        {
            ErrorUtils.ThrowIfArgNull(glowType, nameof(glowType));
            ErrorUtils.ThrowIfArgLessThan(fadeInTime, 0, nameof(fadeInTime));
            ErrorUtils.ThrowIfArgLessThan(fadeOutTime, 0, nameof(fadeOutTime));

            this.GlowType    = glowType;
            this.FadeInTime  = Math.Max(fadeInTime, MinimumFadeTime);
            this.FadeOutTime = Math.Max(fadeOutTime, MinimumFadeTime);
            this.X           = x;
            this.Y           = y;
            this.ScaleX      = scaleX;
            this.ScaleY      = scaleY;
            this.RotateAngle = rotateAngle;
            this.ColorMixer  = colorMixer;
        }
Esempio n. 2
0
 public Glow With(
     GlowType glowType  = null,
     double?fadeInTime  = null,
     double?fadeOutTime = null,
     double?x           = null,
     double?y           = null,
     double?scaleX      = null,
     double?scaleY      = null,
     double?rotateAngle = null,
     FFmpegColorChannelMixer colorMixer = null
     )
 {
     return(new Glow(
                glowType: glowType ?? this.GlowType,
                fadeInTime: fadeInTime ?? this.FadeInTime,
                fadeOutTime: fadeOutTime ?? this.FadeOutTime,
                x: x ?? this.X,
                y: y ?? this.Y,
                scaleX: scaleX ?? this.ScaleX,
                scaleY: scaleY ?? this.ScaleY,
                rotateAngle: rotateAngle ?? this.RotateAngle,
                colorMixer: colorMixer ?? this.ColorMixer
                ));
 }
Esempio n. 3
0
 public static bool Equals(GlowType a, GlowType b) => a?.File.FullName == b?.File.FullName;