• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ImageData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.newdawn.slick.opengl.ImageData的典型用法代码示例。如果您正苦于以下问题:Java ImageData类的具体用法?Java ImageData怎么用?Java ImageData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ImageData类属于org.newdawn.slick.opengl包,在下文中一共展示了ImageData类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
@Override
public void init(GameContainer container) throws SlickException {
	
	// Set up the rendering system
	texture = PixelData.createTexture(container.getWidth(), container.getHeight(), ImageData.Format.RGB, Image.FILTER_NEAREST);
	image = new Image(texture);
	pixels = new PixelData(container.getWidth(), container.getHeight());
	pixels.clear(0x00);
	
	// Creates the Set
	if(fractalType == MANDELBROT_SET) {
		set = new Mandelbrot();
	} else if(fractalType == JULIA_SET) {
		set = new Julia(constantReal, constantImaginary);
	}
	
	// Calculates the first frame
	pixels = set.updateSet(container, pixels, zoom, maxIterations, xOffset, yOffset, colorFactor);
	
	// Updates the texture
	pixels.apply(texture);
}
 
开发者ID:lucas-tulio,项目名称:fractal-explorer,代码行数:23,代码来源:FractalRenderer.java


示例2: setMouseCursor

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
    * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
    */
   public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException {
      try {
         Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY);
         Mouse.setNativeCursor(cursor);
      } catch (Throwable e) {
         Log.error("Failed to load and apply cursor.", e);
throw new SlickException("Failed to set mouse cursor", e);
      }
   }
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:13,代码来源:AppletGameContainer.java


示例3: setMouseCursor

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
 */
public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException {
	try {
		Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY);
		Mouse.setNativeCursor(cursor);
	} catch (Throwable e) {
		Log.error("Failed to load and apply cursor.", e);
		throw new SlickException("Failed to set mouse cursor", e);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:13,代码来源:AppGameContainer.java


示例4: Image

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * Create an image from a image data source. Note that this method uses 
 * 
 * @param data The pixelData to use to create the image
 * @param f The filter to use when scaling this image
 */
public Image(ImageData data, int f) {
	try {
		this.filter = f == FILTER_LINEAR ? SGL.GL_LINEAR : SGL.GL_NEAREST;
		texture = InternalTextureLoader.get().getTexture(data, this.filter);
		ref = texture.toString();
	} catch (IOException e) {
		Log.error(e);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:16,代码来源:Image.java


示例5: setMouseCursor

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
 */
public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException {
   try {
      Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY);
      Mouse.setNativeCursor(cursor);
   } catch (Exception e) {
      Log.error("Failed to load and apply cursor.", e);
   }
}
 
开发者ID:CyboticCatfish,项目名称:code404,代码行数:12,代码来源:AppletGameContainer.java


示例6: setMouseCursor

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
 */
public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException {
	try {
		Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY);
		Mouse.setNativeCursor(cursor);
	} catch (Exception e) {
		Log.error("Failed to load and apply cursor.", e);
	}
}
 
开发者ID:CyboticCatfish,项目名称:code404,代码行数:12,代码来源:AppGameContainer.java


示例7: setMouseCursor

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * Set the mouse cursor to be displayed - this is a hardware cursor and hence shouldn't have any impact of FPS.
 * 
 * @param data The cursor to be used
 * @param hotSpotX The x offset of the cursor
 * @param hotSpotY The y offset of the cursor
 */
public static void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY){
	if(appgc == null){
		return;
	}
	
	try{
		appgc.setMouseCursor(data, hotSpotX, hotSpotY);
	}catch(SlickException e){
		Logger.getLogger(Game.class.getName()).log(Level.WARNING, "Could Not Set Mouse Cursor " + data.toString(), e);
	}
}
 
开发者ID:dstumpff,项目名称:VortexGameLibrary,代码行数:19,代码来源:Game.java


示例8: Image

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * Create an image from a image data source. Note that this method uses
 *
 * @param data The pixelData to use to create the image
 * @param f The filter to use when scaling this image
 */
private Image(@Nonnull ImageData data, int f) {
    try {
        this.filter = f;
        texture = InternalTextureLoader.get().getTexture(data, this.filter);
        ref = texture.toString();
    } catch (IOException e) {
        Log.error(e);
    }
}
 
开发者ID:FOShameDotOrg,项目名称:fuzzy-octo-shame,代码行数:16,代码来源:Image.java


示例9: createTexture

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * Convenience method to create a texture with a given internal format.
 * @param width the width of the empty texture
 * @param height the height of the empty texture
 * @param filter the filter to use
 * @param format the internal format
 * @return a generated texture
 */
public static Texture createTexture(int width, int height, ImageData.Format format, int filter) throws SlickException {
	EmptyImageData data = new EmptyImageData(width, height);
	ByteBuffer dataBuffer = data.getImageBufferData();
	String ref = "pixelhandler:"+width+"x"+height+":"+format.toString();
	try {
		return InternalTextureLoader.get().createTexture(data, dataBuffer, ref,
					GL11.GL_TEXTURE_2D, filter, filter, false, format);
	} catch (IOException e) {
		throw new SlickException("Error generating texture", e);
	}
}
 
开发者ID:lucas-tulio,项目名称:fractal-explorer,代码行数:20,代码来源:PixelData.java


示例10: PixelData

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * Creates a PixelData buffer with the specified size and format.
 * 
 * Note that Slick currently loads textures with an internal RGBA format;
 * this means that even if we upload, say, 2-component (e.g. GRAYALPHA)
 * texture data, it will eventually be stored in OpenGL video memory 
 * using RGBA. For better performance and memory management, 
 * create textures with the same internal format as the format given to PixelData. 
 * The static 'createTexture' utility method is intended for this purpose. 
 * 
 * Also note that most drivers will expand formats to RGBA internally, so this optimization may
 * not be necessary.
 * 
 * @param width the width in pixels of our data
 * @param height the height in pixels of our data
 * @param format the desired format to use during uploading (RGB, RGBA, GRAY, GRAYALPHA, ALPHA)
 */
public PixelData(int width, int height, ImageData.Format format) {
	this.format = format;
	this.width = width;
	this.height = height;
	this.pixels = BufferUtils.createByteBuffer(width * height * format.getColorComponents());
}
 
开发者ID:lucas-tulio,项目名称:fractal-explorer,代码行数:24,代码来源:PixelData.java


示例11: setMouseCursor

import org.newdawn.slick.opengl.ImageData; //导入依赖的package包/类
/**
 * Set the mouse cursor to be displayed - this is a hardware cursor and hence
 * shouldn't have any impact on FPS.
 * 
 * @param data The image data from which the cursor can be construted
 * @param hotSpotX The x coordinate of the hotspot within the cursor image
 * @param hotSpotY The y coordinate of the hotspot within the cursor image
 * @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
 */
public abstract void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException;
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:11,代码来源:GameContainer.java



注:本文中的org.newdawn.slick.opengl.ImageData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SearchResult类代码示例发布时间:2022-05-21
下一篇:
Java InspectionToolProvider类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap