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.
37 lines
1.4 KiB
37 lines
1.4 KiB
// Copyright (c) Six Labors and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
using System;
|
|
using SixLabors.ImageSharp.PixelFormats;
|
|
using SixLabors.ImageSharp.Processing.Processors.Dithering;
|
|
|
|
namespace SixLabors.ImageSharp.Processing.Processors.Quantization
|
|
{
|
|
/// <summary>
|
|
/// Provides methods to allow the execution of the quantization process on an image frame.
|
|
/// </summary>
|
|
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|
public interface IFrameQuantizer<TPixel> : IDisposable
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
/// <summary>
|
|
/// Gets a value indicating whether to apply dithering to the output image.
|
|
/// </summary>
|
|
bool DoDither { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the algorithm to apply to the output image.
|
|
/// </summary>
|
|
IDither Dither { get; }
|
|
|
|
/// <summary>
|
|
/// Quantize an image frame and return the resulting output pixels.
|
|
/// </summary>
|
|
/// <param name="source">The image to quantize.</param>
|
|
/// <param name="bounds">The bounds within the source image to quantize.</param>
|
|
/// <returns>
|
|
/// A <see cref="QuantizedFrame{TPixel}"/> representing a quantized version of the source image pixels.
|
|
/// </returns>
|
|
IQuantizedFrame<TPixel> QuantizeFrame(ImageFrame<TPixel> source, Rectangle bounds);
|
|
}
|
|
}
|
|
|