当前位置: 首页>>代码示例>>Java>>正文


Java AWTTextureIO.newTextureData方法代码示例

本文整理汇总了Java中com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTextureData方法的典型用法代码示例。如果您正苦于以下问题:Java AWTTextureIO.newTextureData方法的具体用法?Java AWTTextureIO.newTextureData怎么用?Java AWTTextureIO.newTextureData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jogamp.opengl.util.texture.awt.AWTTextureIO的用法示例。


在下文中一共展示了AWTTextureIO.newTextureData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateBitmap

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
private void updateBitmap() {
    try {
       
        BufferedImage img = ImageIO.read(imageInputStream);
        data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
        
        if (data.getMustFlipVertically()) {
            ImageUtil.flipImageVertically(img);
            data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
        }
    } catch (IOException ex) {
        //TODO this is a very, very bad practice...
        throw new RuntimeException(ex.getMessage());
    }

    updateTextureFlag = false;
}
 
开发者ID:jchai3d,项目名称:jchai3d,代码行数:18,代码来源:JTexture2D.java

示例2: updateBitmap

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
private void updateBitmap() {
    try {

        BufferedImage img = ImageIO.read(imageInputStream);
        data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
        
        if (data.getMustFlipVertically()) {
            ImageUtil.flipImageVertically(img);
            data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
        }
    } catch (IOException ex) {
        //TODO this is a very, very bad practice...
        throw new RuntimeException(ex.getMessage());
    }

    markForUpdate = false;
}
 
开发者ID:jchai3d,项目名称:jchai3d,代码行数:18,代码来源:JBitmap.java

示例3: newTextureData

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
/**
 * Method newTextureData()
 * 
 * @see com.jogamp.opengl.util.texture.spi.TextureProvider#newTextureData(com.jogamp.opengl.GLProfile, java.io.File,
 *      int, int, boolean, java.lang.String)
 */
@Override
public TextureData newTextureData(final GLProfile glp, final File file, final int internalFormat,
		final int pixelFormat, final boolean mipmap, final String fileSuffix) throws IOException {
	final IScope scope = GAMA.getRuntimeScope();
	final GamaImageFile f = new GamaImageFile(scope, file.getAbsolutePath());
	if (f.getExtension(scope).equals("pgm")) {
		final BufferedImage image = f.getImage(scope, true);
		return AWTTextureIO.newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
	} else {
		return null;
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:19,代码来源:PGMTextureProvider.java

示例4: buildTexture

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public static Texture buildTexture(final GL gl, final BufferedImage image) {
	try {
		final TextureData data = AWTTextureIO.newTextureData(gl.getGLProfile(),
				correctImage(image, !Abstract3DRenderer.isNonPowerOf2TexturesAvailable), false);
		final Texture texture = new Texture(gl, data);
		data.flush();
		return texture;
	} catch (final GLException e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:13,代码来源:OpenGL.java

示例5: addTexture

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public void addTexture(BufferedImage img, int index) {
 try {
	 TextureData data = AWTTextureIO.newTextureData(GLProfile.getDefault(), img, false);
	 texturePool[index] = TextureIO.newTexture(data);
 } catch(Exception e) {
	 System.err.println("Error while setting a texture from an BufferedImage("+img.toString()+") Exception: "+e);
	 System.exit(1);
 }
}
 
开发者ID:xtreme8000,项目名称:aos_remake,代码行数:10,代码来源:TextureHelper.java


注:本文中的com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTextureData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。