|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.twelvemonkeys.image.DiffusionDither
public class DiffusionDither
This BufferedImageOp/RasterOp implements basic
Floyd-Steinberg error-diffusion algorithm for dithering.
| X | 7/16 | |
| 3/16 | 5/16 | 1/16 |
| Field Summary | |
|---|---|
protected IndexColorModel |
indexColorModel
|
| Constructor Summary | |
|---|---|
DiffusionDither()
Creates a DiffusionDither, with no fixed
IndexColorModel. |
|
DiffusionDither(IndexColorModel pICM)
Creates a DiffusionDither, using the given
IndexColorModel for dithering into. |
|
| Method Summary | |
|---|---|
BufferedImage |
createCompatibleDestImage(BufferedImage pSource,
ColorModel pDestCM)
Creates a compatible BufferedImage to dither into. |
WritableRaster |
createCompatibleDestRaster(Raster pSrc)
Creates a compatible Raster to dither into. |
WritableRaster |
createCompatibleDestRaster(Raster pSrc,
IndexColorModel pIndexColorModel)
Creates a compatible Raster to dither into. |
BufferedImage |
filter(BufferedImage pSource,
BufferedImage pDest)
Performs a single-input/single-output dither operation, applying basic Floyd-Steinberg error-diffusion to the image. |
WritableRaster |
filter(Raster pSource,
WritableRaster pDest)
Performs a single-input/single-output dither operation, applying basic Floyd-Steinberg error-diffusion to the image. |
WritableRaster |
filter(Raster pSource,
WritableRaster pDest,
IndexColorModel pColorModel)
Performs a single-input/single-output dither operation, applying basic Floyd-Steinberg error-diffusion to the image. |
Rectangle2D |
getBounds2D(BufferedImage pSrc)
Returns the bounding box of the filtered destination image. |
Rectangle2D |
getBounds2D(Raster pSrc)
Returns the bounding box of the filtered destination Raster. |
Point2D |
getPoint2D(Point2D pSrcPt,
Point2D pDstPt)
Returns the location of the destination point given a point in the source. |
RenderingHints |
getRenderingHints()
Returns the rendering mHints for this op. |
void |
setAlternateScans(boolean pUse)
Sets the scan mode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final IndexColorModel indexColorModel
| Constructor Detail |
|---|
public DiffusionDither(IndexColorModel pICM)
DiffusionDither, using the given
IndexColorModel for dithering into.
pICM - an IndexColorModel.public DiffusionDither()
DiffusionDither, with no fixed
IndexColorModel. The color model will be generated for each
filtering, unless the destination image already has an
IndexColorModel.
| Method Detail |
|---|
public void setAlternateScans(boolean pUse)
true.
pUse - true if scan mode should be alternating left/right
public final BufferedImage createCompatibleDestImage(BufferedImage pSource,
ColorModel pDestCM)
BufferedImage to dither into.
Only IndexColorModel allowed.
createCompatibleDestImage in interface BufferedImageOpBufferedImage
ImageFilterException - if pDestCM is not null or
an instance of IndexColorModel.public final WritableRaster createCompatibleDestRaster(Raster pSrc)
Raster to dither into.
Only IndexColorModel allowed.
createCompatibleDestRaster in interface RasterOppSrc - the source raster
WritableRaster
public final WritableRaster createCompatibleDestRaster(Raster pSrc,
IndexColorModel pIndexColorModel)
Raster to dither into.
pSrc - the source raster.pIndexColorModel - the index color model used to create a Raster.
WritableRasterpublic final Rectangle2D getBounds2D(BufferedImage pSrc)
getBounds2D in interface BufferedImageOppSrc - the BufferedImage to be filtered
public final Rectangle2D getBounds2D(Raster pSrc)
getBounds2D in interface RasterOppSrc - the Raster to be filtered
Raster.
public final Point2D getPoint2D(Point2D pSrcPt,
Point2D pDstPt)
dstPt is not
null, it will be used to hold the return value.
Since this is not a geometric operation, the srcPt
will equal the dstPt.
getPoint2D in interface BufferedImageOpgetPoint2D in interface RasterOppSrcPt - a Point2D that represents a point
in the source imagepDstPt - a Point2Dthat represents the location
in the destination
Point2D in the destination that
corresponds to the specified point in the source.public final RenderingHints getRenderingHints()
getRenderingHints in interface BufferedImageOpgetRenderingHints in interface RasterOpRenderingHints object associated
with this op.
public final BufferedImage filter(BufferedImage pSource,
BufferedImage pDest)
filter in interface BufferedImageOppSource - the source imagepDest - the destination image
pDest was
null.
public final WritableRaster filter(Raster pSource,
WritableRaster pDest)
filter in interface RasterOppSource - the source raster, assumed to be in sRGBpDest - the destination raster, may be null
pDest was
null.
public final WritableRaster filter(Raster pSource,
WritableRaster pDest,
IndexColorModel pColorModel)
pSource - the source raster, assumed to be in sRGBpDest - the destination raster, may be nullpColorModel - the indexed color model to use
pDest was
null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||