本文整理汇总了Java中com.badlogic.gdx.graphics.Pixmap.Format方法的典型用法代码示例。如果您正苦于以下问题:Java Pixmap.Format方法的具体用法?Java Pixmap.Format怎么用?Java Pixmap.Format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.Pixmap
的用法示例。
在下文中一共展示了Pixmap.Format方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadTexture
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public static Texture loadTexture(Crypto crypto, FileHandle file, Pixmap.Format format, boolean useMipMaps) {
try {
byte[] bytes = file.readBytes();
if (crypto != null) {
bytes = crypto.decrypt(bytes, true);
}
Pixmap pixmap = new Pixmap(new Gdx2DPixmap(bytes, 0, bytes.length, 0));
return new Texture(pixmap, format, useMipMaps);
} catch (Exception e) {
throw new GdxRuntimeException("Couldn't load file: " + file, e);
}
}
示例2: toFormatInt
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private static int toFormatInt (Pixmap.Format format){
switch (format){
case Alpha: return FORMAT_ALPHA;
case Intensity: return FORMAT_INTENSITY;
case LuminanceAlpha: return FORMAT_LUMINANCE_ALPHA;
case RGB565: return FORMAT_RGB565;
case RGBA4444: return FORMAT_RGBA4444;
case RGB888: return FORMAT_RGB888;
case RGBA8888: return FORMAT_RGBA8888;
default: return FORMAT_UNKNOWN;
}
}
示例3: toFormatEnum
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private static Pixmap.Format toFormatEnum (int format){
switch (format){
case FORMAT_ALPHA: return Pixmap.Format.Alpha;
case FORMAT_INTENSITY: return Pixmap.Format.Intensity;
case FORMAT_LUMINANCE_ALPHA: return Pixmap.Format.LuminanceAlpha;
case FORMAT_RGB565: return Pixmap.Format.RGB565;
case FORMAT_RGBA4444: return Pixmap.Format.RGBA4444;
case FORMAT_RGB888: return Pixmap.Format.RGB888;
case FORMAT_RGBA8888: return Pixmap.Format.RGBA8888;
default: return Pixmap.Format.RGBA8888;
}
}
示例4: GdxTexture
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public GdxTexture(FileHandle file, Pixmap.Format format, boolean useMipMaps) {
super(file, format, useMipMaps);
}