public DirectComputeFilter(IShaderFilterSettings <IShader11> settings, int threadGroupX, int threadGroupY, int threadGroupZ, params IBaseTextureFilter[] inputFilters) : base(settings, inputFilters) { ThreadGroupX = threadGroupX; ThreadGroupY = threadGroupY; ThreadGroupZ = threadGroupZ; }
public NNedi3HKernelFilter(IShaderFilterSettings <IKernel> settings, IDisposable buffer, int neuronCount, TextureSize textureSize, int[] localWorkSizes, ITextureFilter <IBaseTexture> inputFilter) : base(settings, GlobalWorkSizesHelper.Get(textureSize.Height, textureSize.Width, localWorkSizes), localWorkSizes, inputFilter) { m_Buffer = buffer; m_NeuronCount = neuronCount; m_TextureSize = textureSize; }
protected static TextureSize CalcSize(IShaderFilterSettings <T> settings, params IBaseTextureFilter[] inputFilters) { if (settings.SizeIndex < 0 || settings.SizeIndex >= inputFilters.Length || inputFilters[settings.SizeIndex] == null) { throw new IndexOutOfRangeException(string.Format("No valid input filter at index {0}", settings.SizeIndex)); } return(settings.Transform(inputFilters[settings.SizeIndex].Size())); }
protected GenericShaderFilter(IShaderFilterSettings <T> settings, params IBaseTextureFilter[] inputFilters) : base(CalcSize(settings, inputFilters), settings.Format, inputFilters) { Shader = settings.Shader; LinearSampling = settings.PerTextureLinearSampling .Concat(Enumerable.Repeat(settings.LinearSampling, inputFilters.Length - settings.PerTextureLinearSampling.Length)) .ToArray(); Args = settings.Arguments; this.AddLabel(settings.Name, 50); }
public static ITextureFilter ApplyTo <T>(this IShaderFilterSettings <T> settings, params IBaseTextureFilter[] inputFilters) where T : IShaderBase { if (settings is IShaderFilterSettings <IShader> ) { return(new ShaderFilter((IShaderFilterSettings <IShader>)settings, inputFilters)); } if (settings is IShaderFilterSettings <IShader11> ) { return(new Shader11Filter((IShaderFilterSettings <IShader11>)settings, inputFilters)); } throw new ArgumentException("Unsupported Shader type."); }
protected GenericShaderFilter(IShaderFilterSettings <T> settings, params IBaseTextureFilter[] inputFilters) : base(inputFilters) { Shader = settings.Shader; LinearSampling = settings.PerTextureLinearSampling .Concat(Enumerable.Repeat(settings.LinearSampling, inputFilters.Length - settings.PerTextureLinearSampling.Length)) .ToArray(); Transform = settings.Transform; Format = settings.Format; SizeIndex = settings.SizeIndex; if (SizeIndex < 0 || SizeIndex >= inputFilters.Length || inputFilters[SizeIndex] == null) { throw new IndexOutOfRangeException(string.Format("No valid input filter at index {0}", SizeIndex)); } Args = settings.Arguments; }
public static ITextureFilter Apply <T>(this ITextureFilter filter, IShaderFilterSettings <T> settings) where T : IShaderBase { return(settings.ApplyTo(filter)); }
public static ITextureFilter ApplyTo <T>(this IShaderFilterSettings <T> settings, IEnumerable <IBaseTextureFilter> inputFilters) where T : IShaderBase { return(settings.ApplyTo(inputFilters.ToArray())); }
protected ITextureFilter GetEwaFilter(IShaderFilterSettings <IShader> shader, ITextureFilter[] inputs) { var filters = m_Weights.Select(w => (ITextureFilter <IBaseTexture>)w.ToFilter()); return(shader.ApplyTo(inputs.Concat(filters))); }
public ClKernelFilter(IShaderFilterSettings <IKernel> settings, int[] globalWorkSizes, int[] localWorkSizes, params IBaseTextureFilter[] inputFilters) : base(settings, inputFilters) { GlobalWorkSizes = globalWorkSizes; LocalWorkSizes = localWorkSizes; }
public Shader11Filter(IShaderFilterSettings <IShader11> settings, params IBaseTextureFilter[] inputFilters) : base(settings, inputFilters) { }