mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
621 B
22 lines
621 B
using System.Globalization; |
|
using ErsatzTV.FFmpeg.State; |
|
|
|
namespace ErsatzTV.FFmpeg.Filter; |
|
|
|
public class WatermarkOpacityFilter : BaseFilter |
|
{ |
|
private readonly WatermarkState _desiredState; |
|
|
|
public WatermarkOpacityFilter(WatermarkState desiredState) => _desiredState = desiredState; |
|
|
|
public override string Filter |
|
{ |
|
get |
|
{ |
|
double opacity = _desiredState.Opacity / 100.0; |
|
return $"colorchannelmixer=aa={opacity.ToString("F2", NumberFormatInfo.InvariantInfo)}"; |
|
} |
|
} |
|
|
|
public override FrameState NextState(FrameState currentState) => currentState; |
|
}
|
|
|