aboutsummaryrefslogtreecommitdiff
path: root/engine/src/android/com/jme3/texture/plugins/AndroidImageLoader.java
blob: 17f850e7ad2c95d100d146d53c0741f38b59564c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.jme3.texture.plugins;

import android.graphics.Bitmap;
import com.jme3.asset.AndroidImageInfo;
import com.jme3.asset.AssetInfo;
import com.jme3.asset.AssetLoader;
import com.jme3.texture.Image;
import java.io.IOException;

public class AndroidImageLoader implements AssetLoader {

    public Object load(AssetInfo info) throws IOException {
        AndroidImageInfo imageInfo = new AndroidImageInfo(info);
        Bitmap bitmap = imageInfo.getBitmap();
        
        Image image = new Image(imageInfo.getFormat(), bitmap.getWidth(), bitmap.getHeight(), null);
        image.setEfficentData(imageInfo);
        return image;
    }
}