BufferedImageOp, Cloneablepublic class QuantizeFilter extends WholeImageFilter
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
protected static int[] |
matrix |
Floyd-Steinberg dithering matrix.
|
originalSpace, transformedSpace| 构造器 | 说明 |
|---|---|
QuantizeFilter() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
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() |
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGBfilter, transformSpacepublic 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 在类中 WholeImageFilterwidth - the image widthheight - the image heightinPixels - the image pixelstransformedSpace - the output boundsCopyright © 2019. All rights reserved.