类 PerspectiveFilter
- java.lang.Object
-
- org.meteoinfo.image.filter.AbstractBufferedImageOp
-
- org.meteoinfo.image.filter.TransformFilter
-
- org.meteoinfo.image.filter.PerspectiveFilter
-
- 所有已实现的接口:
java.awt.image.BufferedImageOp,java.lang.Cloneable
public class PerspectiveFilter extends TransformFilter
A filter which performs a perspective distortion on an image. Coordinates are treated as if the image was a unit square, i.e. the bottom-right corner of the image is at (1, 1). The filter maps the unit square onto an arbitrary convex quadrilateral or vice versa.
-
-
字段概要
-
从类继承的字段 org.meteoinfo.image.filter.TransformFilter
BILINEAR, CLAMP, edgeAction, interpolation, NEAREST_NEIGHBOUR, originalSpace, RGB_CLAMP, transformedSpace, WRAP, ZERO
-
-
构造器概要
构造器 构造器 说明 PerspectiveFilter()Construct a PerspectiveFilter.PerspectiveFilter(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Construct a PerspectiveFilter.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)java.awt.geom.Rectangle2DgetBounds2D(java.awt.image.BufferedImage src)booleangetClip()floatgetOriginX()Get the origin of the output image.floatgetOriginY()Get the origin of the output image.java.awt.geom.Point2DgetPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)voidquadToUnitSquare(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set the transform to map a quadrilateral onto the unit square.voidsetClip(boolean clip)voidsetCorners(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set the new positions of the image corners.java.lang.StringtoString()protected voidtransformInverse(int x, int y, float[] out)Inverse transform a point.protected voidtransformSpace(java.awt.Rectangle rect)Forward transform a rectangle.voidunitSquareToQuad(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set the transform to map the unit square onto a quadrilateral.-
从类继承的方法 org.meteoinfo.image.filter.TransformFilter
filterPixelsNN, getEdgeAction, getInterpolation, setEdgeAction, setInterpolation
-
从类继承的方法 org.meteoinfo.image.filter.AbstractBufferedImageOp
clone, createCompatibleDestImage, getRenderingHints, getRGB, setRGB
-
-
-
-
构造器详细资料
-
PerspectiveFilter
public PerspectiveFilter()
Construct a PerspectiveFilter.
-
PerspectiveFilter
public PerspectiveFilter(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Construct a PerspectiveFilter.- 参数:
x0- the new position of the top left cornery0- the new position of the top left cornerx1- the new position of the top right cornery1- the new position of the top right cornerx2- the new position of the bottom right cornery2- the new position of the bottom right cornerx3- the new position of the bottom left cornery3- the new position of the bottom left corner
-
-
方法详细资料
-
setClip
public void setClip(boolean clip)
-
getClip
public boolean getClip()
-
setCorners
public void setCorners(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set the new positions of the image corners. This is the same as unitSquareToQuad, but the coordinates are in image pixels, not relative to the unit square. This method is provided as a convenience.- 参数:
x0- the new position of the top left cornery0- the new position of the top left cornerx1- the new position of the top right cornery1- the new position of the top right cornerx2- the new position of the bottom right cornery2- the new position of the bottom right cornerx3- the new position of the bottom left cornery3- the new position of the bottom left corner
-
unitSquareToQuad
public void unitSquareToQuad(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set the transform to map the unit square onto a quadrilateral. When filtering, all coordinates will be scaled by the size of the image.- 参数:
x0- the new position of the top left cornery0- the new position of the top left cornerx1- the new position of the top right cornery1- the new position of the top right cornerx2- the new position of the bottom right cornery2- the new position of the bottom right cornerx3- the new position of the bottom left cornery3- the new position of the bottom left corner
-
quadToUnitSquare
public void quadToUnitSquare(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set the transform to map a quadrilateral onto the unit square. When filtering, all coordinates will be scaled by the size of the image.- 参数:
x0- the old position of the top left cornery0- the old position of the top left cornerx1- the old position of the top right cornery1- the old position of the top right cornerx2- the old position of the bottom right cornery2- the old position of the bottom right cornerx3- the old position of the bottom left cornery3- the old position of the bottom left corner
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)- 指定者:
filter在接口中java.awt.image.BufferedImageOp- 覆盖:
filter在类中TransformFilter
-
transformSpace
protected void transformSpace(java.awt.Rectangle rect)
从类复制的说明:TransformFilterForward transform a rectangle. Used to determine the size of the output image.- 覆盖:
transformSpace在类中TransformFilter- 参数:
rect- the rectangle to transform
-
getOriginX
public float getOriginX()
Get the origin of the output image. Use this for working out where to draw your new image.- 返回:
- the X origin.
-
getOriginY
public float getOriginY()
Get the origin of the output image. Use this for working out where to draw your new image.- 返回:
- the Y origin.
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage src)
- 指定者:
getBounds2D在接口中java.awt.image.BufferedImageOp- 覆盖:
getBounds2D在类中AbstractBufferedImageOp
-
getPoint2D
public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D srcPt, java.awt.geom.Point2D dstPt)- 指定者:
getPoint2D在接口中java.awt.image.BufferedImageOp- 覆盖:
getPoint2D在类中AbstractBufferedImageOp
-
transformInverse
protected void transformInverse(int x, int y, float[] out)从类复制的说明:TransformFilterInverse transform a point. This method needs to be overriden by all subclasses.- 指定者:
transformInverse在类中TransformFilter- 参数:
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
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
-