Esempio n. 1
0
        internal static async Task <GifImageData> ReadAsync(Stream stream)
        {
            var imgData = new GifImageData();
            await imgData.ReadInternalAsync(stream).ConfigureAwait(false);

            return(imgData);
        }
Esempio n. 2
0
        private async Task ReadInternalAsync(Stream stream, IEnumerable <GifExtension> controlExtensions)
        {
            this.Descriptor = await GifImageDescriptor.ReadAsync(stream).ConfigureAwait(false);

            if (this.Descriptor.HasLocalColorTable)
            {
                this.LocalColorTable = await GifHelpers.ReadColorTableAsync(stream, this.Descriptor.LocalColorTableSize).ConfigureAwait(false);
            }
            this.ImageData = await GifImageData.ReadAsync(stream).ConfigureAwait(false);

            this.Extensions     = (IList <GifExtension>)controlExtensions.ToList <GifExtension>().AsReadOnly();
            this.GraphicControl = this.Extensions.OfType <GifGraphicControlExtension>().FirstOrDefault <GifGraphicControlExtension>();
        }
Esempio n. 3
0
        private async Task ReadInternalAsync(Stream stream, IEnumerable <GifExtension> controlExtensions)
        {
            // Note: at this point, the Image Separator (0x2C) has already been read

            Descriptor = await GifImageDescriptor.ReadAsync(stream).ConfigureAwait(false);

            if (Descriptor.HasLocalColorTable)
            {
                LocalColorTable = await GifHelpers.ReadColorTableAsync(stream, Descriptor.LocalColorTableSize).ConfigureAwait(false);
            }
            ImageData = await GifImageData.ReadAsync(stream).ConfigureAwait(false);

            Extensions     = controlExtensions.ToList().AsReadOnly();
            GraphicControl = Extensions.OfType <GifGraphicControlExtension>().FirstOrDefault();
        }
Esempio n. 4
0
 internal static async Task<GifImageData> ReadAsync(Stream stream)
 {
     var imgData = new GifImageData();
     await imgData.ReadInternalAsync(stream).ConfigureAwait(false);
     return imgData;
 }