|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.render.BasicWWTexture
public class BasicWWTexture
Basic implementation of a texture derived from an image source such as an image file or a BufferedImage.
isTextureInitializationFailed() to determine whether the instance failed to
convert an image source to a texture. If such a failure occurs, the method returns true and no further attempts are
made to create the texture.
This class retrieves its image source immediately during a call to bind(DrawContext) or applyInternalTransform(DrawContext).
LazilyLoadedTexture| Field Summary | |
|---|---|
protected Integer |
height
|
protected TextureCoords |
texCoords
|
protected boolean |
textureInitializationFailed
|
protected Integer |
width
|
| Constructor Summary | |
|---|---|
BasicWWTexture(Object imageSource)
Constructs a texture object. |
|
BasicWWTexture(Object imageSource,
boolean useMipMaps)
Constructs a texture object from an image source. |
|
| Method Summary | |
|---|---|
void |
applyInternalTransform(DrawContext dc)
Applies any necessary transformations to the texture prior to its being rendered. |
boolean |
bind(DrawContext dc)
Makes this texture the current texture for rendering. |
int |
getHeight(DrawContext dc)
Returns the texture's height |
Object |
getImageSource()
Returns the texture's image source. |
TextureCoords |
getTexCoords()
Returns the texture's texture coordinates, which may be other than [0,0],[1,1] if the texture size is not a power of two or the texture must be flipped when rendered. |
protected Texture |
getTexture(DrawContext dc,
boolean initialize)
|
protected Texture |
getTextureFromCache(DrawContext dc)
|
int |
getWidth(DrawContext dc)
Returns the texture's width. |
protected void |
initialize(Object imageSource,
boolean useMipMaps)
|
protected Texture |
initializeTexture(DrawContext dc,
Object imageSource)
|
boolean |
isTextureCurrent(DrawContext dc)
Indicates whether the texture is currently available for use without regenerating it from its image source. |
boolean |
isTextureInitializationFailed()
Indicates whether an attempt to initialize the texture failed, which occurs when the image source is a non-existent image file or for other reasons specific to the image source. |
boolean |
isUseAnisotropy()
Indicates whether texture anisotropy is applied to the texture when rendered. |
boolean |
isUseMipMaps()
Indicates whether the texture creates and uses mipmaps. |
void |
setUseAnisotropy(boolean useAnisotropy)
Specifies whether texture anisotropy is applied to the texture when rendered. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Integer height
protected TextureCoords texCoords
protected boolean textureInitializationFailed
protected Integer width
| Constructor Detail |
|---|
public BasicWWTexture(Object imageSource)
imageSource - the source of the image, either a file path String or a BufferedImage.
IllegalArgumentException - if the imageSource is null.
public BasicWWTexture(Object imageSource,
boolean useMipMaps)
imageSource - the source of the image, either a file path String or a BufferedImage.useMipMaps - Indicates whether to generate and use mipmaps for the image.
IllegalArgumentException - if the imageSource is null.| Method Detail |
|---|
public void applyInternalTransform(DrawContext dc)
WWTexture
applyInternalTransform in interface WWTexturedc - the current draw context.public boolean bind(DrawContext dc)
WWTexture
bind in interface WWTexturedc - the current draw context.
public int getHeight(DrawContext dc)
WWTexture
getHeight in interface WWTexturedc - the current draw context
public Object getImageSource()
WWTexture
getImageSource in interface WWTexturepublic TextureCoords getTexCoords()
WWTexture
getTexCoords in interface WWTexture
protected Texture getTexture(DrawContext dc,
boolean initialize)
protected Texture getTextureFromCache(DrawContext dc)
public int getWidth(DrawContext dc)
WWTexture
getWidth in interface WWTexturedc - the current draw context
protected void initialize(Object imageSource,
boolean useMipMaps)
protected Texture initializeTexture(DrawContext dc,
Object imageSource)
public boolean isTextureCurrent(DrawContext dc)
WWTexture
isTextureCurrent in interface WWTexturedc - the current draw context
public boolean isTextureInitializationFailed()
WWTexture
isTextureInitializationFailed in interface WWTexturepublic boolean isUseAnisotropy()
public boolean isUseMipMaps()
public void setUseAnisotropy(boolean useAnisotropy)
useAnisotropy - true if anisotropy is to be applied, otherwise false.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||