public class JSWDisplacementMapPeer extends JSWEffectPeer
FVALS_A, FVALS_B, FVALS_G, FVALS_R
Constructor and Description |
---|
JSWDisplacementMapPeer(FilterContext fctx,
Renderer r,
java.lang.String uniqueName) |
Modifier and Type | Method and Description |
---|---|
ImageData |
filter(Effect effect,
RenderState rstate,
BaseTransform transform,
Rectangle outputClip,
ImageData... inputs) |
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() |
faccum, fsample, laccum, laccumsample, lsample
dispose, getAccelType, getDestBounds, getDestNativeBounds, getFilterContext, getInputBounds, getInputNativeBounds, getInputTransform, getPass, getRenderer, getRenderState, getResultBounds, getSourceRegion, getTextureCoordinates, getUniqueName, isImageDataCompatible, isOriginUpperLeft, setDestBounds, setDestNativeBounds, setEffect, setInputBounds, setInputNativeBounds, setInputTransform, setPass, setRenderState
public JSWDisplacementMapPeer(FilterContext fctx, Renderer r, java.lang.String uniqueName)
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)public ImageData filter(Effect effect, RenderState rstate, BaseTransform transform, Rectangle outputClip, ImageData... inputs)
filter
in class EffectPeer