* fix validation in new form layout * pin mediatr to last oss version * update dependencies * cleanup code in core * cleanup code in ffmpeg * cleanup code in infra * cleanup code in scanner * cleanup code in application * cleanup main code * cleanup test code * solution-wide code cleanup
24 lines
696 B
C#
24 lines
696 B
C#
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
|
|
$"format=yuva420p|yuva444p|yuva422p|rgba|abgr|bgra|gbrap|ya8,colorchannelmixer=aa={opacity.ToString("F2", NumberFormatInfo.InvariantInfo)}";
|
|
}
|
|
}
|
|
|
|
public override FrameState NextState(FrameState currentState) => currentState;
|
|
}
|