本文整理了Java中com.jme3.texture.Image.setDepth()
方法的一些代码示例,展示了Image.setDepth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setDepth()
方法的具体详情如下:
包路径:com.jme3.texture.Image
类名称:Image
方法名:setDepth
[英]setDepth
sets the depth value of the image. It is typically a good idea to try to keep this as a multiple of 2. This is used for 3d images.
[中]setDepth
设置图像的深度值。通常最好将其保持为2的倍数。这用于3d图像。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public static void resizeToPowerOf2(Image image){
BufferedImage original = ImageToAwt.convert(image, false, true, 0);
int potWidth = FastMath.nearestPowerOfTwo(image.getWidth());
int potHeight = FastMath.nearestPowerOfTwo(image.getHeight());
int potSize = Math.max(potWidth, potHeight);
BufferedImage scaled = scaleDown(original, potSize, potSize);
AWTLoader loader = new AWTLoader();
Image output = loader.load(scaled, false);
image.setWidth(potSize);
image.setHeight(potSize);
image.setDepth(0);
image.setData(output.getData(0));
image.setFormat(output.getFormat());
image.setMipMapSizes(null);
}
代码示例来源:origin: info.projectkyoto/mms-engine
public static void resizeToPowerOf2(Image image){
BufferedImage original = ImageToAwt.convert(image, false, true, 0);
int potWidth = FastMath.nearestPowerOfTwo(image.getWidth());
int potHeight = FastMath.nearestPowerOfTwo(image.getHeight());
int potSize = Math.max(potWidth, potHeight);
BufferedImage scaled = scaleDown(original, potSize, potSize);
AWTLoader loader = new AWTLoader();
Image output = loader.load(scaled, false);
image.setWidth(potSize);
image.setHeight(potSize);
image.setDepth(0);
image.setData(output.getData(0));
image.setFormat(output.getFormat());
image.setMipMapSizes(null);
}
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-desktop
public static void resizeToPowerOf2(Image image){
BufferedImage original = ImageToAwt.convert(image, false, true, 0);
int potWidth = FastMath.nearestPowerOfTwo(image.getWidth());
int potHeight = FastMath.nearestPowerOfTwo(image.getHeight());
int potSize = Math.max(potWidth, potHeight);
BufferedImage scaled = scaleDown(original, potSize, potSize);
AWTLoader loader = new AWTLoader();
Image output = loader.load(scaled, false);
image.setWidth(potSize);
image.setHeight(potSize);
image.setDepth(0);
image.setData(output.getData(0));
image.setFormat(output.getFormat());
image.setMipMapSizes(null);
}
内容来源于网络,如有侵权,请联系作者删除!