Struct OctreeQuantizer<TPixel>
- Namespace
- SixLabors.ImageSharp.Processing.Processors.Quantization
- Assembly
- SixLabors.ImageSharp.dll
Encapsulates methods to calculate the color palette if an image using an Octree pattern. http://msdn.microsoft.com/en-us/library/aa479306.aspx
public struct OctreeQuantizer<TPixel> : IQuantizer<TPixel>, IDisposable where TPixel : unmanaged, IPixel<TPixel>
Type Parameters
TPixel
The pixel format.
- Implements
-
IQuantizer<TPixel>
- Inherited Members
- Extension Methods
Constructors
OctreeQuantizer(Configuration, QuantizerOptions)
Initializes a new instance of the OctreeQuantizer<TPixel> struct.
public OctreeQuantizer(Configuration configuration, QuantizerOptions options)
Parameters
configuration
ConfigurationThe configuration which allows altering default behaviour or extending the library.
options
QuantizerOptionsThe quantizer options defining quantization rules.
Properties
Configuration
public readonly Configuration Configuration { get; }
Property Value
Options
public readonly QuantizerOptions Options { get; }
Property Value
Palette
public readonly ReadOnlyMemory<TPixel> Palette { get; }
Property Value
- ReadOnlyMemory<TPixel>
Methods
AddPaletteColors(Buffer2DRegion<TPixel>)
public void AddPaletteColors(Buffer2DRegion<TPixel> pixelRegion)
Parameters
pixelRegion
Buffer2DRegion<TPixel>
Dispose()
public void Dispose()
GetQuantizedColor(TPixel, out TPixel)
public readonly byte GetQuantizedColor(TPixel color, out TPixel match)
Parameters
color
TPixelmatch
TPixel
Returns
QuantizeFrame(ImageFrame<TPixel>, Rectangle)
public readonly IndexedImageFrame<TPixel> QuantizeFrame(ImageFrame<TPixel> source, Rectangle bounds)
Parameters
source
ImageFrame<TPixel>bounds
Rectangle
Returns
- IndexedImageFrame<TPixel>