PeachImage
PeachImage.ImageInfo
ImageInfo.GetRequiredBufferSize(DecoderOptions, int) Method
The bytes DecodeInto(ReadOnlySpan<byte>, Span<byte>, ImageMetadata, int) needs for this image (as Identify(Stream, DecoderOptions) reported it) under options, which set the scale, orientation and pixel format of the output. Rows sit rowStride bytes apart, 0 meaning tightly packed; the last row needs no padding.
public int GetRequiredBufferSize(PeachImage.DecoderOptions? options=null, int rowStride=0);
Parameters
options DecoderOptions
rowStride System.Int32
Returns
Exceptions
System.ArgumentOutOfRangeException
rowStride is negative.
System.ArgumentException
rowStride is less than one row, or the image is too large for a buffer.