com.jme3.texture.Image.setDepth()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中com.jme3.texture.Image.setDepth()方法的一些代码示例,展示了Image.setDepth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setDepth()方法的具体详情如下:
包路径:com.jme3.texture.Image
类名称:Image
方法名:setDepth

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);
}

相关文章