* Make AndroidImageInfo extensible, add javadoc explanation

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9187 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..om 13 years ago
parent 06f5ad5bce
commit b12285b8a4
  1. 16
      engine/src/android/com/jme3/asset/AndroidImageInfo.java

@ -8,11 +8,19 @@ import com.jme3.texture.Image.Format;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
/**
* <code>AndroidImageInfo</code> is set in a jME3 image via the {@link Image#setEfficientData(java.lang.Object)}
* method to retrieve a {@link Bitmap} when it is needed by the renderer.
* User code may extend <code>AndroidImageInfo</code> and provide their own implementation of the
* {@link AndroidImageInfo#loadBitmap()} method to acquire a bitmap by their own means.
*
* @author Kirill Vainer
*/
public class AndroidImageInfo { public class AndroidImageInfo {
private AssetInfo assetInfo; protected AssetInfo assetInfo;
private Bitmap bitmap; protected Bitmap bitmap;
private Format format; protected Format format;
public AndroidImageInfo(AssetInfo assetInfo) { public AndroidImageInfo(AssetInfo assetInfo) {
this.assetInfo = assetInfo; this.assetInfo = assetInfo;
@ -42,7 +50,7 @@ public class AndroidImageInfo {
* Loads the bitmap directly from the asset info, possibly updating * Loads the bitmap directly from the asset info, possibly updating
* or creating the image object. * or creating the image object.
*/ */
private void loadBitmap() throws IOException{ protected void loadBitmap() throws IOException{
InputStream in = null; InputStream in = null;
try { try {
in = assetInfo.openStream(); in = assetInfo.openStream();

Loading…
Cancel
Save