コード例 #1
0
 /// <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;
 }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
        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();
                }
            }
        }
コード例 #4
0
ファイル: BmpDecoder.cs プロジェクト: jsantosc/ImageSharp
 public Image <TPixel> Decode <TPixel>(Configuration configuration, SpanUnmanagedArray <byte> stream)
     where TPixel : struct, IPixel <TPixel>
 {
     throw new NotImplementedException();
 }