Effect implementation peers.
| Modifier and Type | Field and Description |
|---|---|
| private Rectangle | |
| private final Rectangle | |
| private Effect | |
| private final FilterContext | |
| private final Rectangle[] | |
| private final Rectangle[] | |
| private final BaseTransform[] | |
| private int | |
| private final Renderer | |
| private T | |
| private final String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public abstract ImageData | filter(Effect effect, T renderState, BaseTransform transform, Rectangle outputClip, ImageData... inputs)
|
| public Effect. | |
| protected final Rectangle | |
| protected final Rectangle | |
| protected Effect | |
| protected final FilterContext | |
| protected final Rectangle | Returns: the valid bounds of the source Imagethe index of the source input inputIndex)Returns the "valid" bounds of the source image for the given input. |
| protected final Rectangle | Returns: the native surface boundsthe index of the source input inputIndex)Returns the bounds of the native surface for the given input. |
| protected final BaseTransform | |
| public final int | |
| protected Renderer | |
| protected T | |
| public Rectangle | |
| protected Object | |
| protected float[] | Returns: an array of four float valuesthe index of the source input inputIndex)Returns an array of four floats that represent the mapping of the data for the specified input to the given effect area. |
| pack-priv static float[] | Returns: an array of four float valuesthe logical bounds of the input data srcBounds, Rectangle the actual dimensions of the input image
containing the input data in its upper left srcNativeBounds, Rectangle the logical bounds of the resulting effect output dstBounds)Returns an array of four floats that represent the mapping of the specified source region for the specified effect area. |
| public int | Returns: the number of texture coordinates stored in thecoords
array (either 4 or 8)the index of the input whose texture coordinates
are being queried inputIndex, float[] An array that can hold up to 8 floats for returning
the texture coordinates. coords, float The X coordinate of the origin of the source texture
in the untransformed coordinate space. srcX, float The Y coordinate of the origin of the source texture
in the untransformed coordinate space. srcY, float the native width of the source texture srcNativeWidth, float the native height of the source texture srcNativeHeight, Rectangle the output bounds that the texture is
being stretched over dstBounds, BaseTransform the transform to be implicitly applied to the
source texture as it is mapped onto the destination transform)Returns either 4 or 8 source texture coordinates depending on the transform being applied to the source. |
| public static int | Returns: the number of texture coordinates stored in thecoords
array (either 4 or 8)An array that can hold up to 8 floats for returning
the texture coordinates. coords, float The X coordinate of the origin of the source texture
in the untransformed coordinate space. srcX, float The Y coordinate of the origin of the source texture
in the untransformed coordinate space. srcY, float the native width of the source texture srcNativeWidth, float the native height of the source texture srcNativeHeight, Rectangle the output bounds that the texture is
being stretched over dstBounds, BaseTransform the transform to be implicitly applied to the
source texture as it is mapped onto the destination transform)Returns either 4 or 8 source texture coordinates depending on the transform being applied to the source. |
| public String | |
| public boolean | |
| protected boolean | Returns: true if the coordinate system has an upper-left originReturns true if the native coordinate system has its origin at the upper-left corner of the destination surface; otherwise, returns false, indicating that the origin is at the lower-left corner. |
| protected final void | |
| protected final void | |
| protected void | |
| protected final void | |
| protected final void | |
| protected final void | |
| public void | |
| protected void |
| destBounds | back to summary |
|---|---|
| private Rectangle destBounds | |
| destNativeBounds | back to summary |
|---|---|
| private final Rectangle destNativeBounds | |
| effect | back to summary |
|---|---|
| private Effect effect | |
| fctx | back to summary |
|---|---|
| private final FilterContext fctx | |
| inputBounds | back to summary |
|---|---|
| private final Rectangle[] inputBounds | |
| inputNativeBounds | back to summary |
|---|---|
| private final Rectangle[] inputNativeBounds | |
| inputTransforms | back to summary |
|---|---|
| private final BaseTransform[] inputTransforms | |
| pass | back to summary |
|---|---|
| private int pass | |
| renderer | back to summary |
|---|---|
| private final Renderer renderer | |
| renderState | back to summary |
|---|---|
| private T renderState | |
| uniqueName | back to summary |
|---|---|
| private final String uniqueName | |
| EffectPeer | back to summary |
|---|---|
| protected EffectPeer(FilterContext fctx, Renderer renderer, String uniqueName) | |
| dispose | back to summary |
|---|---|
| public void dispose() Disposes resources associated with this peer. Warning may be called from the rendering thread. | |
| filter | back to summary |
|---|---|
| public abstract ImageData filter(Effect effect, T renderState, BaseTransform transform, Rectangle outputClip, ImageData... inputs) | |
| getAccelType | back to summary |
|---|---|
| public Effect. | |
| getDestBounds | back to summary |
|---|---|
| protected final Rectangle getDestBounds() | |
| getDestNativeBounds | back to summary |
|---|---|
| protected final Rectangle getDestNativeBounds() | |
| getEffect | back to summary |
|---|---|
| protected Effect getEffect() | |
| getFilterContext | back to summary |
|---|---|
| protected final FilterContext getFilterContext() | |
| getInputBounds | back to summary |
|---|---|
| protected final Rectangle getInputBounds(int inputIndex) Returns the "valid" bounds of the source image for the given input. Since Effect implementations try to recycle temporary Images, it is quite possible that the input bounds returned by this method will differ from the size of the associated input Image. For example, this method may return (0, 0, 210, 180) even though the associated Image has dimensions of 230x200 pixels. Pixels in the input Image outside these "valid" bounds are undefined and should be avoided.
| |
| getInputNativeBounds | back to summary |
|---|---|
| protected final Rectangle getInputNativeBounds(int inputIndex) Returns the bounds of the native surface for the given input. It is quite possible that the input native bounds returned by this method will differ from the size of the associated input (Java-level) Image. This is common for the OGL and D3D backends of Java 2D, where on older hardware the dimensions of a VRAM surface (e.g. texture) must be a power of two. For example, this method may return (0, 0, 256, 256) even though the associated (Volatile)Image has dimensions of 230x200 pixels. This method is useful in cases where it is necessary to access adjacent pixels in a native surface. For example, the horizontal distance between two texel centers of a native surface can be calculated as (1f/inputNativeBounds.width); for the vertical distance, (1f/inputNativeBounds.height).
| |
| getInputTransform | back to summary |
|---|---|
| protected final BaseTransform getInputTransform(int inputIndex) | |
| getPass | back to summary |
|---|---|
| public final int getPass() | |
| getRenderer | back to summary |
|---|---|
| protected Renderer getRenderer() | |
| getRenderState | back to summary |
|---|---|
| protected T getRenderState() | |
| getResultBounds | back to summary |
|---|---|
| public Rectangle getResultBounds(BaseTransform transform, Rectangle outputClip, ImageData... inputDatas) | |
| getSamplerData | back to summary |
|---|---|
| protected Object getSamplerData(int i) | |
| getSourceRegion | back to summary |
|---|---|
| protected float[] getSourceRegion(int inputIndex) Returns an array of four floats that represent the mapping of the
data for the specified input to the given effect area.
The interpretation of the returned values is entirely dependent on
the algorithm of the pixel shader, but typical values are in the
"unit" coordinate space of the destination effect area, where
The default implementation converts the logical destination effect
region into the coordinate space of the native surface of the
specified source input according to the
Subclasses can override this method to provide more sophisticated positioning behavior.
| |
| getSourceRegion | back to summary |
|---|---|
| pack-priv static float[] getSourceRegion(Rectangle srcBounds, Rectangle srcNativeBounds, Rectangle dstBounds) Returns an array of four floats that represent the mapping of the specified source region for the specified effect area. The returned values are in the "unit" coordinate space of the source native surface, where (0,0) is at the upper-left corner, and (1,1) is at the lower-right corner. For example, if the native input surface (i.e. texture) is 256x256 pixels, and the effect output region is at the same coordinates as the input region and is 200x200, this method will return (0, 0, 200/256, 220/256). The returned array contains the values in order (x1, y1, x2, y2). Subclasses can override this method to provide more sophisticated positioning behavior. | |
| getTextureCoordinates | back to summary |
|---|---|
| public 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. 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 getTextureCoordinates(float[], float, float, float, float, Rectangle, BaseTransform).
| |
| getTextureCoordinates | back to summary |
|---|---|
| public static int getTextureCoordinates(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. 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]
| |
| getUniqueName | back to summary |
|---|---|
| public String getUniqueName() Returns the unique name of this peer. This value can be used as the key value in a hashmap of cached peer instances. In the case of hardware peers, this value is typically the name of the shader that is used by the peer.
| |
| isImageDataCompatible | back to summary |
|---|---|
| public boolean isImageDataCompatible(ImageData id) | |
| isOriginUpperLeft | back to summary |
|---|---|
| protected boolean isOriginUpperLeft() Returns true if the native coordinate system has its origin at the upper-left corner of the destination surface; otherwise, returns false, indicating that the origin is at the lower-left corner. This method may be useful in determining the direction of adjacent pixels in an OpenGL surface (since many OpenGL methods take parameters assuming a lower-left origin).
| |
| setDestBounds | back to summary |
|---|---|
| protected final void setDestBounds(Rectangle r) | |
| setDestNativeBounds | back to summary |
|---|---|
| protected final void setDestNativeBounds(int w, int h) | |
| setEffect | back to summary |
|---|---|
| protected void setEffect(Effect effect) | |
| setInputBounds | back to summary |
|---|---|
| protected final void setInputBounds(int inputIndex, Rectangle r) | |
| setInputNativeBounds | back to summary |
|---|---|
| protected final void setInputNativeBounds(int inputIndex, Rectangle r) | |
| setInputTransform | back to summary |
|---|---|
| protected final void setInputTransform(int inputIndex, BaseTransform tx) | |
| setPass | back to summary |
|---|---|
| public void setPass(int pass) | |
| setRenderState | back to summary |
|---|---|
| protected void setRenderState(T renderState) | |