public override void ParseFromRaw(ChunkRaw chunk)
 {
     if (chunk.Len != 13)
     {
         throw new System.Exception($"Bad IDHR len {chunk.Len}");
     }
     IO.MemoryStream stream = chunk.GetAsByteStream();
     Cols = PngHelperInternal.ReadInt4(stream);
     Rows = PngHelperInternal.ReadInt4(stream);
     // bit depth: number of bits per channel
     Bitspc     = PngHelperInternal.ReadByte(stream);
     Colormodel = PngHelperInternal.ReadByte(stream);
     Compmeth   = PngHelperInternal.ReadByte(stream);
     Filmeth    = PngHelperInternal.ReadByte(stream);
     Interlaced = PngHelperInternal.ReadByte(stream);
 }
예제 #2
0
        public override void ParseFromRaw(ChunkRaw c)
        {
            if (c.Len != 13)
            {
                throw new PngjException("Bad IDHR len " + c.Len);
            }
            MemoryStream st = c.GetAsByteStream();

            Cols = Pngcs.PngHelperInternal.ReadInt4(st);
            Rows = Pngcs.PngHelperInternal.ReadInt4(st);
            // bit depth: number of bits per channel
            Bitspc     = Pngcs.PngHelperInternal.ReadByte(st);
            Colormodel = Pngcs.PngHelperInternal.ReadByte(st);
            Compmeth   = Pngcs.PngHelperInternal.ReadByte(st);
            Filmeth    = Pngcs.PngHelperInternal.ReadByte(st);
            Interlaced = Pngcs.PngHelperInternal.ReadByte(st);
        }