类 TransformFilter
- java.lang.Object
-
- org.meteoinfo.image.filter.AbstractBufferedImageOp
-
- org.meteoinfo.image.filter.TransformFilter
-
- 所有已实现的接口:
java.awt.image.BufferedImageOp,java.lang.Cloneable
- 直接已知子类:
CircleFilter,CurlFilter,DiffuseFilter,DisplaceFilter,FieldWarpFilter,KaleidoscopeFilter,MapFilter,MarbleFilter,OffsetFilter,PerspectiveFilter,PinchFilter,PolarFilter,RippleFilter,RotateFilter,ShearFilter,SphereFilter,SwimFilter,TwirlFilter,WaterFilter
public abstract class TransformFilter extends AbstractBufferedImageOp
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.
-
-
字段概要
字段 修饰符和类型 字段 说明 static intBILINEARUse bilinear interpolation.static intCLAMPClamp pixels to the image edges.protected intedgeActionThe action to take for pixels off the image edge.protected intinterpolationThe type of interpolation to use.static intNEAREST_NEIGHBOURUse nearest-neighbout interpolation.protected java.awt.RectangleoriginalSpaceThe input image rectangle.static intRGB_CLAMPClamp pixels RGB to the image edges, but zero the alpha.protected java.awt.RectangletransformedSpaceThe output image rectangle.static intWRAPWrap pixels off the edge onto the oppsoite edge.static intZEROTreat pixels off the edge as zero.
-
构造器概要
构造器 构造器 说明 TransformFilter()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)protected java.awt.image.BufferedImagefilterPixelsNN(java.awt.image.BufferedImage dst, int width, int height, int[] inPixels, java.awt.Rectangle transformedSpace)intgetEdgeAction()Get the action to perform for pixels off the edge of the image.intgetInterpolation()Get the type of interpolation to perform.voidsetEdgeAction(int edgeAction)Set the action to perform for pixels off the edge of the image.voidsetInterpolation(int interpolation)Set the type of interpolation to perform.protected abstract voidtransformInverse(int x, int y, float[] out)Inverse transform a point.protected voidtransformSpace(java.awt.Rectangle rect)Forward transform a rectangle.-
从类继承的方法 org.meteoinfo.image.filter.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
-
-
-
字段详细资料
-
ZERO
public static final int ZERO
Treat pixels off the edge as zero.- 另请参阅:
- 常量字段值
-
CLAMP
public static final int CLAMP
Clamp pixels to the image edges.- 另请参阅:
- 常量字段值
-
WRAP
public static final int WRAP
Wrap pixels off the edge onto the oppsoite edge.- 另请参阅:
- 常量字段值
-
RGB_CLAMP
public static final int RGB_CLAMP
Clamp pixels RGB to the image edges, but zero the alpha. This prevents gray borders on your image.- 另请参阅:
- 常量字段值
-
NEAREST_NEIGHBOUR
public static final int NEAREST_NEIGHBOUR
Use nearest-neighbout interpolation.- 另请参阅:
- 常量字段值
-
BILINEAR
public static final int BILINEAR
Use bilinear interpolation.- 另请参阅:
- 常量字段值
-
edgeAction
protected int edgeAction
The action to take for pixels off the image edge.
-
interpolation
protected int interpolation
The type of interpolation to use.
-
transformedSpace
protected java.awt.Rectangle transformedSpace
The output image rectangle.
-
originalSpace
protected java.awt.Rectangle originalSpace
The input image rectangle.
-
-
方法详细资料
-
setEdgeAction
public void setEdgeAction(int edgeAction)
Set the action to perform for pixels off the edge of the image.- 参数:
edgeAction- one of ZERO, CLAMP or WRAP- 另请参阅:
getEdgeAction()
-
getEdgeAction
public int getEdgeAction()
Get the action to perform for pixels off the edge of the image.- 返回:
- one of ZERO, CLAMP or WRAP
- 另请参阅:
setEdgeAction(int)
-
setInterpolation
public void setInterpolation(int interpolation)
Set the type of interpolation to perform.- 参数:
interpolation- one of NEAREST_NEIGHBOUR or BILINEAR- 另请参阅:
getInterpolation()
-
getInterpolation
public int getInterpolation()
Get the type of interpolation to perform.- 返回:
- one of NEAREST_NEIGHBOUR or BILINEAR
- 另请参阅:
setInterpolation(int)
-
transformInverse
protected abstract void transformInverse(int x, int y, float[] out)Inverse transform a point. This method needs to be overriden by all subclasses.- 参数:
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 image
-
transformSpace
protected void transformSpace(java.awt.Rectangle rect)
Forward transform a rectangle. Used to determine the size of the output image.- 参数:
rect- the rectangle to transform
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
-
filterPixelsNN
protected java.awt.image.BufferedImage filterPixelsNN(java.awt.image.BufferedImage dst, int width, int height, int[] inPixels, java.awt.Rectangle transformedSpace)
-
-