public class QuantizeFilter extends WholeImageFilter
| Modifier and Type | Field and Description |
|---|---|
protected static int[] |
matrix
Floyd-Steinberg dithering matrix.
|
originalSpace, transformedSpacefilterListener| Constructor and Description |
|---|
QuantizeFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected int[] |
filterPixels(int width,
int height,
int[] inPixels,
Rectangle transformedSpace)
Actually filter the pixels.
|
boolean |
getDither()
Return the dithering setting
|
int |
getNumColors()
Get the number of colors to quantize to.
|
boolean |
getSerpentine()
Return the serpentine setting
|
void |
quantize(int[] inPixels,
int[] outPixels,
int width,
int height,
int numColors,
boolean dither,
boolean serpentine) |
void |
setDither(boolean dither)
Set whether to use dithering or not.
|
void |
setNumColors(int numColors)
Set the number of colors to quantize to.
|
void |
setSerpentine(boolean serpentine)
Set whether to use a serpentine pattern for return or not.
|
String |
toString() |
filter, transformSpaceclone, createCompatibleDestImage, createCompatibleDestImage, filterDone, filterInitialize, filterProgress, filterStart, getBounds2D, getMetaData, getPoint2D, getRenderingHints, getRGB, setFilterListener, setRGBpublic void setNumColors(int numColors)
numColors - the number of colors. The default is 256.public int getNumColors()
public void setDither(boolean dither)
dither - true to use ditheringpublic boolean getDither()
public void setSerpentine(boolean serpentine)
serpentine - true to use serpentine patternpublic boolean getSerpentine()
public void quantize(int[] inPixels,
int[] outPixels,
int width,
int height,
int numColors,
boolean dither,
boolean serpentine)
protected int[] filterPixels(int width,
int height,
int[] inPixels,
Rectangle transformedSpace)
WholeImageFilterfilterPixels in class WholeImageFilterwidth - the image widthheight - the image heightinPixels - the image pixelstransformedSpace - the output boundsCopyright © 2012-2013 Bambi Software Foundation. All Rights Reserved.