com.threed.jpct
Interface ITextureEffect


public interface ITextureEffect

An interface for texture effects. Texture effects are two-dimensional effects applied to a texture. The affected texture has to be converted and uploaded to the GPU every time the effect will be applied.


Method Summary
 void apply(int[] dest, int[] source)
          Applies the effect.
 boolean containsAlpha()
          If this returns true, jPCT assumes that the alpha channel in the returned pixels is populated and treats it accordingly.
 void init(Texture tex)
          Initializes the effect.
 

Method Detail

init

void init(Texture tex)
Initializes the effect. This will be called by setEffect(), so there should be no need to call this method directly.

Parameters:
tex - the Texture to which the effect should be applied
See Also:
Texture.setEffect(com.threed.jpct.ITextureEffect)

apply

void apply(int[] dest,
           int[] source)
Applies the effect. Like init(), this will be called from within the Texture class. To avoid the construction of a new int[] for every call, the resulting image is rendered directly into dest. So if one wants to implements an effect, take the source bitmap (it's an int[] containing the texture in ARGB (0xaarrggbb)-format) and write the modified source bitmap into the dest bitmap.

Parameters:
dest - the destination bitmap
source - the source bitmap (the unmodified texture)

containsAlpha

boolean containsAlpha()
If this returns true, jPCT assumes that the alpha channel in the returned pixels is populated and treats it accordingly.

Returns:
does it?