Exemplo n.º 1
0
 public override void WriteByte(byte value)
 {
     if (!initdone)
     {
         doInit();
     }
     if (deflateStream == null)
     {
         initStream();
     }
     base.WriteByte(value);
     adler32.Update(value);
 }
        void UnfilterRow(int nbytes)
        {
            int        ftn        = rowbfilter[0];
            FilterType filterType = (FilterType)ftn;

            switch (filterType)
            {
            case Pngcs.FilterType.FILTER_NONE:        UnfilterRowNone(nbytes);              break;

            case Pngcs.FilterType.FILTER_SUB:          UnfilterRowSub(nbytes);               break;

            case Pngcs.FilterType.FILTER_UP:                UnfilterRowUp(nbytes);            break;

            case Pngcs.FilterType.FILTER_AVERAGE:   UnfilterRowAverage(nbytes);      break;

            case Pngcs.FilterType.FILTER_PAETH:      UnfilterRowPaeth(nbytes);         break;

            default:                                                                throw new IO.IOException($"Filter type {ftn} not implemented");
            }
            if (crctest != null)
            {
                crctest.Update(rowb, 1, nbytes);
            }
        }