Method | Description | |
---|---|---|
Quantize ( Image source ) : |
Quantize an image and return the resulting output bitmap.
|
Method | Description | |
---|---|---|
FirstPass ( |
Execute the first pass through the pixels in the image.
|
|
GetPalette ( System.Drawing.Imaging.ColorPalette original ) : System.Drawing.Imaging.ColorPalette |
Retrieve the palette for the quantized image.
|
|
InitialQuantizePixel ( Color32 pixel ) : void |
Override this to process the pixel in the first pass of the algorithm. This function need only be overridden if your quantize algorithm needs two passes, such as an Octree quantizer. |
|
QuantizePixel ( Color32 pixel ) : byte |
Override this to process the pixel in the second pass of the algorithm.
|
|
Quantizer ( bool singlePass ) : System |
Construct the quantizer. If you construct this class with a true value for singlePass, then the code will, when quantizing your image, only call the 'QuantizeImage' function. If two passes are required, the code will call 'InitialQuantizeImage' and then 'QuantizeImage'. |
|
SecondPass ( |
Execute a second pass through the bitmap.
|
protected FirstPass ( |
||
sourceData | The source data. | |
width | int | The width in pixels of the image. |
height | int | The height in pixels of the image. |
return | void |
protected abstract GetPalette ( System.Drawing.Imaging.ColorPalette original ) : System.Drawing.Imaging.ColorPalette | ||
original | System.Drawing.Imaging.ColorPalette | Any old palette, this is overwritten. |
return | System.Drawing.Imaging.ColorPalette |
protected InitialQuantizePixel ( Color32 pixel ) : void | ||
pixel | Color32 | The pixel to quantize. |
return | void |
public Quantize ( Image source ) : |
||
source | Image | The image to quantize. |
return |
protected abstract QuantizePixel ( Color32 pixel ) : byte | ||
pixel | Color32 | The pixel to quantize. |
return | byte |
protected Quantizer ( bool singlePass ) : System | ||
singlePass | bool | If true, the quantization only needs to loop through the source pixels once. |
return | System |
protected SecondPass ( |
||
sourceData | The source bitmap, locked into memory. | |
output | The output bitmap. | |
width | int | The width in pixels of the image. |
height | int | The height in pixels of the image. |
bounds | The bounding rectangle. | |
return | void |