|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.TransformFilter
public abstract class TransformFilter
An abstract superclass for filters which distort images in some way. The subclass only needs to override two methods to provide the mapping between source and destination pixels.
Field Summary | |
---|---|
static int |
BILINEAR
Use bilinear interpolation. |
static int |
CLAMP
Clamp pixels to the image edges. |
protected int |
edgeAction
The action to take for pixels off the image edge. |
protected int |
interpolation
The type of interpolation to use. |
static int |
NEAREST_NEIGHBOUR
Use nearest-neighbout interpolation. |
protected java.awt.Rectangle |
originalSpace
The input image rectangle. |
protected java.awt.Rectangle |
transformedSpace
The output image rectangle. |
static int |
WRAP
Wrap pixels off the edge onto the oppsoite edge. |
static int |
ZERO
Treat pixels off the edge as zero. |
Constructor Summary | |
---|---|
TransformFilter()
|
Method Summary | |
---|---|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage src,
java.awt.image.BufferedImage dst)
|
protected java.awt.image.BufferedImage |
filterPixelsNN(java.awt.image.BufferedImage dst,
int width,
int height,
int[] inPixels,
java.awt.Rectangle transformedSpace)
|
int |
getEdgeAction()
Get the action to perform for pixels off the edge of the image. |
int |
getInterpolation()
Get the type of interpolation to perform. |
void |
setEdgeAction(int edgeAction)
Set the action to perform for pixels off the edge of the image. |
void |
setInterpolation(int interpolation)
Set the type of interpolation to perform. |
protected abstract void |
transformInverse(int x,
int y,
float[] out)
Inverse transform a point. |
protected void |
transformSpace(java.awt.Rectangle rect)
Forward transform a rectangle. |
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp |
---|
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ZERO
public static final int CLAMP
public static final int WRAP
public static final int NEAREST_NEIGHBOUR
public static final int BILINEAR
protected int edgeAction
protected int interpolation
protected java.awt.Rectangle transformedSpace
protected java.awt.Rectangle originalSpace
Constructor Detail |
---|
public TransformFilter()
Method Detail |
---|
public void setEdgeAction(int edgeAction)
edgeAction
- one of ZERO, CLAMP or WRAPgetEdgeAction()
public int getEdgeAction()
setEdgeAction(int)
public void setInterpolation(int interpolation)
interpolation
- one of NEAREST_NEIGHBOUR or BILINEARgetInterpolation()
public int getInterpolation()
setInterpolation(int)
protected abstract void transformInverse(int x, int y, float[] out)
x
- the X position of the pixel in the output imagey
- the Y position of the pixel in the output imageout
- the position of the pixel in the input imageprotected void transformSpace(java.awt.Rectangle rect)
rect
- the rectangle to transformpublic java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
protected java.awt.image.BufferedImage filterPixelsNN(java.awt.image.BufferedImage dst, int width, int height, int[] inPixels, java.awt.Rectangle transformedSpace)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |