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); }
public override void ParseFromRaw(ChunkRaw c) { if (c.Length != 13) { throw new PngjException("Bad IDHR len " + c.Length.ToString()); } MemoryStream asByteStream = c.GetAsByteStream(); Cols = PngHelperInternal.ReadInt4(asByteStream); Rows = PngHelperInternal.ReadInt4(asByteStream); Bitspc = PngHelperInternal.ReadByte(asByteStream); Colormodel = PngHelperInternal.ReadByte(asByteStream); Compmeth = PngHelperInternal.ReadByte(asByteStream); Filmeth = PngHelperInternal.ReadByte(asByteStream); Interlaced = PngHelperInternal.ReadByte(asByteStream); }