public class PPSDisplacementMapPeer extends PPSTwoSamplerPeer
Constructor and Description |
---|
PPSDisplacementMapPeer(FilterContext fctx,
Renderer r,
java.lang.String shaderName) |
Modifier and Type | Method and Description |
---|---|
protected Shader |
createShader() |
protected DisplacementMap |
getEffect() |
private float[] |
getImagetx() |
protected java.lang.Object |
getSamplerData(int i) |
private float[] |
getSampletx() |
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 |
getWrap() |
protected boolean |
isSamplerLinear(int i) |
protected void |
updateShader(Shader shader) |
dispose, filterImpl
filter, getRenderer, getShaderName
getAccelType, getDestBounds, getDestNativeBounds, getFilterContext, getInputBounds, getInputNativeBounds, getInputTransform, getPass, getRenderState, getResultBounds, getSourceRegion, getTextureCoordinates, getUniqueName, isImageDataCompatible, isOriginUpperLeft, setDestBounds, setDestNativeBounds, setEffect, setInputBounds, setInputNativeBounds, setInputTransform, setPass, setRenderState
public PPSDisplacementMapPeer(FilterContext fctx, Renderer r, java.lang.String shaderName)
protected final DisplacementMap getEffect()
getEffect
in class EffectPeer
private float[] getSampletx()
private float[] getImagetx()
private float getWrap()
protected java.lang.Object getSamplerData(int i)
getSamplerData
in class EffectPeer
public int getTextureCoordinates(int inputIndex, float[] coords, float srcX, float srcY, float srcNativeWidth, float srcNativeHeight, Rectangle dstBounds, BaseTransform transform)
EffectPeer
If 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 EffectPeer
inputIndex
- 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 PPSEffectPeer
protected Shader createShader()
createShader
in class PPSEffectPeer
protected void updateShader(Shader shader)
updateShader
in class PPSEffectPeer