本文整理匯總了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);
}