QuantizeFilter Class
Rounds the colors multiplied by their alpha (premultiplied) and the alpha to a number of bits per sample, as a texture of that depth holds them: the last filter of a chain gives the result of a filter a browser draws on an 8-bit premultiplied texture.
public sealed class QuantizeFilter : FilterRemarks
Each value v of a pixel, a fraction of one, becomes floor(M v + 1/2) / M, with M = 2^n - 1: the colors are rounded multiplied by the alpha, so a color is kept with the precision its alpha leaves it. The result is then written to the samples of the layer as any filter result is (Filter): a layer of 8 bits per sample gets the straight color closest to the rounded value, and a layer of 16 bits per sample keeps it nearly exactly.
- Inheritance
FilterQuantizeFilter
Constructors
| Name | Description |
|---|---|
| QuantizeFilter(int) | Initializes a new instance of the QuantizeFilter class. |
QuantizeFilter(int)
QuantizeFilter.csInitializes a new instance of the QuantizeFilter class.
public QuantizeFilter(int bitsPerSample)Parameters
bitsPerSampleint- The number of bits per sample of the values. Must be between 1 and 16.
Exceptions
ArgumentOutOfRangeExceptionbitsPerSampleis not between 1 and 16.
Properties
| Name | Description |
|---|---|
| BitsPerSample | Gets the number of bits per sample of the values. |