| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectcom.jhlabs.image.AbstractBufferedImageOpcom.jhlabs.image.ConvolveFilterpublic class ConvolveFilterextends AbstractBufferedImageOpField Summary | |
static int |
|
static int |
|
static int |
|
protected boolean |
|
protected Kernel |
|
protected boolean |
|
Constructor Summary | |
| |
| |
| |
| |
Method Summary | |
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
BufferedImage |
|
BufferedImage |
|
Rectangle2D |
|
int |
|
Kernel |
|
Point2D |
|
boolean |
|
RenderingHints | |
boolean |
|
void |
|
void |
|
void |
|
void |
|
String |
|
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp | |
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB | |
public static int CLAMP_EDGES
Clamp pixels off the edge to the nearest edge.
public static int WRAP_EDGES
Wrap pixels off the edge to the opposite edge.
public static int ZERO_EDGES
Treat pixels off the edge as zero.
protected boolean alpha
Whether to convolve alpha.
protected Kernel kernel
The convolution kernel.
protected boolean premultiplyAlpha
Whether to promultiply the alpha before convolving.
public ConvolveFilter()
Construct a filter with a null kernel. This is only useful if you're going to change the kernel later on.
public ConvolveFilter(Kernel kernel)
Construct a filter with the given 3x3 kernel.
- Parameters:
kernel- the convolution kernel
public ConvolveFilter(float[] matrix)
Construct a filter with the given 3x3 kernel.
- Parameters:
matrix- an array of 9 floats containing the kernel
public ConvolveFilter(int rows,
int cols,
float[] matrix)Construct a filter with the given kernel.
- Parameters:
rows- the number of rows in the kernelcols- the number of columns in the kernelmatrix- an array of rows*cols floats containing the kernel
public static void convolve(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)Convolve a block of pixels.
- Parameters:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
public static void convolve(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
int edgeAction)Convolve a block of pixels.
- Parameters:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightedgeAction- what to do at the edges
public 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.
- Parameters:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
public static void convolveHV(Kernel kernel,
int[] inPixels,
int[] outPixels,
int width,
int height,
boolean alpha,
int edgeAction)Convolve with a 2D kernel.
- Parameters:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
public 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.
- Parameters:
kernel- the kernelinPixels- the input pixelsoutPixels- the output pixelswidth- the widthheight- the heightalpha- include alpha channeledgeAction- what to do at the edges
public BufferedImage createCompatibleDestImage(BufferedImage src,
ColorModel dstCM)
- Overrides:
- createCompatibleDestImage in interface AbstractBufferedImageOp
public BufferedImage filter(BufferedImage src,
BufferedImage dst)public Rectangle2D getBounds2D(BufferedImage src)
- Overrides:
- getBounds2D in interface AbstractBufferedImageOp
public int getEdgeAction()
Get the action to perfomr for pixels off the image edges.
- Returns:
- the action
- See Also:
setEdgeAction(int)
public Kernel getKernel()
Get the convolution kernel.
- Returns:
- the kernel
- See Also:
setKernel(Kernel)
public Point2D getPoint2D(Point2D srcPt,
Point2D dstPt)
- Overrides:
- getPoint2D in interface AbstractBufferedImageOp
public boolean getPremultiplyAlpha()
Get whether to premultiply the alpha channel.
- Returns:
- true to premultiply the alpha
- See Also:
setPremultiplyAlpha(boolean)
public RenderingHints getRenderingHints()
- Overrides:
- getRenderingHints in interface AbstractBufferedImageOp
public boolean getUseAlpha()
Get whether to convolve the alpha channel.
- Returns:
- true to convolve the alpha
- See Also:
setUseAlpha(boolean)
public void setEdgeAction(int edgeAction)
Set the action to perfomr for pixels off the image edges.
- Parameters:
edgeAction- the action
- See Also:
getEdgeAction()
public void setKernel(Kernel kernel)
Set the convolution kernel.
- Parameters:
kernel- the kernel
- See Also:
getKernel()
public void setPremultiplyAlpha(boolean premultiplyAlpha)
Set whether to premultiply the alpha channel.
- Parameters:
premultiplyAlpha- true to premultiply the alpha
- See Also:
getPremultiplyAlpha()
public void setUseAlpha(boolean useAlpha)
Set whether to convolve the alpha channel.
- Parameters:
useAlpha- true to convolve the alpha
- See Also:
getUseAlpha()
public String toString()