public abstract class ConvolveFilter extends AbstractBufferedImageOp implements DynFiltering
Modifier and Type | Field and Description |
---|---|
static int |
CLAMP_EDGES
Clamp pixels off the edge to the nearest edge.
|
static int |
WRAP_EDGES
Wrap pixels off the edge to the opposite edge.
|
static int |
ZERO_EDGES
Treat pixels off the edge as zero.
|
Constructor and Description |
---|
ConvolveFilter()
Construct a filter with a null kernel.
|
ConvolveFilter(float[] matrix)
Construct a filter with the given 3x3 kernel.
|
ConvolveFilter(int rows,
int cols,
float[] matrix)
Construct a filter with the given kernel.
|
ConvolveFilter(Kernel kernel)
Construct a filter with the given 3x3 kernel.
|
Modifier and Type | Method and Description |
---|---|
static void |
convolve(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)
Convolve a block of pixels.
|
static void |
convolve(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
int edgeAction)
Convolve a block of pixels.
|
static void |
convolveH(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)
Convolve with a kernel consisting of one row.
|
static void |
convolveHV(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)
Convolve with a 2D kernel.
|
static void |
convolveV(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)
Convolve with a kernel consisting of one column.
|
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel dstCM) |
BufferedImage |
filter(BufferedImage src,
BufferedImage dst) |
BufferedImage |
filter(BufferedImage src,
Struct parameters) |
Rectangle2D |
getBounds2D(BufferedImage src) |
int |
getEdgeAction()
Get the action to perfomr for pixels off the image edges.
|
Kernel |
getKernel()
Get the convolution kernel.
|
Point2D |
getPoint2D(Point2D srcPt,
Point2D dstPt) |
boolean |
getPremultiplyAlpha()
Get whether to premultiply the alpha channel.
|
RenderingHints |
getRenderingHints() |
boolean |
getUseAlpha()
Get whether to convolve the alpha channel.
|
void |
setEdgeAction(String edgeAction)
Set the action to perfomr for pixels off the image edges.
|
void |
setKernel(Kernel kernel)
Set the convolution kernel.
|
void |
setPremultiplyAlpha(boolean premultiplyAlpha)
Set whether to premultiply the alpha channel.
|
void |
setUseAlpha(boolean useAlpha)
Set whether to convolve the alpha channel.
|
String |
toString() |
clone, getRGB, setRGB
public static final int ZERO_EDGES
public static final int CLAMP_EDGES
public static final int WRAP_EDGES
public ConvolveFilter()
public ConvolveFilter(float[] matrix)
matrix
- an array of 9 floats containing the kernelpublic ConvolveFilter(int rows, int cols, float[] matrix)
rows
- the number of rows in the kernelcols
- the number of columns in the kernelmatrix
- an array of rows*cols floats containing the kernelpublic ConvolveFilter(Kernel kernel)
kernel
- the convolution kernelpublic void setKernel(Kernel kernel)
kernel
- the kernelgetKernel()
public Kernel getKernel()
setKernel(java.awt.image.Kernel)
public void setEdgeAction(String edgeAction) throws ExpressionException
edgeAction
- the actionExpressionException
public int getEdgeAction()
setEdgeAction(java.lang.String)
public void setUseAlpha(boolean useAlpha)
useAlpha
- true to convolve the alphagetUseAlpha()
public boolean getUseAlpha()
setUseAlpha(boolean)
public void setPremultiplyAlpha(boolean premultiplyAlpha)
premultiplyAlpha
- true to premultiply the alphagetPremultiplyAlpha()
public boolean getPremultiplyAlpha()
setPremultiplyAlpha(boolean)
public BufferedImage filter(BufferedImage src, BufferedImage dst)
filter
in interface BufferedImageOp
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM)
createCompatibleDestImage
in interface BufferedImageOp
createCompatibleDestImage
in class AbstractBufferedImageOp
public Rectangle2D getBounds2D(BufferedImage src)
getBounds2D
in interface BufferedImageOp
getBounds2D
in class AbstractBufferedImageOp
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
getPoint2D
in interface BufferedImageOp
getPoint2D
in class AbstractBufferedImageOp
public RenderingHints getRenderingHints()
getRenderingHints
in interface BufferedImageOp
getRenderingHints
in class AbstractBufferedImageOp
public static void convolve(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, int edgeAction)
kernel
- the kernelinPixels
- the input pixelsoutPixels
- the output pixelswidth
- the widthheight
- the heightedgeAction
- what to do at the edgespublic static void convolve(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel
- the kernelinPixels
- the input pixelsoutPixels
- the output pixelswidth
- the widthheight
- the heightalpha
- include alpha channeledgeAction
- what to do at the edgespublic static void convolveHV(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel
- the kernelinPixels
- the input pixelsoutPixels
- the output pixelswidth
- the widthheight
- the heightalpha
- include alpha channeledgeAction
- what to do at the edgespublic static void convolveH(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel
- the kernelinPixels
- the input pixelsoutPixels
- the output pixelswidth
- the widthheight
- the heightalpha
- include alpha channeledgeAction
- what to do at the edgespublic static void convolveV(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, int edgeAction)
kernel
- the kernelinPixels
- the input pixelsoutPixels
- the output pixelswidth
- the widthheight
- the heightalpha
- include alpha channeledgeAction
- what to do at the edgespublic BufferedImage filter(BufferedImage src, Struct parameters) throws PageException
filter
in interface DynFiltering
PageException
Copyright © 2015 Lucee