IQuantizingSession Interface

Represents a disposable quantizing session returned by the IQuantizer.Initialize method that is used to quantize (reduce the colors) of a specific IReadableBitmapData source.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
C#
public interface IQuantizingSession : IDisposable
Implements
IDisposable

Properties

AlphaThreshold If this IQuantizingSession can produce transparent pixels, then gets the alpha threshold value that can be used to determine whether a color with alpha should be considered transparent or should be blended with BackColor.
BackColor Gets the background color for this IQuantizingSession. When the GetQuantizedColor is called with a color with alpha, which is considered opaque, then it will be blended with this color before quantizing.
See also the Remarks section of the AlphaThreshold property for details.
IsGrayscale Gets whether this IQuantizingSession works with grayscale colors. Its value may help to optimize the processing in some cases but it is allowed to return always .
Default value if not implemented: . (Only in .NET Core 3.0/.NET Standard 2.1 and above. In earlier targeted frameworks this member must be implemented.)
Palette Gets the palette containing the colors of the quantized result. Expected to be called if the target of the quantization is indexed. Typical indexed pixel formats contain no more than 256 colors; however, it is allowed to return a bigger Palette. If the corresponding IQuantizer returns a non-indexed pixel format in its PixelFormatHint property, then this property can return .
WorkingColorSpace Gets the preferred working color space of this IQuantizingSession instance. If this quantizing session is used by a ditherer, then IDitheringSession implementations may also respect the value of this property.
Default value if not implemented: Default. (Only in .NET Core 3.0/.NET Standard 2.1 and above. In earlier targeted frameworks this member must be implemented.)

Methods

GetQuantizedColor Gets the quantized color of the specified origColor. If Palette property has non- return value, then the result color must be a valid Palette entry.
See also the Remarks section of the AlphaThreshold property for details.

See Also