Exemple #1
0
 public DirectComputeFilter(IShaderFilterSettings <IShader11> settings, int threadGroupX, int threadGroupY,
                            int threadGroupZ, params IBaseTextureFilter[] inputFilters)
     : base(settings, inputFilters)
 {
     ThreadGroupX = threadGroupX;
     ThreadGroupY = threadGroupY;
     ThreadGroupZ = threadGroupZ;
 }
Exemple #2
0
 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;
 }
Exemple #3
0
        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()));
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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.");
        }
Exemple #6
0
        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;
        }
Exemple #7
0
 public static ITextureFilter Apply <T>(this ITextureFilter filter, IShaderFilterSettings <T> settings)
     where T : IShaderBase
 {
     return(settings.ApplyTo(filter));
 }
Exemple #8
0
 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)));
            }
Exemple #10
0
 public ClKernelFilter(IShaderFilterSettings <IKernel> settings, int[] globalWorkSizes, int[] localWorkSizes, params IBaseTextureFilter[] inputFilters)
     : base(settings, inputFilters)
 {
     GlobalWorkSizes = globalWorkSizes;
     LocalWorkSizes  = localWorkSizes;
 }
Exemple #11
0
 public Shader11Filter(IShaderFilterSettings <IShader11> settings, params IBaseTextureFilter[] inputFilters)
     : base(settings, inputFilters)
 {
 }