public class PPSPerspectiveTransformPeer extends PPSOneSamplerPeer
| Constructor and Description |
|---|
PPSPerspectiveTransformPeer(FilterContext fctx,
Renderer r,
java.lang.String shaderName) |
| Modifier and Type | Method and Description |
|---|---|
protected Shader |
createShader() |
protected PerspectiveTransform |
getEffect() |
private float[][] |
getITX() |
int |
getTextureCoordinates(int inputIndex,
float[] coords,
float srcX,
float srcY,
float srcNativeWidth,
float srcNativeHeight,
Rectangle dstBounds,
BaseTransform transform)
Returns either 4 or 8 source texture coordinates depending on the
transform being applied to the source.
|
private float[] |
getTx0() |
private float[] |
getTx1() |
private float[] |
getTx2() |
protected boolean |
isSamplerLinear(int i) |
protected void |
updateShader(Shader shader) |
dispose, filterImplfilter, getRenderer, getShaderNamegetAccelType, getDestBounds, getDestNativeBounds, getFilterContext, getInputBounds, getInputNativeBounds, getInputTransform, getPass, getRenderState, getResultBounds, getSamplerData, getSourceRegion, getTextureCoordinates, getUniqueName, isImageDataCompatible, isOriginUpperLeft, setDestBounds, setDestNativeBounds, setEffect, setInputBounds, setInputNativeBounds, setInputTransform, setPass, setRenderStatepublic PPSPerspectiveTransformPeer(FilterContext fctx, Renderer r, java.lang.String shaderName)
protected final PerspectiveTransform getEffect()
getEffect in class EffectPeerprivate float[][] getITX()
private float[] getTx0()
private float[] getTx1()
private float[] getTx2()
public int getTextureCoordinates(int inputIndex,
float[] coords,
float srcX,
float srcY,
float srcNativeWidth,
float srcNativeHeight,
Rectangle dstBounds,
BaseTransform transform)
EffectPeerIf the mapping is rectilinear then 4 floats are returned. The texture coordinates are thus mapped using the following table:
dx1,dy1 => ret[0], ret[1]
dx2,dy1 => ret[2], ret[1]
dx1,dy2 => ret[0], ret[3]
dx2,dy2 => ret[2], ret[3]
If the mapping is non-rectilinear then 8 floats are returned and
the texture coordinates are mapped using the following table (note
that the dx1,dy1 and dx2,dy2 mappings are still from the same
indices as in the 4 float return value):
dx1,dy1 => ret[0], ret[1]
dx2,dy1 => ret[4], ret[5]
dx1,dy2 => ret[6], ret[7]
dx2,dy2 => ret[2], ret[3]
The default implementation of this method simply calls the static
method EffectPeer.getTextureCoordinates(float[],float,float,float,float,Rectangle,BaseTransform).getTextureCoordinates in class EffectPeerinputIndex - the index of the input whose texture coordinates
are being queriedcoords - An array that can hold up to 8 floats for returning
the texture coordinates.srcX - The X coordinate of the origin of the source texture
in the untransformed coordinate space.srcY - The Y coordinate of the origin of the source texture
in the untransformed coordinate space.srcNativeWidth - the native width of the source texturesrcNativeHeight - the native height of the source texturedstBounds - the output bounds that the texture is
being stretched overtransform - the transform to be implicitly applied to the
source texture as it is mapped onto the destinationcoords
array (either 4 or 8)protected boolean isSamplerLinear(int i)
isSamplerLinear in class PPSEffectPeerprotected Shader createShader()
createShader in class PPSEffectPeerprotected void updateShader(Shader shader)
updateShader in class PPSEffectPeer