/// <summary> /// Initializes a new instance of the <see cref="InputProcessor"/> struct. /// </summary> /// <param name="inputStream">The input <see cref="Stream"/></param> /// <param name="temp">Temporal buffer, same as <see cref="JpegDecoderCore.Temp"/></param> public SpanInputProcessor(SpanUnmanagedArray <byte> inputStream) { this.Bits = default(Bits); this.Bytes = Bytes.Create(); this.InputStream = inputStream; this.UnexpectedEndOfStreamReached = false; }
public Image <TPixel> Decode <TPixel>(Configuration configuration, SpanUnmanagedArray <byte> stream) where TPixel : struct, IPixel <TPixel> { Guard.NotNull(stream, "stream"); using (var decoder = new JpegDecoderCoreUnmanaged(configuration, this)) { return(decoder.Decode <TPixel>(stream)); } }
public void SpanDecodeFormat() { int pixels = 0; var spanMemory = SpanUnmanagedArray <byte> .FromByteArray(this._jpegBytes); for (int i = 0; i < Loops; ++i) { var format = Image.DetectFormat(spanMemory); if (format == null) { throw new Exception(); } } }
public Image <TPixel> Decode <TPixel>(Configuration configuration, SpanUnmanagedArray <byte> stream) where TPixel : struct, IPixel <TPixel> { throw new NotImplementedException(); }