public class SSEDisplacementMapPeer extends SSEEffectPeer
Constructor and Description |
---|
SSEDisplacementMapPeer(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) |
private static void |
filter(int[] dstPixels,
int dstx,
int dsty,
int dstw,
int dsth,
int dstscan,
float imagetx_x,
float imagetx_y,
float imagetx_z,
float imagetx_w,
float[] mapImg_arr,
float src1Rect_x1,
float src1Rect_y1,
float src1Rect_x2,
float src1Rect_y2,
int src1w,
int src1h,
int src1scan,
int[] origImg_arr,
float src0Rect_x1,
float src0Rect_y1,
float src0Rect_x2,
float src0Rect_y2,
int src0w,
int src0h,
int src0scan,
float sampletx_x,
float sampletx_y,
float sampletx_z,
float sampletx_w,
float wrap) |
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() |
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 SSEDisplacementMapPeer(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
private static void filter(int[] dstPixels, int dstx, int dsty, int dstw, int dsth, int dstscan, float imagetx_x, float imagetx_y, float imagetx_z, float imagetx_w, float[] mapImg_arr, float src1Rect_x1, float src1Rect_y1, float src1Rect_x2, float src1Rect_y2, int src1w, int src1h, int src1scan, int[] origImg_arr, float src0Rect_x1, float src0Rect_y1, float src0Rect_x2, float src0Rect_y2, int src0w, int src0h, int src0scan, float sampletx_x, float sampletx_y, float sampletx_z, float sampletx_w, float wrap)