playn.java
Class JavaAsyncImage

java.lang.Object
  extended by playn.core.AbstractImage
      extended by playn.core.gl.ImageGL
          extended by playn.java.JavaAsyncImage
All Implemented Interfaces:
AsyncImage<BufferedImage>, Image

public class JavaAsyncImage
extends ImageGL
implements AsyncImage<BufferedImage>


Nested Class Summary
 
Nested classes/interfaces inherited from interface playn.core.Image
Image.BitmapTransformer, Image.Region
 
Field Summary
protected  BufferedImage img
           
 
Fields inherited from class playn.core.gl.ImageGL
ctx, refs, reptex, scale, tex
 
Constructor Summary
JavaAsyncImage(GLContext ctx, float preWidth, float preHeight)
           
 
Method Summary
 void addCallback(Callback<? super Image> callback)
           
 void draw(Graphics2D gfx, float x, float y, float w, float h)
           
 void draw(Graphics2D gfx, float dx, float dy, float dw, float dh, float sx, float sy, float sw, float sh)
           
 void getRgb(int startX, int startY, int width, int height, int[] rgbArray, int offset, int scanSize)
           
 float height()
           
 boolean isReady()
           
 void setError(Throwable error)
           
 void setImage(BufferedImage img, Scale scale)
           
 Image.Region subImage(float sx, float sy, float swidth, float sheight)
           
 Pattern toPattern()
           
 Image transform(Image.BitmapTransformer xform)
           
protected  void updateTexture(int tex)
           
 float width()
           
 
Methods inherited from class playn.core.gl.ImageGL
clearTexture, ensureTexture, finalize, reference, release, texHeight, texWidth, x, y
 
Methods inherited from class playn.core.AbstractImage
glTexImage2D, glTexSubImage2D
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface playn.core.Image
clearTexture, ensureTexture, getRgb, glTexImage2D, glTexSubImage2D, isReady, subImage, toPattern, transform
 

Field Detail

img

protected BufferedImage img
Constructor Detail

JavaAsyncImage

public JavaAsyncImage(GLContext ctx,
                      float preWidth,
                      float preHeight)
Method Detail

width

public float width()
Specified by:
width in interface Image

height

public float height()
Specified by:
height in interface Image

addCallback

public void addCallback(Callback<? super Image> callback)
Specified by:
addCallback in interface Image

setImage

public void setImage(BufferedImage img,
                     Scale scale)
Specified by:
setImage in interface AsyncImage<BufferedImage>

setError

public void setError(Throwable error)
Specified by:
setError in interface AsyncImage<BufferedImage>

isReady

public boolean isReady()
Specified by:
isReady in interface Image

subImage

public Image.Region subImage(float sx,
                             float sy,
                             float swidth,
                             float sheight)
Specified by:
subImage in interface Image

toPattern

public Pattern toPattern()
Specified by:
toPattern in interface Image

getRgb

public void getRgb(int startX,
                   int startY,
                   int width,
                   int height,
                   int[] rgbArray,
                   int offset,
                   int scanSize)
Specified by:
getRgb in interface Image

transform

public Image transform(Image.BitmapTransformer xform)
Specified by:
transform in interface Image

draw

public void draw(Graphics2D gfx,
                 float x,
                 float y,
                 float w,
                 float h)

draw

public void draw(Graphics2D gfx,
                 float dx,
                 float dy,
                 float dw,
                 float dh,
                 float sx,
                 float sy,
                 float sw,
                 float sh)

updateTexture

protected void updateTexture(int tex)
Specified by:
updateTexture in class ImageGL


Copyright © 2012. All Rights Reserved.