Class TLsp2DImageTextureObject
java.lang.Object
com.luciad.view.lightspeed.services.glcache.ALspGLResource
com.luciad.view.lightspeed.util.opengl.texture.ALspTextureObject
com.luciad.view.lightspeed.util.opengl.texture.ALsp2DTextureObject
com.luciad.view.lightspeed.util.opengl.texture.TLsp2DImageTextureObject
Texture object representation of a buffered image. It uses automatic mipmap
generation together with linear interpolation for minification and maxification
and clamps to the edges of the image. This class does not perform 'live'
synchronization with the input images, i.e. the texture is not updated to reflect
any changes to the image after construction.
Note that two different texture objects that are created for equal images
are also equal, even though they may return a different texture object id.
- Since:
- 2012.0
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a texture object for the given image with filtering enabled.TLsp2DImageTextureObject(BufferedImage aImage, boolean aFiltering) Constructs a texture object for the given image, with the option to enable or disable texture filtering.TLsp2DImageTextureObject(BufferedImage aImage, boolean aFiltering, boolean aRepeat) Constructs a texture object for the given image, with the options to enable or disable texture filtering and texture repeating.TLsp2DImageTextureObject(String aSourceString, BufferedImage aImage, boolean aFiltering, boolean aRepeat) Constructs a texture object for the given image, with the options to enable or disable texture filtering and texture repeating. -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(ILcdGLDrawable aGLDrawable) Binds the texture object to its appropriate target.voiddestroy(ILcdGLDrawable aGLDrawable) Deletes the texture object owned by thisALspTextureObject.longgetBytes()Returns the number of estimated bytes this texture object occupies.protected voidinit(ILcdGLDrawable aGLDrawable) Creates a new OpenGL texture object.voidsetImage(BufferedImage aImage) Sets the given image.Methods inherited from class com.luciad.view.lightspeed.util.opengl.texture.ALsp2DTextureObject
getHeight, getTarget, getWidthMethods inherited from class com.luciad.view.lightspeed.util.opengl.texture.ALspTextureObject
getTextureObject, isDestroyed, unbindMethods inherited from class com.luciad.view.lightspeed.services.glcache.ALspGLResource
getSourceString, isBound, toString
-
Constructor Details
-
TLsp2DImageTextureObject
Constructs a texture object for the given image with filtering enabled.- Parameters:
aImage- the image to create a texture for- Throws:
IllegalArgumentException- whenaImage==null
-
TLsp2DImageTextureObject
Constructs a texture object for the given image, with the option to enable or disable texture filtering.- Parameters:
aImage- the image to create a texture foraFiltering- indicates whether or not texture interpolation is desired- Throws:
IllegalArgumentException- whenaImage==null
-
TLsp2DImageTextureObject
Constructs a texture object for the given image, with the options to enable or disable texture filtering and texture repeating.- Parameters:
aImage- the image to create a texture foraFiltering- whether or not filtering should be enabledaRepeat- whether or not the texture should be repeating- Throws:
IllegalArgumentException- whenaImage==null
-
TLsp2DImageTextureObject
public TLsp2DImageTextureObject(String aSourceString, BufferedImage aImage, boolean aFiltering, boolean aRepeat) Constructs a texture object for the given image, with the options to enable or disable texture filtering and texture repeating.- Parameters:
aSourceString- the name of the textureaImage- the image to create a texture foraFiltering- whether or not filtering should be enabledaRepeat- whether or not the texture should be repeating- Throws:
IllegalArgumentException- whenaImage==null
-
-
Method Details
-
setImage
Sets the given image. The given image should have the same properties as the previously set image. Note that this texture always has its alpha pre-multiplied, if the image has alpha but it is not pre-multiplied a conversion will be performed.- Parameters:
aImage- the new image to set as the texture
-
init
Description copied from class:ALspTextureObjectCreates a new OpenGL texture object. This method is called the first time this texture is bound. It may be extended to include initialization of the texture image (e.g. by callingglTexImage2D()).- Overrides:
initin classALspTextureObject- Parameters:
aGLDrawable- the drawable
-
bind
Description copied from class:ALspTextureObjectBinds the texture object to its appropriate target. Note that this method does not enable texture mapping on this target. This method invokesALspTextureObject.init(ILcdGLDrawable)the first time it is called.- Overrides:
bindin classALspTextureObject- Parameters:
aGLDrawable- the drawable- See Also:
-
destroy
Description copied from class:ALspTextureObjectDeletes the texture object owned by thisALspTextureObject.- Overrides:
destroyin classALspTextureObject- Parameters:
aGLDrawable- the drawable
-
getBytes
public long getBytes()Description copied from class:ALspTextureObjectReturns the number of estimated bytes this texture object occupies.- Specified by:
getBytesin classALspTextureObject- Returns:
- the number of estimated bytes this texture object occupies
-