Exemplo n.º 1
0
        public MemoryFilterProvider(IDecodeParameterResolver decodeParameterResolver, IPngPredictor pngPredictor, ILog log)
        {
            IFilter Ascii85Func() => new Ascii85Filter();
            IFilter AsciiHexFunc() => new AsciiHexDecodeFilter();
            IFilter FlateFunc() => new FlateFilter(decodeParameterResolver, pngPredictor, log);
            IFilter RunLengthFunc() => new RunLengthFilter();

            filterFactories = new Dictionary <CosName, Func <IFilter> >
            {
                { CosName.ASCII85_DECODE, Ascii85Func },
                { CosName.ASCII85_DECODE_ABBREVIATION, Ascii85Func },
                { CosName.ASCII_HEX_DECODE, AsciiHexFunc },
                { CosName.ASCII_HEX_DECODE_ABBREVIATION, AsciiHexFunc },
                { CosName.FLATE_DECODE, FlateFunc },
                { CosName.FLATE_DECODE_ABBREVIATION, FlateFunc },
                { CosName.RUN_LENGTH_DECODE, RunLengthFunc },
                { CosName.RUN_LENGTH_DECODE_ABBREVIATION, RunLengthFunc }
            };
        }
Exemplo n.º 2
0
        public MemoryFilterProvider(IDecodeParameterResolver decodeParameterResolver, IPngPredictor pngPredictor, ILog log)
        {
            var ascii85   = new Ascii85Filter();
            var asciiHex  = new AsciiHexDecodeFilter();
            var flate     = new FlateFilter(decodeParameterResolver, pngPredictor, log);
            var runLength = new RunLengthFilter();
            var lzw       = new LzwFilter(decodeParameterResolver, pngPredictor);

            filterInstances = new Dictionary <string, IFilter>
            {
                { NameToken.Ascii85Decode.Data, ascii85 },
                { NameToken.Ascii85DecodeAbbreviation.Data, ascii85 },
                { NameToken.AsciiHexDecode.Data, asciiHex },
                { NameToken.AsciiHexDecodeAbbreviation.Data, asciiHex },
                { NameToken.FlateDecode.Data, flate },
                { NameToken.FlateDecodeAbbreviation.Data, flate },
                { NameToken.RunLengthDecode.Data, runLength },
                { NameToken.RunLengthDecodeAbbreviation.Data, runLength },
                { NameToken.LzwDecode, lzw },
                { NameToken.LzwDecodeAbbreviation, lzw }
            };
        }
Exemplo n.º 3
0
 public LzwFilter(IDecodeParameterResolver decodeParameterResolver, IPngPredictor pngPredictor)
 {
     this.decodeParameterResolver = decodeParameterResolver ?? throw new ArgumentNullException(nameof(decodeParameterResolver));
     this.pngPredictor            = pngPredictor ?? throw new ArgumentNullException(nameof(pngPredictor));
 }
Exemplo n.º 4
0
        public MemoryFilterProvider(IDecodeParameterResolver decodeParameterResolver, IPngPredictor pngPredictor, ILog log)
        {
            IFilter Ascii85Func() => new Ascii85Filter();
            IFilter AsciiHexFunc() => new AsciiHexDecodeFilter();
            IFilter FlateFunc() => new FlateFilter(decodeParameterResolver, pngPredictor, log);
            IFilter RunLengthFunc() => new RunLengthFilter();
            IFilter LzwFunc() => new LzwFilter(decodeParameterResolver, pngPredictor);

            filterFactories = new Dictionary <string, Func <IFilter> >
            {
                { NameToken.Ascii85Decode.Data, Ascii85Func },
                { NameToken.Ascii85DecodeAbbreviation.Data, Ascii85Func },
                { NameToken.AsciiHexDecode.Data, AsciiHexFunc },
                { NameToken.AsciiHexDecodeAbbreviation.Data, AsciiHexFunc },
                { NameToken.FlateDecode.Data, FlateFunc },
                { NameToken.FlateDecodeAbbreviation.Data, FlateFunc },
                { NameToken.RunLengthDecode.Data, RunLengthFunc },
                { NameToken.RunLengthDecodeAbbreviation.Data, RunLengthFunc },
                { NameToken.LzwDecode, LzwFunc },
                { NameToken.LzwDecodeAbbreviation, LzwFunc }
            };
        }
Exemplo n.º 5
0
 public FlateFilter(IDecodeParameterResolver decodeParameterResolver, IPngPredictor pngPredictor, ILog log)
 {
     this.decodeParameterResolver = decodeParameterResolver;
     this.pngPredictor            = pngPredictor;
     this.log = log;
 }