crystalspace.jbind.impl.video.texture
Class csTextureHandle

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.video.texture.csTextureHandle
All Implemented Interfaces:
iBase, iPointer, iTextureHandle

public class csTextureHandle
extends csBase
implements iTextureHandle

Author:
qan To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Fields inherited from interface crystalspace.jbind.interfaces.ivideo.texture.iTextureHandle
CS_TEX_IMG_1D, CS_TEX_IMG_2D, CS_TEX_IMG_3D, CS_TEX_IMG_CUBEMAP, CS_TEXTURE_CUBE_NEG_X, CS_TEXTURE_CUBE_NEG_Y, CS_TEXTURE_CUBE_NEG_Z, CS_TEXTURE_CUBE_POS_X, CS_TEXTURE_CUBE_POS_Y, CS_TEXTURE_CUBE_POS_Z
 
Constructor Summary
csTextureHandle(iPointer nPointer)
           
 
Method Summary
 boolean getAlphaMap()
          Query if the texture has an alpha channel.
 iPointer getCacheData()
          Get data associated internally with this texture by texture cache.
 iGraphics2D getCanvas()
          Get a canvas instance which is suitable for rendering on this texture.
 int getFlags()
          Retrieve the flags set for this texture.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 byte[] getKeyColor()
          Get the key color.
 boolean getKeyColorStatus()
          Get the key color status (false if disabled, true if enabled);.
 byte[] getMeanColor()
          Get the mean color.
 int[] getMipMapDimensions()
          Get the dimensions for a given mipmap level (0 to 3);.
 java.lang.String getName()
          Return the name of the interface
 int[] getOriginalDimensions()
          Return the original dimensions of the image used to create this texture.
 int getVersion()
          Return the version of the interface
static void initSCF()
           
protected  boolean isNativePointerValidSafe()
           
 void prepare()
          Merge this texture into current palette, compute mipmaps and so on.
 void setCacheData(iPointer d)
          Set data associated internally with this texture by texture cache.
 void setKeyColor(byte red, byte green, byte blue)
          Set the key color.
 void setKeyColorStatus(boolean Enable)
          Enable key color.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, isNativePointerValidSafe, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csTextureHandle

public csTextureHandle(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase

initSCF

public static void initSCF()

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe()

getAlphaMap

public boolean getAlphaMap()
Description copied from interface: iTextureHandle
Query if the texture has an alpha channel. This depends both on whenever the original image had an alpha channel and of the fact whenever the renderer supports alpha maps at all.

Specified by:
getAlphaMap in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getAlphaMap()

getCacheData

public iPointer getCacheData()
Description copied from interface: iTextureHandle
Get data associated internally with this texture by texture cache.

Specified by:
getCacheData in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getCacheData()

getCanvas

public iGraphics2D getCanvas()
Description copied from interface: iTextureHandle
Get a canvas instance which is suitable for rendering on this texture. Note that it is not allowed to change the palette of the returned canvas.

Specified by:
getCanvas in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getCanvas()

getFlags

public int getFlags()
Description copied from interface: iTextureHandle
Retrieve the flags set for this texture.

Specified by:
getFlags in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getFlags()

getKeyColor

public byte[] getKeyColor()
Description copied from interface: iTextureHandle
Get the key color.

Specified by:
getKeyColor in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getKeyColor()

getKeyColorStatus

public boolean getKeyColorStatus()
Description copied from interface: iTextureHandle
Get the key color status (false if disabled, true if enabled);.

Specified by:
getKeyColorStatus in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getKeyColorStatus()

getMeanColor

public byte[] getMeanColor()
Description copied from interface: iTextureHandle
Get the mean color.

Specified by:
getMeanColor in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getMeanColor()

getMipMapDimensions

public int[] getMipMapDimensions()
Description copied from interface: iTextureHandle
Get the dimensions for a given mipmap level (0 to 3);. If the texture was registered just for 2D usage, mipmap levels above 0 will return false. Note that the result of this function will be the size that the renderer uses for this texture. In most cases this corresponds to the size that was used to create this texture but some renderers have texture size limitations (like power of two); and in that case the size returned here will be the corrected size. You can get the original image size with GetOriginalDimensions();.

Specified by:
getMipMapDimensions in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getMipMapDimensions()

getOriginalDimensions

public int[] getOriginalDimensions()
Description copied from interface: iTextureHandle
Return the original dimensions of the image used to create this texture. This is most often equal to GetMipMapDimensions (0, mw, mh); but in some cases the texture will have been resized in order to accomodate hardware restrictions (like power of two and maximum texture size);. This function returns the uncorrected coordinates.

Specified by:
getOriginalDimensions in interface iTextureHandle
Returns:
See Also:
iTextureHandle.getOriginalDimensions()

prepare

public void prepare()
Description copied from interface: iTextureHandle
Merge this texture into current palette, compute mipmaps and so on. You should call either Prepare(); or iTextureManager::PrepareTextures(); before using any texture. Note that it is in this stage that the original image that is attached to a texture is scaled so that it fits hardware requirements. So it is important to realize that calling this function may actually change the image from which you created this texture!

Specified by:
prepare in interface iTextureHandle
See Also:
iTextureHandle.prepare()

setCacheData

public void setCacheData(iPointer d)
Description copied from interface: iTextureHandle
Set data associated internally with this texture by texture cache.

Specified by:
setCacheData in interface iTextureHandle
Parameters:
d -
See Also:
iTextureHandle.setCacheData(crystalspace.jbind.interfaces.iPointer)

setKeyColor

public void setKeyColor(byte red,
                        byte green,
                        byte blue)
Description copied from interface: iTextureHandle
Set the key color.

Specified by:
setKeyColor in interface iTextureHandle
Parameters:
red -
green -
blue -
See Also:
iTextureHandle.setKeyColor(byte, byte, byte)

setKeyColorStatus

public void setKeyColorStatus(boolean Enable)
Description copied from interface: iTextureHandle
Enable key color.

Specified by:
setKeyColorStatus in interface iTextureHandle
Parameters:
Enable -
See Also:
iTextureHandle.setKeyColorStatus(boolean)