/// <summary> /// Initializes a new instance of the <see cref="PngDecoderCore"/> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="options">The decoder options.</param> public PngDecoderCore(Configuration configuration, IPngDecoderOptions options) { this.configuration = configuration ?? Configuration.Default; this.memoryAllocator = this.configuration.MemoryAllocator; this.textEncoding = options.TextEncoding ?? PngConstants.DefaultEncoding; this.ignoreMetadata = options.IgnoreMetadata; }
/// <inheritdoc/> public void Decode <TColor>(Image <TColor> image, Stream stream, IDecoderOptions options) where TColor : struct, IPixel <TColor> { IPngDecoderOptions pngOptions = PngDecoderOptions.Create(options); this.Decode(image, stream, pngOptions); }
/// <inheritdoc/> public Image <TColor> Decode <TColor>(Configuration configuration, Stream stream, IDecoderOptions options) where TColor : struct, IPixel <TColor> { IPngDecoderOptions pngOptions = PngDecoderOptions.Create(options); return(this.Decode <TColor>(configuration, stream, pngOptions)); }
/// <summary> /// Initializes a new instance of the <see cref="PngDecoderCore"/> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="options">The decoder options.</param> public PngDecoderCore(Configuration configuration, IPngDecoderOptions options) { this.configuration = configuration ?? Configuration.Default; this.memoryAllocator = this.configuration.MemoryAllocator; this.ignoreMetadata = options.IgnoreMetadata; }
/// <summary> /// Decodes the image from the specified stream to the <see cref="ImageBase{TColor}"/>. /// </summary> /// <typeparam name="TColor">The pixel format.</typeparam> /// <param name="configuration">The configuration for the image.</param> /// <param name="stream">The <see cref="Stream"/> containing image data.</param> /// <param name="options">The options for the decoder.</param> /// <returns>The decoded image.</returns> public Image <TColor> Decode <TColor>(Configuration configuration, Stream stream, IPngDecoderOptions options) where TColor : struct, IPixel <TColor> { return(new PngDecoderCore(options, configuration).Decode <TColor>(stream)); }
/// <summary> /// Initializes a new instance of the <see cref="PngDecoderCore"/> class. /// </summary> /// <param name="options">The decoder options.</param> /// <param name="configuration">The configuration.</param> public PngDecoderCore(IPngDecoderOptions options, Configuration configuration) { this.configuration = configuration ?? Configuration.Default; this.options = options ?? new PngDecoderOptions(); }
/// <summary> /// Initializes a new instance of the <see cref="PngDecoderCore"/> class. /// </summary> /// <param name="options">The decoder options.</param> public PngDecoderCore(IPngDecoderOptions options) { this.options = options ?? new PngDecoderOptions(); }
/// <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, IPngDecoderOptions options) where TColor : struct, IPixel <TColor> { new PngDecoderCore(options).Decode(image, stream); }