/// <summary> /// Initializes a new instance of the <see cref="AvifReader"/> class. /// </summary> /// <param name="parser">The parser.</param> /// <exception cref="ArgumentNullException"><paramref name="input"/> is null.</exception> public AvifReader(Stream input, bool leaveOpen, IByteArrayPool arrayPool) { if (input is null) { ExceptionUtil.ThrowArgumentNullException(nameof(input)); } // The parser is initialized first because it will throw an exception // if the AVIF file is invalid or not supported. this.parser = new AvifParser(input, leaveOpen, arrayPool); this.primaryItemId = this.parser.GetPrimaryItemId(); this.alphaItemId = this.parser.GetAlphaItemId(this.primaryItemId); this.colorInfoBox = this.parser.TryGetColorInfoBox(this.primaryItemId); this.parser.GetTransformationProperties(this.primaryItemId, out this.cleanApertureBox, out this.imageRotateBox, out this.imageMirrorBox); this.colorGridInfo = this.parser.TryGetImageGridInfo(this.primaryItemId); if (this.alphaItemId != 0) { this.alphaGridInfo = this.parser.TryGetImageGridInfo(this.alphaItemId); } else { this.alphaGridInfo = null; } }
public AvifParserDebugView(AvifParser parser) { this.parser = parser; }