/// <summary> /// Initializes a new instance of the <see cref="GifDecoderCore"/> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="options">The decoder options.</param> public GifDecoderCore(Configuration configuration, IGifDecoderOptions options) { this.TextEncoding = options.TextEncoding ?? GifConstants.DefaultEncoding; this.IgnoreMetadata = options.IgnoreMetadata; this.DecodingMode = options.DecodingMode; this.configuration = configuration ?? Configuration.Default; }
/// <inheritdoc/> public void Decode <TColor>(Image <TColor> image, Stream stream, IDecoderOptions options) where TColor : struct, IPixel <TColor> { IGifDecoderOptions gifOptions = GifDecoderOptions.Create(options); this.Decode(image, stream, gifOptions); }
/// <inheritdoc/> public Image <TPixel> Decode <TPixel>(Configuration configuration, Stream stream, IDecoderOptions options) where TPixel : struct, IPixel <TPixel> { IGifDecoderOptions gifOptions = GifDecoderOptions.Create(options); return(this.Decode <TPixel>(configuration, stream, gifOptions)); }
/// <summary> /// Initializes a new instance of the <see cref="GifDecoderCore"/> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="options">The decoder options.</param> public GifDecoderCore(Configuration configuration, IGifDecoderOptions options) { this.IgnoreMetadata = options.IgnoreMetadata; this.DecodingMode = options.DecodingMode; this.Configuration = configuration ?? Configuration.Default; }
/// <summary> /// Decodes the image from the specified stream to the <see cref="ImageBase{TPixel}"/>. /// </summary> /// <typeparam name="TPixel">The pixel format.</typeparam> /// <param name="configuration">The configuration.</param> /// <param name="stream">The <see cref="Stream"/> containing image data.</param> /// <param name="options">The options for the decoder.</param> /// <returns>The image thats been decoded.</returns> public Image <TPixel> Decode <TPixel>(Configuration configuration, Stream stream, IGifDecoderOptions options) where TPixel : struct, IPixel <TPixel> { return(new GifDecoderCore <TPixel>(options, configuration).Decode(stream)); }
/// <summary> /// Initializes a new instance of the <see cref="GifDecoderCore{TColor}"/> class. /// </summary> /// <param name="options">The decoder options.</param> public GifDecoderCore(IGifDecoderOptions options) { this.options = options ?? new GifDecoderOptions(); }
/// <summary> /// Initializes a new instance of the <see cref="GifDecoderCore{TColor}"/> class. /// </summary> /// <param name="options">The decoder options.</param> /// <param name="configuration">The configuration.</param> public GifDecoderCore(IGifDecoderOptions options, Configuration configuration) { this.options = options ?? new GifDecoderOptions(); this.configuration = configuration ?? Configuration.Default; }
/// <summary> /// Decodes the image from the specified stream to the <see cref="ImageBase{TColor}"/>. /// </summary> /// <typeparam name="TColor">The pixel format.</typeparam> /// <param name="image">The <see cref="ImageBase{TColor}"/> to decode to.</param> /// <param name="stream">The <see cref="Stream"/> containing image data.</param> /// <param name="options">The options for the decoder.</param> public void Decode <TColor>(Image <TColor> image, Stream stream, IGifDecoderOptions options) where TColor : struct, IPixel <TColor> { new GifDecoderCore <TColor>(options).Decode(image, stream); }