mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
735 B
20 lines
735 B
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
using SixLabors.ImageSharp.Formats.Png;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;
|
|
|
|
/// <summary>
|
|
/// A Png encoder that uses the ImageSharp core encoder but the default configuration.
|
|
/// This allows encoding under environments with restricted memory.
|
|
/// </summary>
|
|
public sealed class ImageSharpPngEncoderWithDefaultConfiguration : PngEncoder
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken)
|
|
{
|
|
using PngEncoderCore encoder = new(Configuration.Default, this);
|
|
encoder.Encode(image, stream, cancellationToken);
|
|
}
|
|
}
|
|
|