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


Java AWTTextureIO.newTexture方法代码示例

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


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

示例1: render

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
@Override
public void render(Object glC) {
	OpenGLContext context=(OpenGLContext)glC;//SumoPlatform.getApplication().getGeoContext();
    GL gl = context.getGL();
    gl.getGL2().glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
    BufferedImage temp=new BufferedImage(overview.getWidth(), overview.getHeight(), overview.getType());
    this.overview.copyData(temp.getRaster());

    BufferedImage buffer=rescale.filter(temp, temp);
    Texture texture = AWTTextureIO.newTexture(((GLBase)gl).getGLProfile(), buffer, true);
    //Texture texture = TextureIO.newTexture(rescale.filter(temp, temp), false);

    float tempscale=this.scale*context.getHeight()/context.getWidth();
    if(tempscale<1){
        bindTexture(gl, texture, 0, tempscale, 0, 1);
    }
    else{
        bindTexture(gl, texture, 0, 1, 0, tempscale);
    }
    texture.disable(gl);
    context.setX(0);
    context.setY(0);
    context.setZoom(Math.max(thumbReader.getWidth() / context.getWidth(),thumbReader.getHeight() / context.getHeight()));
    SumoPlatform.getApplication().getLayerManager().render(context);
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:26,代码来源:ThumbnailsLayer.java

示例2: init

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public void init()
{
	GL2 gl = Unknown.getGL();

	AffineTransform at = AffineTransform.getScaleInstance(1, -1);
	at.translate(0, -backend.getHeight());
	AffineTransformOp op = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);

	this.backend = op.filter(backend, null);

	text = AWTTextureIO.newTexture(Unknown.getGLProfile(), backend, false);
	text.bind(gl);

	bounds = new BoundingBox(0, 0, text.getImageWidth() * scale, text.getImageHeight() * scale);

	hasInit = true;
}
 
开发者ID:CUB3D,项目名称:Unknown-3,代码行数:18,代码来源:Image.java

示例3: createBlankTexture

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
/**
 * Creates a clear white 1x1 texture for rendering objects without textures
 * @param gl
 */
private void createBlankTexture(GL3 gl) {
	BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
	WritableRaster raster = image.getRaster();
	float[] white = new float[] {255, 255, 255};
	for (int i=0; i<image.getWidth(); i++) {
		for (int j=0; j<image.getHeight(); j++) {
			raster.setPixel(i, j, white);
		}
	}
	
	blank = AWTTextureIO.newTexture(gl.getGLProfile(), image, false);
	blank.setTexParameteri(gl, GL3.GL_TEXTURE_MAG_FILTER, GL3.GL_NEAREST);
}
 
开发者ID:patowen,项目名称:hyperbolic-space,代码行数:18,代码来源:TextureBank.java

示例4: createPlaceholderTexture

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
/**
 * Creates an 8x8 magenta and black checkerboard pattern to use as a texture if
 * the correct texture is missing
 * @param gl
 */
private void createPlaceholderTexture(GL3 gl) {
	BufferedImage image = new BufferedImage(8, 8, BufferedImage.TYPE_INT_RGB);
	WritableRaster raster = image.getRaster();
	float[] black = new float[] {0, 0, 0};
	float[] magenta = new float[] {255, 0, 255};
	for (int i=0; i<image.getWidth(); i++) {
		for (int j=0; j<image.getHeight(); j++) {
			raster.setPixel(i, j, (i+j)%2==0 ? magenta : black);
		}
	}
	
	placeholder = AWTTextureIO.newTexture(gl.getGLProfile(), image, false);
	placeholder.setTexParameteri(gl, GL3.GL_TEXTURE_MAG_FILTER, GL3.GL_NEAREST);
}
 
开发者ID:patowen,项目名称:hyperbolic-space,代码行数:20,代码来源:TextureBank.java

示例5: getTexture

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public Texture getTexture(GL2 gl, String resourceName) throws IOException {
    URL url = TextureLoader.class.getClassLoader().getResource(resourceName);
    if (url == null) {
        throw new IOException("Cannot find: "+resourceName);
    }
    
    BufferedImage bufferedImage = ImageIO.read(new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(resourceName))); 
  //  ImageUtil.flipImageVertically(bufferedImage);
    Texture result = AWTTextureIO.newTexture(GLProfile.getDefault(), bufferedImage, true);
    result.enable(gl);
    gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_S, GL2.GL_REPEAT);
    gl.glTexParameteri(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_T, GL2.GL_REPEAT);
    return result;
}
 
开发者ID:WhiteHexagon,项目名称:example-jovr-jogl-rift,代码行数:15,代码来源:TextureLoader.java

示例6: create

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public void create(DrawContext dc){
	GL gl = dc.getGL();

	BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
	for(int i=0;i<width;i++){
		for(int j=0;j<height;j++){
			image.setRGB(i, j, (int)(Math.random()*Integer.MAX_VALUE));
		}
	}
	texture = AWTTextureIO.newTexture(GLProfile.getDefault(), image, false);
}
 
开发者ID:vcucek,项目名称:WildPlot,代码行数:12,代码来源:RandomTexture.java

示例7: finishSprite

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public static void finishSprite() {
	GLProfile gp = GLProfile.getGL2ES2();
	Texture texture = AWTTextureIO.newTexture(gp, currentSprite.getImage(), true);
	currentSprite.dispose();
	for (String key : currentSpriteList.keySet()) {
		list.put(key, texture);
	}
	currentSpriteList.clear();
}
 
开发者ID:olamedia,项目名称:assets,代码行数:10,代码来源:TextureManager.java

示例8: load

import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
@Override
public Texture load(String c) throws Exception {
  return AWTTextureIO.newTexture(gl.getGLProfile(), getTexture(c, FONT_SIZE), true);
}
 
开发者ID:mitoma,项目名称:kashiki,代码行数:5,代码来源:TextureProvider.java


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